mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-23 10:41:03 +00:00
refactor(protonvpn): RemoveDelayPatch
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user