├── .github
└── workflows
│ └── android.yml
├── .gitignore
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── huanchengfly
│ │ └── miui
│ │ └── checker
│ │ └── ExampleInstrumentedTest.kt
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── xposed_init
│ ├── java
│ └── com
│ │ └── huanchengfly
│ │ └── miui
│ │ └── checker
│ │ ├── Extensions.kt
│ │ ├── MainActivity.kt
│ │ ├── utils
│ │ ├── DeviceUtil.kt
│ │ ├── OSUtil.kt
│ │ ├── VersionUtil.kt
│ │ └── XposedUtil.kt
│ │ └── xposed
│ │ └── FullDeviceLevelModule.kt
│ └── res
│ ├── animator
│ └── appbar_elevation.xml
│ ├── drawable
│ ├── emoji_confused_face.xml
│ ├── emoji_expressionless_face.xml
│ ├── emoji_grinning_squinting_face.xml
│ ├── emoji_thinking_face.xml
│ ├── ic_launcher_foreground.xml
│ ├── ic_logo_github.xml
│ ├── ic_round_developer_board.xml
│ ├── ic_round_exit_to_app.xml
│ ├── ic_round_help.xml
│ ├── ic_round_memory.xml
│ ├── ic_round_offline_bolt.xml
│ ├── ic_round_phone_android.xml
│ ├── ic_round_score.xml
│ ├── ic_round_settings.xml
│ ├── ic_round_smartphone.xml
│ └── ic_round_storage.xml
│ ├── layout
│ ├── activity_main.xml
│ └── dialog_about.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-en
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ └── values
│ ├── arrays.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── themes.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.github/workflows/android.yml:
--------------------------------------------------------------------------------
1 | name: Android CI
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: set up JDK 1.8
17 | uses: actions/setup-java@v1
18 | with:
19 | java-version: 1.8
20 | - name: Grant execute permission for gradlew
21 | run: chmod +x gradlew
22 | - name: Build with Gradle
23 | run: ./gradlew assembleRelease
24 | - name: Upload APK
25 | uses: actions/upload-artifact@v2
26 | with:
27 | name: app-release
28 | path: app/build/outputs/apk/release/
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .cxx
3 |
4 | # Built application files
5 | *.apk
6 | *.ap_
7 | app/release/
8 |
9 | # Files for the ART/Dalvik VM
10 | *.dex
11 |
12 | # Java class files
13 | *.class
14 |
15 | # Generated files
16 | bin/
17 | gen/
18 | out/
19 | output.json
20 |
21 | # Gradle files
22 | .gradle/
23 | build/
24 |
25 | # Local configuration file (sdk path, etc)
26 | local.properties
27 |
28 | # Proguard folder generated by Eclipse
29 | proguard/
30 | app/lint.xml
31 | # app/proguard-project.txt
32 |
33 | # Log Files
34 | *.log
35 |
36 | # Android Studio Navigation editor temp files
37 | .navigation/
38 |
39 | # Android Studio captures folder
40 | captures/
41 |
42 | # IntelliJ
43 | *.iml
44 | .idea/
45 |
46 | # Keystore files
47 | # Uncomment the following line if you do not want to check your keystore files in.
48 | *.jks
49 |
50 | keystore.properties
51 |
52 | # External native build folder generated in Android Studio 2.2 and later
53 | .externalNativeBuild
54 |
55 | # Google Services (e.g. APIs or Firebase)
56 | google-services.json
57 |
58 | # Freeline
59 | freeline.py
60 | freeline/
61 | freeline_project_description.json
62 |
63 | # fastlane
64 | fastlane/report.xml
65 | fastlane/Preview.html
66 | fastlane/screenshots
67 | fastlane/test_output
68 | fastlane/readme.md
69 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MIUILevelChecker
2 | 帮助你查看自己的机型在 MIUI 12.5 上的分级
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdkVersion 29
8 |
9 | defaultConfig {
10 | applicationId "com.huanchengfly.miui.checker"
11 | minSdkVersion 28
12 | targetSdkVersion 29
13 | versionCode 1001
14 | versionName "1.0.1"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | kotlinOptions {
30 | jvmTarget = '1.8'
31 | }
32 | buildFeatures {
33 | viewBinding = true
34 | }
35 | }
36 |
37 | dependencies {
38 | implementation fileTree(dir: 'libs', include: ['*.jar'])
39 |
40 | compileOnly 'de.robv.android.xposed:api:82'
41 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
43 | implementation 'androidx.core:core-ktx:1.3.1'
44 | implementation 'androidx.appcompat:appcompat:1.2.0'
45 | implementation 'com.google.android.material:material:1.1.0'
46 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
47 | testImplementation 'junit:junit:4.13.1'
48 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
49 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
50 | }
51 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/huanchengfly/miui/checker/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import org.junit.Assert.assertEquals
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumented test, which will execute on an Android device.
11 | *
12 | * See [testing documentation](http://d.android.com/tools/testing).
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | fun useAppContext() {
18 | // Context of the app under test.
19 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
20 | assertEquals("com.miui.fuck", appContext.packageName)
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
15 |
18 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.huanchengfly.miui.checker.xposed.FullDeviceLevelModule
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/Extensions.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.net.Uri
7 | import android.provider.Browser
8 | import android.view.LayoutInflater
9 | import android.widget.Toast
10 | import androidx.viewbinding.ViewBinding
11 |
12 |
13 | inline fun Activity.bindView(): Binding {
14 | val clazz = Binding::class.java
15 | val inflateMethod = clazz.getDeclaredMethod("inflate", LayoutInflater::class.java)
16 | val binding: Binding = inflateMethod.invoke(null, layoutInflater) as Binding
17 | setContentView(binding.root)
18 | return binding
19 | }
20 |
21 | fun Context.toastShort(text: String) {
22 | Toast.makeText(this, text, Toast.LENGTH_SHORT).show()
23 | }
24 |
25 | fun Context.toastShort(resId: Int, vararg args: Any) {
26 | Toast.makeText(this, getString(resId, *args), Toast.LENGTH_SHORT).show()
27 | }
28 |
29 | inline fun Context.goToActivity() {
30 | startActivity(Intent(this, T::class.java))
31 | }
32 |
33 | inline fun Context.goToActivity(pre: Intent.() -> Unit) {
34 | startActivity(Intent(this, T::class.java).apply(pre))
35 | }
36 |
37 | fun Context.startApp(packageName: String) {
38 | startActivity(packageManager.getLaunchIntentForPackage(packageName))
39 | }
40 |
41 | fun Context.startURL(uri: Uri) {
42 | startActivity(Intent(Intent.ACTION_VIEW, uri).apply {
43 | putExtra(Browser.EXTRA_APPLICATION_ID, packageName)
44 | })
45 | }
46 |
47 | fun Context.startURL(url: String) {
48 | startURL(Uri.parse(url))
49 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker
2 |
3 | import android.annotation.SuppressLint
4 | import android.os.Build
5 | import android.os.Bundle
6 | import android.text.Html
7 | import android.view.Menu
8 | import android.view.MenuItem
9 | import android.view.View
10 | import androidx.appcompat.app.AlertDialog
11 | import androidx.appcompat.app.AppCompatActivity
12 | import com.huanchengfly.miui.checker.databinding.ActivityMainBinding
13 | import com.huanchengfly.miui.checker.databinding.DialogAboutBinding
14 | import com.huanchengfly.miui.checker.utils.DeviceUtil
15 | import com.huanchengfly.miui.checker.utils.OSUtil
16 | import com.huanchengfly.miui.checker.utils.VersionUtil
17 | import com.huanchengfly.miui.checker.utils.XposedUtil
18 |
19 | class MainActivity : AppCompatActivity() {
20 | private lateinit var binding: ActivityMainBinding
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | binding = bindView()
25 | setSupportActionBar(binding.toolbar)
26 | if (OSUtil.isMIUI()) {
27 | load()
28 | } else {
29 | AlertDialog.Builder(this)
30 | .setTitle(R.string.title_dialog_not_miui)
31 | .setMessage(R.string.text_dialog_not_miui)
32 | .setPositiveButton(R.string.btn_ok, null)
33 | .show()
34 | }
35 | }
36 |
37 | private fun load() {
38 | binding.contentContainer.visibility = View.VISIBLE
39 | var manufacturer = Character.toUpperCase(Build.MANUFACTURER[0]).toString() + Build.MANUFACTURER.substring(1)
40 | if (Build.BRAND != Build.MANUFACTURER) {
41 | manufacturer += " " + Character.toUpperCase(Build.BRAND[0]) + Build.BRAND.substring(1)
42 | }
43 | manufacturer += " " + Build.MODEL
44 | binding.phoneInfo.text = manufacturer
45 | binding.socInfo.text = DeviceUtil.getHardwareInfo()
46 | binding.ramInfo.text = getString(R.string.text_ram_info, DeviceUtil.getTotalRam())
47 | when (DeviceUtil.getDeviceLevel()) {
48 | DeviceUtil.DEVICE_HIGH_END -> {
49 | binding.statusIcon.setImageResource(R.drawable.emoji_grinning_squinting_face)
50 | binding.statusTitle.setText(R.string.status_title_full)
51 | binding.statusText.setText(R.string.status_text_full)
52 | binding.deviceLevelInfo.setText(R.string.level_text_high_end)
53 | }
54 | DeviceUtil.DEVICE_MIDDLE -> {
55 | binding.statusIcon.setImageResource(R.drawable.emoji_expressionless_face)
56 | binding.statusTitle.setText(R.string.status_title_basic)
57 | binding.statusText.setText(R.string.status_text_basic)
58 | binding.deviceLevelInfo.setText(R.string.level_text_middle)
59 | }
60 | DeviceUtil.DEVICE_PRIMARY -> {
61 | binding.statusIcon.setImageResource(R.drawable.emoji_confused_face)
62 | binding.statusTitle.setText(R.string.status_title_none)
63 | binding.statusText.setText(R.string.status_text_none)
64 | binding.deviceLevelInfo.setText(R.string.level_text_primary)
65 | }
66 | DeviceUtil.DEVICE_UNKNOWN -> {
67 | binding.statusIcon.setImageResource(R.drawable.emoji_thinking_face)
68 | binding.statusTitle.setText(R.string.status_title_unknown)
69 | binding.statusText.setText(R.string.status_text_unknown)
70 | binding.deviceLevelInfo.setText(R.string.level_text_unknown)
71 | }
72 | }
73 | if (DeviceUtil.isMiuiLite()) {
74 | binding.miuiLiteInfo.setText(R.string.miui_lite_yes)
75 | } else {
76 | binding.miuiLiteInfo.setText(R.string.miui_lite_no)
77 | }
78 | binding.miuiLiteHelpBtn.setOnClickListener {
79 | AlertDialog.Builder(this)
80 | .setTitle(R.string.title_dialog_whats_this)
81 | .setMessage(R.string.text_dialog_miui_lite_help)
82 | .setPositiveButton(R.string.btn_ok, null)
83 | .show()
84 | }
85 | if (XposedUtil.isModuleEnabled) {
86 | binding.xposedModuleStatusCard.setCardBackgroundColor(getColor(R.color.green_400))
87 | binding.xposedModuleStatus.setText(R.string.title_xposed_module_enabled)
88 | binding.xposedModuleStatusMessage.text = Html.fromHtml(getString(R.string.text_xposed_module_enabled), Html.FROM_HTML_MODE_COMPACT)
89 | binding.xposedModuleStatusActionBtn.setImageResource(R.drawable.ic_round_settings)
90 | binding.xposedModuleStatusActionBtn.visibility = View.GONE
91 | } else if (!XposedUtil.isManagerInstalled(this)) {
92 | binding.xposedModuleStatusCard.visibility = View.GONE
93 | } else {
94 | binding.xposedModuleStatusCard.setCardBackgroundColor(getColor(R.color.red_A400))
95 | binding.xposedModuleStatus.setText(R.string.title_xposed_module_not_actived)
96 | binding.xposedModuleStatusMessage.text = Html.fromHtml(getString(R.string.text_xposed_module_not_enabled), Html.FROM_HTML_MODE_COMPACT)
97 | binding.xposedModuleStatusActionBtn.setImageResource(R.drawable.ic_round_exit_to_app)
98 | binding.xposedModuleStatusCard.setOnClickListener {
99 | startApp(XposedUtil.getInstalledManagerPackageName(this)!!)
100 | }
101 | }
102 | }
103 |
104 | override fun onCreateOptionsMenu(menu: Menu): Boolean {
105 | menuInflater.inflate(R.menu.menu_main, menu)
106 | return true
107 | }
108 |
109 | @SuppressLint("SetTextI18n")
110 | override fun onOptionsItemSelected(item: MenuItem): Boolean {
111 | if (item.itemId == R.id.menu_about) {
112 | val dialogViewBinding = DialogAboutBinding.inflate(layoutInflater)
113 | dialogViewBinding.dialogAboutText.text = getString(R.string.text_dialog_about, VersionUtil.getVersionName(this), VersionUtil.getVersionCode(this))
114 | dialogViewBinding.btnGithub.setOnClickListener {
115 | startURL(getString(R.string.link_source))
116 | }
117 | AlertDialog.Builder(this)
118 | .setView(dialogViewBinding.root)
119 | .show()
120 | }
121 | return false
122 | }
123 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/utils/DeviceUtil.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker.utils
2 |
3 | import android.text.TextUtils
4 | import android.util.Log
5 | import java.io.*
6 | import java.util.*
7 | import java.util.regex.Matcher
8 | import java.util.regex.Pattern
9 |
10 |
11 | object DeviceUtil {
12 | private const val TAG = "DeviceUtil"
13 |
14 | private val MT_PATTERN: Pattern = Pattern.compile("MT([\\d]{2})([\\d]+)")
15 | private val SM_PATTERN: Pattern = Pattern.compile("Inc ([A-Z]+)([\\d]+)")
16 |
17 | const val DEVICE_HIGH_END = 2
18 | const val DEVICE_MIDDLE = 1
19 | const val DEVICE_PRIMARY = 0
20 | const val DEVICE_UNKNOWN = -1
21 |
22 | private const val ARM_V8 = 8
23 | private const val CORE_COUNT = 8
24 | private const val BIG_CORE_FREQ = 2000000
25 | private const val MIDDLE_FREQ = 2300000
26 | private const val HIGH_FREQ = 2700000
27 | private const val MTK_DIMENSITY = 68
28 | private const val D800 = 73
29 | private const val MIDDLE_EIGHT_SERIES = 45
30 |
31 | private const val HEX = "0x"
32 | private const val CPU_MAX_INFO_FORMAT = "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq"
33 | private const val IMPLEMENTOR = "CPU implementer"
34 | private const val ARCHITECTURE = "CPU architecture"
35 | private const val PART = "CPU part"
36 | private const val PROCESSOR = "processor"
37 | private const val QUALCOMM = "Qualcomm"
38 | private const val SNAPDRAGON = "sm"
39 | private const val SEPARATOR = ": "
40 |
41 | private var mLevel = DEVICE_UNKNOWN
42 | private var mTotalRam = Int.MAX_VALUE
43 |
44 | fun getDeviceLevel(): Int {
45 | if (mLevel != DEVICE_UNKNOWN) {
46 | return mLevel
47 | }
48 | if (isMiuiLite()) {
49 | mLevel = DEVICE_PRIMARY
50 | } else {
51 | mLevel = getCpuLevel()
52 | if (mLevel == DEVICE_MIDDLE && getTotalRam() <= 4) {
53 | mLevel = DEVICE_PRIMARY
54 | }
55 | }
56 | return mLevel
57 | }
58 |
59 | fun getTotalRam(): Int {
60 | if (mTotalRam == Int.MAX_VALUE) {
61 | mTotalRam = try {
62 | ((Class.forName("miui.util.HardwareInfo")
63 | .getMethod("getTotalPhysicalMemory")
64 | .invoke(null) as Long).toLong() / 1024 / 1024 / 1024).toInt()
65 | } catch (e: Exception) {
66 | Log.e(TAG, "${e.message}")
67 | 0
68 | }
69 | }
70 | return mTotalRam
71 | }
72 |
73 | fun isMiuiLite(): Boolean {
74 | return try {
75 | Class.forName("miui.os.Build").getDeclaredField("IS_MIUI_LITE_VERSION")
76 | .get(null) as Boolean
77 | } catch (e: Exception) {
78 | e.printStackTrace()
79 | false
80 | }
81 | }
82 |
83 | private fun createCpuInfo(str: String): CpuInfo {
84 | val cpuInfo = CpuInfo()
85 | cpuInfo.id = str.toInt()
86 | val contentFromFileInfo = getContentFromFileInfo(
87 | String.format(
88 | Locale.ENGLISH,
89 | CPU_MAX_INFO_FORMAT,
90 | cpuInfo.id!!
91 | )
92 | )
93 | if (contentFromFileInfo != null) {
94 | cpuInfo.maxFreq = contentFromFileInfo.toInt()
95 | }
96 | return cpuInfo
97 | }
98 |
99 | private fun getContentFromFileInfo(filePath: String): String? {
100 | try {
101 | val fileInputStream = FileInputStream(filePath)
102 | val inputStreamReader = InputStreamReader(fileInputStream)
103 | val bufferedReader = BufferedReader(inputStreamReader)
104 | val str = bufferedReader.readLine()
105 | bufferedReader.close()
106 | fileInputStream.close()
107 | inputStreamReader.close()
108 | return str
109 | } catch (e: IOException) {
110 | e.printStackTrace()
111 | }
112 | return null
113 | }
114 |
115 | private fun getCpuInfoList(): List {
116 | val arrayList = mutableListOf()
117 | try {
118 | val scanner = Scanner(File("/proc/cpuinfo"))
119 | var cpuInfo: CpuInfo? = null
120 | while (scanner.hasNextLine()) {
121 | val split: List = scanner.nextLine().split(SEPARATOR)
122 | if (split.size > 1) {
123 | cpuInfo = parseLine(split, arrayList, cpuInfo)
124 | }
125 | }
126 | } catch (e: java.lang.Exception) {
127 | Log.e(TAG, "getChipSetFromCpuInfo failed", e)
128 | }
129 | return arrayList
130 | }
131 |
132 | private fun getCpuStats(): CpuStats {
133 | val cpuInfoList: List = getCpuInfoList()
134 | val cpuStats = CpuStats()
135 | if (cpuInfoList.size < CORE_COUNT) {
136 | cpuStats.level = DEVICE_PRIMARY
137 | }
138 | doCpuStats(cpuStats, cpuInfoList)
139 | return cpuStats
140 | }
141 |
142 | private fun doCpuStats(cpuStats: CpuStats, list: List) {
143 | for (next in list) {
144 | if (next.architecture!! < ARM_V8) {
145 | cpuStats.level = DEVICE_PRIMARY
146 | }
147 | if (next.maxFreq > cpuStats.maxFreq) {
148 | cpuStats.maxFreq = next.maxFreq
149 | }
150 | if (next.maxFreq >= BIG_CORE_FREQ) {
151 | cpuStats.bigCoreCount++
152 | } else {
153 | cpuStats.smallCoreCount++
154 | }
155 | }
156 | decideLevel(cpuStats)
157 | }
158 |
159 | private fun decideLevel(cpuStats: CpuStats) {
160 | if (cpuStats.level == DEVICE_UNKNOWN) {
161 | cpuStats.level = when {
162 | cpuStats.bigCoreCount >= 4 ->
163 | when {
164 | cpuStats.maxFreq > HIGH_FREQ -> DEVICE_HIGH_END
165 | cpuStats.maxFreq > MIDDLE_FREQ -> DEVICE_MIDDLE
166 | else -> DEVICE_PRIMARY
167 | }
168 | cpuStats.maxFreq > MIDDLE_FREQ -> DEVICE_MIDDLE
169 | else -> DEVICE_PRIMARY
170 | }
171 | }
172 | }
173 |
174 | private fun parseLine(
175 | strArr: List,
176 | list: MutableList,
177 | cpuInfo: CpuInfo?
178 | ): CpuInfo? {
179 | val trim = strArr[1].trim { it <= ' ' }
180 | return if (strArr[0].contains(PROCESSOR) && TextUtils.isDigitsOnly(trim)) {
181 | createCpuInfo(trim).also { list.add(it) }
182 | } else {
183 | if (cpuInfo != null) {
184 | getCpuInfo(strArr[0], trim, cpuInfo)
185 | }
186 | cpuInfo
187 | }
188 | }
189 |
190 | private fun getCpuInfo(str: String, str2: String, cpuInfo: CpuInfo) {
191 | when {
192 | str.contains(IMPLEMENTOR) -> {
193 | cpuInfo.implementor = toInt(str2)
194 | }
195 | str.contains(ARCHITECTURE) -> {
196 | cpuInfo.architecture = toInt(str2)
197 | }
198 | str.contains(PART) -> {
199 | cpuInfo.part = toInt(str2)
200 | }
201 | }
202 | }
203 |
204 | private fun toInt(str: String): Int {
205 | return if (str.startsWith(HEX)) {
206 | str.substring(2).toInt(16)
207 | } else {
208 | str.toInt()
209 | }
210 | }
211 |
212 | fun getHardwareInfo(): String {
213 | return try {
214 | val scanner = Scanner(File("/proc/cpuinfo"))
215 | while (scanner.hasNextLine()) {
216 | val nextLine = scanner.nextLine()
217 | if (!scanner.hasNextLine()) {
218 | val split = nextLine.split(SEPARATOR).toTypedArray()
219 | if (split.size > 1) {
220 | return split[1]
221 | }
222 | }
223 | }
224 | ""
225 | } catch (e: java.lang.Exception) {
226 | Log.e(TAG, "getChipSetFromCpuInfo failed", e)
227 | ""
228 | }
229 | }
230 |
231 | private fun getCpuLevel(): Int {
232 | val hardwareInfo = getHardwareInfo()
233 | val level = if (hardwareInfo.isNotEmpty()) {
234 | if (hardwareInfo.contains(QUALCOMM)) {
235 | getQualcommCpuLevel(hardwareInfo)
236 | } else {
237 | getMtkCpuLevel(hardwareInfo)
238 | }
239 | } else {
240 | DEVICE_UNKNOWN
241 | }
242 | return if (level == DEVICE_UNKNOWN) {
243 | getCpuStats().level
244 | } else {
245 | level
246 | }
247 | }
248 |
249 | private fun getMtkCpuLevel(str: String): Int {
250 | val matcher: Matcher = MT_PATTERN.matcher(str)
251 | if (!matcher.find()) {
252 | return DEVICE_UNKNOWN
253 | }
254 | val group: String? = matcher.group(1)
255 | val group2: String? = matcher.group(2)
256 | if (group == null || group2 == null) {
257 | return DEVICE_UNKNOWN
258 | }
259 | val parseInt = group.toInt()
260 | val parseInt2 = group2.toInt()
261 | return if (parseInt != MTK_DIMENSITY || parseInt2 < D800) {
262 | DEVICE_PRIMARY
263 | } else {
264 | DEVICE_MIDDLE
265 | }
266 | }
267 |
268 | private fun getQualcommCpuLevel(str: String): Int {
269 | val matcher: Matcher = SM_PATTERN.matcher(str)
270 | if (!matcher.find()) {
271 | return DEVICE_UNKNOWN
272 | }
273 | val group: String? = matcher.group(1)
274 | val group2: String? = matcher.group(2)
275 | if (group == null || group2 == null || group.toLowerCase(Locale.ENGLISH) != SNAPDRAGON) {
276 | return DEVICE_UNKNOWN
277 | }
278 | val parseInt = group2.substring(0, 1).toInt()
279 | val parseInt2 = group2.substring(1).toInt()
280 | if (parseInt >= 8 && parseInt2 > MIDDLE_EIGHT_SERIES) {
281 | return DEVICE_HIGH_END
282 | }
283 | return if (parseInt >= 7) {
284 | DEVICE_MIDDLE
285 | } else {
286 | DEVICE_PRIMARY
287 | }
288 | }
289 |
290 | class CpuInfo {
291 | var id: Int? = null
292 | var implementor: Int? = null
293 | var architecture: Int? = null
294 | var part: Int? = null
295 | var maxFreq: Int = 0
296 |
297 | override fun toString(): String {
298 | return "CpuInfo(id=$id, implementor=$implementor, architecture=$architecture, part=$part, maxFreq=$maxFreq)"
299 | }
300 | }
301 |
302 | class CpuStats {
303 | var level: Int = DEVICE_UNKNOWN
304 | var maxFreq: Int = 0
305 | var bigCoreCount: Int = 0
306 | var smallCoreCount: Int = 0
307 |
308 | override fun toString(): String {
309 | return "CpuStats(level=$level, maxFreq=$maxFreq, bigCoreCount=$bigCoreCount, smallCoreCount=$smallCoreCount)"
310 | }
311 | }
312 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/utils/OSUtil.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker.utils
2 |
3 | import java.io.File
4 |
5 | object OSUtil {
6 | fun isMIUI(): Boolean {
7 | return File("/system/framework/framework-miui-res.apk").exists() ||
8 | File("/system/app/miui/miui.apk").exists() ||
9 | File("/system/app/miuisystem/miuisystem.apk").exists()
10 | }
11 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/utils/VersionUtil.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker.utils
2 |
3 | import android.content.Context
4 | import android.content.pm.PackageManager
5 |
6 | object VersionUtil {
7 | fun getVersionCode(context: Context): Int {
8 | var versionCode = 0
9 | try {
10 | versionCode =
11 | context.packageManager.getPackageInfo(context.packageName, 0).versionCode
12 | } catch (e: PackageManager.NameNotFoundException) {
13 | e.printStackTrace()
14 | }
15 | return versionCode
16 | }
17 |
18 | fun getVersionName(context: Context): String {
19 | var verName = ""
20 | try {
21 | verName = context.packageManager.getPackageInfo(context.packageName, 0).versionName
22 | } catch (e: PackageManager.NameNotFoundException) {
23 | e.printStackTrace()
24 | }
25 | return verName
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/utils/XposedUtil.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker.utils
2 |
3 | import android.content.Context
4 | import android.content.pm.PackageInfo
5 | import android.content.pm.PackageManager
6 |
7 |
8 | object XposedUtil {
9 | private val MANAGER_PACKAGE_NAME_LIST = listOf(
10 | "org.meowcat.edxposed.manager"
11 | )
12 |
13 | @JvmStatic
14 | val isModuleEnabled: Boolean
15 | get() = false
16 |
17 | fun isManagerInstalled(context: Context): Boolean {
18 | return getInstalledManagerPackageName(context) != null
19 | }
20 |
21 | fun getInstalledManagerPackageName(context: Context): String? {
22 | return MANAGER_PACKAGE_NAME_LIST.firstOrNull {
23 | checkAppInstalled(context, it)
24 | }
25 | }
26 |
27 | fun checkAppInstalled(context: Context, pkgName: String): Boolean {
28 | if (pkgName.isEmpty()) {
29 | return false
30 | }
31 | var packageInfo: PackageInfo?
32 | try {
33 | packageInfo = context.packageManager.getPackageInfo(pkgName, 0)
34 | } catch (e: PackageManager.NameNotFoundException) {
35 | packageInfo = null
36 | e.printStackTrace()
37 | }
38 | return packageInfo != null
39 | }
40 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/huanchengfly/miui/checker/xposed/FullDeviceLevelModule.kt:
--------------------------------------------------------------------------------
1 | package com.huanchengfly.miui.checker.xposed
2 |
3 | import de.robv.android.xposed.IXposedHookLoadPackage
4 | import de.robv.android.xposed.XC_MethodReplacement
5 | import de.robv.android.xposed.XposedHelpers
6 | import de.robv.android.xposed.callbacks.XC_LoadPackage
7 |
8 |
9 | class FullDeviceLevelModule : IXposedHookLoadPackage {
10 | override fun handleLoadPackage(packageParam: XC_LoadPackage.LoadPackageParam) {
11 | val pkgName = packageParam.packageName
12 | if (SELF_PACKAGE_NAME == pkgName) {
13 | val clazz =
14 | XposedHelpers.findClassIfExists(
15 | "$SELF_PACKAGE_NAME.utils.XposedUtil",
16 | packageParam.classLoader
17 | ) ?: return
18 | XposedHelpers.findAndHookMethod(
19 | clazz,
20 | "isModuleEnabled",
21 | XC_MethodReplacement.returnConstant(true)
22 | )
23 | } else if ("miui" in pkgName || "xiaomi" in pkgName) {
24 | val clazz =
25 | XposedHelpers.findClassIfExists(
26 | MIUIX_DEVICE_UTILS_CLASS_NAME,
27 | packageParam.classLoader
28 | ) ?: return
29 | XposedHelpers.findAndHookMethod(
30 | clazz,
31 | "getDeviceLevel",
32 | XC_MethodReplacement.returnConstant(2)
33 | )
34 | }
35 | }
36 |
37 | companion object {
38 | const val SELF_PACKAGE_NAME = "com.huanchengfly.miui.checker"
39 | const val MIUIX_DEVICE_UTILS_CLASS_NAME = "miuix.animation.utils.DeviceUtils"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/animator/appbar_elevation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/emoji_confused_face.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/emoji_expressionless_face.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/emoji_grinning_squinting_face.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
18 |
21 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/emoji_thinking_face.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
18 |
21 |
24 |
27 |
30 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_logo_github.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_developer_board.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_exit_to_app.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_help.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_memory.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_offline_bolt.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_phone_android.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_score.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_settings.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_smartphone.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_round_storage.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
22 |
29 |
30 |
35 |
36 |
41 |
42 |
50 |
51 |
59 |
60 |
68 |
69 |
70 |
79 |
80 |
85 |
86 |
91 |
92 |
100 |
101 |
109 |
110 |
111 |
119 |
120 |
121 |
122 |
131 |
132 |
136 |
137 |
145 |
146 |
150 |
151 |
156 |
157 |
164 |
165 |
166 |
171 |
172 |
177 |
178 |
185 |
186 |
187 |
192 |
193 |
198 |
199 |
206 |
207 |
208 |
209 |
210 |
219 |
220 |
224 |
225 |
233 |
234 |
239 |
240 |
245 |
246 |
252 |
253 |
262 |
263 |
264 |
270 |
271 |
276 |
277 |
283 |
284 |
285 |
286 |
287 |
288 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
23 |
24 |
31 |
32 |
39 |
40 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MIUILevelChecker
3 | After the module is activated, you can forcibly activate the full animation of MIUI 12.5
4 | Device Info
5 | Full support
6 | Partial support
7 | Without support
8 | Unknown
9 | Your device supports MIUI 12.5 full animation
10 | Your device only supports MIUI 12.5 partial animations
11 | Your device does not support MIUI 12.5 animation
12 | Unable to get the level of your device
13 | High range
14 | Mid-range
15 | Low range
16 | Unknown
17 | MIUI Lite Edition
18 | MIUI Normal Edition
19 | MIUI model classification
20 | Xposed module is enabled
21 | Xposed module is actived but not enabled
22 | Xposed module is not activated
23 | What is this?
24 | Note: Due to device performance limitations, some animations may cause hangs.]]>
25 | Tap here to go to Xposed manager and enable the module.
Note: Due to device performance limitations, some animations may cause hangs.]]>
26 | OK
27 | MIUI may mark some models as \"Lite\" version. Devices marked as lite version will be considered "low-end" devices regardless of performance, and most of them have animation disabled.
28 | %dGB RAM
29 | It seems that you are not using MIUI
30 | The detection results of this software only apply to mobile phones using the MIUI system.
31 | About
32 | Version: %1$s(%2$d)\nIt helps you to check the MIUI 12.5 rating of your model.
33 | https://github.com/HuanCheng65/MIUILevelChecker
34 | Github
35 | coolapk
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MIUILevelChecker
3 | Una vez activado el módulo, puede activar a la fuerza la animación completa de MIUI 12.5
4 | Información del dispositivo
5 | Soporte total
6 | Soporte parcial
7 | Sin soporte
8 | Desconocido
9 | Su dispositivo es compatible con la animación completa de MIUI 12.5
10 | Su dispositivo solo admite animaciones parciales de MIUI 12.5
11 | Su dispositivo no es compatible con la animación de MIUI 12.5
12 | No se puede obtener el nivel de su dispositivo
13 | Gama Alta
14 | Gama Media
15 | Gama Baja
16 | Desconocido
17 | MIUI Lite
18 | MIUI normal
19 | Clasificación del modelo MIUI
20 | El módulo Xposed está habilitado
21 | El módulo Xposed está activado, pero no funcionando
22 | El módulo Xposed no está activado
23 | ¿Que es esto?
24 | Nota: debido a las limitaciones de rendimiento del dispositivo, algunas animaciones pueden provocar bloqueos.]]>
25 | Toque aquí para ir al administrador Xposed y habilitar el módulo.
Nota: debido a las limitaciones de rendimiento del dispositivo, algunas animaciones pueden provocar bloqueos.]]>
26 | Vale
27 | MIUI puede marcar algunos modelos como versión \"Lite\" (aquí traducida como "versión reducida"). Los dispositivos marcados como versión lite se considerarán dispositivos de "gama baja" independientemente de su rendimiento, y la mayoría de ellos tienen animación desactivada.
28 | %dGB Memoria RAM
29 | Parece que no estás usando MIUI
30 | Los resultados de detección de este software solo se aplican a teléfonos móviles que utilizan el sistema MIUI.
31 | Acerca de
32 | Versión: %1$s(%2$d)\nTe ayuda a verificar la calificación MIUI 12.5 de tu modelo.
33 | https://github.com/HuanCheng65/MIUILevelChecker
34 | Github
35 | coolapk
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - com.miui.screenrecorder
5 | - com.xiaomi.vipaccount
6 | - com.miui.miwallpaper.miweatherwallpaper
7 | - com.miui.backup
8 | - com.miui.huanji
9 | - com.miui.hybrid
10 | - com.miui.securitycore
11 | - com.miui.compass
12 | - com.miui.aod
13 | - com.miui.voicetrigger
14 | - com.xiaomi.mirror
15 | - com.miui.audiomonitor
16 | - com.miui.calculator
17 | - com.miui.weather2
18 | - com.xiaomi.scanner
19 | - com.miui.home
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #448AFF
4 | #2962FF
5 | #66BB6A
6 | #FF1744
7 | #FFD600
8 | #FF000000
9 | #FFFFFFFF
10 |
11 | @color/blue_A200
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 8dp
4 | 0dp
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MIUILevelChecker
3 | 模块激活后,可以为您强行开启 MIUI 12.5 的完整动画
4 | 设备信息
5 | 完整支持
6 | 部分支持
7 | 不支持
8 | 未知
9 | 您的设备支持 MIUI 12.5 完整动画
10 | 您的设备只支持 MIUI 12.5 部分动画
11 | 您的设备不支持 MIUI 12.5 的动画
12 | 无法获取您的设备等级
13 | 高端
14 | 中端
15 | 低端
16 | 未知
17 | MIUI “精简版”
18 | 非 MIUI “精简版”
19 | MIUI 机型分级
20 | Xposed 模块已启用
21 | Xposed 模块已激活,但未启用
22 | Xposed 模块未激活
23 | 这是什么?
24 | 注意:由于设备性能限制,部分动画可能会导致卡顿。]]>
25 | 轻按此处可跳转至 Xposed 管理器以启用模块。
注意:由于设备性能限制,部分动画可能会导致卡顿。]]>
26 | OK
27 | MIUI 可能会将部分机型标记为 \"Lite\" 版(此处译为“精简版”),被标记为精简版的设备无论性能如何都会被认为是“低端”设备,禁用绝大多数动画。
28 | %dGB 运行内存
29 | 您似乎没有使用 MIUI 系统
30 | 本软件的检测结果仅适用于正在使用 MIUI 系统的手机。
31 | 关于
32 | 版本: %1$s(%2$d)\n帮助你查看自己的机型在 MIUI 12.5 上的分级。
33 | https://github.com/HuanCheng65/MIUILevelChecker
34 | Github
35 | coolapk
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
16 |
20 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version = "1.4.21"
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath "com.android.tools.build:gradle:4.1.1"
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanCheng65/MIUILevelChecker/ee29d3e2628b122c209e4cb1c1753c789b62d1cc/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Feb 13 14:46:21 CST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "FuckMIUI"
--------------------------------------------------------------------------------