mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 11:04:36 +02:00
fix(YouTube): some patches failed in support version
This commit is contained in:
parent
f66ac24f55
commit
8417398042
@ -219,7 +219,11 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
val constIndex = getWideLiteralInstructionIndex(FadeDurationFast)
|
||||
val constRegister = getInstruction<OneRegisterInstruction>(constIndex).registerA
|
||||
val insertIndex = getTargetIndexReversed(constIndex, Opcode.INVOKE_VIRTUAL) + 1
|
||||
val jumpIndex = getTargetIndex(insertIndex, Opcode.GOTO).coerceAtMost(getTargetIndex(insertIndex, Opcode.GOTO_16))
|
||||
val jumpIndex = implementation!!.instructions.let { instruction ->
|
||||
insertIndex + instruction.subList(insertIndex, instruction.size - 1).indexOfFirst { instructions ->
|
||||
instructions.opcode == Opcode.GOTO || instructions.opcode == Opcode.GOTO_16
|
||||
}
|
||||
}
|
||||
|
||||
val replaceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex)
|
||||
val replaceReference =
|
||||
@ -284,8 +288,14 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
val onClickListenerIndex = getTargetIndexWithMethodReferenceName(insertIndex, "setOnClickListener")
|
||||
val constComponent = getConstComponent(insertIndex, onClickListenerIndex - 1)
|
||||
|
||||
if (constComponent.isNotEmpty()) {
|
||||
addInstruction(
|
||||
onClickListenerIndex + 2,
|
||||
constComponent
|
||||
)
|
||||
}
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, constComponent + """
|
||||
insertIndex, """
|
||||
invoke-static {}, $PLAYER_CLASS_DESCRIPTOR->hideSeekUndoMessage()Z
|
||||
move-result v$insertRegister
|
||||
if-nez v$insertRegister, :default
|
||||
@ -387,7 +397,7 @@ object PlayerComponentsPatch : BaseBytecodePatch(
|
||||
|
||||
for (index in endIndex downTo startIndex) {
|
||||
val instruction = getInstruction(index)
|
||||
if (instruction !is WideLiteralInstruction)
|
||||
if (instruction.opcode != Opcode.CONST_16 && instruction.opcode != Opcode.CONST_4)
|
||||
continue
|
||||
|
||||
if ((instruction as OneRegisterInstruction).registerA != constRegister)
|
||||
|
@ -14,7 +14,7 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomSheetFooterText
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.literalInstructionBooleanHook
|
||||
import app.revanced.util.literalInstructionViewHook
|
||||
import app.revanced.util.literalInstructionHook
|
||||
import app.revanced.util.patch.BaseBytecodePatch
|
||||
|
||||
@Suppress("unused")
|
||||
@ -45,7 +45,7 @@ object PlayerFlyoutMenuPatch : BaseBytecodePatch(
|
||||
CaptionsBottomSheetFingerprint to "hideFooterCaptions",
|
||||
QualityMenuViewInflateFingerprint to "hideFooterQuality"
|
||||
).map { (fingerprint, name) ->
|
||||
fingerprint.literalInstructionViewHook(BottomSheetFooterText, "$PLAYER_CLASS_DESCRIPTOR->$name(Landroid/view/View;)V")
|
||||
fingerprint.literalInstructionHook(BottomSheetFooterText, "$PLAYER_CLASS_DESCRIPTOR->$name(Landroid/view/View;)V")
|
||||
}
|
||||
|
||||
LithoFilterPatch.addFilter(PANELS_FILTER_CLASS_DESCRIPTOR)
|
||||
|
@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
*/
|
||||
internal object RollingNumberSetterFingerprint : LiteralValueFingerprint(
|
||||
opcodes = listOf(Opcode.CHECK_CAST),
|
||||
literalSupplier = { 45427773 }
|
||||
literalSupplier = { 45427773 }
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user