Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Fix method call order
Browse files Browse the repository at this point in the history
  • Loading branch information
PranavPurwar authored Aug 14, 2023
1 parent f65f74b commit de5c612
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions app/src/main/kotlin/org/cosmicide/rewrite/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,10 @@ class MainActivity : AppCompatActivity() {

Shizuku.addRequestPermissionResultListener(listener)

if (isShizukuInstalled()) {
lifecycleScope.launch {
awaitBinderReceived()
CommonUtils.showSnackBar(binding.root, "Shizuku is ready")
}
if (Shizuku.shouldShowRequestPermissionRationale()) {
lifecycleScope.launch {
awaitBinderReceived()
if (isShizukuInstalled() && Shizuku.shouldShowRequestPermissionRationale()) {
requestPermission()
} else {
if (Shizuku.checkSelfPermission() == PackageManager.PERMISSION_GRANTED) {
lifecycleScope.launch {
awaitBinderReceived()
CommonUtils.showSnackBar(binding.root, "Shizuku is ready")
}
}
}
}
}
Expand Down

0 comments on commit de5c612

Please sign in to comment.