-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/root shizuku setup #8
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
Conversation
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.
Pull Request Overview
This PR introduces additional methods for granting the protected WRITE_SECURE_SETTINGS permission via Shizuku and Root, in addition to the existing ADB method. Key changes include updating dependency versions to support Shizuku, revising string resources for multiple permission granting options in both English and German, and adding new logic in the ViewModel, UI composables, and MainActivity to check and request permissions via Shizuku/Root.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
gradle/libs.versions.toml | Added Shizuku version and new library definitions for Shizuku API and provider support. |
app/src/main/res/values/strings.xml app/src/main/res/values-de/strings.xml |
Updated string resources to support additional permission grant methods (ADB, Shizuku, Root). |
app/src/main/java/com/rbn/qtsettings/viewmodel/MainViewModel.kt | Added new StateFlows and functions to check system states and grant permissions via Shizuku and Root. |
app/src/main/java/com/rbn/qtsettings/utils/PermissionUtils.kt | Introduced utility functions for checking/requesting Shizuku permission and detecting root status. |
app/src/main/java/com/rbn/qtsettings/ui/composables/PermissionGrantDialog.kt | Created a new dialog composable to display multiple permission options. |
app/src/main/java/com/rbn/qtsettings/ui/composables/MainScreen.kt | Updated the main screen logic to show the new permission grant dialog when necessary. |
Other files (AdbInstructionDialog.kt, MainActivity.kt, AndroidManifest.xml, build.gradle.kts, README.md) | Adjustments to support the new permission methods and update documentation accordingly. |
Comments suppressed due to low confidence (1)
app/src/main/java/com/rbn/qtsettings/ui/composables/MainScreen.kt:100
- The onClick handler for the help icon contains a redundant conditional since both branches perform the same actions. Consider simplifying the logic by eliminating the conditional.
IconButton( if (!hasWriteSecureSettings) { showPermissionGrantDialog = true; viewModel.checkSystemStates(context) } else { showPermissionGrantDialog = true; viewModel.checkSystemStates(context) } }) {
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.
Pull Request Overview
This PR adds support for granting the WRITE_SECURE_SETTINGS
permission via Shizuku and Root, updates UI flows for permission setup, and integrates new resources and dependencies.
- Introduces Shizuku and Root grant options in strings, manifest, and README
- Extends
PermissionUtils
,MainViewModel
, and UI composables for multi‐method permission workflows - Adds Shizuku provider dependency and manifest entries, updates Gradle libs
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
gradle/libs.versions.toml | Added Shizuku dependency versions |
app/src/main/res/values/strings.xml | New strings for Shizuku/Root dialogs and messages |
app/src/main/res/values-de/strings.xml | German translations for the new permission dialogs |
app/src/main/java/com/rbn/qtsettings/utils/PermissionUtils.kt | New helpers for Shizuku availability, permission, root detection |
app/src/main/java/com/rbn/qtsettings/viewmodel/MainViewModel.kt | State flows and functions for multi‐method grants |
app/src/main/java/com/rbn/qtsettings/ui/composables/PermissionGrantDialog.kt | Full‐screen dialog with ADB/Shizuku/Root options |
app/src/main/java/com/rbn/qtsettings/ui/composables/MainScreen.kt | Trigger permission dialog, about dialog integration |
app/src/main/java/com/rbn/qtsettings/ui/composables/AdbInstructionDialog.kt | Renamed and refactored ADB instruction dialog |
app/src/main/java/com/rbn/qtsettings/ui/composables/AboutDialog.kt | New About dialog linking to permission setup |
app/src/main/java/com/rbn/qtsettings/MainActivity.kt | Shizuku listener, toast handling, request flow |
app/src/main/AndroidManifest.xml | Shizuku provider and package queries |
app/build.gradle.kts | Added Shizuku API and provider implementations |
README.md | Documentation for ADB, Shizuku, and Root methods |
Comments suppressed due to low confidence (2)
app/src/main/res/values/strings.xml:54
- This string contains format placeholders (%1$d, %2$s). Add a translator comment (e.g., ) so translators understand the placeholders.
<string name="permission_method_adb_title">Method %1$d: ADB %2$s</string>
app/src/main/java/com/rbn/qtsettings/viewmodel/MainViewModel.kt:137
- New permission grant flows in MainViewModel and system checks in PermissionUtils lack unit tests. Consider adding tests for Shizuku availability, root detection, and grant success/failure scenarios.
fun grantWriteSecureSettingsViaShizuku(context: Context) {
app/src/main/java/com/rbn/qtsettings/ui/composables/MainScreen.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.