signing fix
This commit is contained in:
parent
afa960c808
commit
121be4bc6f
3 changed files with 6 additions and 6 deletions
|
@ -29,7 +29,7 @@ android {
|
|||
debug {
|
||||
applicationIdSuffix ".beta"
|
||||
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher_beta", icon_placeholder_round: "@mipmap/ic_launcher_beta_round"]
|
||||
debuggable false
|
||||
debuggable true
|
||||
}
|
||||
release {
|
||||
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher", icon_placeholder_round: "@mipmap/ic_launcher_round"]
|
||||
|
|
|
@ -124,7 +124,7 @@ class NovelExtensionGithubApi {
|
|||
source.baseUrl,
|
||||
)
|
||||
}
|
||||
val iconUrl = "${REPO_URL_PREFIX}icons/${extension.pkg}.png"
|
||||
val iconUrl = "${REPO_URL_PREFIX}icon/${extension.pkg}.png"
|
||||
NovelExtension.Available(
|
||||
extension.name,
|
||||
extension.pkg,
|
||||
|
|
|
@ -71,7 +71,7 @@ internal object NovelExtensionLoader {
|
|||
val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
context.packageManager.getPackageArchiveInfo(
|
||||
file.absolutePath,
|
||||
GET_SIGNING_CERTIFICATES
|
||||
GET_SIGNATURES or GET_SIGNING_CERTIFICATES
|
||||
)
|
||||
?: return NovelLoadResult.Error(Exception("Failed to load extension"))
|
||||
} else {
|
||||
|
@ -89,7 +89,7 @@ internal object NovelExtensionLoader {
|
|||
logger("Package ${packageInfo.packageName} isn't signed")
|
||||
logger("signatureHash: $signatureHash")
|
||||
snackString("Package ${packageInfo.packageName} isn't signed")
|
||||
return NovelLoadResult.Error(Exception("Extension not signed"))
|
||||
//return NovelLoadResult.Error(Exception("Extension not signed"))
|
||||
}
|
||||
|
||||
val extension = NovelExtension.Installed(
|
||||
|
@ -111,12 +111,12 @@ internal object NovelExtensionLoader {
|
|||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun getSignatureHash(pkgInfo: PackageInfo): List<String>? {
|
||||
val signatures = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
val signatures = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && pkgInfo.signingInfo != null) {
|
||||
pkgInfo.signingInfo.apkContentsSigners
|
||||
} else {
|
||||
pkgInfo.signatures
|
||||
}
|
||||
return if (signatures != null && signatures.isNotEmpty()) {
|
||||
return if (!signatures.isNullOrEmpty()) {
|
||||
signatures.map { Hash.sha256(it.toByteArray()) }
|
||||
} else {
|
||||
null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue