From ff895f6f66c54d8aae26d5c16831295b8eee8092 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Mon, 25 Sep 2023 11:00:47 +0900 Subject: [PATCH] fix(music/import-export-settings): integrated into `settings` patch --- .../importexport/patch/ImportExportPatch.kt | 34 ------------------- .../settings/resource/patch/SettingsPatch.kt | 6 ++++ 2 files changed, 6 insertions(+), 34 deletions(-) delete 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 deleted file mode 100644 index 454c30c38..000000000 --- a/src/main/kotlin/app/revanced/patches/music/misc/importexport/patch/ImportExportPatch.kt +++ /dev/null @@ -1,34 +0,0 @@ -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/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt index 41a3ab74a..c619c63ee 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt @@ -174,6 +174,12 @@ class SettingsPatch : AbstractSettingsResourcePatch( } override fun close() { + addMusicPreferenceWithIntent( + CategoryType.MISC, + "revanced_extended_settings_import_export", + "" + ) + CategoryType.entries.sorted().forEach { contexts.sortMusicPreferenceCategory(it.value) }