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 index bc8ad3925..3ca1535d3 100644 --- a/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/Fingerprints.kt @@ -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" - } -} \ No newline at end of file +internal val BytecodePatchContext.shortDelayMethod by gettingFirstMutableMethodDeclaratively { + name("getChangeServerShortDelayInSeconds") +} 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 index 01794b88f..ceb771886 100644 --- a/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/RemoveDelayPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/protonvpn/delay/RemoveDelayPatch.kt @@ -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) } -} \ No newline at end of file +}