H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Mar 21, 2016 #1 How can we detect if device is rooted or not programmatically? Also, how can we force our app to not installed on unrooted devices?
How can we detect if device is rooted or not programmatically? Also, how can we force our app to not installed on unrooted devices?
DonManfred Expert Licensed User Longtime User Mar 21, 2016 #2 HAH said: How can we detect if device is rooted or not programmatically? Click to expand... https://www.b4x.com/android/forum/threads/superuser-acquiring-root-permissions-the-easy-way.43322/ Upvote 0
HAH said: How can we detect if device is rooted or not programmatically? Click to expand... https://www.b4x.com/android/forum/threads/superuser-acquiring-root-permissions-the-easy-way.43322/
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2016 #3 You cannot force your app not to be installed on rooted devices. Upvote 0
DonManfred Expert Licensed User Longtime User Mar 22, 2016 #4 Erel said: You cannot force your app not to be installed on rooted devices. Click to expand... He want HAH said: our app to not installed on unrooted devices? Click to expand... He want to limit the app to be installed only on Rooted devices. But the result - i guess - i the same. It can not be forced this way too. Upvote 0
Erel said: You cannot force your app not to be installed on rooted devices. Click to expand... He want HAH said: our app to not installed on unrooted devices? Click to expand... He want to limit the app to be installed only on Rooted devices. But the result - i guess - i the same. It can not be forced this way too.
amidgeha Active Member Licensed User Longtime User May 28, 2016 #5 HAH said: How can we detect if device is rooted or not programmatically? Also, how can we force our app to not installed on unrooted devices? Click to expand... You can execute a shell command "su" using the phone library and check the error message if any. In case of no error, this means su command can be reached and the phone is rooted. You can do it in java: public boolean isPhoneRooted(){ Process process = null; try{ process = Runtime.getRuntime().exec("su"); return true; } catch (Exception e) { return false; } finally{ if(process != null){ try{ process.destroy(); }catch (Exception e) { } } } } Upvote 0
HAH said: How can we detect if device is rooted or not programmatically? Also, how can we force our app to not installed on unrooted devices? Click to expand... You can execute a shell command "su" using the phone library and check the error message if any. In case of no error, this means su command can be reached and the phone is rooted. You can do it in java: public boolean isPhoneRooted(){ Process process = null; try{ process = Runtime.getRuntime().exec("su"); return true; } catch (Exception e) { return false; } finally{ if(process != null){ try{ process.destroy(); }catch (Exception e) { } } } }