Repository navigation
Conversation
3 tasks done
Nothing in the app called Shizuku.requestPermission(), so a fresh install could never get Shizuku access: Retry only re-ran the compatibility check, which flashed the loading state and went back to "Shizuku Access Denied". Retry now shows Shizuku's permission dialog when the permission is missing, waits for the answer, then checks again. Root keeps its existing check. Repeated taps while a request is open are ignored, and a Shizuku binder error while checking is treated as "not granted" instead of crashing. Fixes aunchagaonkar#36
kirtan05
force-pushed
the
fix/request-shizuku-permission
branch
from
October 25, 2026 16:26
180193d to
2c1c312
Compare
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.
Problem
On a fresh install with Shizuku running, the app never gets Shizuku access. The main screen shows "Shizuku Access Denied", and tapping Retry only makes the card flash; the Shizuku permission dialog never opens.
Nothing in the app calls
Shizuku.requestPermission().SHIZUKU_PERMISSION_REQUEST_IDis declared inShizukuNetworkControlDataSourcebut never used. Retry only re-runscheckCompatibility(), so the state goes Pending → PermissionDenied again, which is the "blink" reported in #36. It is not specific to One UI: I reproduced it on a Pixel 8 with stock Android 17.Fixes #36
Change
NetworkControlDataSource.requestPermission(): the Shizuku version shows Shizuku's dialog and suspends untilOnRequestPermissionResultListeneranswers. The listener is removed on every path (result, cancellation, exception). Binder errors count as "not granted" instead of crashing. If the user denied before (shouldShowRequestPermissionRationale()), it returns false, because Shizuku won't show the dialog again. The root version keeps the existingUtils.isRootGranted()check.NetworkControlRepository.requestPermission(method)and aRequestPermissionUseCase, following the existing layering.MainViewModel.retryCompatibilityCheck(): when the state isPermissionDenied(SHIZUKU), it asks for permission first and then re-checks. Extra taps while a request is open are ignored.SettingsViewModel.retryCompatibilityCheck(): same, but only when Shizuku is the selected method, so a root user isn't shown a Shizuku dialog.SettingsViewModelTest: requests when Shizuku is denied, doesn't request when root is selected, doesn't request when Shizuku is already compatible../gradlew testpasses.Testing
Pixel 8, Android 17 (CP3A.261005.005), Shizuku 13.7.0 (thedjchi fork, started over wireless debugging).
Before: three taps on Retry, and no activity starts:
After: one tap on Retry opens Shizuku's dialog. After "Allow all the time", the app shows "Device Compatible":
Notes
MainActivity.onResumealso starts a compatibility check, and that can race with the one after Retry. This race existed before and I didn't change it here.