mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
fix(YouTube/Hide seek message): force closes in YouTube v18.36.39
This commit is contained in:
@ -94,8 +94,12 @@ object SeekMessagePatch : BytecodePatch(
|
||||
if (((targetInstruction as Instruction35c).reference as MethodReference).name != "setOnClickListener")
|
||||
continue
|
||||
|
||||
// Force close occurs only in YouTube v18.36.xx unless we add this.
|
||||
if (SettingsPatch.is1836)
|
||||
addComponent(insertIndex, index - 1)
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
insertIndex, fixComponent + """
|
||||
invoke-static {}, $PLAYER->hideSeekUndoMessage()Z
|
||||
move-result v$insertRegister
|
||||
if-nez v$insertRegister, :default
|
||||
@ -130,4 +134,31 @@ object SeekMessagePatch : BytecodePatch(
|
||||
SettingsPatch.updatePatchStatus("Hide seek message")
|
||||
|
||||
}
|
||||
|
||||
private var fixComponent: String = ""
|
||||
|
||||
private fun MutableMethod.addComponent(
|
||||
startIndex: Int,
|
||||
endIndex: Int
|
||||
) {
|
||||
val fixRegister =
|
||||
getInstruction<FiveRegisterInstruction>(endIndex).registerE
|
||||
|
||||
for (index in endIndex downTo startIndex) {
|
||||
val opcode = getInstruction(index).opcode
|
||||
if (opcode != Opcode.CONST_16)
|
||||
continue
|
||||
|
||||
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
||||
|
||||
if (register != fixRegister)
|
||||
continue
|
||||
|
||||
val fixValue = getInstruction<WideLiteralInstruction>(index).wideLiteral.toInt()
|
||||
|
||||
fixComponent = "const/16 v$fixRegister, $fixValue"
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,8 +90,9 @@ object SettingsPatch : AbstractSettingsResourcePatch(
|
||||
|
||||
val playServicesVersion = node.textContent.toInt()
|
||||
|
||||
upward1828 = playServicesVersion >= 232900000
|
||||
upward1834 = playServicesVersion >= 233502000
|
||||
upward1828 = 232900000 <= playServicesVersion
|
||||
upward1834 = 233502000 <= playServicesVersion
|
||||
is1836 = playServicesVersion in 233700000..233801999
|
||||
|
||||
break
|
||||
}
|
||||
@ -198,6 +199,7 @@ object SettingsPatch : AbstractSettingsResourcePatch(
|
||||
private val threadPoolExecutor = Executors.newFixedThreadPool(THREAD_COUNT)
|
||||
|
||||
internal lateinit var contexts: ResourceContext
|
||||
internal var is1836: Boolean = false
|
||||
internal var upward1828: Boolean = false
|
||||
internal var upward1834: Boolean = false
|
||||
|
||||
|
Reference in New Issue
Block a user