Fixed the issue where root detection not working for android 14+ Emulators #242
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.
Issue Summary
Starting with Android 14, emulators no longer provide access to the ro.debuggable and ro.secure properties, as noted in this issue. These properties were critical for our root detection logic, and their unavailability has caused our root detection to fail on Android 14+ emulators.
As our team primarily relies on rooted emulators for testing, this issue has disrupted our workflows and impacted testing capabilities.
Investigation
To address this, I explored alternative properties that could reliably indicate rooted devices. During this process, I came across this discussion on XDA, which suggested using the ro.adb.secure property. This property appears to be a reliable substitute for detecting rooted devices in Android 14+ environments.
Proposed Solution
This pull request modifies our root detection logic to include the ro.adb.secure property as an alternative check when ro.debuggable and ro.secure are unavailable. This ensures that our root detection continues to function properly on Android 14+ emulators.
Benefits
Request for Review
I kindly request you to review and approve this pull request so that we can resolve the issue and resume testing on rooted emulators seamlessly.
Developer checklist
./gradlew test
and confirmed all tests pass.