Skip to content

Commit 89f4d83

Browse files
committed
fix for old version
1 parent 4f87180 commit 89f4d83

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/Fingerprints.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@ package app.revanced.patches.spotify.misc.fix
33
import app.revanced.patcher.fingerprint
44

55
internal val getPackageInfoFingerprint = fingerprint {
6-
strings(
7-
"Failed to get the application signatures",
8-
"Failed to get installer package"
9-
)
6+
strings("Failed to get the application signatures")
107
}

patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/SpoofPackageInfoPatch.kt

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package app.revanced.patches.spotify.misc.fix
33
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
44
import app.revanced.patcher.extensions.InstructionExtensions.instructions
55
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
6+
import app.revanced.patcher.fingerprint
67
import app.revanced.patcher.patch.bytecodePatch
78
import app.revanced.util.addInstructionsAtControlFlowLabel
8-
import app.revanced.util.indexOfFirstInstructionOrThrow
99
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
1010
import com.android.tools.smali.dexlib2.Opcode
1111
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@@ -37,10 +37,11 @@ val spoofPackageInfoPatch = bytecodePatch(
3737

3838
// region Spoof installer name.
3939

40-
val failedToGetInstallerPackageStringIndex = getPackageInfoFingerprint.stringMatches!!.last().index
40+
// Old versions of Spotify do not check the installer name.
41+
fingerprint { strings("Failed to get installer package") }.matchOrNull(this) ?: return@execute
4142

42-
val returnInstallerNameIndex = indexOfFirstInstructionOrThrow(
43-
failedToGetInstallerPackageStringIndex,
43+
val returnInstallerNameIndex = indexOfFirstInstructionReversedOrThrow(
44+
instructions.size,
4445
Opcode.RETURN_OBJECT
4546
)
4647

0 commit comments

Comments
 (0)