feat: remove decoding-patch that are no longer used

This commit is contained in:
inotia00
2023-09-05 09:34:58 +09:00
parent e619c4bf60
commit c00af81a9b
16 changed files with 3 additions and 86 deletions

View File

@ -4,16 +4,13 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
import org.w3c.dom.Element
@Patch
@Name("Amoled")
@Description("Applies pure black theme in flyout panels.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class AmoledPatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -4,17 +4,14 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
import app.revanced.util.resources.IconHelper.customIconMusic
import app.revanced.util.resources.IconHelper.customIconMusicAdditional
@Patch(false)
@Name("Custom branding icon MMT")
@Description("Changes the YouTube Music launcher icon to MMT.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class CustomBrandingIconMMTPatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -4,16 +4,13 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
import app.revanced.util.resources.IconHelper.customIconMusic
@Patch
@Name("Custom branding icon Revancify blue")
@Description("Changes the YouTube Music launcher icon to Revancify Blue.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class CustomBrandingIconRevancifyBluePatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -4,16 +4,13 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
import app.revanced.util.resources.IconHelper.customIconMusic
@Patch(false)
@Name("Custom branding icon Revancify red")
@Description("Changes the YouTube Music launcher icon to Revancify Red.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class CustomBrandingIconRevancifyRedPatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -10,17 +10,11 @@ import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
@Patch
@Name("Custom branding Music name")
@Description("Rename the YouTube Music app to the name specified in options.json.")
@DependsOn(
[
DecodingPatch::class,
RemoveElementsPatch::class
]
)
@DependsOn([RemoveElementsPatch::class])
@MusicCompatibility
class CustomBrandingNamePatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -6,17 +6,14 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.misc.backgroundplay.fingerprints.BackgroundPlaybackParentFingerprint
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
@Patch
@Name("Background play")
@Description("Enables playing music in the background.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class BackgroundPlayPatch : BytecodePatch(
listOf(BackgroundPlaybackParentFingerprint)

View File

@ -4,15 +4,12 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
@Patch
@Name("Bitrate default value")
@Description("Set the audio quality to \"Always High\" when you first install the app.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class BitrateDefaultValuePatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -7,16 +7,13 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
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.misc.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
@Patch
@Name("Exclusive audio playback")
@Description("Enables the option to play music without video.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class ExclusiveAudioPatch : BytecodePatch(
listOf(AudioOnlyEnablerFingerprint)

View File

@ -4,17 +4,14 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
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.fix.decoding.patch.DecodingPatch
import java.nio.file.Files
import java.nio.file.StandardCopyOption
@Patch
@Name("Optimize resource")
@Description("Remove unnecessary resources.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class OptimizeResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext) {

View File

@ -13,7 +13,6 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.music.misc.premium.fingerprints.AccountMenuFooterFingerprint
import app.revanced.patches.music.misc.premium.fingerprints.HideGetPremiumFingerprint
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch.Companion.PrivacyTosFooter
import app.revanced.util.bytecode.getWideLiteralIndex
@ -26,12 +25,7 @@ import com.android.tools.smali.dexlib2.iface.reference.Reference
@Patch
@Name("Hide get premium")
@Description("Hides \"Get Premium\" label from the account menu.")
@DependsOn(
[
DecodingPatch::class,
SharedResourceIdPatch::class
]
)
@DependsOn([SharedResourceIdPatch::class])
@MusicCompatibility
class HideGetPremiumPatch : BytecodePatch(
listOf(

View File

@ -7,17 +7,14 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
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.misc.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch
@Name("Hide taste builder")
@Description("Hides the \"Tell us which artists you like\" card from homepage.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class TasteBuilderPatch : BytecodePatch(
listOf(TasteBuilderConstructorFingerprint)

View File

@ -14,7 +14,6 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.misc.upgradebutton.fingerprints.NotifierShelfFingerprint
import app.revanced.patches.music.misc.upgradebutton.fingerprints.PivotBarConstructorFingerprint
import app.revanced.patches.music.utils.annotations.MusicCompatibility
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
import app.revanced.patches.music.utils.integrations.patch.IntegrationsPatch
import app.revanced.patches.music.utils.resourceid.patch.SharedResourceIdPatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@ -26,7 +25,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@Description("Hides upgrade button from navigation bar and hide upgrade banner from homepage.")
@DependsOn(
[
DecodingPatch::class,
IntegrationsPatch::class,
SharedResourceIdPatch::class
]

View File

@ -6,16 +6,13 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
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.fix.androidauto.fingerprints.CertificateCheckFingerprint
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
@Patch
@Name("Certificate spoof")
@Description("Spoofs the YouTube Music certificate for Android Auto.")
@DependsOn([DecodingPatch::class])
@MusicCompatibility
class AndroidAutoCertificatePatch : BytecodePatch(
listOf(CertificateCheckFingerprint)

View File

@ -1,31 +0,0 @@
package app.revanced.patches.music.utils.fix.decoding.patch
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
class DecodingPatch : ResourcePatch {
override fun execute(context: ResourceContext) {
/**
* For some reason, Androlib is incorrectly decoding some resources of YT Music
*/
arrayOf(
"res/layout/fullscreen_loading_spinner.xml",
"res/layout/notification_media_cancel_action.xml"
).forEach { xmlPath ->
context[xmlPath].apply {
writeText(
readText()
.replace(
"@android:drawable/emulator_circular_window_overlay",
"@android:drawable/screen_background_dark_transparent"
).replace(
"@android:drawable/ab_share_pack_material",
"@android:drawable/ic_menu_close_clear_cancel"
)
)
}
}
}
}

View File

@ -9,7 +9,6 @@ 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.fix.clientspoof.patch.ClientSpoofMusicPatch
import app.revanced.patches.music.utils.fix.decoding.patch.DecodingPatch
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastContextFetchFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleFingerprint
import app.revanced.patches.music.utils.microg.bytecode.fingerprints.CastDynamiteModuleV2Fingerprint
@ -26,7 +25,6 @@ import app.revanced.util.microg.MicroGBytecodeHelper
@DependsOn(
[
ClientSpoofMusicPatch::class,
DecodingPatch::class,
MicroGResourcePatch::class,
PackageNamePatch::class
]

View File

@ -6,7 +6,6 @@ import app.revanced.patcher.data.ResourceContext
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.fix.decoding.patch.DecodingPatch
import app.revanced.patches.music.utils.settings.bytecode.patch.SettingsBytecodePatch
import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch
import app.revanced.util.enum.CategoryType
@ -27,12 +26,7 @@ import java.nio.file.Paths
@Patch
@Name("Settings")
@Description("Adds settings for ReVanced to YouTube Music.")
@DependsOn(
[
DecodingPatch::class,
SettingsBytecodePatch::class
]
)
@DependsOn([SettingsBytecodePatch::class])
@MusicCompatibility
class SettingsPatch : AbstractSettingsResourcePatch(
"music/settings",