diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/TrustExtension.kt b/app/src/main/java/eu/kanade/domain/source/interactor/TrustExtension.kt index 1608d6adb..cd0e02274 100644 --- a/app/src/main/java/eu/kanade/domain/source/interactor/TrustExtension.kt +++ b/app/src/main/java/eu/kanade/domain/source/interactor/TrustExtension.kt @@ -24,4 +24,8 @@ class TrustExtension( } } } + + fun revokeAll() { + preferences.trustedExtensions().delete() + } } diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt index 4a486b0b4..9f046480e 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt @@ -24,6 +24,7 @@ import androidx.core.net.toUri import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.domain.base.BasePreferences +import eu.kanade.domain.source.interactor.TrustExtension import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.screen.advanced.ClearDatabaseScreen import eu.kanade.presentation.more.settings.screen.debug.DebugInfoScreen @@ -340,6 +341,7 @@ object SettingsAdvancedScreen : SearchableSettings { val uriHandler = LocalUriHandler.current val extensionInstallerPref = basePreferences.extensionInstaller() var shizukuMissing by rememberSaveable { mutableStateOf(false) } + val trustExtension = remember { Injekt.get() } if (shizukuMissing) { val dismiss = { shizukuMissing = false } @@ -392,6 +394,13 @@ object SettingsAdvancedScreen : SearchableSettings { } }, ), + Preference.PreferenceItem.TextPreference( + title = stringResource(MR.strings.ext_revoke_trust), + onClick = { + trustExtension.revokeAll() + context.toast(MR.strings.requires_app_restart) + }, + ), ), ) } diff --git a/i18n/src/commonMain/resources/MR/base/strings.xml b/i18n/src/commonMain/resources/MR/base/strings.xml index e4b3b04d1..d19e1f543 100644 --- a/i18n/src/commonMain/resources/MR/base/strings.xml +++ b/i18n/src/commonMain/resources/MR/base/strings.xml @@ -334,6 +334,7 @@ Private Shizuku is not running Install and start Shizuku to use Shizuku as extension installer. + Revoke trusted unknown extensions Extension repos