-
Notifications
You must be signed in to change notification settings - Fork 347
Secure mode
dtmilano edited this page Feb 1, 2013
·
23 revisions
AndroidViewClient has two possible back-ends:
- ViewServer
- UiAutomator
UiAutomator works on Android API 16 and higher, so if your device has a previous version your only alternative is ViewServer.
System ViewServer is started only when the device is not considered secure.
private boolean isSystemSecure() {
return "1".equals(SystemProperties.get(SYSTEM_SECURE, "1")) &&
"0".equals(SystemProperties.get(SYSTEM_DEBUGGABLE, "0"));
}
The properties involved to consider a device secure are
private static final String SYSTEM_SECURE = "ro.secure";
private static final String SYSTEM_DEBUGGABLE = "ro.debuggable";
This oneliner can be used to test these properties
$ (eval $(adb shell getprop | dos2unix | egrep '\[ro\.secure]|\[ro\.debuggable]' | sed 's/\./_/g; s/]: /=/g; s/[][]//g'); [[ 1 == $ro_secure && 0 == $ro_debuggable ]] && echo "System is secure: AVC won't work" || echo "System is not secure: AVC will work")
when run, this oneliner will tell you if AndroidViewClient could work on your device:
System is secure: AVC won't work