From cc791159d11c9c75938d6edd3762801c514f4359 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:01:48 +0400 Subject: [PATCH] fix(Hide ads): restore compatibility with prior targets --- .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt | 6 ++++++ .../fingerprints/OnBackPressedFingerprint.kt | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index d789c43052..8c0fd8856c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -25,6 +25,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", [ + "18.32.39", + "18.37.36", + "18.38.44", + "18.43.45", + "18.44.41", + "18.45.43", "18.48.39", "18.49.37" ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/fingerprints/OnBackPressedFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/fingerprints/OnBackPressedFingerprint.kt index d8a7061463..282122b84f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/fingerprints/OnBackPressedFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/fingerprints/OnBackPressedFingerprint.kt @@ -12,7 +12,9 @@ internal object OnBackPressedFingerprint : MethodFingerprint( Opcode.RETURN_VOID ), customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("MainActivity;") + (methodDef.definingClass.endsWith("MainActivity;") || + // Old versions of YouTube called this class "WatchWhileActivity" instead. + methodDef.definingClass.endsWith("WatchWhileActivity;")) && methodDef.name == "onBackPressed" } ) \ No newline at end of file