AI Slop Code RIsk Monitor

topjohnwu/Magisk

The Magic Mask for Android

4.1 Low pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for topjohnwu/Magisk, a Kotlin project with 63,190 GitHub stars. SynthScan examined 75,714 lines of code across 463 source files, recording 178 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 4.1 (Low pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

4.1
Adjusted Signal
4.1
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
63.2K
Stars
Kotlin
Language
75.7K
Lines of Code
463
Files
178
Pattern Hits
2026-10-12
Scan Date
0.00
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 10.8/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 139 finding(s).

Hallucinated Dependency & Supply Chain Risk 0.1/100 · LOW

Are imports declared and package/API names verified? 1 finding(s).

Agent Over-Engineering Ratio 8.6/100 · LOW

Are wrappers, guards, and repeated structures necessary? 38 finding(s).

PR Review Velocity Impact 15.9/100 · LOW

Which changes need focused human review? 178 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 2MEDIUM 37LOW 139

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 178 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Decorative Section Separators35 hits · 125 pts
SeverityFileLineSnippetContext
MEDIUM⚡native/src/core/zygisk/hook.cpp31// ┌───────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp34// │ │ ┌────────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp35// │ └────────────────────────────────────────►│LoadNativeBridge│COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp36// │ └───────┬────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp37// ┌────────────────┐ │ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp38// │LoadNativeBridge│◄────────────┼───────────────────────────────────────────────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp39// └───────┬────┬───┘ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp40// │ │ │ ┌───────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp41// │ └─────────────────┼────────────────────►│NativeBridgeItf│COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp42// │ │ └──────┬────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp45// │ │ ┌────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp47// ▼ │ └────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp48// ┌───────┐ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp52// │ │ ┌───────────────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp53// └──────────────────────┼────────────────►│post_native_bridge_load│COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp54// │ └───────────────────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp56// ┌──────────────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp58// └───────────┬────┬─────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp59// │ │ ┌───────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp60// │ └───────────────►│hook_zygote_jni│COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp61// │ └───────────────┘ ┌─────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp63// └────────────────────────────────────────────►│ JVM │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp66// ┌───────────────────┐ │ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp67// │nativeXXXSpecialize│◄─────────────────────────────────────┘ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp68// └─────────────┬─────┘ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp69// │ ┌─────────────┐ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp70// └────────────────►│ZygiskContext│ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp71// └─────────────┘ ▼COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp72// ┌────────────────────┐COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp74// └─────────┬──────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp75// ┌────────────────┐ │COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp76// │restore_plt_hook│◄───────────┘COMMENT
MEDIUM⚡native/src/core/zygisk/hook.cpp77// └────────────────┘COMMENT
MEDIUMscripts/app_functions.sh237# ==============================================================================COMMENT
MEDIUMscripts/app_functions.sh239# ==============================================================================COMMENT
Over-Commented Block77 hits · 70 pts
SeverityFileLineSnippetContext
LOWnative/src/init/twostage.rs41 }COMMENT
LOWnative/src/init/selinux.rs21const SELINUX_ENFORCE: &Utf8CStr = cstr!(concatcp!(SELINUX_MNT, "/enforce"));COMMENT
LOWnative/src/core/utils.cpp1#include <csignal>COMMENT
LOWnative/src/core/logging.rs141 }COMMENT
LOWnative/src/core/magisk.rs81#[derive(FromArgs)]COMMENT
LOWnative/src/core/zygisk/zygisk.hpp1#pragma onceCOMMENT
LOWnative/src/core/zygisk/hook.cpp1#include <sys/mman.h>COMMENT
LOWnative/src/core/zygisk/hook.cpp21//COMMENT
LOWnative/src/core/zygisk/hook.cpp41// │ └─────────────────┼────────────────────►│NativeBridgeItf│COMMENT
LOWnative/src/core/zygisk/hook.cpp61// │ └───────────────┘ ┌─────────┐COMMENT
LOWnative/src/core/zygisk/api.hpp121 // AppSpecializeArgs object. You can read and overwrite these arguments to change how the appCOMMENT
LOWnative/src/core/zygisk/api.hpp181struct api_table;COMMENT
LOWnative/src/core/zygisk/api.hpp201COMMENT
LOWnative/src/core/zygisk/api.hpp221 // function that would be called in the root process with REGISTER_ZYGISK_COMPANION(func).COMMENT
LOWnative/src/core/zygisk/api.hpp241 //COMMENT
LOWnative/src/core/zygisk/api.hpp261COMMENT
LOWnative/src/core/include/core.hpp1#pragma onceCOMMENT
LOWnative/src/core/su/su.cpp1/*COMMENT
LOWnative/src/core/deny/utils.cpp1#include <sys/types.h>COMMENT
LOWnative/src/boot/futility.rs1// ChromeOS verified boot kernel signing, ported from vboot_reference futility.COMMENT
LOWnative/src/boot/zimage.rs1//! ARM 32-bit Linux zImage Parsing and Piggy Resizing / RelocationCOMMENT
LOWnative/src/boot/zimage.rs21//!COMMENT
LOWnative/src/boot/zimage.rs41//! are shifted by `+ delta_got`.COMMENT
LOWnative/src/boot/bootimg.cpp1#include <bit>COMMENT
LOWnative/src/boot/magiskboot.hpp1#pragma onceCOMMENT
LOWnative/src/boot/magiskboot.hpp21#define VENDOR_BOOT_MAGIC "VNDRBOOT"COMMENT
LOWnative/src/include/consts.hpp1#pragma onceCOMMENT
LOWnative/src/include/consts.hpp21COMMENT
LOWnative/src/external/xz_config/xz_config.h21#elif defined(__arm__)COMMENT
LOWnative/src/external/xz_config/xz_config.h41#include <stdlib.h>COMMENT
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 wasmCOMMENT
LOWnative/src/external/lz4-sys/src/lib.rs201 // This is achieved using LZ4F_createCompressionContext(), which takes as argument a versionCOMMENT
LOWnative/src/external/lz4-sys/src/lib.rs221 // LZ4F_compressBegin() :COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs241 // LZ4F_compressBound() :COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs261 // meaning input data was just buffered.COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs281 // to be be filled, you can call LZ4_flush(), which will immediately compress any remainingCOMMENT
LOWnative/src/external/lz4-sys/src/lib.rs301 // It will flush whatever data remained within compressionContext (like LZ4_flush())COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs321 // The first thing to do is to create a decompressionContext object, which will be usedCOMMENT
LOWnative/src/external/lz4-sys/src/lib.rs341COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs361 srcBuffer: *const u8,COMMENT
LOWnative/src/external/lz4-sys/src/lib.rs381 //COMMENT
LOWnative/src/sepolicy/include/sepolicy.hpp1#pragma onceCOMMENT
LOWnative/src/base/argh.rs1// Copyright (c) 2020 Google LLC All rights reserved.COMMENT
LOWnative/src/base/argh.rs21//! /// whether or not to jumpCOMMENT
LOWnative/src/base/argh.rs41//!COMMENT
LOWnative/src/base/argh.rs61//! `#[argh(default = "<your_code_here>")]` attribute, and in this case anCOMMENT
LOWnative/src/base/argh.rs81//! height: usize,COMMENT
LOWnative/src/base/argh.rs101//! #[derive(FromArgs)]COMMENT
LOWnative/src/base/argh.rs121//! /// A command with positional arguments.COMMENT
LOWnative/src/base/argh.rs141//! #[argh(option)]COMMENT
LOWnative/src/base/argh.rs161//! over each command:COMMENT
LOWnative/src/base/argh.rs181//! /// First subcommand.COMMENT
LOWnative/src/base/argh.rs201//! `dynamic` attribute. Instead of deriving `FromArgs`, the value inside theCOMMENT
LOWnative/src/base/argh.rs221//! Normal(NormalSubCommand),COMMENT
LOWnative/src/base/argh.rs241//! impl DynamicSubCommand for Dynamic {COMMENT
LOWnative/src/base/argh.rs261//! }COMMENT
LOWnative/src/base/argh.rs281//! for command in Self::commands() {COMMENT
LOWnative/src/base/argh.rs301//! # use argh::FromArgs;COMMENT
LOWnative/src/base/argh.rs341 }COMMENT
LOWnative/src/base/argh.rs361 /// /// Command to manage a classroom.COMMENT
17 more matches not shown…
Verbosity Indicators29 hits · 47 pts
SeverityFileLineSnippetContext
LOWnative/src/init/selinux.rs102 // Step 0: determine strategyCOMMENT
LOWnative/src/init/selinux.rs126 // Step 1: setup for intercepting init boot control flowCOMMENT
LOWnative/src/init/selinux.rs187 // Step 2: wait for selinuxfs to be mounted (only for LEGACY)COMMENT
LOWnative/src/init/selinux.rs219 // Step 3: obtain sepolicy, patch, and load the patched sepolicyCOMMENT
LOW⚡native/src/core/sqlite.cpp111 // Step 1: prepare statementCOMMENT
LOW⚡native/src/core/sqlite.cpp119 // Step 2: bind argumentsCOMMENT
LOW⚡native/src/core/sqlite.cpp129 // Step 3: executeCOMMENT
LOWnative/src/core/module.rs848 // Step 1: Create virtual filesystem treeCOMMENT
LOWnative/src/core/module.rs878 // Step 2: Inject custom filesCOMMENT
LOWnative/src/core/module.rs897 // Step 3: Extract all supported read-only partition rootsCOMMENT
LOWnative/src/core/module.rs925 // Step 4: Convert virtual filesystem tree into concrete operationsCOMMENT
LOWnative/src/core/zygisk/hook.cpp276 // On arm32, we need to check if the pc is in thumb mode,COMMENT
LOW⚡native/src/boot/zimage.rs323 // Step 1: Calculate offset delta for GOT and trailing sections based on 4-byte realignmentCOMMENT
LOW⚡native/src/boot/zimage.rs331 // Step 2: Patch zimage_hdr->end (offset 0x2C) with new total image end addressCOMMENT
LOW⚡native/src/boot/zimage.rs335 // Step 3: Patch .Linflated_image_size_offset pointer table entryCOMMENT
LOW⚡native/src/boot/zimage.rs342 // Step 4: Patch the LC0 position table (arch/arm/boot/compressed/head.S)COMMENT
LOW⚡native/src/boot/zimage.rs358 // Step 5: Patch LC1 relocation table in newer kernelsCOMMENT
LOW⚡native/src/boot/zimage.rs367 // Step 6: Patch .table (_magic_table) TagKernelSize entryCOMMENT
LOW⚡native/src/boot/zimage.rs374 // Step 7: Disassemble and patch R_ARM_GOTPC PC-relative literal pool entries in .textCOMMENT
LOW⚡native/src/boot/zimage.rs455 // Step 1: Re-pad leading gap before the GOT with zeros to maintain 4-byte alignmentCOMMENT
LOW⚡native/src/boot/zimage.rs461 // Step 2: Relocate internal GOT pointers (arch/arm/boot/compressed/vmlinux.lds.S)COMMENT
LOWnative/src/boot/zimage.rs108 // Step 1: Validate 32-bit ARM zImage header (magic 0x016f2818 at offset 0x24)COMMENT
LOWnative/src/boot/zimage.rs123 // Step 2: Locate the start of compressed piggy payload by scanning forward from 0x28.COMMENT
LOWnative/src/boot/zimage.rs154 // Step 3: Scan for the LC0 position table (arch/arm/boot/compressed/head.S)COMMENT
LOWnative/src/boot/zimage.rs194 // Step 4: Determine piggy_end using a 3-tier heuristic strategyCOMMENT
LOWnative/src/boot/zimage.rs266 // Step 5: Locate .Linflated_image_size_offset matching known piggy_endCOMMENT
LOWnative/src/boot/zimage.rs286 // Step 6: Scan for LC1 relocation table in newer kernels (where p1 + off + start == end)COMMENT
LOWnative/src/boot/zimage.rs304 // Step 7: Construct zero-copy ZImage struct slicing head, piggy, and tailCOMMENT
LOWnative/src/boot/bootimg.cpp206 // We need to check if it is LZ4_LGCOMMENT
Structural Annotation Overuse27 hits · 45 pts
SeverityFileLineSnippetContext
LOWnative/src/init/selinux.rs102 // Step 0: determine strategyCOMMENT
LOWnative/src/init/selinux.rs126 // Step 1: setup for intercepting init boot control flowCOMMENT
LOWnative/src/init/selinux.rs187 // Step 2: wait for selinuxfs to be mounted (only for LEGACY)COMMENT
LOWnative/src/init/selinux.rs219 // Step 3: obtain sepolicy, patch, and load the patched sepolicyCOMMENT
LOW⚡native/src/core/sqlite.cpp111 // Step 1: prepare statementCOMMENT
LOW⚡native/src/core/sqlite.cpp119 // Step 2: bind argumentsCOMMENT
LOW⚡native/src/core/sqlite.cpp129 // Step 3: executeCOMMENT
LOWnative/src/core/module.rs848 // Step 1: Create virtual filesystem treeCOMMENT
LOWnative/src/core/module.rs878 // Step 2: Inject custom filesCOMMENT
LOWnative/src/core/module.rs897 // Step 3: Extract all supported read-only partition rootsCOMMENT
LOWnative/src/core/module.rs925 // Step 4: Convert virtual filesystem tree into concrete operationsCOMMENT
LOW⚡native/src/boot/zimage.rs323 // Step 1: Calculate offset delta for GOT and trailing sections based on 4-byte realignmentCOMMENT
LOW⚡native/src/boot/zimage.rs331 // Step 2: Patch zimage_hdr->end (offset 0x2C) with new total image end addressCOMMENT
LOW⚡native/src/boot/zimage.rs335 // Step 3: Patch .Linflated_image_size_offset pointer table entryCOMMENT
LOW⚡native/src/boot/zimage.rs342 // Step 4: Patch the LC0 position table (arch/arm/boot/compressed/head.S)COMMENT
LOW⚡native/src/boot/zimage.rs358 // Step 5: Patch LC1 relocation table in newer kernelsCOMMENT
LOW⚡native/src/boot/zimage.rs367 // Step 6: Patch .table (_magic_table) TagKernelSize entryCOMMENT
LOW⚡native/src/boot/zimage.rs374 // Step 7: Disassemble and patch R_ARM_GOTPC PC-relative literal pool entries in .textCOMMENT
LOW⚡native/src/boot/zimage.rs455 // Step 1: Re-pad leading gap before the GOT with zeros to maintain 4-byte alignmentCOMMENT
LOW⚡native/src/boot/zimage.rs461 // Step 2: Relocate internal GOT pointers (arch/arm/boot/compressed/vmlinux.lds.S)COMMENT
LOWnative/src/boot/zimage.rs108 // Step 1: Validate 32-bit ARM zImage header (magic 0x016f2818 at offset 0x24)COMMENT
LOWnative/src/boot/zimage.rs123 // Step 2: Locate the start of compressed piggy payload by scanning forward from 0x28.COMMENT
LOWnative/src/boot/zimage.rs154 // Step 3: Scan for the LC0 position table (arch/arm/boot/compressed/head.S)COMMENT
LOWnative/src/boot/zimage.rs194 // Step 4: Determine piggy_end using a 3-tier heuristic strategyCOMMENT
LOWnative/src/boot/zimage.rs266 // Step 5: Locate .Linflated_image_size_offset matching known piggy_endCOMMENT
LOWnative/src/boot/zimage.rs286 // Step 6: Scan for LC1 relocation table in newer kernels (where p1 + off + start == end)COMMENT
LOWnative/src/boot/zimage.rs304 // Step 7: Construct zero-copy ZImage struct slicing head, piggy, and tailCOMMENT
Empty Error Handlers2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHbuild.py87except FileNotFoundError:CODE
HIGHbuild.py97except FileNotFoundError as e:CODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM…pk/src/main/java/com/topjohnwu/magisk/ui/MainScreen.kt176 // In rail mode this slot is also composed (unplaced) by the scaffold,COMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMscripts/avd_setup.sh140# Create a marker file to understand it is a live setupCOMMENT
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippetContext
LOWbuild.py565CODE
LOWbuild.py623CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWscripts/avd_setup.sh7# For developing Magisk, just use:COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWscripts/flash_script.sh59# Check if system root is installed and removeCOMMENT
Unused Imports1 hit · 1 pts
SeverityFileLineSnippetContext
LOWbuild.py19CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWscripts/env.py13__all__ = [CODE