feat(YouTube - Navigation buttons): Support version 18.43.45

This commit is contained in:
oSumAtrIX 2023-11-11 17:49:16 +01:00
parent 9180d4f5c3
commit e21286e4d7
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 5 additions and 10 deletions

View File

@ -15,7 +15,6 @@ import app.revanced.patches.youtube.layout.buttons.navigation.utils.InjectionUti
import app.revanced.patches.youtube.layout.buttons.navigation.utils.InjectionUtils.injectHook
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch(
@ -177,13 +176,7 @@ object NavigationButtonsPatch : BytecodePatch(
}
PivotBarCreateButtonViewFingerprint.result!!.apply {
val insertIndex = mutableMethod.implementation!!.instructions.let {
val scanStart = scanResult.patternScanResult!!.endIndex
scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
instruction.opcode == Opcode.INVOKE_STATIC
}
}
val insertIndex = scanResult.patternScanResult!!.endIndex
/*
* Inject hooks

View File

@ -5,7 +5,9 @@ import com.android.tools.smali.dexlib2.Opcode
object PivotBarCreateButtonViewFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.MOVE_OBJECT,
Opcode.INVOKE_DIRECT_RANGE, // unique instruction anchor
Opcode.INVOKE_DIRECT_RANGE,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC
)
)