refactor: remove unnecessary locale-config-fix patch

This commit is contained in:
inotia00 2023-02-09 10:23:56 +09:00
parent 59a4befe17
commit fcde5a9e35
3 changed files with 0 additions and 42 deletions

View File

@ -4,12 +4,10 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext 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.annotations.Patch
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch 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.annotation.YouTubeMusicCompatibility
import app.revanced.shared.util.resources.ResourceUtils.copyXmlNode import app.revanced.shared.util.resources.ResourceUtils.copyXmlNode
import org.w3c.dom.Element import org.w3c.dom.Element
@ -18,7 +16,6 @@ import org.w3c.dom.Element
@Name("music-settings") @Name("music-settings")
@Description("Adds settings for ReVanced to YouTube Music.") @Description("Adds settings for ReVanced to YouTube Music.")
@YouTubeMusicCompatibility @YouTubeMusicCompatibility
@DependsOn([FixLocaleConfigErrorPatch::class])
@Version("0.0.1") @Version("0.0.1")
class MusicSettingsPatch : ResourcePatch { class MusicSettingsPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {

View File

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

View File

@ -9,7 +9,6 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch 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.resourceid.patch.SharedResourcdIdPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsBytecodePatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsBytecodePatch
import app.revanced.shared.annotation.YouTubeCompatibility 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.") @Description("Applies mandatory patches to implement ReVanced settings into the application.")
@DependsOn( @DependsOn(
[ [
FixLocaleConfigErrorPatch::class,
IntegrationsPatch::class, IntegrationsPatch::class,
PatchOptions::class, PatchOptions::class,
SharedResourcdIdPatch::class, SharedResourcdIdPatch::class,