feat(Spotify): Add Fix Facebook login patch (#5023)

This commit is contained in:
Nuckyz 2025-05-26 04:08:15 -03:00 committed by GitHub
parent c89f2bc9b8
commit 34932dc439
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 46 additions and 2 deletions

View File

@ -1,3 +1,7 @@
public final class FixFacebookLoginPatchKt {
public static final fun getFixFacebookLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/all/misc/activity/exportall/ExportAllActivitiesPatchKt {
public static final fun getExportAllActivitiesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
}

View File

@ -7,7 +7,5 @@ import app.revanced.patcher.patch.bytecodePatch
val spoofSignaturePatch = bytecodePatch(
description = "Spoofs the signature of the app fix various functions of the app.",
) {
compatibleWith("com.spotify.music")
dependsOn(spoofPackageInfoPatch)
}

View File

@ -0,0 +1,13 @@
package app.revanced.patches.spotify.misc.fix.login
import app.revanced.patcher.fingerprint
import app.revanced.util.literal
internal val katanaProxyLoginMethodHandlerClassFingerprint = fingerprint {
strings("katana_proxy_auth")
}
internal val katanaProxyLoginMethodTryAuthorizeFingerprint = fingerprint {
strings("e2e")
literal { 0 }
}

View File

@ -0,0 +1,29 @@
package app.revanced.patches.spotify.misc.fix.login
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val fixFacebookLoginPatch = bytecodePatch(
name = "Fix Facebook login",
description =
"Fix logging in with Facebook when the app is patched by always opening the login in a web browser window.",
) {
compatibleWith("com.spotify.music")
execute {
// The Facebook SDK tries to handle the login using the Facebook app in case it is installed.
// However, the Facebook app does signature checks with the app that is requesting the authentication,
// which ends up making the Facebook server reject with an invalid key hash for the app signature.
// Override the Faceboook SDK to always handle the login using the web browser, which does not perform
// signature checks.
val katanaProxyLoginMethodHandlerClass = katanaProxyLoginMethodHandlerClassFingerprint.originalClassDef
// Always return 0 (no Intent was launched) as the result of trying to authorize with the Facebook app to
// make the login fallback to a web browser window.
katanaProxyLoginMethodTryAuthorizeFingerprint
.match(katanaProxyLoginMethodHandlerClass)
.method
.returnEarly(0)
}
}