How to Access Different Firmware Modes of a Terminal

From wizarPOS
Revision as of 03:13, 7 March 2022 by Mahong (talk | contribs) (Created page with " It can get from system property: ro.firmware.type <syntaxhighlight lang="java" line='line'> String name = getProperty("ro.firmware.type","");// eng is engineer mode, user...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 It can get from 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;
  }
}