简体   繁体   中英

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.

I am not able to find the way in Appcelerator to achieve this. 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

Determining if an Android device is rooted programatically?

how to find the rooted device programmatically?

Have a look at these two modules:

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

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)

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:

Try to execute the su command, Runtime.getRuntime().exec("/system/xbin/which su"); Also check for the same su command in bin too (/system/bin/which 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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