Skip to content

Support exec via broadcast#6

Closed
Howard20181 wants to merge 14 commits intovvb2060:masterfrom
Howard20181:master
Closed

Support exec via broadcast#6
Howard20181 wants to merge 14 commits intovvb2060:masterfrom
Howard20181:master

Conversation

@Howard20181
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 9, 2026 04:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :libmagica Android library with native MagicaRoot (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: compileSdk should be configured at the android {} level, not inside defaultConfig. Also, cmake.version typically expects an exact version string; a '3.28.0+' wildcard is likely not supported and may break builds—pin an exact version or omit version if you want Android Studio/AGP to manage it.
    libmagica/build.gradle:1
  • Same DSL issue as the app module: compileSdk should be configured at the android {} level, not inside defaultConfig. Also, cmake.version typically expects an exact version string; a '3.28.0+' wildcard is likely not supported and may break builds—pin an exact version or omit version if 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 convention 1.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants