Skip to content

Commit d85881a

Browse files
committed
fix: Correctly name Enable ROM signature spoofing patch
1 parent a172263 commit d85881a

File tree

3 files changed

+3
-93
lines changed

3 files changed

+3
-93
lines changed

patches/api/patches.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ public final class app/revanced/patches/all/misc/shortcut/sharetargets/RemoveSha
116116
public static final fun getRemoveShareTargetsPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
117117
}
118118

119-
public final class app/revanced/patches/all/misc/spoof/SignatureSpoofPatchKt {
120-
public static final fun getSignatureSpoofPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
119+
public final class app/revanced/patches/all/misc/spoof/EnableRomSignatureSpoofingKt {
120+
public static final fun getEnableRomSignatureSpoofing ()Lapp/revanced/patcher/patch/ResourcePatch;
121121
}
122122

123123
public final class app/revanced/patches/all/misc/targetSdk/SetTargetSdkVersion34Kt {

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

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,6 @@ val spoofClientPatch = bytecodePatch(
3737

3838
dependsOn(
3939
sharedExtensionPatch,
40-
hexPatch(ignoreMissingTargetFiles = true, block = fun HexPatchBuilder.() {
41-
listOf(
42-
"arm64-v8a",
43-
"armeabi-v7a",
44-
"x86",
45-
"x86_64"
46-
).forEach { architecture ->
47-
"https://login5.spotify.com/v3/login" to "http://127.0.0.1:$requestListenerPort/v3/login" inFile
48-
"lib/$architecture/liborbit-jni-spotify.so"
49-
50-
"https://login5.spotify.com/v4/login" to "http://127.0.0.1:$requestListenerPort/v4/login" inFile
51-
"lib/$architecture/liborbit-jni-spotify.so"
52-
}
53-
})
5440
)
5541

5642
compatibleWith("com.spotify.music")
@@ -103,82 +89,6 @@ val spoofClientPatch = bytecodePatch(
10389

10490
// region Spoof client.
10591

106-
loadOrbitLibraryFingerprint.method.addInstructions(
107-
0,
108-
"""
109-
const/16 v0, $requestListenerPort
110-
invoke-static { v0 }, $EXTENSION_CLASS_DESCRIPTOR->launchListener(I)V
111-
"""
112-
)
113-
114-
startupPageLayoutInflateFingerprint.method.apply {
115-
val openLoginWebViewDescriptor =
116-
"$EXTENSION_CLASS_DESCRIPTOR->launchLogin(Landroid/view/LayoutInflater;)V"
117-
118-
addInstructions(
119-
0,
120-
"invoke-static/range { p1 .. p1 }, $openLoginWebViewDescriptor"
121-
)
122-
}
123-
124-
renderStartLoginScreenFingerprint.method.apply {
125-
val onEventIndex = indexOfFirstInstructionOrThrow {
126-
opcode == Opcode.INVOKE_INTERFACE && getReference<MethodReference>()?.name == "getView"
127-
}
128-
129-
val buttonRegister = getInstruction<OneRegisterInstruction>(onEventIndex + 1).registerA
130-
131-
addInstruction(
132-
onEventIndex + 2,
133-
"invoke-static { v$buttonRegister }, $EXTENSION_CLASS_DESCRIPTOR->setNativeLoginHandler(Landroid/view/View;)V"
134-
)
135-
}
136-
137-
renderSecondLoginScreenFingerprint.method.apply {
138-
val getViewIndex = indexOfFirstInstructionOrThrow {
139-
opcode == Opcode.INVOKE_INTERFACE && getReference<MethodReference>()?.name == "getView"
140-
}
141-
142-
val buttonRegister = getInstruction<OneRegisterInstruction>(getViewIndex + 1).registerA
143-
144-
// Early return the render for loop since the first item of the loop is the login button.
145-
addInstructions(
146-
getViewIndex + 2,
147-
"""
148-
invoke-virtual { v$buttonRegister }, Landroid/view/View;->performClick()Z
149-
return-void
150-
"""
151-
)
152-
}
153-
154-
renderThirdLoginScreenFingerprint.method.apply {
155-
val invokeSetListenerIndex = indexOfFirstInstructionOrThrow {
156-
val reference = getReference<MethodReference>()
157-
reference?.definingClass == "Landroid/view/View;" && reference.name == "setOnClickListener"
158-
}
159-
160-
val buttonRegister = getInstruction<FiveRegisterInstruction>(invokeSetListenerIndex).registerC
161-
162-
addInstruction(
163-
invokeSetListenerIndex + 1,
164-
"invoke-virtual { v$buttonRegister }, Landroid/view/View;->performClick()Z"
165-
)
166-
}
167-
168-
thirdLoginScreenLoginOnClickFingerprint.method.apply {
169-
// Use placeholder credentials to pass the login screen.
170-
val loginActionIndex = indexOfFirstInstructionOrThrow(Opcode.RETURN_VOID) - 1
171-
val loginActionInstruction = getInstruction<FiveRegisterInstruction>(loginActionIndex)
172-
173-
addInstructions(
174-
loginActionIndex,
175-
"""
176-
const-string v${loginActionInstruction.registerD}, "placeholder"
177-
const-string v${loginActionInstruction.registerE}, "placeholder"
178-
"""
179-
)
180-
}
181-
18292
// endregion
18393

18494
// region Disable verdicts.

patches/src/main/kotlin/app/revanced/util/ResourceUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ internal fun Node.addResource(
144144
appendChild(resource.serialize(ownerDocument, resourceCallback))
145145
}
146146

147-
internal fun org.w3c.dom.Document.getNode(tagName: String) = this.getElementsByTagName(tagName).item(0)
147+
internal fun Document.getNode(tagName: String) = getElementsByTagName(tagName).item(0)
148148

149149
internal fun NodeList.findElementByAttributeValue(attributeName: String, value: String): Element? {
150150
for (i in 0 until length) {

0 commit comments

Comments
 (0)