mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 06:09:19 +01:00
Fix crash when installing an extension
This commit is contained in:
parent
7dfbd6aab3
commit
37abd2aa2e
@ -88,11 +88,15 @@ internal object ExtensionLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isExtensionInstalledByApp(context: Context, pkgName: String): Boolean {
|
fun isExtensionInstalledByApp(context: Context, pkgName: String): Boolean {
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
return try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
context.packageManager.getInstallSourceInfo(pkgName).installingPackageName
|
context.packageManager.getInstallSourceInfo(pkgName).installingPackageName
|
||||||
} else {
|
} else {
|
||||||
context.packageManager.getInstallerPackageName(pkgName)
|
context.packageManager.getInstallerPackageName(pkgName)
|
||||||
} == BuildConfig.APPLICATION_ID
|
} == BuildConfig.APPLICATION_ID
|
||||||
|
} catch (e: java.lang.Exception) {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user