From 46dda20e77c748094c1fdc856bd0a4553a71dab4 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Mon, 18 Sep 2023 18:46:39 +0900 Subject: [PATCH] feat(music): add `import/export-settings` patch --- .../importexport/patch/ImportExportPatch.kt | 34 +++++++++++++++++++ .../music/settings/host/values/strings.xml | 7 ++++ 2 files changed, 41 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/music/misc/importexport/patch/ImportExportPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/music/misc/importexport/patch/ImportExportPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/importexport/patch/ImportExportPatch.kt new file mode 100644 index 000000000..454c30c38 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/music/misc/importexport/patch/ImportExportPatch.kt @@ -0,0 +1,34 @@ +package app.revanced.patches.music.misc.importexport.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.music.utils.annotations.MusicCompatibility +import app.revanced.patches.music.utils.intenthook.patch.IntentHookPatch +import app.revanced.patches.music.utils.settings.resource.patch.SettingsPatch +import app.revanced.util.enum.CategoryType + +@Patch +@Name("Import/Export settings") +@Description("Import or export settings as text.") +@DependsOn( + [ + IntentHookPatch::class, + SettingsPatch::class + ] +) +@MusicCompatibility +class ImportExportPatch : BytecodePatch() { + override fun execute(context: BytecodeContext) { + + SettingsPatch.addMusicPreferenceWithIntent( + CategoryType.MISC, + "revanced_extended_settings_import_export", + "" + ) + + } +} diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index 5b7ca9948..770b56128 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -51,6 +51,13 @@ Enable sleep timer Adds a grey tint to the video player to reduce eye strain. Enable zen mode + Import + Copy + Import or export settings as text. + Import / Export + Import failed: %s + Settings reset to default + Imported %d settings %s is not installed. Please install it. Package name of your installed external downloader app, such as NewPipe or Seal. External downloader package name