refactor(protonvpn): RemoveDelayPatch

This commit is contained in:
Pun Butrach
2026-01-12 00:08:18 +07:00
parent c17bfcb452
commit 6a4c03220e
2 changed files with 15 additions and 19 deletions

View File

@@ -1,16 +1,13 @@
package app.revanced.patches.protonvpn.delay
import app.revanced.patcher.fingerprint
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val longDelayFingerprint = fingerprint {
custom { method, _ ->
method.name == "getChangeServerLongDelayInSeconds"
}
internal val BytecodePatchContext.longDelayMethod by gettingFirstMutableMethodDeclaratively {
name("getChangeServerLongDelayInSeconds")
}
internal val shortDelayFingerprint = fingerprint {
custom { method, _ ->
method.name == "getChangeServerShortDelayInSeconds"
}
}
internal val BytecodePatchContext.shortDelayMethod by gettingFirstMutableMethodDeclaratively {
name("getChangeServerShortDelayInSeconds")
}

View File

@@ -1,17 +1,16 @@
package app.revanced.patches.protonvpn.delay
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.creatingBytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val removeDelayPatch = bytecodePatch(
name = "Remove delay",
description = "Removes the delay when changing servers.",
@Suppress("unused", "ObjectPropertyName")
val `Remove delay` by creatingBytecodePatch(
description = "Removes the delay when changing servers."
) {
compatibleWith("ch.protonvpn.android")
apply {
longDelayFingerprint.method.returnEarly(0)
shortDelayFingerprint.method.returnEarly(0)
longDelayMethod.returnEarly(0)
shortDelayMethod.returnEarly(0)
}
}
}