美文网首页
判断是否为小米MIUI系统

判断是否为小米MIUI系统

作者: dreamkong | 来源:发表于2017-06-14 17:09 被阅读36次
        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;
        }
    

    相关文章

      网友评论

          本文标题:判断是否为小米MIUI系统

          本文链接:https://www.haomeiwen.com/subject/iyceqxtx.html