Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Add advanced setting to revoke all trusted unknown extensions

Cette révision appartient à :
arkon 2024-01-07 16:16:26 -05:00
Parent 8033a94ee2
révision 3dc2f9a711
3 fichiers modifiés avec 14 ajouts et 0 suppressions

Voir le fichier

@ -24,4 +24,8 @@ class TrustExtension(
}
}
}
fun revokeAll() {
preferences.trustedExtensions().delete()
}
}

Voir le fichier

@ -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<TrustExtension>() }
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)
},
),
),
)
}

Voir le fichier

@ -334,6 +334,7 @@
<string name="ext_installer_private" translatable="false">Private</string>
<string name="ext_installer_shizuku_stopped">Shizuku is not running</string>
<string name="ext_installer_shizuku_unavailable_dialog">Install and start Shizuku to use Shizuku as extension installer.</string>
<string name="ext_revoke_trust">Revoke trusted unknown extensions</string>
<!-- Extension repos -->
<string name="label_extension_repos">Extension repos</string>