Repository Analysis

topjohnwu/Magisk

The Magic Mask for Android

2.9 Likely human-written View on GitHub
2.9
Adjusted Score
2.9
Raw Score
100%
Time Factor
2026-05-24
Last Push
60,697
Stars
Kotlin
Language
85,682
Lines of Code
646
Files
133
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 3HIGH 0MEDIUM 33LOW 97

Pattern Findings

133 matches across 8 categories. Click a row to expand file-level details.

Decorative Section Separators33 hits · 119 pts
SeverityFileLineSnippet
MEDIUMnative/src/core/zygisk/hook.cpp31// ┌───────┐
MEDIUMnative/src/core/zygisk/hook.cpp34// │ │ ┌────────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp35// │ └────────────────────────────────────────►│LoadNativeBridge│
MEDIUMnative/src/core/zygisk/hook.cpp36// │ └───────┬────────┘
MEDIUMnative/src/core/zygisk/hook.cpp37// ┌────────────────┐ │ │
MEDIUMnative/src/core/zygisk/hook.cpp38// │LoadNativeBridge│◄────────────┼───────────────────────────────────────────────────┘
MEDIUMnative/src/core/zygisk/hook.cpp39// └───────┬────┬───┘ │
MEDIUMnative/src/core/zygisk/hook.cpp40// │ │ │ ┌───────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp41// │ └─────────────────┼────────────────────►│NativeBridgeItf│
MEDIUMnative/src/core/zygisk/hook.cpp42// │ │ └──────┬────────┘
MEDIUMnative/src/core/zygisk/hook.cpp45// │ │ ┌────────┐
MEDIUMnative/src/core/zygisk/hook.cpp47// ▼ │ └────────┘
MEDIUMnative/src/core/zygisk/hook.cpp48// ┌───────┐ │
MEDIUMnative/src/core/zygisk/hook.cpp52// │ │ ┌───────────────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp53// └──────────────────────┼────────────────►│post_native_bridge_load│
MEDIUMnative/src/core/zygisk/hook.cpp54// │ └───────────────────────┘
MEDIUMnative/src/core/zygisk/hook.cpp56// ┌──────────────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp58// └───────────┬────┬─────┘
MEDIUMnative/src/core/zygisk/hook.cpp59// │ │ ┌───────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp60// │ └───────────────►│hook_zygote_jni│
MEDIUMnative/src/core/zygisk/hook.cpp61// │ └───────────────┘ ┌─────────┐
MEDIUMnative/src/core/zygisk/hook.cpp63// └────────────────────────────────────────────►│ JVM │
MEDIUMnative/src/core/zygisk/hook.cpp66// ┌───────────────────┐ │ │
MEDIUMnative/src/core/zygisk/hook.cpp67// │nativeXXXSpecialize│◄─────────────────────────────────────┘ │
MEDIUMnative/src/core/zygisk/hook.cpp68// └─────────────┬─────┘ │
MEDIUMnative/src/core/zygisk/hook.cpp69// │ ┌─────────────┐ │
MEDIUMnative/src/core/zygisk/hook.cpp70// └────────────────►│ZygiskContext│ │
MEDIUMnative/src/core/zygisk/hook.cpp71// └─────────────┘ ▼
MEDIUMnative/src/core/zygisk/hook.cpp72// ┌────────────────────┐
MEDIUMnative/src/core/zygisk/hook.cpp74// └─────────┬──────────┘
MEDIUMnative/src/core/zygisk/hook.cpp75// ┌────────────────┐ │
MEDIUMnative/src/core/zygisk/hook.cpp76// │restore_plt_hook│◄───────────┘
MEDIUMnative/src/core/zygisk/hook.cpp77// └────────────────┘
Over-Commented Block79 hits · 74 pts
SeverityFileLineSnippet
LOWnative/src/init/twostage.rs41 }
LOWnative/src/init/selinux.rs21const SELINUX_ENFORCE: &Utf8CStr = cstr!(concatcp!(SELINUX_MNT, "/enforce"));
LOWnative/src/core/logging.rs141}
LOWnative/src/core/magisk.rs81#[derive(FromArgs)]
LOWnative/src/core/zygisk/zygisk.hpp1#pragma once
LOWnative/src/core/zygisk/hook.cpp1#include <sys/mman.h>
LOWnative/src/core/zygisk/hook.cpp21//
LOWnative/src/core/zygisk/hook.cpp41// │ └─────────────────┼────────────────────►│NativeBridgeItf│
LOWnative/src/core/zygisk/hook.cpp61// │ └───────────────┘ ┌─────────┐
LOWnative/src/core/zygisk/api.hpp121 // AppSpecializeArgs object. You can read and overwrite these arguments to change how the app
LOWnative/src/core/zygisk/api.hpp181struct api_table;
LOWnative/src/core/zygisk/api.hpp201
LOWnative/src/core/zygisk/api.hpp221 // function that would be called in the root process with REGISTER_ZYGISK_COMPANION(func).
LOWnative/src/core/zygisk/api.hpp241 //
LOWnative/src/core/zygisk/api.hpp261
LOWnative/src/core/include/core.hpp1#pragma once
LOWnative/src/core/su/su.cpp1/*
LOWnative/src/core/deny/utils.cpp1#include <sys/types.h>
LOWnative/src/boot/bootimg.hpp101// https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/android12-release/include/bootimg/booti
LOWnative/src/boot/bootimg.cpp1#include <bit>
LOWnative/src/boot/magiskboot.hpp1#pragma once
LOWnative/src/boot/magiskboot.hpp21#define BOOT_MAGIC "ANDROID!"
LOWnative/src/include/consts.hpp1#pragma once
LOWnative/src/include/consts.hpp21
LOWnative/src/external/xz_config/config.h401# define _GNU_SOURCE 1
LOWnative/src/external/xz_config/config.h421 significant byte first (like Motorola and SPARC, unlike Intel). */
LOWnative/src/external/xz-embedded/xz_config.h121# define get_le32 get_unaligned_le32
LOWnative/src/external/xz-embedded/xz_private.h21# include <linux/string.h>
LOWnative/src/external/xz-embedded/xz_private.h41# define memzero(buf, size) memset(buf, 0, size)
LOWnative/src/external/xz-embedded/xz_private.h61/*
LOWnative/src/external/xz-embedded/xz_private.h81# define DEC_IS_DYNALLOC(mode) (false)
LOWnative/src/external/lz4-sys/src/wasm_shim.rs1//! A shim for the libc functions used in lz4-rs that are not available when building for wasm
LOWnative/src/external/lz4-sys/src/lib.rs201 // This is achieved using LZ4F_createCompressionContext(), which takes as argument a version
LOWnative/src/external/lz4-sys/src/lib.rs221 // LZ4F_compressBegin() :
LOWnative/src/external/lz4-sys/src/lib.rs241 // LZ4F_compressBound() :
LOWnative/src/external/lz4-sys/src/lib.rs261 // meaning input data was just buffered.
LOWnative/src/external/lz4-sys/src/lib.rs281 // to be be filled, you can call LZ4_flush(), which will immediately compress any remaining
LOWnative/src/external/lz4-sys/src/lib.rs301 // It will flush whatever data remained within compressionContext (like LZ4_flush())
LOWnative/src/external/lz4-sys/src/lib.rs321 // The first thing to do is to create a decompressionContext object, which will be used
LOWnative/src/external/lz4-sys/src/lib.rs341
LOWnative/src/external/lz4-sys/src/lib.rs361 srcBuffer: *const u8,
LOWnative/src/external/lz4-sys/src/lib.rs381 //
LOWnative/src/sepolicy/include/sepolicy.hpp1#pragma once
LOWnative/src/base/argh.rs1// Copyright (c) 2020 Google LLC All rights reserved.
LOWnative/src/base/argh.rs21//! /// whether or not to jump
LOWnative/src/base/argh.rs41//!
LOWnative/src/base/argh.rs61//! `#[argh(default = "<your_code_here>")]` attribute, and in this case an
LOWnative/src/base/argh.rs81//! height: usize,
LOWnative/src/base/argh.rs101//! #[derive(FromArgs)]
LOWnative/src/base/argh.rs121//! /// A command with positional arguments.
LOWnative/src/base/argh.rs141//! #[argh(option)]
LOWnative/src/base/argh.rs161//! over each command:
LOWnative/src/base/argh.rs181//! /// First subcommand.
LOWnative/src/base/argh.rs201//! `dynamic` attribute. Instead of deriving `FromArgs`, the value inside the
LOWnative/src/base/argh.rs221//! Normal(NormalSubCommand),
LOWnative/src/base/argh.rs241//! impl DynamicSubCommand for Dynamic {
LOWnative/src/base/argh.rs261//! }
LOWnative/src/base/argh.rs281//! for command in Self::commands() {
LOWnative/src/base/argh.rs301//! # use argh::FromArgs;
LOWnative/src/base/argh.rs341 }
19 more matches not shown…
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippet
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt268 val invalidDialog = com.topjohnwu.magisk.ui.component.rememberConfirmDialog(
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt289 com.topjohnwu.magisk.ui.component.rememberConfirmDialog(
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt301 val shortcutDialog = com.topjohnwu.magisk.ui.component.rememberConfirmDialog(
Verbosity Indicators13 hits · 21 pts
SeverityFileLineSnippet
LOWnative/src/init/selinux.rs102 // Step 0: determine strategy
LOWnative/src/init/selinux.rs126 // Step 1: setup for intercepting init boot control flow
LOWnative/src/init/selinux.rs187 // Step 2: wait for selinuxfs to be mounted (only for LEGACY)
LOWnative/src/init/selinux.rs219 // Step 3: obtain sepolicy, patch, and load the patched sepolicy
LOWnative/src/core/sqlite.cpp111 // Step 1: prepare statement
LOWnative/src/core/sqlite.cpp119 // Step 2: bind arguments
LOWnative/src/core/sqlite.cpp129 // Step 3: execute
LOWnative/src/core/module.rs848 // Step 1: Create virtual filesystem tree
LOWnative/src/core/module.rs878 // Step 2: Inject custom files
LOWnative/src/core/module.rs897 // Step 3: Extract all supported read-only partition roots
LOWnative/src/core/module.rs925 // Step 4: Convert virtual filesystem tree into concrete operations
LOWnative/src/core/zygisk/hook.cpp267 // On arm32, we need to check if the pc is in thumb mode,
LOWnative/src/boot/bootimg.cpp318 // We need to check if it is LZ4_LG
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWscripts/flash_script.sh60# Check if system root is installed and remove
LOWscripts/boot_patch.sh58 # Check if 64-bit
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippet
LOWscripts/live_setup.sh7# For developing Magisk, just use:
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWbuild.py17
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippet
LOW…/java/com/topjohnwu/magisk/core/su/SuRequestHandler.kt25class SuRequestHandler(