设置/获取Systemproperties值

时间:2025-01-27 14:19:30

设置Systemproperties值

执行 adb 命令即可
例如:adb shell setprop 1

获取Systemproperties值

  public static final String PROPERTIES_KEY = "";
  public static String getConfigDisplayId() {
      String property = getProperty(PROPERTIES_KEY,"0");
      return property;
  }

public static String getProperty(String key, String defaultValue) {
    String value = defaultValue;
    try {
        Class<?> aClass = ("");
        Method get = ("get", , );
        value = (String) (aClass, key, defaultValue);
    } catch (Exception e) {
        ();
    } finally {
        return value;
    }
}