Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the previous libsu-based RootService integration and replaces it with an owned root-process startup and Binder handoff flow, eliminating the JitPack/libsu dependency and updating the library, demo app, and tests accordingly.
Changes:
- Drop libsu + JitPack usage and implement an owned root app_process startup path with provider-based Binder handoff.
- Introduce new internal startup/runtime components (bootstrap/main/launcher/ownership/handoff) and a new public
NoShellException. - Update tests and demo code to validate the new startup, IPC, and failure/cancellation behaviors.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Removes JitPack repository entry (no longer needed after libsu removal). |
| README.md | Updates feature/comparison docs and documents hidden API assumptions for the new design. |
| lib/src/test/java/be/mygod/librootkotlinx/RootSessionTest.kt | Adds coverage for propagating owned-shell startup failures from acquire(). |
| lib/src/test/java/be/mygod/librootkotlinx/RootServerTest.kt | Adds tests for new lifecycle logging and startup event behavior. |
| lib/src/test/java/be/mygod/librootkotlinx/impl/RootServiceHandoffTest.kt | New tests for token-based Binder handoff and provider failure behavior. |
| lib/src/test/java/be/mygod/librootkotlinx/impl/RootProcessHandleTest.kt | Updates startup/cancellation tests to match new startup sequencing and error messages. |
| lib/src/test/java/be/mygod/librootkotlinx/impl/RootCommandServiceTest.kt | Adds test ensuring fatal callback failures stop the root process. |
| lib/src/test/java/be/mygod/librootkotlinx/impl/libsu/RootProcessLauncherTest.kt | Deletes obsolete tests for the removed libsu rewrite path. |
| lib/src/main/java/be/mygod/librootkotlinx/RootSession.kt | Changes lifecycle hook to handleRootLifecycle, adds niceName, and documents new lifecycle timing; annotates acquire/use with @Throws(NoShellException). |
| lib/src/main/java/be/mygod/librootkotlinx/RootServer.kt | Refactors lifecycle/event handling, improves failure logging, and adjusts close/cleanup semantics. |
| lib/src/main/java/be/mygod/librootkotlinx/NoShellException.kt | New public exception for “no root shell” startup failures. |
| lib/src/main/java/be/mygod/librootkotlinx/io/ProcessPipes.kt | New process helper APIs (startPipes, awaitExit, Process.pid) and ProcessPipes wrapper. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootServiceHandoffProvider.kt | New internal ContentProvider endpoint for root-to-app Binder handoff. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootServiceHandoffClient.kt | New root-side client for external provider acquisition + IContentProvider.call compatibility. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootServiceHandoff.kt | New token registry and delivery mechanism for one-shot Binder handoff. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootServiceConnection.kt | Replaces libsu binding with owned root-process startup + handoff registration/cleanup. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessPipes.kt | Adjusts pipe path handling and removes libsu/ShellUtils dependency. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessOwnership.kt | Refactors ownership socket API (explicit socket name param) and switches logging to project logger. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessMain.kt | New root-side runtime that creates the service binder and delivers it via handoff. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessLauncher.kt | New owned startup command builder/executor for root app_process (no libsu rewrite). |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessHandle.kt | New startup sequencing (ownership + stdio + connection) and lifecycle handling orchestration. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootProcessBootstrap.kt | New bootstrap entrypoint to create package context/classloader before invoking RootProcessMain. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/RootCommandService.kt | Converts from RootService to an owned binder with explicit “stop root process” callback. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/libsu/RootProcessMain.kt | Deletes obsolete libsu-mirroring root-side entrypoint. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/libsu/RootProcessLauncher.kt | Deletes obsolete libsu startup command rewrite implementation. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/libsu/PendingRootServiceBind.kt | Deletes obsolete libsu reflection shim for pending bind cleanup. |
| lib/src/main/java/be/mygod/librootkotlinx/impl/AppProcess.kt | New helper for app_process command construction, quoting, and (API<26) relocation script. |
| lib/src/main/AndroidManifest.xml | Adds non-exported direct-boot-aware provider for handoff. |
| lib/consumer-rules.pro | Updates keep rules for bootstrap/main reflection entry points. |
| lib/build.gradle.kts | Removes libsu dependency from library module. |
| lib/api/current.txt | Updates tracked public API for NoShellException, RootSession signature changes, and new process helpers. |
| app/src/main/java/be/mygod/librootkotlinx/demo/MainActivity.kt | Updates demo to use new nonblocking Process IO and adds Binder passing demo. |
| app/src/androidTest/java/be/mygod/librootkotlinx/demo/RootStartupCancellationTest.kt | Expands assertions for new demo output and updates no-root detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+163
to
+164
| currentCoroutineContext().ensureActive() | ||
| if (rootServiceConnected.isCancelled) throw CancellationException("Root startup cancelled") |
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.