Repository Analysis

topjohnwu/Magisk

The Magic Mask for Android

3.1 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of topjohnwu/Magisk, a Kotlin project with 61,670 GitHub stars. SynthScan v2.0 examined 85,682 lines of code across 646 source files, recording 144 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 3.1 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

3.1
Adjusted Score
3.1
Raw Score
100%
Time Factor
2026-06-11
Last Push
61.7K
Stars
Kotlin
Language
85.7K
Lines of Code
646
Files
144
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 3HIGH 0MEDIUM 33LOW 108

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 144 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators33 hits · 119 pts
SeverityFileLineSnippetContext
MEDIUMnative/src/core/zygisk/hook.cpp31// ┌───────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp34// │ │ ┌────────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp35// │ └────────────────────────────────────────►│LoadNativeBridge│COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp36// │ └───────┬────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp37// ┌────────────────┐ │ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp38// │LoadNativeBridge│◄────────────┼───────────────────────────────────────────────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp39// └───────┬────┬───┘ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp40// │ │ │ ┌───────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp41// │ └─────────────────┼────────────────────►│NativeBridgeItf│COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp42// │ │ └──────┬────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp45// │ │ ┌────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp47// ▼ │ └────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp48// ┌───────┐ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp52// │ │ ┌───────────────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp53// └──────────────────────┼────────────────►│post_native_bridge_load│COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp54// │ └───────────────────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp56// ┌──────────────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp58// └───────────┬────┬─────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp59// │ │ ┌───────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp60// │ └───────────────►│hook_zygote_jni│COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp61// │ └───────────────┘ ┌─────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp63// └────────────────────────────────────────────►│ JVM │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp66// ┌───────────────────┐ │ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp67// │nativeXXXSpecialize│◄─────────────────────────────────────┘ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp68// └─────────────┬─────┘ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp69// │ ┌─────────────┐ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp70// └────────────────►│ZygiskContext│ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp71// └─────────────┘ ▼COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp72// ┌────────────────────┐COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp74// └─────────┬──────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp75// ┌────────────────┐ │COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp76// │restore_plt_hook│◄───────────┘COMMENT
MEDIUMnative/src/core/zygisk/hook.cpp77// └────────────────┘COMMENT
Over-Commented Block79 hits · 74 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/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/bootimg.hpp101// https://android.googlesource.com/platform/system/tools/mkbootimg/+/refs/heads/android12-release/include/bootimg/bootiCOMMENT
LOWnative/src/boot/bootimg.cpp1#include <bit>COMMENT
LOWnative/src/boot/magiskboot.hpp1#pragma onceCOMMENT
LOWnative/src/boot/magiskboot.hpp21#define BOOT_MAGIC "ANDROID!"COMMENT
LOWnative/src/include/consts.hpp1#pragma onceCOMMENT
LOWnative/src/include/consts.hpp21COMMENT
LOWnative/src/external/xz_config/config.h401# define _GNU_SOURCE 1COMMENT
LOWnative/src/external/xz_config/config.h421 significant byte first (like Motorola and SPARC, unlike Intel). */COMMENT
LOWnative/src/external/xz-embedded/xz_config.h121# define get_le32 get_unaligned_le32COMMENT
LOWnative/src/external/xz-embedded/xz_private.h21# include <linux/string.h>COMMENT
LOWnative/src/external/xz-embedded/xz_private.h41# define memzero(buf, size) memset(buf, 0, size)COMMENT
LOWnative/src/external/xz-embedded/xz_private.h61/*COMMENT
LOWnative/src/external/xz-embedded/xz_private.h81# define DEC_IS_DYNALLOC(mode) (false)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
19 more matches not shown…
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt268 val invalidDialog = com.topjohnwu.magisk.ui.component.rememberConfirmDialog(CODE
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt289 com.topjohnwu.magisk.ui.component.rememberConfirmDialog(CODE
CRITICAL…/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt301 val shortcutDialog = com.topjohnwu.magisk.ui.component.rememberConfirmDialog(CODE
Verbosity Indicators13 hits · 21 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
LOWnative/src/core/sqlite.cpp111 // Step 1: prepare statementCOMMENT
LOWnative/src/core/sqlite.cpp119 // Step 2: bind argumentsCOMMENT
LOWnative/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.cpp267 // On arm32, we need to check if the pc is in thumb mode,COMMENT
LOWnative/src/boot/bootimg.cpp318 // We need to check if it is LZ4_LGCOMMENT
Structural Annotation Overuse11 hits · 19 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
LOWnative/src/core/sqlite.cpp111 // Step 1: prepare statementCOMMENT
LOWnative/src/core/sqlite.cpp119 // Step 2: bind argumentsCOMMENT
LOWnative/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
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippetContext
LOWscripts/flash_script.sh60# Check if system root is installed and removeCOMMENT
LOWscripts/boot_patch.sh58 # Check if 64-bitCOMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWscripts/live_setup.sh7# For developing Magisk, just use:COMMENT
Unused Imports1 hit · 1 pts
SeverityFileLineSnippetContext
LOWbuild.py17CODE
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippetContext
LOW…/java/com/topjohnwu/magisk/core/su/SuRequestHandler.kt25class SuRequestHandler(CODE