Add more info to debug screen (#9357)

* App version
* WebView version
* ART profile status
* Device model
* Android version
This commit is contained in:
Ivan Iskandar
2023-04-19 09:59:27 +07:00
committed by GitHub
parent ba30dfe7e2
commit 2c6e025063
4 changed files with 137 additions and 18 deletions

View File

@ -14,15 +14,15 @@ object DeviceUtil {
/**
* Extracts the MIUI major version code from a string like "V12.5.3.0.QFGMIXM".
*
* @return MIUI major version code (e.g., 13) or -1 if can't be parsed.
* @return MIUI major version code (e.g., 13) or null if can't be parsed.
*/
val miuiMajorVersion by lazy {
if (!isMiui) return@lazy -1
if (!isMiui) return@lazy null
Build.VERSION.INCREMENTAL
.substringBefore('.')
.trimStart('V')
.toIntOrNull() ?: -1
.toIntOrNull()
}
@SuppressLint("PrivateApi")
@ -45,6 +45,20 @@ object DeviceUtil {
Build.MANUFACTURER.equals("samsung", ignoreCase = true)
}
val oneUiVersion by lazy {
try {
val semPlatformIntField = Build.VERSION::class.java.getDeclaredField("SEM_PLATFORM_INT")
val version = semPlatformIntField.getInt(null) - 90000
if (version < 0) {
1.0
} else {
((version / 10000).toString() + "." + version % 10000 / 100).toDouble()
}
} catch (e: Exception) {
null
}
}
val invalidDefaultBrowsers = listOf(
"android",
"com.huawei.android.internal.app",