feat: OldQualityLayout, HideSuggestions, HideReels, EnableSeekbarTapping

This commit is contained in:
oSumAtrIX
2022-03-22 00:55:42 +01:00
parent 795cef129c
commit 04a7cfff20
8 changed files with 193 additions and 7 deletions

View File

@ -0,0 +1,49 @@
package app.revanced.patches.interaction
import app.revanced.patcher.cache.Cache
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.writer.ASMWriter.insertAt
import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.*
class EnableSeekbarTapping : Patch("enable-seekbar-tapping") {
override fun execute(cache: Cache): PatchResult {
val patchData = cache.methods["enable-seekbar-tapping"]
val methodOPatchData = cache.methods["enable-seekbar-tapping-method-o"]
val methodPPatchData = cache.methods["enable-seekbar-tapping-method-p"]
val elseLabel = LabelNode()
patchData.method.instructions.insertAt(
patchData.scanData.endIndex,
InsnNode(Opcodes.ACONST_NULL),
MethodInsnNode(
Opcodes.INVOKESTATIC,
"fi/razerman/youtube/preferences/BooleanPreferences",
"isTapSeekingEnabled",
"()Z"
),
JumpInsnNode(Opcodes.IFEQ, elseLabel),
VarInsnNode(Opcodes.ALOAD, 0),
VarInsnNode(Opcodes.ILOAD, 6),
MethodInsnNode(
Opcodes.INVOKEVIRTUAL,
methodOPatchData.declaringClass.name,
methodOPatchData.method.name,
"(I)V"
),
VarInsnNode(Opcodes.ALOAD, 0),
VarInsnNode(Opcodes.ILOAD, 6),
MethodInsnNode(
Opcodes.INVOKEVIRTUAL,
methodPPatchData.declaringClass.name,
methodPPatchData.method.name,
"(I)V"
),
elseLabel
)
return PatchResultSuccess()
}
}