No more nonsense to say, directly to everyone to paste the code:
The specific code looks like this:
public class Miuiutils {//Detect MIUI private static final String Key_miui_version_code = "Ro.miui.ui.version.code";
private static final String Key_miui_version_name = "Ro.miui.ui.version.name";
private static final String key_miui_internal_storage = "Ro.miui.internal.storage"; The public static Boolean Ismiui () {<span style= "white-space:pre" > </span>//gets the cached state if (sputils.getinstance).
Getcachedatasp (). Contains ("ISMIUI")) {return sputils.getinstance (). getcachedatasp (). Getboolean ("Ismiui", false);
Properties prop= new Properties ();
Boolean ismiui;
try {prop.load (New FileInputStream (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;
Sputils.getinstance (). Putcachedata ("Ismiui", ISMIUI);//save MIUI return ISMIUI;}}
The above code is based on Android to determine whether the phone is a millet minu system method, I hope to help!