diff --git a/patches/api/patches.api b/patches/api/patches.api index dc493ca0b..4c2586c82 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -621,6 +621,10 @@ public final class app/revanced/patches/protonmail/signature/RemoveSentFromSigna public static final fun getRemoveSentFromSignaturePatch ()Lapp/revanced/patcher/patch/ResourcePatch; } +public final class app/revanced/patches/protonvpn/delay/RemoveDelayPatchKt { + public static final fun getRemoveDelayPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatchKt { public static final fun getHidePurchaseReminderPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/Fingerprints.kt new file mode 100644 index 000000000..bc8ad3925 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/Fingerprints.kt @@ -0,0 +1,16 @@ +package app.revanced.patches.protonvpn.delay + +import app.revanced.patcher.fingerprint + + +internal val longDelayFingerprint = fingerprint { + custom { method, _ -> + method.name == "getChangeServerLongDelayInSeconds" + } +} + +internal val shortDelayFingerprint = fingerprint { + custom { method, _ -> + method.name == "getChangeServerShortDelayInSeconds" + } +} \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/RemoveDelayPatch.kt b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/RemoveDelayPatch.kt new file mode 100644 index 000000000..512813e59 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/RemoveDelayPatch.kt @@ -0,0 +1,17 @@ +package app.revanced.patches.protonvpn.delay + +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.returnEarly + +@Suppress("unused") +val removeDelayPatch = bytecodePatch( + name = "Remove delay", + description = "Removes the delay when changing servers.", +) { + compatibleWith("ch.protonvpn.android") + + execute { + longDelayFingerprint.method.returnEarly(0) + shortDelayFingerprint.method.returnEarly(0) + } +} \ No newline at end of file