Skip to content

Commit

Permalink
feat(YouTube): Bump compatibility to 18.37.36 (#3028)
Browse files Browse the repository at this point in the history
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
  • Loading branch information
oSumAtrIX and LisoUseInAIKyrios authored Sep 27, 2023
1 parent 04cb04b commit eda28e5
Show file tree
Hide file tree
Showing 56 changed files with 196 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import app.revanced.util.microg.MicroGBytecodeHelper


@Patch(
name = "MicroG support",
description = "Allows YouTube Music ReVanced to run without root and under a different package name.",
name = "Vanced MicroG support",
description = "Allows YouTube Music to run without root and under a different package name.",
dependencies = [MicroGResourcePatch::class],
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
name = "Hide get premium",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [
CompatiblePackage("com.google.android.youtube", ["18.16.37", "18.19.35", "18.20.39", "18.23.35", "18.29.38", "18.32.39"])
CompatiblePackage(
"com.google.android.youtube", [
"18.16.37",
"18.19.35",
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39",
"18.37.36"
]
)
]
)
object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package app.revanced.patches.youtube.layout.autocaptions

import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
Expand Down Expand Up @@ -28,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
],
Expand All @@ -47,38 +49,32 @@ object AutoCaptionsPatch : BytecodePatch(
)
)

val startVideoInformerMethod = StartVideoInformerFingerprint.result!!.mutableMethod
mapOf(
StartVideoInformerFingerprint to 0,
SubtitleButtonControllerFingerprint to 1
).forEach { (fingerprint, enabled) ->
fingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x$enabled
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
"""
) ?: throw fingerprint.exception
}

startVideoInformerMethod.addInstructions(
0, """
const/4 v0, 0x0
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
"""
)

val subtitleButtonControllerMethod = SubtitleButtonControllerFingerprint.result!!.mutableMethod

subtitleButtonControllerMethod.addInstructions(
0, """
const/4 v0, 0x1
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
"""
)

val subtitleTrackMethod = SubtitleTrackFingerprint.result!!.mutableMethod

subtitleTrackMethod.addInstructionsWithLabels(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
move-result v0
if-eqz v0, :auto_captions_enabled
sget-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
if-nez v0, :auto_captions_enabled
const/4 v0, 0x1
return v0
:auto_captions_enabled
nop
"""
SubtitleTrackFingerprint.result?.mutableMethod?.addInstructionsWithLabels(
0,
"""
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
move-result v0
if-eqz v0, :auto_captions_enabled
sget-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
if-nez v0, :auto_captions_enabled
const/4 v0, 0x1
return v0
:auto_captions_enabled
nop
"""
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,11 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

object StartVideoInformerFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L", "L", "L"), listOf(
Opcode.INVOKE_STATIC,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
opcodes = listOf(
Opcode.INVOKE_INTERFACE,
Opcode.IF_EQZ,
Opcode.CONST_STRING,
Opcode.INVOKE_INTERFACE,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.GOTO,
)
Opcode.RETURN_VOID
),
strings = listOf("pc")
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.Opcode
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import com.android.tools.smali.dexlib2.Opcode
object LayoutIconFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
opcodes = listOf(
Opcode.CONST_4,
Opcode.CONST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
LithoFilterPatch::class,
SettingsPatch::class
],
compatiblePackages = [CompatiblePackage("com.google.android.youtube", ["18.32.39"])]
compatiblePackages = [
CompatiblePackage(
"com.google.android.youtube", [
"18.32.39",
"18.37.36"
]
)
]
)
@Suppress("unused")
object HideLayoutComponentsPatch : BytecodePatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.20.39",
"18.23.35",
"18.29.38",
"18.32.39"
"18.32.39",
"18.37.36"
]
)
]
Expand Down
Loading

0 comments on commit eda28e5

Please sign in to comment.