fix: attempt on all patches

This commit is contained in:
oSumAtrIX
2022-04-09 22:59:51 +02:00
parent e088c67108
commit 3395d69747
8 changed files with 28 additions and 23 deletions

View File

@ -11,7 +11,7 @@ class CreateButtonRemover : Patch("create-button-remover") {
val map = cache.methodMap["create-button-patch"]
// Hide the button view via proxy by passing it to the hideCreateButton method
map.resolveAndGetMethod().implementation!!.addInstruction(
map.method.implementation!!.addInstruction(
map.scanData.endIndex,
"invoke-static { v6 }, Lfi/razerman/youtube/XAdRemover;->hideCreateButton(Landroid/view/View;)V".asInstruction()
)

View File

@ -8,7 +8,7 @@ import app.revanced.patcher.smali.asInstruction
class HideReels : Patch("hide-reels") {
override fun execute(cache: Cache): PatchResult {
val implementation = cache.methodMap["hide-reel-patch"].resolveAndGetMethod().implementation!!
val implementation = cache.methodMap["hide-reel-patch"].method.implementation!!
// HideReel will hide the reel view before it is being used,
// so we pass the view to the HideReel method

View File

@ -18,12 +18,12 @@ class HideSuggestions : Patch("hide-suggestions") {
MethodSignature(
"hide-suggestions-method",
"V",
AccessFlags.PUBLIC or AccessFlags.PUBLIC,
setOf("Z"),
AccessFlags.PUBLIC or AccessFlags.FINAL,
arrayOf("Z"),
arrayOf(
Opcode.IPUT_BOOLEAN,
Opcode.IGET_OBJECT,
Opcode.IPUT_BOOLEAN,
Opcode.IGET_BOOLEAN,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
)
@ -31,7 +31,7 @@ class HideSuggestions : Patch("hide-suggestions") {
) ?: return PatchResultError("Parent method hide-suggestions-method has not been found")
// Proxy the first parameter by passing it to the RemoveSuggestions method
map.resolveAndGetMethod().implementation!!.addInstructions(
map.method.implementation!!.addInstructions(
0,
"""
invoke-static { p1 }, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

View File

@ -12,7 +12,7 @@ class MinimizedPlayback : Patch("minimized-playback") {
// Instead of removing all instructions like Vanced,
// we return the method at the beginning instead
cache.methodMap["minimized-playback-manager"]
.resolveAndGetMethod()
.method
.implementation!!
.addInstruction(
0,

View File

@ -19,18 +19,20 @@ class OldQualityLayout : Patch("old-quality-restore") {
"old-quality-patch-method",
"L",
AccessFlags.FINAL or AccessFlags.PUBLIC,
emptySet(),
emptyArray(),
arrayOf(
Opcode.IF_NEZ,
Opcode.IGET,
Opcode.CONST_4,
Opcode.IF_NE
Opcode.IF_NE,
Opcode.IGET_OBJECT,
Opcode.GOTO,
Opcode.IGET_OBJECT,
Opcode.RETURN_OBJECT
)
)
) ?: return PatchResultError("Parent method old-quality-patch-method has not been found")
val implementation = map.resolveAndGetMethod().implementation!!
val implementation = map.method.implementation!!
// if useOldStyleQualitySettings == true, jump over all instructions and return the field at the end
val jmpInstruction =