Skip to content

Commit 23bb8de

Browse files
committed
Fix: Root access check logic in PermissionBridge
1 parent d8c08cf commit 23bb8de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/com/appcontrolx/service/PermissionBridge.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class PermissionBridge(private val context: Context? = null) {
6464
*/
6565
fun checkRootNow(): Boolean {
6666
return try {
67-
// Initialize shell if needed
68-
if (!Shell.isAppGrantedRoot()!!) {
69-
Shell.getShell() // This will trigger root request
70-
}
67+
// Get shell instance - this will trigger root request if needed
68+
val shell = Shell.getShell()
69+
70+
// Check if root was granted
7171
Shell.isAppGrantedRoot() == true
7272
} catch (e: Exception) {
7373
false

0 commit comments

Comments
 (0)