Skip to content

Commit 8f3f4c9

Browse files
xehpukoSumAtrIX
andauthored
feat(Strava): Add Enable password login patch (#6396)
Co-authored-by: oSumAtrIX <[email protected]>
1 parent da02d68 commit 8f3f4c9

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

patches/api/patches.api

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,10 @@ public final class app/revanced/patches/stocard/layout/HideStoryBubblesPatchKt {
11881188
public static final fun getHideStoryBubblesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
11891189
}
11901190

1191+
public final class app/revanced/patches/strava/password/EnablePasswordLoginPatchKt {
1192+
public static final fun getEnablePasswordLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
1193+
}
1194+
11911195
public final class app/revanced/patches/strava/subscription/UnlockSubscriptionPatchKt {
11921196
public static final fun getUnlockSubscriptionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
11931197
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package app.revanced.patches.strava.password
2+
3+
import app.revanced.patcher.Fingerprint
4+
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
5+
import app.revanced.patcher.patch.bytecodePatch
6+
7+
@Suppress("unused")
8+
val enablePasswordLoginPatch = bytecodePatch(
9+
name = "Enable password login",
10+
description = "Re-enables password login after having used an OTP code.",
11+
) {
12+
compatibleWith("com.strava")
13+
14+
execute {
15+
fun Fingerprint.loadTrueInsteadOfField() =
16+
method.replaceInstruction(patternMatch!!.startIndex, "const/4 v0, 0x1")
17+
18+
logInGetUsePasswordFingerprint.loadTrueInsteadOfField()
19+
emailChangeGetUsePasswordFingerprint.loadTrueInsteadOfField()
20+
}
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package app.revanced.patches.strava.password
2+
3+
import app.revanced.patcher.fingerprint
4+
import com.android.tools.smali.dexlib2.Opcode
5+
6+
internal val logInGetUsePasswordFingerprint = fingerprint {
7+
opcodes(Opcode.IGET_BOOLEAN)
8+
custom { method, classDef ->
9+
method.name == "getUsePassword" && classDef.endsWith("/RequestOtpLogInNetworkResponse;")
10+
}
11+
}
12+
13+
internal val emailChangeGetUsePasswordFingerprint = fingerprint {
14+
opcodes(Opcode.IGET_BOOLEAN)
15+
custom { method, classDef ->
16+
method.name == "getUsePassword" && classDef.endsWith("/RequestEmailChangeWithOtpOrPasswordResponse;")
17+
}
18+
}

0 commit comments

Comments
 (0)