Skip to content

Commit 868f51d

Browse files
LisoUseInAIKyriosoSumAtrIX
andcommitted
feat(YouTube): Support version 19.12, 19.13, 19.14, 19.15 and 19.16 (#3239)
Co-authored-by: oSumAtrIX <[email protected]>
1 parent efbe314 commit 868f51d

File tree

67 files changed

+491
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+491
-196
lines changed

api/revanced-patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,11 @@ public final class app/revanced/util/BytecodeUtilsKt {
18891889
public static final fun containsWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)Z
18901890
public static final fun findMutableMethodOf (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lcom/android/tools/smali/dexlib2/iface/Method;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;
18911891
public static final fun getException (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/patch/PatchException;
1892+
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;)I
18921893
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)I
1894+
public static synthetic fun indexOfFirstInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
1895+
public static final fun indexOfFirstInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;)I
1896+
public static synthetic fun indexOfFirstInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
18931897
public static final fun indexOfFirstWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)I
18941898
public static final fun indexOfIdResource (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I
18951899
public static final fun indexOfIdResourceOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I

src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/SpoofClientPatch.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.Ba
1111
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.BuildAuthorizationStringFingerprint
1212
import app.revanced.patches.reddit.customclients.redditisfun.api.fingerprints.GetUserAgentFingerprint
1313
import app.revanced.util.getReference
14-
import app.revanced.util.indexOfFirstInstruction
14+
import app.revanced.util.indexOfFirstInstructionOrThrow
1515
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
1616
import com.android.tools.smali.dexlib2.iface.reference.StringReference
1717
@Suppress("unused")
@@ -68,7 +68,7 @@ object SpoofClientPatch : BaseSpoofClientPatch(
6868
// Reddit messed up and does not append a redirect uri to the authorization url to old.reddit.com/login.
6969
// Replace old.reddit.com with ssl.reddit.com to fix this.
7070
BuildAuthorizationStringFingerprint.result!!.mutableMethod.apply {
71-
val index = indexOfFirstInstruction {
71+
val index = indexOfFirstInstructionOrThrow {
7272
getReference<StringReference>()?.contains("old.reddit.com") == true
7373
}
7474

src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearModePatch.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
1111
import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnClearDisplayEventFingerprint
1212
import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnRenderFirstFrameFingerprint
1313
import app.revanced.util.exception
14-
import app.revanced.util.indexOfFirstInstruction
14+
import app.revanced.util.indexOfFirstInstructionOrThrow
1515
import com.android.tools.smali.dexlib2.Opcode
1616
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
1717

@@ -34,7 +34,7 @@ object RememberClearDisplayPatch : BytecodePatch(
3434
OnClearDisplayEventFingerprint.result?.mutableMethod?.let {
3535
// region Hook the "Clear display" configuration save event to remember the state of clear display.
3636

37-
val isEnabledIndex = it.indexOfFirstInstruction { opcode == Opcode.IGET_BOOLEAN } + 1
37+
val isEnabledIndex = it.indexOfFirstInstructionOrThrow { opcode == Opcode.IGET_BOOLEAN } + 1
3838
val isEnabledRegister = it.getInstruction<Instruction22c>(isEnabledIndex - 1).registerA
3939

4040
it.addInstructions(

src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
1818
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
1919
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
2020
import app.revanced.util.exception
21-
import app.revanced.util.indexOfFirstInstruction
21+
import app.revanced.util.indexOfFirstInstructionOrThrow
2222
import com.android.tools.smali.dexlib2.Opcode
2323
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
2424
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@@ -81,16 +81,16 @@ object DownloadsPatch : BytecodePatch(
8181
},
8282
// Change the download path patch.
8383
DownloadPathParentFingerprint to {
84-
val targetIndex = indexOfFirstInstruction { opcode == Opcode.INVOKE_STATIC }
84+
val targetIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.INVOKE_STATIC }
8585
val downloadUriMethod = context
8686
.toMethodWalker(this)
8787
.nextMethod(targetIndex, true)
8888
.getMethod() as MutableMethod
8989

90-
val firstIndex = downloadUriMethod.indexOfFirstInstruction {
90+
val firstIndex = downloadUriMethod.indexOfFirstInstructionOrThrow {
9191
opcode == Opcode.INVOKE_DIRECT && ((this as Instruction35c).reference as MethodReference).name == "<init>"
9292
}
93-
val secondIndex = downloadUriMethod.indexOfFirstInstruction {
93+
val secondIndex = downloadUriMethod.indexOfFirstInstructionOrThrow {
9494
opcode == Opcode.INVOKE_STATIC && ((this as Instruction35c).reference as MethodReference).returnType.contains(
9595
"Uri"
9696
)

src/main/kotlin/app/revanced/patches/tiktok/interaction/speed/PlaybackSpeedPatch.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import app.revanced.patches.tiktok.interaction.speed.fingerprints.SetSpeedFinger
1414
import app.revanced.util.exception
1515
import app.revanced.util.getReference
1616
import app.revanced.util.indexOfFirstInstruction
17+
import app.revanced.util.indexOfFirstInstructionOrThrow
1718
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction11x
1819
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
1920

@@ -38,7 +39,7 @@ object PlaybackSpeedPatch : BytecodePatch(
3839
SetSpeedFingerprint.result?.let { onVideoSwiped ->
3940
// Remember the playback speed of the current video.
4041
GetSpeedFingerprint.result?.mutableMethod?.apply {
41-
val injectIndex = indexOfFirstInstruction { getReference<MethodReference>()?.returnType == "F" } + 2
42+
val injectIndex = indexOfFirstInstructionOrThrow { getReference<MethodReference>()?.returnType == "F" } + 2
4243
val register = getInstruction<Instruction11x>(injectIndex - 1).registerA
4344

4445
addInstruction(

src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
4444
"19.08.36",
4545
"19.09.38",
4646
"19.10.39",
47-
"19.11.43"
47+
"19.11.43",
48+
"19.12.41",
49+
"19.13.37",
50+
"19.14.43",
51+
"19.15.36",
52+
"19.16.39",
4853
],
4954
),
5055
],

src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
3838
"19.08.36",
3939
"19.09.38",
4040
"19.10.39",
41-
"19.11.43"
41+
"19.11.43",
42+
"19.12.41",
43+
"19.13.37",
44+
"19.14.43",
45+
"19.15.36",
46+
"19.16.39",
4247
]
4348
)
4449
]

src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
4343
"19.08.36",
4444
"19.09.38",
4545
"19.10.39",
46-
"19.11.43"
46+
"19.11.43",
47+
"19.12.41",
48+
"19.13.37",
49+
"19.14.43",
50+
"19.15.36",
51+
"19.16.39",
4752
]
4853
)
4954
]

src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
3131
"19.08.36",
3232
"19.09.38",
3333
"19.10.39",
34-
"19.11.43"
34+
"19.11.43",
35+
"19.12.41",
36+
"19.13.37",
37+
"19.14.43",
38+
"19.15.36",
39+
"19.16.39",
3540
],
3641
),
3742
],

src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
4040
"19.08.36",
4141
"19.09.38",
4242
"19.10.39",
43-
"19.11.43"
43+
"19.11.43",
44+
"19.12.41",
45+
"19.13.37",
46+
"19.14.43",
47+
"19.15.36",
48+
"19.16.39",
4449
]
4550
)
4651
]

0 commit comments

Comments
 (0)