Remove extensions repo
This commit is contained in:
parent
ea3e53e6ae
commit
9d2a030bf5
11 changed files with 36 additions and 109 deletions
10
.github/ISSUE_TEMPLATE/config.yml
vendored
10
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,11 +1,5 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: ⚠️ Extension/source issue
|
||||
url: https://github.com/komikku-app/extensions/issues/new/choose
|
||||
about: Issues and requests for official extensions and sources should be opened in the extensions repository instead
|
||||
- name: 📦 Extensions
|
||||
url: https://komikku-app.github.io/komikku-extensions/
|
||||
about: List of all available extensions with download links
|
||||
- name: 🖥️ Mihon website
|
||||
url: https://mihon.app/
|
||||
- name: 🖥️ Komikku website
|
||||
url: https://komikku-app.github.io/
|
||||
about: Guides, troubleshooting, and answers to common questions
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/report_issue.yml
vendored
2
.github/ISSUE_TEMPLATE/report_issue.yml
vendored
|
|
@ -94,8 +94,6 @@ body:
|
|||
required: true
|
||||
- label: I have written a short but informative title.
|
||||
required: true
|
||||
- label: If this is an issue with an official extension, I should be opening an issue in the [extensions repository](https://github.com/komikku-app/extensions/issues/new/choose).
|
||||
required: true
|
||||
- label: I have gone through the [FAQ](https://mihon.app/docs/faq/general) and [troubleshooting guide](https://mihon.app/docs/guides/troubleshooting/).
|
||||
required: true
|
||||
- label: I have updated the app to version **[1.12.1](https://github.com/komikku-app/komikku/releases/latest)**.
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/request_feature.yml
vendored
2
.github/ISSUE_TEMPLATE/request_feature.yml
vendored
|
|
@ -31,8 +31,6 @@ body:
|
|||
required: true
|
||||
- label: I have written a short but informative title.
|
||||
required: true
|
||||
- label: If this is an issue with an official extension, I should be opening an issue in the [extensions repository](https://github.com/komikku-app/extensions/issues/new/choose).
|
||||
required: true
|
||||
- label: I have updated the app to version **[1.12.1](https://github.com/komikku-app/komikku/releases/latest)**.
|
||||
required: true
|
||||
- label: I will fill out all of the requested information in this form.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class TrustExtension(
|
|||
|
||||
suspend fun isTrusted(pkgInfo: PackageInfo, fingerprints: List<String>): Boolean {
|
||||
// KMK -->
|
||||
if (fingerprints.contains(CreateExtensionRepo.OFFICIAL_REPO_SIGNATURE)) return true
|
||||
if (fingerprints.contains(CreateExtensionRepo.KOMIKKU_SIGNATURE)) return true
|
||||
// KMK <--
|
||||
val trustedFingerprints = extensionRepoRepository.getAll().map { it.signingKeyFingerprint }.toHashSet()
|
||||
val key = "${pkgInfo.packageName}:${PackageInfoCompat.getLongVersionCode(pkgInfo)}:${fingerprints.last()}"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import kotlinx.collections.immutable.ImmutableSet
|
||||
import kotlinx.collections.immutable.persistentSetOf
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KEIYOUSHI_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KOMIKKU_SIGNATURE
|
||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.padding
|
||||
|
|
@ -101,7 +103,7 @@ private fun ExtensionRepoListItem(
|
|||
modifier = Modifier
|
||||
.padding(start = MaterialTheme.padding.medium),
|
||||
) {
|
||||
val resId = repoResId(repo.baseUrl)
|
||||
val resId = repoResId(repo.signingKeyFingerprint)
|
||||
Image(
|
||||
bitmap = ImageBitmap.imageResource(id = resId),
|
||||
contentDescription = null,
|
||||
|
|
@ -179,9 +181,9 @@ private fun ExtensionRepoListItem(
|
|||
}
|
||||
|
||||
// KMK -->
|
||||
fun repoResId(baseUrl: String) = when (baseUrl) {
|
||||
"https://raw.githubusercontent.com/komikku-app/extensions/repo" -> R.mipmap.komikku
|
||||
"https://raw.githubusercontent.com/keiyoushi/extensions/repo" -> R.mipmap.keiyoushi
|
||||
fun repoResId(signKey: String) = when (signKey) {
|
||||
KOMIKKU_SIGNATURE -> R.mipmap.komikku
|
||||
KEIYOUSHI_SIGNATURE -> R.mipmap.keiyoushi
|
||||
else -> R.mipmap.extension
|
||||
}
|
||||
|
||||
|
|
@ -189,8 +191,8 @@ fun repoResId(baseUrl: String) = when (baseUrl) {
|
|||
@Composable
|
||||
fun ExtensionReposContentPreview() {
|
||||
val repos = persistentSetOf(
|
||||
ExtensionRepo("https://raw.githubusercontent.com/komikku-app/extensions/repo", "Komikku", "", "", "key1"),
|
||||
ExtensionRepo("https://raw.githubusercontent.com/keiyoushi/extensions/repo", "Keiyoushi", "", "", "key2"),
|
||||
ExtensionRepo("https://repo", "Komikku", "", "", KOMIKKU_SIGNATURE),
|
||||
ExtensionRepo("https://repo", "Keiyoushi", "", "", KEIYOUSHI_SIGNATURE),
|
||||
ExtensionRepo("https://repo", "Other", "", "", "key2"),
|
||||
)
|
||||
ExtensionReposContent(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
package eu.kanade.presentation.more.settings.screen.browse.components
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
|
|
@ -15,16 +12,12 @@ import androidx.compose.runtime.getValue
|
|||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import kotlinx.collections.immutable.ImmutableSet
|
||||
import kotlinx.collections.immutable.persistentSetOf
|
||||
import kotlinx.coroutines.delay
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.OFFICIAL_REPO_BASE_URL
|
||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
|
|
@ -44,37 +37,19 @@ fun ExtensionRepoCreateDialog(
|
|||
AlertDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
confirmButton = {
|
||||
// KMK -->
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween, // Distribute space between items
|
||||
verticalAlignment = Alignment.CenterVertically, // Align items vertically
|
||||
TextButton(
|
||||
enabled = name.isNotEmpty() && !nameAlreadyExists,
|
||||
onClick = {
|
||||
onCreate(name)
|
||||
onDismissRequest()
|
||||
},
|
||||
) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
name = "$OFFICIAL_REPO_BASE_URL/index.min.json"
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(MR.strings.label_default))
|
||||
}
|
||||
Row(
|
||||
// Group the right-aligned elements
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(MR.strings.action_cancel))
|
||||
}
|
||||
// KMK <--
|
||||
TextButton(
|
||||
enabled = name.isNotEmpty() && !nameAlreadyExists,
|
||||
onClick = {
|
||||
onCreate(name)
|
||||
onDismissRequest()
|
||||
},
|
||||
) {
|
||||
Text(text = stringResource(MR.strings.action_add))
|
||||
}
|
||||
}
|
||||
Text(text = stringResource(MR.strings.action_add))
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onDismissRequest) {
|
||||
Text(text = stringResource(MR.strings.action_cancel))
|
||||
}
|
||||
},
|
||||
title = {
|
||||
|
|
@ -115,14 +90,6 @@ fun ExtensionRepoCreateDialog(
|
|||
}
|
||||
}
|
||||
|
||||
// KMK -->
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun ExtensionRepoCreateDialogPreview() {
|
||||
ExtensionRepoCreateDialog({ }, { }, persistentSetOf())
|
||||
}
|
||||
// KMK <--
|
||||
|
||||
@Composable
|
||||
fun ExtensionRepoDeleteDialog(
|
||||
onDismissRequest: () -> Unit,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ import eu.kanade.presentation.components.AppBar
|
|||
import eu.kanade.presentation.more.settings.screen.browse.RepoScreenState
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import kotlinx.collections.immutable.persistentSetOf
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.OFFICIAL_REPO_WEBSITE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KEIYOUSHI_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KOMIKKU_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.REPO_HELP
|
||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||
import tachiyomi.i18n.MR
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
|
|
@ -79,7 +81,7 @@ fun ExtensionReposScreen(
|
|||
// KMK -->
|
||||
help = {
|
||||
TextButton(
|
||||
onClick = { context.openInBrowser(OFFICIAL_REPO_WEBSITE) },
|
||||
onClick = { context.openInBrowser(REPO_HELP) },
|
||||
modifier = Modifier.padding(top = MaterialTheme.padding.small),
|
||||
) {
|
||||
Icon(imageVector = Icons.AutoMirrored.Outlined.Help, contentDescription = null)
|
||||
|
|
@ -114,8 +116,8 @@ fun ExtensionReposScreen(
|
|||
private fun ExtensionReposScreenPreview() {
|
||||
val state = RepoScreenState.Success(
|
||||
repos = persistentSetOf(
|
||||
ExtensionRepo("https://raw.githubusercontent.com/komikku-app/extensions/repo", "Komikku", "", "", "key1"),
|
||||
ExtensionRepo("https://raw.githubusercontent.com/keiyoushi/extensions/repo", "Keiyoushi", "", "", "key2"),
|
||||
ExtensionRepo("https://repo", "Komikku", "", "", KOMIKKU_SIGNATURE),
|
||||
ExtensionRepo("https://repo", "Keiyoushi", "", "", KEIYOUSHI_SIGNATURE),
|
||||
ExtensionRepo("https://repo", "Other", "", "", "key2"),
|
||||
),
|
||||
disabledRepos = setOf("https://repo"),
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import kotlinx.coroutines.async
|
|||
import kotlinx.coroutines.awaitAll
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import logcat.LogPriority
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KEIYOUSHI_REPO_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.OFFICIAL_REPO_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KEIYOUSHI_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo.Companion.KOMIKKU_SIGNATURE
|
||||
import mihon.domain.extensionrepo.interactor.GetExtensionRepo
|
||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
|
|
@ -428,11 +428,11 @@ internal object ExtensionLoader {
|
|||
}
|
||||
|
||||
private fun isOfficiallySigned(signatures: List<String>): Boolean {
|
||||
return signatures.all { it == OFFICIAL_REPO_SIGNATURE }
|
||||
return signatures.all { it == KOMIKKU_SIGNATURE }
|
||||
}
|
||||
|
||||
private fun isKeiyoushiSigned(signatures: List<String>): Boolean {
|
||||
return signatures.all { it == KEIYOUSHI_REPO_SIGNATURE }
|
||||
return signatures.all { it == KEIYOUSHI_SIGNATURE }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ val migrations: List<Migration>
|
|||
MoveEncryptionSettingsToAppStateMigration(),
|
||||
TrustExtensionRepositoryMigration(),
|
||||
// KMK -->
|
||||
OfficialExtensionRepositoryMigration(),
|
||||
IntegratedHentaiMigration(),
|
||||
SetupAppUpdateMigration(),
|
||||
// KMK <--
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
package mihon.core.migration.migrations
|
||||
|
||||
import logcat.LogPriority
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
import mihon.domain.extensionrepo.exception.SaveExtensionRepoException
|
||||
import mihon.domain.extensionrepo.interactor.CreateExtensionRepo
|
||||
import mihon.domain.extensionrepo.repository.ExtensionRepoRepository
|
||||
import tachiyomi.core.common.util.lang.withIOContext
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
|
||||
class OfficialExtensionRepositoryMigration : Migration {
|
||||
override val version: Float = 70f
|
||||
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean = withIOContext {
|
||||
val extensionRepositoryRepository =
|
||||
migrationContext.get<ExtensionRepoRepository>() ?: return@withIOContext false
|
||||
try {
|
||||
extensionRepositoryRepository.upsertRepo(
|
||||
baseUrl = CreateExtensionRepo.OFFICIAL_REPO_BASE_URL,
|
||||
name = "Komikku Official",
|
||||
shortName = "Komikku",
|
||||
website = "https://komikku-app.github.io",
|
||||
signingKeyFingerprint = CreateExtensionRepo.OFFICIAL_REPO_SIGNATURE,
|
||||
)
|
||||
} catch (e: SaveExtensionRepoException) {
|
||||
logcat(LogPriority.ERROR, e) { "Error inserting Official Extension Repo" }
|
||||
return@withIOContext false
|
||||
}
|
||||
return@withIOContext true
|
||||
}
|
||||
}
|
||||
|
|
@ -71,11 +71,10 @@ class CreateExtensionRepo(
|
|||
}
|
||||
|
||||
companion object {
|
||||
const val OFFICIAL_REPO_WEBSITE = "https://komikku-app.github.io"
|
||||
const val OFFICIAL_REPO_BASE_URL = "https://raw.githubusercontent.com/komikku-app/extensions/repo"
|
||||
const val REPO_HELP = "https://komikku-app.github.io/docs/guides/getting-started#adding-sources"
|
||||
|
||||
// cuong-tran's key
|
||||
const val OFFICIAL_REPO_SIGNATURE = "cbec121aa82ebb02aaa73806992e0368a97d47b5451ed6524816d03084c45905"
|
||||
const val KEIYOUSHI_REPO_SIGNATURE = "9add655a78e96c4ec7a53ef89dccb557cb5d767489fac5e785d671a5a75d4da2"
|
||||
const val KOMIKKU_SIGNATURE = "cbec121aa82ebb02aaa73806992e0368a97d47b5451ed6524816d03084c45905"
|
||||
const val KEIYOUSHI_SIGNATURE = "9add655a78e96c4ec7a53ef89dccb557cb5d767489fac5e785d671a5a75d4da2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue