Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

fix: request Shizuku permissions only when necessary #64

Merged
merged 3 commits into from
Jan 15, 2024
Merged

fix: request Shizuku permissions only when necessary #64

merged 3 commits into from
Jan 15, 2024

Conversation

rushiiMachine
Copy link
Contributor

@rushiiMachine rushiiMachine commented Jan 15, 2024

Fixes #58

  • Only request shizuku at startup if shizuku is the selected install method (not by default)
  • Request and wait for shizuku perms again once installing and handle the event that permissions are denied/not available
  • When switching install methods, check if shizuku is available and wait for permissions to be granted before confirming the change (previously this relied on shizuku was already granted at startup otherwise it disabled the switcher)

@wingio wingio self-requested a review January 15, 2024 16:30
@wingio wingio merged commit cc449da into vendetta-mod:main Jan 15, 2024
1 check passed
if (preferences.installMethod == InstallMethod.SHIZUKU) {
lifecycleScope.launch {
if (!ShizukuPermissions.waitShizukuPermissions()) {
preferences.installMethod = InstallMethod.DEFAULT
Copy link
Contributor Author

@rushiiMachine rushiiMachine Jan 15, 2024

Choose a reason for hiding this comment

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

You should've probably shown a toast here otherwise it's changing a setting without telling the user.
Something like "Failed to obtain Shizuku permissions, reverting to PackageManager"

@rushiiMachine rushiiMachine deleted the fix/shizuku-permission-request branch January 16, 2024 02:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The denial of Shizuku permission sometimes leads to spam requests
2 participants