Skip to content
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

Root detection not working on android 14 #221

Open
pravinlondhe opened this issue Feb 6, 2024 · 5 comments
Open

Root detection not working on android 14 #221

pravinlondhe opened this issue Feb 6, 2024 · 5 comments

Comments

@pravinlondhe
Copy link

Root detection not working on android 14 emulator google API's system image while on android 13 emulator google API's system image it is working.

@NityaSantosh26
Copy link

NityaSantosh26 commented Sep 23, 2024

@pravinlondhe, Yes I also have this issue. The root detection doesn't work from Android 14 emulator onwards (Also tested on Android 15 Emulator).
I have digged deeper into the code and the failure is seems to be with https://github.com/scottyab/rootbeer/blob/master/rootbeerlib/src/main/java/com/scottyab/rootbeer/RootBeer.java, checkForDangerousProps() method.
The properties ro.debuggable, ro.secure are not part of the properties list of the emulator (Android 14)
Leaving that aside, I expected checkForBinary(BINARY_SU) method to return true but this fails in verifying if the su file exists.
The file indeed exists in the device explorer but the Line 191 of Rootbeer.java fails due to permission is not granted.
I am not sure about the real rooted device scenario, but on the Android 14 & 15 rooted emulators are not been detected!
"android.system.ErrnoException: access failed: EACCES (Permission denied)" is the Exception that we get and returns false.
@scottyab, Please look into it. Atleast the checkForBinary going fine. Even tried checkSuExists() which also fails detecting rooted device.

@scottyab
Copy link
Owner

scottyab commented Sep 23, 2024

Thanks both for flagging this. Just so I'm clear what your are reporting. The only reason Android 13 emulator was flagging as rooted was the checkForDangerousProps() check specifically ro.debuggable, ro.secure and new on android 14/15 emulator the properties are not set/accessible? Or were there other root checks that returned false on Android 13?

The file indeed exists in the device explorer

@NityaSantosh26 What path in the su binary that you're seeing is not detected? I'm unclear if this is a file you've added for test purposes or something that's part of the emulator

@NityaSantosh26
Copy link

Thanks for your reply @scottyab.
That's correct only with the check for ro.debuggable, ro.secure the root detection is being done on Android 13 Emulator. All the other properties/methods return false.
For Android 14 and above, the two properties are not available in the list of all properties maybe they are removed (i am not sure).
So even this checkForDangerousProps() also fails resulting in no root detection.

@scottyab
Copy link
Owner

scottyab commented Sep 23, 2024

I'm seeing ro.force.debuggable rather than ro.debuggable in system properties from Android 14 and Android 15, it could be this changed in Android 14 although not found any proof of that yet. Even if we changed it to also check for ro.force.debuggable, this is [0] so it would still pass the check and not be detected as rooted.

When I test the Default Android System image (i.e not the recommended Google one) emulator I'm setting test keys flagged and so rooted check fails.

image

I'm not sure of the best solution here, potentially it's a clarification about the expected root check result of the emulator for the default system image vs google system images?

@NityaSantosh26
Copy link

Yeah. But how about checkForBinary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants