Skip to content

Commit 34932dc

Browse files
authored
feat(Spotify): Add Fix Facebook login patch (#5023)
1 parent c89f2bc commit 34932dc

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
public final class FixFacebookLoginPatchKt {
2+
public static final fun getFixFacebookLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
3+
}
4+
15
public final class app/revanced/patches/all/misc/activity/exportall/ExportAllActivitiesPatchKt {
26
public static final fun getExportAllActivitiesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
37
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ import app.revanced.patcher.patch.bytecodePatch
77
val spoofSignaturePatch = bytecodePatch(
88
description = "Spoofs the signature of the app fix various functions of the app.",
99
) {
10-
compatibleWith("com.spotify.music")
11-
1210
dependsOn(spoofPackageInfoPatch)
1311
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package app.revanced.patches.spotify.misc.fix.login
2+
3+
import app.revanced.patcher.fingerprint
4+
import app.revanced.util.literal
5+
6+
internal val katanaProxyLoginMethodHandlerClassFingerprint = fingerprint {
7+
strings("katana_proxy_auth")
8+
}
9+
10+
internal val katanaProxyLoginMethodTryAuthorizeFingerprint = fingerprint {
11+
strings("e2e")
12+
literal { 0 }
13+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package app.revanced.patches.spotify.misc.fix.login
2+
3+
import app.revanced.patcher.patch.bytecodePatch
4+
import app.revanced.util.returnEarly
5+
6+
@Suppress("unused")
7+
val fixFacebookLoginPatch = bytecodePatch(
8+
name = "Fix Facebook login",
9+
description =
10+
"Fix logging in with Facebook when the app is patched by always opening the login in a web browser window.",
11+
) {
12+
compatibleWith("com.spotify.music")
13+
14+
execute {
15+
// The Facebook SDK tries to handle the login using the Facebook app in case it is installed.
16+
// However, the Facebook app does signature checks with the app that is requesting the authentication,
17+
// which ends up making the Facebook server reject with an invalid key hash for the app signature.
18+
// Override the Faceboook SDK to always handle the login using the web browser, which does not perform
19+
// signature checks.
20+
21+
val katanaProxyLoginMethodHandlerClass = katanaProxyLoginMethodHandlerClassFingerprint.originalClassDef
22+
// Always return 0 (no Intent was launched) as the result of trying to authorize with the Facebook app to
23+
// make the login fallback to a web browser window.
24+
katanaProxyLoginMethodTryAuthorizeFingerprint
25+
.match(katanaProxyLoginMethodHandlerClass)
26+
.method
27+
.returnEarly(0)
28+
}
29+
}

0 commit comments

Comments
 (0)