@@ -17,7 +17,6 @@ import app.revanced.util.addInstructionsAtControlFlowLabel
1717import app.revanced.util.findInstructionIndicesReversedOrThrow
1818import app.revanced.util.getReference
1919import app.revanced.util.indexOfFirstInstructionOrThrow
20- import app.revanced.util.indexOfFirstLiteralInstructionOrThrow
2120import com.android.tools.smali.dexlib2.Opcode
2221import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
2322import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@@ -48,7 +47,7 @@ private val wideSearchbarResourcePatch = resourcePatch {
4847
4948 actionBarRingoId = resourceMappings[
5049 " layout" ,
51- " action_bar_ringo_background " ,
50+ " action_bar_ringo " ,
5251 ]
5352 }
5453}
@@ -111,18 +110,18 @@ val wideSearchbarPatch = bytecodePatch(
111110
112111 // Fix missing left padding when using wide searchbar.
113112 wideSearchbarLayoutFingerprint.method.apply {
114- val layoutIndex = indexOfFirstLiteralInstructionOrThrow(actionBarRingoId)
115- val inflateIndex = indexOfFirstInstructionOrThrow(layoutIndex) {
113+ findInstructionIndicesReversedOrThrow {
116114 val reference = getReference<MethodReference >()
117115 reference?.definingClass == " Landroid/view/LayoutInflater;"
118116 && reference.name == " inflate"
119- }
120- val register = getInstruction<OneRegisterInstruction >(inflateIndex + 1 ).registerA
117+ }.forEach { inflateIndex ->
118+ val register = getInstruction<OneRegisterInstruction >(inflateIndex + 1 ).registerA
121119
122- addInstruction(
123- inflateIndex + 2 ,
124- " invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR ->setActionBar(Landroid/view/View;)V"
125- )
120+ addInstruction(
121+ inflateIndex + 2 ,
122+ " invoke-static { v$register }, $EXTENSION_CLASS_DESCRIPTOR ->setActionBar(Landroid/view/View;)V"
123+ )
124+ }
126125 }
127126 }
128127}
0 commit comments