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,
|
||||
)
|
||||
val pkgInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||
val installSource = context.packageManager.getInstallSourceInfo(context.packageName)
|
||||
val installInfo =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
val installSource =
|
||||
context.packageManager.getInstallSourceInfo(context.packageName)
|
||||
buildList {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
add("Install source: ${installSource.packageSource}")
|
||||
}
|
||||
add("Installer: ${installSource.installingPackageName}")
|
||||
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()}",
|
||||
"Install source: ${installSource.packageSource}",
|
||||
"Installer: ${installSource.installingPackageName}",
|
||||
"Initiator: ${installSource.initiatingPackageName}",
|
||||
) + installInfo
|
||||
).forEach {
|
||||
Text(
|
||||
text = it,
|
||||
text = it.toString(),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue