@@ -5,6 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.instructions
5
5
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
6
6
import app.revanced.patcher.patch.bytecodePatch
7
7
import app.revanced.util.addInstructionsAtControlFlowLabel
8
+ import app.revanced.util.indexOfFirstInstructionOrThrow
8
9
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
9
10
import com.android.tools.smali.dexlib2.Opcode
10
11
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@@ -20,10 +21,10 @@ val spoofPackageInfoPatch = bytecodePatch(
20
21
getPackageInfoFingerprint.method.apply {
21
22
// region Spoof signature.
22
23
23
- val failedToGetSignaturesStringMatch = getPackageInfoFingerprint.stringMatches!! .first()
24
+ val failedToGetSignaturesStringIndex = getPackageInfoFingerprint.stringMatches!! .first().index
24
25
25
26
val concatSignaturesIndex = indexOfFirstInstructionReversedOrThrow(
26
- failedToGetSignaturesStringMatch.index ,
27
+ failedToGetSignaturesStringIndex ,
27
28
Opcode .MOVE_RESULT_OBJECT ,
28
29
)
29
30
@@ -36,8 +37,10 @@ val spoofPackageInfoPatch = bytecodePatch(
36
37
37
38
// region Spoof installer name.
38
39
39
- val returnInstallerNameIndex = indexOfFirstInstructionReversedOrThrow(
40
- instructions.lastIndex,
40
+ val failedToGetInstallerPackageStringIndex = getPackageInfoFingerprint.stringMatches!! .last().index
41
+
42
+ val returnInstallerNameIndex = indexOfFirstInstructionOrThrow(
43
+ failedToGetInstallerPackageStringIndex,
41
44
Opcode .RETURN_OBJECT
42
45
)
43
46
0 commit comments