mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
feat: Allow user to backup sensitive settings
This commit is contained in:
parent
6213604278
commit
842b3d3d1e
4 changed files with 8 additions and 3 deletions
|
@ -64,11 +64,11 @@ class BackupCreator(
|
|||
sourcesBackupCreator.backupExtensionInfo(databaseManga),
|
||||
|
||||
if (options.appPrefs)
|
||||
preferenceBackupCreator.backupAppPreferences(false)
|
||||
preferenceBackupCreator.backupAppPreferences(options.includePrivate)
|
||||
else emptyList(),
|
||||
|
||||
if (options.sourcePrefs)
|
||||
preferenceBackupCreator.backupSourcePreferences(false)
|
||||
preferenceBackupCreator.backupSourcePreferences(options.includePrivate)
|
||||
else emptyList(),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ data class BackupOptions(
|
|||
val sourcePrefs: Boolean = true,
|
||||
val customInfo: Boolean = true,
|
||||
val readManga: Boolean = true,
|
||||
val includePrivate: Boolean = false,
|
||||
) {
|
||||
fun asBooleanArray() = booleanArrayOf(
|
||||
libraryEntries,
|
||||
|
@ -23,6 +24,7 @@ data class BackupOptions(
|
|||
sourcePrefs,
|
||||
customInfo,
|
||||
readManga,
|
||||
includePrivate,
|
||||
)
|
||||
|
||||
companion object {
|
||||
|
@ -36,6 +38,7 @@ data class BackupOptions(
|
|||
R.string.source_settings,
|
||||
R.string.custom_manga_info,
|
||||
R.string.all_read_manga,
|
||||
R.string.backup_private_pref,
|
||||
)
|
||||
|
||||
fun fromBooleanArray(array: BooleanArray): BackupOptions = BackupOptions(
|
||||
|
@ -48,6 +51,7 @@ data class BackupOptions(
|
|||
array[6],
|
||||
array[7],
|
||||
array[8],
|
||||
array[9],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -303,7 +303,7 @@ class SettingsDataController : SettingsLegacyController() {
|
|||
.setTitle(R.string.what_should_backup)
|
||||
.setMultiChoiceItems(
|
||||
options.toTypedArray(),
|
||||
options.map { true }.toBooleanArray(),
|
||||
BackupOptions().asBooleanArray(),
|
||||
) { dialog, position, _ ->
|
||||
if (position == 0) {
|
||||
val listView = (dialog as AlertDialog).listView
|
||||
|
|
|
@ -846,6 +846,7 @@
|
|||
<item quantity="other">Done in %1$s with %2$s errors</item>
|
||||
</plurals>
|
||||
<string name="not_logged_into_">Not logged into %1$s</string>
|
||||
<string name="backup_private_pref">Include sensitivve settings (e.g. tracker login tokens)</string>
|
||||
|
||||
<!-- Advanced section -->
|
||||
<string name="clear_chapter_cache">Clear chapter cache</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue