From feceb1c0561c60c50391fdc43dbe5c85cd9263a0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 2 May 2023 03:56:19 +0200 Subject: [PATCH] feat!(youtube/client-spoof): depend on `spoof-signature-verification` patch This gets rid of compatibility for Vanced YouTube. At the same time the `spoof-signature-verification` patch is now a dependency patch only. --- .../annotations/ClientSpoofCompatibility.kt | 19 +++++++++++---- .../misc/fix/spoof/patch/ClientSpoofPatch.kt | 3 +++ .../annotation/ProtobufSpoofCompatibility.kt | 24 ------------------- .../patch/SpoofSignatureVerificationPatch.kt | 6 ----- 4 files changed, 18 insertions(+), 34 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotation/ProtobufSpoofCompatibility.kt diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/annotations/ClientSpoofCompatibility.kt b/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/annotations/ClientSpoofCompatibility.kt index 8ed8a4716..dc3138144 100644 --- a/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/annotations/ClientSpoofCompatibility.kt +++ b/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/annotations/ClientSpoofCompatibility.kt @@ -4,10 +4,21 @@ import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Package @Compatibility( - [ - Package("com.google.android.youtube"), - Package("com.vanced.android.youtube") - ] + [Package( + "com.google.android.youtube", arrayOf( + "17.49.37", + "18.03.36", + "18.03.42", + "18.04.35", + "18.04.41", + "18.05.32", + "18.05.35", + "18.05.40", + "18.08.37", + "18.15.40", + "18.16.37" + ) + )] ) @Target(AnnotationTarget.CLASS) internal annotation class ClientSpoofCompatibility diff --git a/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/patch/ClientSpoofPatch.kt b/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/patch/ClientSpoofPatch.kt index 49c91185d..161f960ee 100644 --- a/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/patch/ClientSpoofPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/misc/fix/spoof/patch/ClientSpoofPatch.kt @@ -10,15 +10,18 @@ import app.revanced.patcher.extensions.instruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.shared.misc.fix.spoof.annotations.ClientSpoofCompatibility import app.revanced.patches.shared.misc.fix.spoof.fingerprints.UserAgentHeaderBuilderFingerprint +import app.revanced.patches.youtube.misc.fix.playback.patch.SpoofSignatureVerificationPatch import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction @Patch @Name("client-spoof") @Description("Spoofs a patched client to allow playback.") @ClientSpoofCompatibility +@DependsOn([SpoofSignatureVerificationPatch::class]) @Version("0.0.1") class ClientSpoofPatch : BytecodePatch( listOf(UserAgentHeaderBuilderFingerprint) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotation/ProtobufSpoofCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotation/ProtobufSpoofCompatibility.kt deleted file mode 100644 index 223943ee3..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotation/ProtobufSpoofCompatibility.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.annotation - -import app.revanced.patcher.annotation.Compatibility -import app.revanced.patcher.annotation.Package - -@Compatibility( - [Package( - "com.google.android.youtube", arrayOf( - "17.49.37", - "18.03.36", - "18.03.42", - "18.04.35", - "18.04.41", - "18.05.32", - "18.05.35", - "18.05.40", - "18.08.37", - "18.15.40", - "18.16.37" - ) - )] -) -@Target(AnnotationTarget.CLASS) -internal annotation class ProtobufSpoofCompatibility \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt index 242e10fef..1f6d84c6d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/SpoofSignatureVerificationPatch.kt @@ -12,12 +12,9 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess 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.shared.misc.fix.spoof.patch.ClientSpoofPatch import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.SwitchPreference -import app.revanced.patches.youtube.misc.fix.playback.annotation.ProtobufSpoofCompatibility import app.revanced.patches.youtube.misc.fix.playback.fingerprints.OpenCronetDataSourceFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.SubtitleWindowSettingsConstructorFingerprint @@ -27,15 +24,12 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -@Patch @Name("spoof-signature-verification") @Description("Spoofs a patched client to prevent playback issues.") -@ProtobufSpoofCompatibility @DependsOn([ IntegrationsPatch::class, SettingsPatch::class, PlayerTypeHookPatch::class, - ClientSpoofPatch::class, VideoIdPatch::class ]) @Version("0.0.1")