How does copy protection on my computer check if the device is rooted?

The http://developer.android.com/guide/publishing/licensing.html in the "Replace for copy protection" section says:

A limitation of the obsolete copy protection mechanism on the Android Market is that applications that use it can only be installed on compatible devices that provide a secure internal storage environment. For example, a copy-protected application cannot be downloaded from Market to a device that provides root access, and the application cannot be installed on the device’s SD card.

How Android, meanwhile, is outdated - copy protection checks if the device is rooted? Afaik is not possible, also according to Dianne Hackborn (see How to determine if a device is associated with an application? ). Thus, this can only mean that the check is performed using some (unknown public) check of confusing criteria, obviously, not just checking if the su command exists, I suppose. Does anyone know more about this control logic - or how safe is it?

+4
source share
3 answers

This is what I use:

public static boolean isDeviceRooted () { boolean ret = false; String path = null; Map<String,String> env = System.getenv(); if (env != null && (path = env.get("PATH")) != null) { setDevicePath(path); String [] dirs = path.split(":"); for (String dir : dirs){ String suPath = dir + "/" + "su"; File suFile = new File(suPath); if (suFile != null && suFile.exists()) { setSuLocation(suPath); ret = true; } } } return ret; } 
Theoretically, it will not work in all cases, because the user can put "su" in a non-standard location that is not in PATH, but practically, if he does, other applications that need to know where "su" will not find him, therefore the rooting goal will be defeated.
+2
source

While the presence of the Superuser app is not an ideal way to determine if a phone is rooted in its good indicator, that might be. Why not just check if the com.noshufou.android.su package is com.noshufou.android.su ?

I have never tried, but I do not understand why this will not work.

0
source

We clearly indicate in the sales information that the application does not run on root devices.

This will definitely affect your installation speed. Although you plan to sell your application for $ 1,000, it will have a much worse effect than anything you could do to it.

0
source

All Articles