mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
app: merge :shared into :core and remove :shared
Consolidate ProviderInstaller and APKInstall into :core under matching packages (com.topjohnwu.magisk and com.topjohnwu.magisk.utils). - Move ProviderInstaller.java and APKInstall.java to :core - Delete app/shared/ module and its build configuration - Merge permissions and application attributes into :core manifest - Remove :shared project dependency from :core build.gradle.kts - Update app/settings.gradle.kts to only include :apk, :core, :test - Update magisk-app skill documentation to remove obsolete references Assisted-by: Gemini 4 Argon
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: magisk-app
|
||||
description: 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).
|
||||
description: 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, :test, :build-logic).
|
||||
---
|
||||
|
||||
# Magisk App Subproject Guidelines
|
||||
@@ -18,9 +18,6 @@ Guidelines and workflows for developing and building the Android application in
|
||||
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.
|
||||
|
||||
@@ -29,7 +26,7 @@ Multi-module Gradle project structure:
|
||||
- **Target Modules:** All active app development occurs in `:core` and `: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 live in `core/src/main/res/values/strings.xml` and `stub-res/src/main/res/values/strings.xml`. Translations live in `values-[lang]/strings.xml`.
|
||||
- Default strings live in `core/src/main/res/values/strings.xml`. Translations live in `values-[lang]/strings.xml`.
|
||||
- Whenever updating an existing string in a way that significantly changes its meaning, **always create a new string resource key** (and remove the old key across all `values*/strings.xml` files if unused) so existing translations do not go out of sync; falling back to untranslated default text is preferred over displaying an incorrect translation.
|
||||
- **Data Stack:** Room, KSP, Wire (Protocol Buffers), Moshi.
|
||||
|
||||
@@ -37,12 +34,10 @@ Multi-module Gradle project structure:
|
||||
|
||||
### From `app/` directory (prefixed with `../scripts/env.py`):
|
||||
- **Build App (`:apk` Debug):** `../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`
|
||||
|
||||
@@ -37,7 +37,6 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":shared"))
|
||||
coreLibraryDesugaring(libs.jdk.libs)
|
||||
|
||||
api(libs.timber)
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:installLocation="internalOnly">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
|
||||
<uses-permission android:name="android.permission.HIDE_OVERLAY_WINDOWS" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.RUN_USER_INITIATED_JOBS" />
|
||||
@@ -30,8 +35,13 @@
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="false"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="Magisk"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
||||
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning"
|
||||
tools:remove="android:appComponentFactory">
|
||||
|
||||
|
||||
@@ -31,4 +31,4 @@ pluginManagement {
|
||||
}
|
||||
|
||||
rootProject.name = "Magisk"
|
||||
include(":apk", ":core", ":shared", ":test")
|
||||
include(":apk", ":core", ":test")
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
|
||||
setupCommon()
|
||||
|
||||
android {
|
||||
namespace = "com.topjohnwu.shared"
|
||||
enableKotlin = false
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:installLocation="internalOnly">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:label="Magisk"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user