0

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?

Community
  • 1
  • 1
Saggy
  • 118
  • 1
  • 6
  • no need to down-vote. A valid question with good examples/hints how to do it in JAVA – miga Feb 16 '16 at 20:23

3 Answers3

1

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 (e.g. you'll find those two when searching for "root" on gitTio)

miga
  • 3,997
  • 13
  • 45
  • Thanx @miga, for saving lot of time., both the modules are helpful. Thanx to appersonlab & collinprice – Saggy Feb 18 '16 at 13:14
0

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.

Soumya
  • 1,350
  • 3
  • 19
  • 34
  • Good tip! There is already a module (see my answer below) that is searching for these files (https://github.com/collinprice/com.collinprice.rooted/blob/master/android/src/com/collinprice/rooted/RootUtil.java) – miga Feb 16 '16 at 20:20
  • Yes, the above module can be used to solve your purpose. Also in later point of time, if the logic gets modified, you only need to update the module and your actual JS code remains intact. – Soumya Feb 16 '16 at 20:28