-
-
Notifications
You must be signed in to change notification settings - Fork 432
Merge pull request #253 from rainxchzed/feat-shizuku-installer #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ab5dcd1
Merge pull request #253 from rainxchzed/feat-shizuku-installer
rainxchzed 35fc40f
Refactor `ShizukuInstallerServiceImpl` to use reflection for hidden A…
rainxchzed 44fdc2d
Merge branch 'main' into shizuku-integration
rainxchzed 541614a
Refactor Shizuku installer to use `ParcelFileDescriptor` for APK inst…
rainxchzed a6f6b90
Refactor Shizuku installer to use shell commands instead of reflection
rainxchzed fc66218
feat(shizuku): implement timeouts and improve service binding
rainxchzed b4d66b2
Add translations for Shizuku installation method settings across mult…
rainxchzed 68ebb66
docs(readme): update feature structure and technical specifications
rainxchzed 8eba4ca
feat(profile): Add Shizuku-based auto-update functionality
rainxchzed abaa77d
feat(core/data): add AutoUpdateWorker and BootReceiver for Android
rainxchzed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
7 changes: 7 additions & 0 deletions
7
...src/androidMain/aidl/zed/rainxch/core/data/services/shizuku/IShizukuInstallerService.aidl
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package zed.rainxch.core.data.services.shizuku; | ||
|
|
||
| interface IShizukuInstallerService { | ||
| int installPackage(in ParcelFileDescriptor pfd, long fileSize); | ||
| int uninstallPackage(String packageName); | ||
| void destroy(); | ||
| } |
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
37 changes: 37 additions & 0 deletions
37
...droidMain/kotlin/zed/rainxch/core/data/services/shizuku/AndroidInstallerStatusProvider.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package zed.rainxch.core.data.services.shizuku | ||
|
|
||
| import kotlinx.coroutines.CoroutineScope | ||
| import kotlinx.coroutines.flow.SharingStarted | ||
| import kotlinx.coroutines.flow.StateFlow | ||
| import kotlinx.coroutines.flow.map | ||
| import kotlinx.coroutines.flow.stateIn | ||
| import zed.rainxch.core.domain.model.ShizukuAvailability | ||
| import zed.rainxch.core.domain.system.InstallerStatusProvider | ||
|
|
||
| /** | ||
| * Android implementation of [InstallerStatusProvider]. | ||
| * Maps [ShizukuServiceManager.status] to the platform-agnostic [ShizukuAvailability] enum. | ||
| */ | ||
| class AndroidInstallerStatusProvider( | ||
| private val shizukuServiceManager: ShizukuServiceManager, | ||
| scope: CoroutineScope | ||
| ) : InstallerStatusProvider { | ||
|
|
||
| override val shizukuAvailability: StateFlow<ShizukuAvailability> = | ||
| shizukuServiceManager.status.map { status -> | ||
| when (status) { | ||
| ShizukuStatus.NOT_INSTALLED -> ShizukuAvailability.UNAVAILABLE | ||
| ShizukuStatus.NOT_RUNNING -> ShizukuAvailability.NOT_RUNNING | ||
| ShizukuStatus.PERMISSION_NEEDED -> ShizukuAvailability.PERMISSION_NEEDED | ||
| ShizukuStatus.READY -> ShizukuAvailability.READY | ||
| } | ||
| }.stateIn( | ||
| scope = scope, | ||
| started = SharingStarted.Eagerly, | ||
| initialValue = ShizukuAvailability.UNAVAILABLE | ||
| ) | ||
|
|
||
| override fun requestShizukuPermission() { | ||
| shizukuServiceManager.requestPermission() | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve the
NOT_INSTALLEDstate instead of collapsing it toUNAVAILABLE.Line 23 drops a user-actionable distinction the new UI needs. With this mapping, the profile flow cannot tell “Shizuku is not installed” apart from generic unavailability, so the install-specific status/hint strings added in this PR become unreachable. Please expose a dedicated availability for that case, or pass the raw
ShizukuStatusthrough to the UI layer.