I won't say much nonsense, I will just post code to you:
The specific code is as follows:
public class MIUIUtils { // Detect MIUIprivate static final String KEY_MIUI_VERSION_CODE = ""; private static final String KEY_MIUI_VERSION_NAME = ""; private static final String KEY_MIUI_INTERNAL_STORAGE = ""; public static boolean isMIUI() {<span style="white-space:pre"> </span>//Get cache statusif(().getCacheDataSP().contains("isMIUI")) { return ().getCacheDataSP().getBoolean("isMIUI",false); } Properties prop= new Properties(); boolean isMIUI; try { (new FileInputStream(new File((), ""))); } catch (IOException e) { (); return false; } isMIUI= (KEY_MIUI_VERSION_CODE, null) != null || (KEY_MIUI_VERSION_NAME, null) != null || (KEY_MIUI_INTERNAL_STORAGE, null) != null; ().putCacheData("isMIUI",isMIUI);//Save whether to MIUIreturn isMIUI; }}
The above code is based on Android to determine whether the phone is a Xiaomi minu system. I hope it will be helpful to everyone!