Replace repo icon

This commit is contained in:
Cuong-Tran 2025-03-24 19:57:53 +07:00
parent d20ea8ae2d
commit 92d0d5cc7e
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
2 changed files with 8 additions and 15 deletions

View file

@ -20,7 +20,6 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import logcat.LogPriority import logcat.LogPriority
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KOMIKKU_SIGNATURE
import mihon.domain.extensionrepo.interactor.GetExtensionRepo import mihon.domain.extensionrepo.interactor.GetExtensionRepo
import mihon.domain.extensionrepo.model.ExtensionRepo import mihon.domain.extensionrepo.model.ExtensionRepo
import tachiyomi.core.common.util.system.logcat import tachiyomi.core.common.util.system.logcat
@ -289,11 +288,10 @@ internal object ExtensionLoader {
libVersion, libVersion,
signatures.last(), signatures.last(),
// KMK --> // KMK -->
repoName = when { repoName = repos.firstOrNull { repo ->
isOfficiallySigned(signatures) -> "Komikku" signatures.all { it == repo.signingKeyFingerprint }
else -> repos.firstOrNull { repo -> }?.let { repo ->
signatures.all { it == repo.signingKeyFingerprint } repo.shortName.takeIf { !it.isNullOrBlank() } ?: repo.name
}?.name
}, },
// KMK <-- // KMK <--
) )
@ -360,11 +358,10 @@ internal object ExtensionLoader {
isShared = extensionInfo.isShared, isShared = extensionInfo.isShared,
// KMK --> // KMK -->
signatureHash = signatures.last(), signatureHash = signatures.last(),
repoName = when { repoName = repos.firstOrNull { repo ->
isOfficiallySigned(signatures) -> "Komikku" signatures.all { it == repo.signingKeyFingerprint }
else -> repos.firstOrNull { repo -> }?.let { repo ->
signatures.all { it == repo.signingKeyFingerprint } repo.shortName.takeIf { !it.isNullOrBlank() } ?: repo.name
}?.name
}, },
// KMK <-- // KMK <--
) )
@ -424,10 +421,6 @@ internal object ExtensionLoader {
?.toList() ?.toList()
} }
private fun isOfficiallySigned(signatures: List<String>): Boolean {
return signatures.all { it == KOMIKKU_SIGNATURE }
}
/** /**
* On Android 13+ the ApplicationInfo generated by getPackageArchiveInfo doesn't * On Android 13+ the ApplicationInfo generated by getPackageArchiveInfo doesn't
* have sourceDir which breaks assets loading (used for getting icon here). * have sourceDir which breaks assets loading (used for getting icon here).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 95 KiB