mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fix debug page crash on Android <11
This commit is contained in:
parent
78e6304571
commit
eea650bb39
1 changed files with 23 additions and 11 deletions
|
|
@ -202,19 +202,31 @@ fun DebugPage(
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
val pkgInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
val pkgInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||||
val installSource = context.packageManager.getInstallSourceInfo(context.packageName)
|
val installInfo =
|
||||||
listOf(
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
"Version Name: ${pkgInfo.versionName}",
|
val installSource =
|
||||||
"Version Code: ${pkgInfo.versionCodeLong}",
|
context.packageManager.getInstallSourceInfo(context.packageName)
|
||||||
"Build type: ${BuildConfig.BUILD_TYPE}",
|
buildList {
|
||||||
"Debug enabled: ${BuildConfig.DEBUG}",
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
"ABIs: ${Build.SUPPORTED_ABIS.toList()}",
|
add("Install source: ${installSource.packageSource}")
|
||||||
"Install source: ${installSource.packageSource}",
|
}
|
||||||
"Installer: ${installSource.installingPackageName}",
|
add("Installer: ${installSource.installingPackageName}")
|
||||||
"Initiator: ${installSource.initiatingPackageName}",
|
add("Initiator: ${installSource.initiatingPackageName}")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
listOf(context.packageManager.getInstallerPackageName(context.packageName))
|
||||||
|
}
|
||||||
|
(
|
||||||
|
listOf(
|
||||||
|
"Version Name: ${pkgInfo.versionName}",
|
||||||
|
"Version Code: ${pkgInfo.versionCodeLong}",
|
||||||
|
"Build type: ${BuildConfig.BUILD_TYPE}",
|
||||||
|
"Debug enabled: ${BuildConfig.DEBUG}",
|
||||||
|
"ABIs: ${Build.SUPPORTED_ABIS.toList()}",
|
||||||
|
) + installInfo
|
||||||
).forEach {
|
).forEach {
|
||||||
Text(
|
Text(
|
||||||
text = it,
|
text = it.toString(),
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue