Add more info to debug screen (#9357)

* App version
* WebView version
* ART profile status
* Device model
* Android version

(cherry picked from commit 2c6e02506363496a183f2ecb7b50382a1544e94e)
This commit is contained in:
Ivan Iskandar
2023-04-19 09:59:27 +07:00
committed by Jobobby04
parent d09471f0c4
commit b96cbf7cb2
4 changed files with 137 additions and 18 deletions
@@ -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",