public static boolean isMIUI() {
String KEY_MIUI_VERSION_CODE = "ro.miui.ui.version.code";
String KEY_MIUI_VERSION_NAME = "ro.miui.ui.version.name";
String KEY_MIUI_INTERNAL_STORAGE = "ro.miui.internal.storage";
Properties prop = new Properties();
boolean isMIUI;
try {
prop.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
} catch (IOException e) {
e.printStackTrace();
return false;
}
isMIUI = prop.getProperty(KEY_MIUI_VERSION_CODE, null) != null
|| prop.getProperty(KEY_MIUI_VERSION_NAME, null) != null
|| prop.getProperty(KEY_MIUI_INTERNAL_STORAGE, null) != null;
return isMIUI;
}
网友评论