How to Access Different Firmware Modes of a Terminal: Difference between revisions
No edit summary |
m (Simon moved page How to get different firmware mode of terminal to How to Access Different Firmware Modes of a Terminal: Normalize the title) |
(No difference)
|
Revision as of 22:31, 27 December 2023
Guide to Accessing Different Firmware Modes of a Terminal
Method
- Retrieve the firmware mode information from the system property: 'ro.firmware.type'.
String name = getProperty("ro.firmware.type","");// eng is engineer mode, user is production mode
public static String getProperty(String key, String defaultValue) {
String value = defaultValue;
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class, String.class);
value = (String)(get.invoke(c, key, defaultValue ));
} catch (Exception e) {
e.printStackTrace();
}finally {
return value;
}
}