Created
December 4, 2016 12:30
-
-
Save jackypanster/db2d36407bbdab2dfae51ed851957596 to your computer and use it in GitHub Desktop.
check the rom whether is miui rom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isMiUi() { | |
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.name")); | |
} | |
public static String getSystemProperty(String propName) { | |
String line; | |
BufferedReader input = null; | |
try { | |
java.lang.Process p = Runtime.getRuntime().exec("getprop " + propName); | |
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024); | |
line = input.readLine(); | |
input.close(); | |
} catch (IOException ex) { | |
return null; | |
} finally { | |
if (input != null) { | |
try { | |
input.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
return line; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment