如何确定操作系统是否是应用程序的自定义ROM?
我正在开发一个 Android 应用程序,但我想限制我的应用程序只能由未运行 root/自定义 ROM 的硬件访问。我了解 Android 的前向锁定内容保护,但想在我的应用程序中仔细检查此保护。有没有什么方法可以使用 android API 获取设备的签名以及 ROM 的可信签名,以便我将我的应用程序锁定在自定义 ROM 之外?
I'm developing an Android application, but I want to restrict my application to only be accessible by hardware that is not running a rooted/custom ROM. I know about Android's Forward Locking content protection, but would like to double check this protection from within my app. Is there any way to get the signature of the device along with a trusted signature of the ROM using android API's so that I lock my app out from Custom ROMs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想不出万无一失的方法,抱歉。 ROM 或 root 的要点是您可以更改任何您想要的内容。因此,没有任何 Android API 调用可以安全地进行修改,例如,没有任何调用可以 100% 让您知道您正在合法设备上运行。
更新:查看 Google Safety Net,它可以让您确保设备未被修改。据我所知,安全网应该让你检查设备是否与谷歌所说的正确的“android”API“兼容”
There is no fail-proof way that I can think of, sorry. The main point of a ROM or root is that you can change whatever you want. Therefore, none of the Android API calls are safe from modifications e.g. there is no call that would 100% let you know you are running on a legit device.
Update: Check out Google Safety Net, it may allow you to ensure that a device is non-modified. From what I read, safety net is supposed to let you check if a device is "compatible" with what google says are the corrent "android" APIs
此问题提供了一些有关确定设备是否正在运行自定义 ROM 的信息:
如何找出 ROM 提供商是谁?
This question has some information on determining whether a device is running a custom ROM:
How to find out who the ROM provider is?