这里是string类型的属性,其他可灵活修改反射类型
public static String getProperty(String key, String defValue) {
String value = "";
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class, String.class);
value = (String) (get.invoke(c, key, defValue));
} catch (Exception e) {
e.printStackTrace();
} finally {
return value;
}
}
private String mAIFaceSwitch=null;
mAIFaceSwitch=getProperty("persist.personalized.enable","0");