Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an “exec via broadcast” pathway by introducing a persistent bridge service that can forward broadcast-triggered commands into the isolated/rooted service, while also migrating native hooking from bundled xhook sources to LSPlt and upgrading the build toolchain.
Changes:
- Add
CommandReceiver+CommandService+ AIDL API to execute commands triggered by broadcasts via an isolated rooted service. - Introduce new
:libmagicaAndroid library with nativeMagicaRoot(JNI) and LSPlt-based hooking. - Upgrade Gradle/AGP wrapper/scripts and remove bundled
xhook/ ndk-build makefiles.
Reviewed changes
Copilot reviewed 43 out of 59 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Upgrades AGP plugin versions, adds foojay toolchain resolver, includes :libmagica. |
| libmagica/src/main/jni/external/lsplt | Adds LSPlt as a Git submodule reference. |
| libmagica/src/main/jni/CMakeLists.txt | Adds CMake build for magica + static libcap and LSPlt integration. |
| libmagica/src/main/java/io/github/vvb2060/magica/lib/MagicaRoot.java | Adds public JNI entrypoint to trigger native “root” escalation. |
| libmagica/src/main/AndroidManifest.xml | Adds library manifest scaffold. |
| libmagica/build.gradle | Configures Android library module with CMake external build. |
| libmagica/.gitignore | Ignores module build outputs. |
| gradlew.bat | Updates Windows Gradle wrapper script behavior and error handling. |
| gradlew | Updates Unix Gradle wrapper script behavior and error handling. |
| gradle/wrapper/gradle-wrapper.properties | Upgrades Gradle distribution URL and adds wrapper hardening settings. |
| gradle/gradle-daemon-jvm.properties | Adds daemon JVM/toolchain metadata (foojay). |
| gradle.properties | Removes AndroidX / non-transitive R properties. |
| build.gradle | Configures updateDaemonJvm toolchain selection. |
| app/src/main/jni/xhook/xhook.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_version.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_version.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_util.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_util.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_log.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_log.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_errno.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_elf.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_elf.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_core.h | Removes bundled xhook source. |
| app/src/main/jni/xhook/xh_core.c | Removes bundled xhook source. |
| app/src/main/jni/xhook/tree.h | Removes bundled xhook header. |
| app/src/main/jni/xhook/queue.h | Removes bundled xhook header. |
| app/src/main/jni/xhook/include/xhook.h | Removes bundled xhook public header. |
| app/src/main/jni/xhook/Android.mk | Removes ndk-build definition for xhook. |
| app/src/main/jni/magica.c | Switches JNI init/hooking logic from xhook to LSPlt APIs. |
| app/src/main/jni/Application.mk | Removes ndk-build Application.mk configuration. |
| app/src/main/jni/Android.mk | Removes ndk-build Android.mk for the app native lib. |
| app/src/main/java/io/github/vvb2060/puellamagi/MainActivity.java | Tracks service binding state, adjusts Magisk install logic, adds console logging. |
| app/src/main/java/io/github/vvb2060/puellamagi/MagicaService.java | Uses MagicaRoot.root() and adds execCommand binder API + lifecycle cleanup. |
| app/src/main/java/io/github/vvb2060/puellamagi/CommandService.java | Adds foreground bridge service that proxies exec requests to MagicaService. |
| app/src/main/java/io/github/vvb2060/puellamagi/CommandReceiver.java | Adds broadcast receiver that starts CommandService and returns results via ResultReceiver. |
| app/src/main/java/io/github/vvb2060/puellamagi/CommandExecutor.java | Adds command normalization/execution helper that escalates via MagicaRoot.root(). |
| app/src/main/java/io/github/vvb2060/puellamagi/BootCompletedReceiver.java | Adds boot receiver to start services at boot/direct-boot. |
| app/src/main/java/io/github/vvb2060/puellamagi/App.java | Moves initialization to onCreate() and stores device-protected context. |
| app/src/main/aidl/io/github/vvb2060/puellamagi/IRemoteService.aidl | Adds execCommand(String) to the remote service AIDL. |
| app/src/main/AndroidManifest.xml | Adds permissions, receivers, foreground bridge service, and direct-boot settings. |
| app/build.gradle | Upgrades Android config, enables AIDL, adds dependency on :libmagica. |
| README.md | Documents new am broadcast “EXEC” usage. |
| .gitmodules | Adds LSPlt Git submodule configuration. |
Comments suppressed due to low confidence (3)
libmagica/build.gradle:1
- Same DSL issue as the app module:
compileSdkshould be configured at theandroid {}level, not insidedefaultConfig. Also,cmake.versiontypically expects an exact version string; a'3.28.0+'wildcard is likely not supported and may break builds—pin an exact version or omitversionif you want Android Studio/AGP to manage it.
libmagica/build.gradle:1 - Same DSL issue as the app module:
compileSdkshould be configured at theandroid {}level, not insidedefaultConfig. Also,cmake.versiontypically expects an exact version string; a'3.28.0+'wildcard is likely not supported and may break builds—pin an exact version or omitversionif you want Android Studio/AGP to manage it.
settings.gradle:1 - These versions look newer than what I’m aware of as stable/available (AGP
9.1.0, foojay resolver convention1.0.0). If they don’t exist in the configured repositories, project sync will fail. Consider pinning to verified published versions (and align them with the Gradle wrapper version).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/src/main/java/io/github/vvb2060/puellamagi/BootCompletedReceiver.java
Show resolved
Hide resolved
app/src/main/java/io/github/vvb2060/puellamagi/CommandReceiver.java
Outdated
Show resolved
Hide resolved
….java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
….java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.