From fcde5a9e35f09b15e47cf3575b2c7c76fce08034 Mon Sep 17 00:00:00 2001 From: inotia00 Date: Thu, 9 Feb 2023 10:23:56 +0900 Subject: [PATCH] refactor: remove unnecessary `locale-config-fix` patch --- .../misc/settings/patch/MusicSettingsPatch.kt | 3 -- .../patch/FixLocaleConfigErrorPatch.kt | 37 ------------------- .../settings/resource/patch/SettingsPatch.kt | 2 - 3 files changed, 42 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/music/misc/settings/patch/MusicSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/music/misc/settings/patch/MusicSettingsPatch.kt index fc3d66af8..1bab0a523 100644 --- a/src/main/kotlin/app/revanced/patches/music/misc/settings/patch/MusicSettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/misc/settings/patch/MusicSettingsPatch.kt @@ -4,12 +4,10 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import app.revanced.shared.annotation.YouTubeMusicCompatibility import app.revanced.shared.util.resources.ResourceUtils.copyXmlNode import org.w3c.dom.Element @@ -18,7 +16,6 @@ import org.w3c.dom.Element @Name("music-settings") @Description("Adds settings for ReVanced to YouTube Music.") @YouTubeMusicCompatibility -@DependsOn([FixLocaleConfigErrorPatch::class]) @Version("0.0.1") class MusicSettingsPatch : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt deleted file mode 100644 index a6520fd57..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/manifest/patch/FixLocaleConfigErrorPatch.kt +++ /dev/null @@ -1,37 +0,0 @@ -package app.revanced.patches.youtube.misc.manifest.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.shared.annotation.YouTubeCompatibility -import org.w3c.dom.Element - -@Name("locale-config-fix") -@Description("Fixes an error when building the resources by patching the manifest file.") -@YouTubeCompatibility -@Version("0.0.1") -class FixLocaleConfigErrorPatch : ResourcePatch { - override fun execute(context: ResourceContext): PatchResult { - // create an xml editor instance - context.xmlEditor["AndroidManifest.xml"].use { - // edit the application nodes attribute... - val applicationNode = it - .file - .getElementsByTagName("application") - .item(0) as Element - - - // by replacing the attributes name - val attribute = "android:localeConfig" - applicationNode.setAttribute("localeConfig", applicationNode.getAttribute(attribute)) - applicationNode.removeAttribute("android:localeConfig") - - } - - return PatchResultSuccess() - } -} diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/resource/patch/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/resource/patch/SettingsPatch.kt index 00654ab6f..7c65fa97b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/resource/patch/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/resource/patch/SettingsPatch.kt @@ -9,7 +9,6 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch -import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourcdIdPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsBytecodePatch import app.revanced.shared.annotation.YouTubeCompatibility @@ -25,7 +24,6 @@ import org.w3c.dom.Element @Description("Applies mandatory patches to implement ReVanced settings into the application.") @DependsOn( [ - FixLocaleConfigErrorPatch::class, IntegrationsPatch::class, PatchOptions::class, SharedResourcdIdPatch::class,