mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
Remove the legacy view-based APK module (:apk-legacy), along with its subcommands, configurations, release packaging steps, and associated unused dependencies. Assisted-by: Gemini 3.8 Flash
2.9 KiB
2.9 KiB
name, description
| name | description |
|---|---|
| magisk-app | Guidelines, architecture, development conventions, and build workflows for the Magisk Android application (app/ subproject). Use when working on, modifying, building, or testing code in app/ or any of its submodules (:core, :apk, :shared, :stub, :stub-res, :test, :build-logic). |
Magisk App Subproject Guidelines
Guidelines and workflows for developing and building the Android application in the app/ subproject.
1. Environment & Gradle Setup
- General Guidelines: Always follow the top-level
AGENTS.mdandmagisk-gitfor repository rules, environment execution setup, and commit control policies. - Working Directory: Set working directory to
app/when running standalone Gradle commands, or execute build commands via./build.pyfrom the repository root. - Environment Wrapper: Standalone
./gradlewcommands MUST be prefixed with../scripts/env.py(e.g.,../scripts/env.py ./gradlew :apk:assembleDebug). Alternatively, run./build.py appfrom the repository root (which configures the environment automatically and builds:apk).
2. Architecture & Submodules
Multi-module Gradle project structure:
:apk(apk/): Main Magisk app (modern Jetpack Compose UI). Primary target for UI and application features.:core(core/): Core domain logic, resources, Room DB, services. Primary target for core feature development.:shared(shared/): Shared utilities and common data structures.:stub(stub/): Lightweight stub app loader for hidden installs.:stub-res(stub-res/): Stub-specific Android resources.:test(test/): Application testing target.:build-logic(build-logic/): Custom Gradle plugins and build logic.
3. Development Guidelines
- Target Modules: All active app development occurs in
:coreand:apk. - Language & UI: Written in Kotlin/Java. Prefer Kotlin for all new code. Uses Jetpack Compose for UI (prefer over View XML).
- String Resources: Default strings in
core/src/main/res/values/strings.xmlandstub-res/src/main/res/values/strings.xml. Translations go invalues-[lang]/strings.xml. - Data Stack: Room, KSP, Wire (Protocol Buffers), Moshi.
4. Workflows & Verification
From app/ directory (prefixed with ../scripts/env.py):
- Build App (
:apkDebug):../scripts/env.py ./gradlew :apk:assembleDebug - Build Stub APK:
../scripts/env.py ./gradlew :stub:assembleDebug - Run Lint:
../scripts/env.py ./gradlew lint(or../scripts/env.py ./gradlew :apk:lintDebug) - Run Unit Tests:
../scripts/env.py ./gradlew test - Clean Artifacts:
../scripts/env.py ./gradlew clean
From repository root (via build.py):
- Build App (
:apk):./build.py app - Build Stub App:
./build.py stub - Run App Tests:
./build.py test