mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-04-29 22:24:27 +02:00
fix(Wide search bar): Fix patching 19.16.39
This commit is contained in:
parent
255cb5874c
commit
433dbc3bf8
@ -11,8 +11,8 @@ internal val setWordmarkHeaderFingerprint = fingerprint {
|
|||||||
returns("V")
|
returns("V")
|
||||||
parameters("Landroid/widget/ImageView;")
|
parameters("Landroid/widget/ImageView;")
|
||||||
custom { methodDef, _ ->
|
custom { methodDef, _ ->
|
||||||
methodDef.containsLiteralInstruction(ytWordmarkHeaderId) &&
|
methodDef.containsLiteralInstruction(ytPremiumWordmarkHeaderId) &&
|
||||||
methodDef.containsLiteralInstruction(ytPremiumWordmarkHeaderId)
|
methodDef.containsLiteralInstruction(ytWordmarkHeaderId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import app.revanced.util.addInstructionsAtControlFlowLabel
|
|||||||
import app.revanced.util.findInstructionIndicesReversedOrThrow
|
import app.revanced.util.findInstructionIndicesReversedOrThrow
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||||
import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||||
@ -48,7 +47,7 @@ private val wideSearchbarResourcePatch = resourcePatch {
|
|||||||
|
|
||||||
actionBarRingoId = resourceMappings[
|
actionBarRingoId = resourceMappings[
|
||||||
"layout",
|
"layout",
|
||||||
"action_bar_ringo_background",
|
"action_bar_ringo",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,18 +110,18 @@ val wideSearchbarPatch = bytecodePatch(
|
|||||||
|
|
||||||
// Fix missing left padding when using wide searchbar.
|
// Fix missing left padding when using wide searchbar.
|
||||||
wideSearchbarLayoutFingerprint.method.apply {
|
wideSearchbarLayoutFingerprint.method.apply {
|
||||||
val layoutIndex = indexOfFirstLiteralInstructionOrThrow(actionBarRingoId)
|
findInstructionIndicesReversedOrThrow {
|
||||||
val inflateIndex = indexOfFirstInstructionOrThrow(layoutIndex) {
|
|
||||||
val reference = getReference<MethodReference>()
|
val reference = getReference<MethodReference>()
|
||||||
reference?.definingClass == "Landroid/view/LayoutInflater;"
|
reference?.definingClass == "Landroid/view/LayoutInflater;"
|
||||||
&& reference.name == "inflate"
|
&& reference.name == "inflate"
|
||||||
}
|
}.forEach { inflateIndex ->
|
||||||
val register = getInstruction<OneRegisterInstruction>(inflateIndex + 1).registerA
|
val register = getInstruction<OneRegisterInstruction>(inflateIndex + 1).registerA
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
inflateIndex + 2,
|
inflateIndex + 2,
|
||||||
"invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->setActionBar(Landroid/view/View;)V"
|
"invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR->setActionBar(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user