Tuesday, September 5, 2017

applications - Can I 'trick' my device into thinking it's unrooted?


I rooted my Nexus 4 in order to install a custom ROM, which I'm quite happy with. However, there are a couple of apps that I want to use but refuse to work because the device is rooted.


Is there a way for me to trick the device into thinking - or telling apps - that it is unrooted?



Answer



This depends on how the app is checking for root.


One method is for the app to actually attempt to find or use the su binary, or the Superuser apk file. These methods can often be bypassed by using an app that will move su to a temporary backup location, then restore it afterwards. Some root management apps have this built in to their settings (e.g. recent versions of Superuser and SuperSU). Otherwise you can try an app like OTA RootKeeper.


Another method that apps will use to determine if you're rooted involves checking the contents of your build.prop file. You can check this with any text editor, from your terminal, or using a specialized app like Build Prop Editor. The file resides at /system/build.prop, and it is a good idea to make a backup before modifying it since having a malformed build.prop can cause boot issues.



What you'll need to look for is lines that specify that you are running a "test-keys" build, such as:


ro.build.tags=test-keys

Change this to "release-keys" and the app performing the root check should assume you're running a normal release build. This is typically not needed if you're running a rooted stock ROM, but it would be necessary on many custom ones like CyanogenMod.


There are likely other root detection techniques, some of which may be somewhat complex to bypass. This blog post outlines a few, but I honestly cannot say which of these is being used in the wild. I have seen the two I outlined above, however.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...