Android Question How to prevent app run on root device

youjunjer

Member
Licensed User
Longtime User
hi all,
I am doing some work from gov. They want app only run on unroot device. If app detect device has been rooted, app will close itself.
Does anyone have any experience on this issus?
Pls give me some advice?
 

JohnC

Expert
Licensed User
Longtime User
This is usually a cat and mouse game - when someone comes out with a new way to detect a rooted device, someone else figures out how to trick it.

So, one method to detect root is for your app to specifically request root permission, and if that request is granted, then have your app abort/exit. If it is denied or gives an error, then the device is probably unrooted.

 
Upvote 0
Top