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

checkForDangerousProps: only return true if both props have a bad value #192

Closed

Conversation

Tachi107
Copy link

See #147 for details :)
Fixes #147, fixes #181

@Tachi107
Copy link
Author

Tachi107 commented Jul 3, 2022

@stealthcopter sorry for the ping, but I see you've been involved in #147, so you might be interested in reviewing this. Thanks!

Copy link

@eksencncozay eksencncozay left a comment

Choose a reason for hiding this comment

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

Oz

@scottyab
Copy link
Owner

Hey @Tachi107 Sorry it's taken so very long to respond. I have a window between jobs at the moment and attempting to address these PRs, update the documentation around the root checks and release a new version of rootbeer. In terms of this PR the checkForDangerousProps check is working as intended it'll flag for any of the properties not matching the expected value so changes in this PR are not aligned here so closing this PR. But thank you for your efforts here.

There's a different question in terms of whether the ro.debuggable is truly an indication of root. In one sense it's not, on the other it's an indication the device is not in a production-ready state so the plan is to keep the functionality as it for the time being.

To clarify @eksencncozay is not a maintainer of this project. Perhaps they can add some context to their review/comment/

Again sorry it's taken so long to respond.

@scottyab scottyab closed this Sep 10, 2024
@Tachi107
Copy link
Author

Tachi107 commented Sep 10, 2024

Hi Scott, thanks for the reply! Don't worry about the time it took to respond, good things take time :)

I do agree that, looking back at this patch, only returning true if both properties are in an unexpected state is wrong. I am now of the opinion that the function should return true only if ro.secure is set to 0.

The purpose of checkForDangerousProps is to check for properties which might imply root access. As thoroughly discussed in #147, ro.secure likely implies root, while ro.debuggable is unrelated to this.

Yes, ro.debuggable might imply that the phone is in a non-production-ready state, but there's already an official way to check for "certified devices": SafetyNet, or more recently, Google Play Integrity API.

And as seen in #147, checking for ro.debuggable for the reason of checking non-production-readyness is flawed, as many devices are sold with the property enabled.

In short: a root checking library should only check for ro.secure, an integrity checking library cannot rely on any of them (and you can't beat Google's Play Integrity API in this)

Hope this makes sense to you! Thanks again and bye :)

@scottyab
Copy link
Owner

In short: a root checking library should only check for ro.secure, an integrity checking library cannot rely on any of them (and you can't beat Google's Play Integrity API in this)

Thanks for the extra comments. Yes, agree with this. Given removing the ro.debuggable maybe something users are relying on I think it would be better placed to add this to new major version of the library.

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

Successfully merging this pull request may close these issues.

False positive - Dangerous props detect non rooted device as rooted device
3 participants