mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-23 05:35:51 +03:00
Avoid crash when loading invalid extension package
(cherry picked from commit 3d7c136320
)
This commit is contained in:
parent
b690de55e5
commit
6f2bb18d72
1 changed files with 2 additions and 3 deletions
|
@ -126,8 +126,8 @@ internal object ExtensionLoader {
|
|||
}
|
||||
|
||||
// Validate lib version
|
||||
val libVersion = versionName.substringBeforeLast('.').toDouble()
|
||||
if (libVersion < LIB_VERSION_MIN || libVersion > LIB_VERSION_MAX) {
|
||||
val libVersion = versionName.substringBeforeLast('.').toDoubleOrNull()
|
||||
if (libVersion == null || libVersion < LIB_VERSION_MIN || libVersion > LIB_VERSION_MAX) {
|
||||
logcat(LogPriority.WARN) {
|
||||
"Lib version is $libVersion, while only versions " +
|
||||
"$LIB_VERSION_MIN to $LIB_VERSION_MAX are allowed"
|
||||
|
@ -136,7 +136,6 @@ internal object ExtensionLoader {
|
|||
}
|
||||
|
||||
val signatureHash = getSignatureHash(pkgInfo)
|
||||
|
||||
if (signatureHash == null) {
|
||||
logcat(LogPriority.WARN) { "Package $pkgName isn't signed" }
|
||||
return LoadResult.Error
|
||||
|
|
Loading…
Reference in a new issue