简体   繁体   English

如何检查Android设备是否植根于Appcelerator中?

[英]How to check if the android device is rooted or not in Appcelerator?

I am looking for the solution in Appcelerator, to check that the android device is rooted or not through coding or programming. 我正在寻找Appcelerator中的解决方案,以检查android设备是否已通过编码或编程扎根。

I am not able to find the way in Appcelerator to achieve this. 我无法在Appcelerator中找到实现此目的的方法。 if anybody has done this please help to find out how achieve this. 如果有人这样做,请帮助找出如何实现这一目标。

i have found few solution for android native but how to make it possible in android Appcelerator 我发现很少有针对Android本机的解决方案,但是如何在android Appcelerator中实现

Determining if an Android device is rooted programatically? 确定Android设备是否以编程方式植根?

how to find the rooted device programmatically? 如何以编程方式找到有根设备?

Have a look at these two modules: 看一下这两个模块:

https://github.com/collinprice/com.collinprice.rooted https://github.com/collinprice/com.collinprice.rooted

https://github.com/appersonlabs/RootFinder https://github.com/appersonlabs/RootFinder

you can use http://gitt.io to search for modules (eg you'll find those two when searching for "root" on gitTio) 您可以使用http://gitt.io搜索模块(例如,在gitTio上搜索“ root”时会找到这两个模块)

You need to understand that the process of rooting the device is changing with time and is getting more and more smarter. 您需要了解,设备生根的过程会随着时间而变化,并且变得越来越智能。 Nonetheless we still can try to perform some basic checks to filter out a portion of it. 尽管如此,我们仍然可以尝试执行一些基本检查以过滤掉其中的一部分。

Instead of doing it from Appcelerator, create an Android module and do the following: 代替从Appcelerator进行操作,创建一个Android模块并执行以下操作:

Try to execute the su command, Runtime.getRuntime().exec("/system/xbin/which su"); 尝试执行su命令Runtime.getRuntime()。exec(“ / system / xbin / which su”); Also check for the same su command in bin too (/system/bin/which su). 还要在bin(/ system / bin / which su)中检查相同的su命令。

If it returns a success, you know for sure that the device is rooted. 如果返回成功,则可以确定设备已植根。 But you need to be aware that these are not the foolproof way, but only one of the ways to test and filter out. 但是您需要意识到,这些并不是万无一失的方法,而仅仅是测试和过滤的一种方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM