Skip to content

Commit

Permalink
feat(YouTube): Support version 19.03.35 (ReVanced#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios authored Jan 24, 2024
1 parent ba6d1dc commit ff08f58
Show file tree
Hide file tree
Showing 59 changed files with 135 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.FiveRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
),
]
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.FiveRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ import com.android.tools.smali.dexlib2.Opcode
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.formats.Instruction3rc
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.OneRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.OneRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.TwoRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.TwoRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
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.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
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.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand All @@ -59,6 +60,8 @@ object HideShortsComponentsPatch : BytecodePatch(
override fun execute(context: BytecodeContext) {
// region Hide the Shorts shelf.

// This patch point is not present in 19.03.x and greater.
// If 19.02.x and lower is dropped, then this section of code and the fingerprint should be removed.
ReelConstructorFingerprint.result?.let {
it.mutableMethod.apply {
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
Expand All @@ -71,7 +74,7 @@ object HideShortsComponentsPatch : BytecodePatch(
"hideShortsShelf"
)
}
} ?: throw ReelConstructorFingerprint.exception
} // Do not throw an exception if not resolved.

// endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
)
)

fun String.getId() = ResourceMappingPatch.resourceMappings.single { it.name == this }.id
ResourceMappingPatch.resourceMappings.find {
it.type == "layout" && it.name == "reel_multiple_items_shelf"
}?.also {
reelMultipleItemShelfId = it.id
}

reelMultipleItemShelfId = "reel_multiple_items_shelf".getId()
reelPlayerRightCellButtonHeight = "reel_player_right_cell_button_height".getId()
reelPlayerRightCellButtonHeight =
ResourceMappingPatch.resourceMappings.single {
it.type == "dimen" && it.name == "reel_player_right_cell_button_height"
}.id
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package app.revanced.patches.youtube.layout.hide.shorts.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsResourcePatch
import app.revanced.util.patch.LiteralValueFingerprint
import app.revanced.util.containsWideLiteralInstructionValue
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object ReelConstructorFingerprint : LiteralValueFingerprint(
internal object ReelConstructorFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
opcodes = listOf(Opcode.INVOKE_VIRTUAL),
literalSupplier = { HideShortsComponentsResourcePatch.reelMultipleItemShelfId }
customFingerprint = { methodDef, _ ->
// Cannot use LiteralValueFingerprint, because the resource id may not be present.
val reelMultipleItemShelfId = HideShortsComponentsResourcePatch.reelMultipleItemShelfId
reelMultipleItemShelfId != -1L
&& methodDef.containsWideLiteralInstructionValue(reelMultipleItemShelfId)
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"18.48.39",
"18.49.37",
"19.01.34",
"19.02.34"
"19.02.39",
"19.03.35"
]
)
]
Expand Down
Loading

0 comments on commit ff08f58

Please sign in to comment.