Android的复制保护如何检查设备是否已植根?

Android的复制保护如何检查设备是否已植根?,第1张

概述在 http://developer.android.com/guide/publishing/licensing.html,在“替换复制保护”部分下面说: A limitation of the legacy Copy Protection mechanism on Android Market is that applications using it can be installed onl 在 http://developer.android.com/guide/publishing/licensing.html,在“替换复制保护”部分下面说:

A limitation of the legacy copy Protection mechanism on AndroID Market
is that applications using it can be installed only 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 to a device’s SD card.

如何AndroID – 同时弃用 – 复制保护检查设备是否已植根?根据Dianne Hackborn(见How can you detect if the device is rooted in the app?)的说法,这是不可能的.所以这只能意味着,检查是由一些(未知的公共)混淆标准检查完成的,显然不仅仅是简单检查’su’命令是否存在,我想.
有没有人更了解那种检查逻辑 – 或者它有多安全?

解决方法 这是我使用的:

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;}

从理论上讲,它并不适用于所有情况,因为用户可以将’su’放在非标准位置,这不在PATH中,但实际上如果他这样做,其他应用程序需要知道’su’的位置也不会找到它,因此生根的目的将被打败.

总结

以上是内存溢出为你收集整理的Android的复制保护如何检查设备是否已植根?全部内容,希望文章能够帮你解决Android的复制保护如何检查设备是否已植根?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1126413.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存