Skip to content

Instantly share code, notes, and snippets.

@NLMartian
Created January 30, 2015 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NLMartian/ce1efbf34fbceb8b79a4 to your computer and use it in GitHub Desktop.
Save NLMartian/ce1efbf34fbceb8b79a4 to your computer and use it in GitHub Desktop.
判断ROM是否为MIUI
public static boolean isMIUI() {
String propName = "ro.miui.ui.version.name";
String line;
BufferedReader input = null;
try {
Process p = Runtime.getRuntime().exec("getprop " + propName);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
} catch (IOException ex) {
return false;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
}
}
}
return line != null && line.length() > 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment