@@ -11,14 +11,17 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
11
11
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
12
12
import app.revanced.patcher.util.smali.ExternalLabel
13
13
import app.revanced.patches.shared.integrations.Constants.COMPONENTS_PATH
14
+ import app.revanced.patches.shared.litho.fingerprints.BufferUpbFeatureFlagFingerprint
14
15
import app.revanced.patches.shared.litho.fingerprints.ByteBufferFingerprint
15
16
import app.revanced.patches.shared.litho.fingerprints.EmptyComponentsFingerprint
16
17
import app.revanced.patches.shared.litho.fingerprints.PathBuilderFingerprint
18
+ import app.revanced.patches.shared.litho.fingerprints.PathUpbFeatureFlagFingerprint
17
19
import app.revanced.util.findMethodsOrThrow
18
20
import app.revanced.util.getReference
19
21
import app.revanced.util.indexOfFirstInstructionOrThrow
20
22
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
21
23
import app.revanced.util.indexOfFirstStringInstructionOrThrow
24
+ import app.revanced.util.injectLiteralInstructionBooleanCall
22
25
import app.revanced.util.resultOrThrow
23
26
import com.android.tools.smali.dexlib2.AccessFlags
24
27
import com.android.tools.smali.dexlib2.Opcode
@@ -38,6 +41,8 @@ object LithoFilterPatch : BytecodePatch(
38
41
setOf(
39
42
ByteBufferFingerprint ,
40
43
EmptyComponentsFingerprint ,
44
+ BufferUpbFeatureFlagFingerprint ,
45
+ PathUpbFeatureFlagFingerprint ,
41
46
)
42
47
), Closeable {
43
48
private const val INTEGRATIONS_LITHO_FILER_CLASS_DESCRIPTOR =
@@ -156,6 +161,28 @@ object LithoFilterPatch : BytecodePatch(
156
161
}
157
162
}
158
163
164
+ // region A/B test of new Litho native code.
165
+
166
+ // Turn off native code that handles litho component names. If this feature is on then nearly
167
+ // all litho components have a null name and identifier/path filtering is completely broken.
168
+
169
+ if (BufferUpbFeatureFlagFingerprint .result != null &&
170
+ PathUpbFeatureFlagFingerprint .result != null ) {
171
+ mapOf (
172
+ BufferUpbFeatureFlagFingerprint to 45419603 ,
173
+ PathUpbFeatureFlagFingerprint to 45631264 ,
174
+ ).forEach { (fingerprint, literalValue) ->
175
+ fingerprint.result?.let {
176
+ fingerprint.injectLiteralInstructionBooleanCall(
177
+ literalValue,
178
+ " 0x0"
179
+ )
180
+ }
181
+ }
182
+ }
183
+
184
+ // endregion
185
+
159
186
// Create a new method to get the filter array to avoid register conflicts.
160
187
// This fixes an issue with Integrations compiled with Android Gradle Plugin 8.3.0+.
161
188
// https://github.com/ReVanced/revanced-patches/issues/2818
0 commit comments