Sunday, 15 February 2015

Android - detect rooted device in C/C++ code -


In Java code there are several samples of Android device detection, I have to do this in C code by GN of course) No examples could be found. Please help. Thank you.

After the research, something found, in the JNI code: the system ("echo" test "">

  1. 512 on the Routed Device, 512 contains error code 2 (the major error).
  2. 256 Returns on 256 unrated devices, Error code 1 (minor error) Permission denied.

    return error 512 should be examined, is it enough to say that the device is root?

    You can do something simple.

    In Java The flag is to determine if the phone is the root.If yes, then when you call the JNI signal, then flag this flag, then you can handle the code flow for the root / non-route in the root. .

No comments:

Post a Comment