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")
|
||||
parameters("Landroid/widget/ImageView;")
|
||||
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.getReference
|
||||
import app.revanced.util.indexOfFirstInstructionOrThrow
|
||||
import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
@ -48,7 +47,7 @@ private val wideSearchbarResourcePatch = resourcePatch {
|
||||
|
||||
actionBarRingoId = resourceMappings[
|
||||
"layout",
|
||||
"action_bar_ringo_background",
|
||||
"action_bar_ringo",
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -111,12 +110,11 @@ val wideSearchbarPatch = bytecodePatch(
|
||||
|
||||
// Fix missing left padding when using wide searchbar.
|
||||
wideSearchbarLayoutFingerprint.method.apply {
|
||||
val layoutIndex = indexOfFirstLiteralInstructionOrThrow(actionBarRingoId)
|
||||
val inflateIndex = indexOfFirstInstructionOrThrow(layoutIndex) {
|
||||
findInstructionIndicesReversedOrThrow {
|
||||
val reference = getReference<MethodReference>()
|
||||
reference?.definingClass == "Landroid/view/LayoutInflater;"
|
||||
&& reference.name == "inflate"
|
||||
}
|
||||
}.forEach { inflateIndex ->
|
||||
val register = getInstruction<OneRegisterInstruction>(inflateIndex + 1).registerA
|
||||
|
||||
addInstruction(
|
||||
@ -125,4 +123,5 @@ val wideSearchbarPatch = bytecodePatch(
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user