mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 17:14:35 +02:00
fix(YouTube/Disable shorts on startup): patch does not work on YouTube v18.29.38
This commit is contained in:
parent
096871e6af
commit
dd6a63bb20
@ -12,6 +12,7 @@ import app.revanced.patches.youtube.shorts.startupshortsreset.fingerprints.UserW
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.SHORTS
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.getStringInstructionIndex
|
||||
import app.revanced.util.getTargetIndexReversed
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
@ -61,8 +62,9 @@ object DisableShortsOnStartupPatch : BytecodePatch(
|
||||
|
||||
UserWasInShortsFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||
val targetIndex = getTargetIndexReversed(startIndex, Opcode.RETURN_VOID) + 1
|
||||
val startIndex = getStringInstructionIndex("Failed to read user_was_in_shorts proto after successful warmup")
|
||||
val exceptionIndex = getTargetIndexReversed(startIndex, Opcode.RETURN_VOID) - 1
|
||||
val targetIndex = getTargetIndexReversed(exceptionIndex, Opcode.RETURN_VOID) + 1
|
||||
if (getInstruction(targetIndex).opcode != Opcode.IGET_OBJECT)
|
||||
throw PatchException("Failed to find insert index")
|
||||
|
||||
|
@ -3,16 +3,10 @@ package app.revanced.patches.youtube.shorts.startupshortsreset.fingerprints
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object UserWasInShortsFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("Ljava/lang/Object;"),
|
||||
opcodes = listOf(
|
||||
null,
|
||||
Opcode.RETURN_VOID,
|
||||
Opcode.MOVE_EXCEPTION
|
||||
),
|
||||
strings = listOf("Failed to read user_was_in_shorts proto after successful warmup")
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user