From 00b84dde61c2693317a662e309f812a75a6e2e1f Mon Sep 17 00:00:00 2001 From: esefxdz Date: Sat, 17 Oct 2026 16:26:41 +0300 Subject: [PATCH] fix(session): stop the expiry warning promising a time and an ad it cannot honour The warning said "Revolt VPN disconnects in 5 minutes" / "Watch an ad to extend your session." Both can be wrong. handleSessionWarningAlarm accepts the warning anywhere between WARNING_FLOOR_MS and WARNING_LEAD_MS + WARNING_SLACK_MS remaining, so it can say "5 minutes" with just over one left. And the ad is a dead end in a release build: AdManager.showAd('support') is still kDebugMode-gated (rule 87), so the support button does nothing there - and nothing at all in a build shipped with ads off. Say neither. The comment records what has to change for the number and the ad to come back. Co-Authored-By: Claude Opus 5 --- .../tfox/flutter_vless/xray/utils/RevoltAlerts.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/local_packages/flutter_vless_android-1.1.5/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/utils/RevoltAlerts.kt b/local_packages/flutter_vless_android-1.1.5/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/utils/RevoltAlerts.kt index 05c998a..d014dc3 100644 --- a/local_packages/flutter_vless_android-1.1.5/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/utils/RevoltAlerts.kt +++ b/local_packages/flutter_vless_android-1.1.5/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/utils/RevoltAlerts.kt @@ -27,12 +27,19 @@ object RevoltAlerts { private const val TAG = "RevoltAlerts" private const val LAUNCH_REQUEST_CODE = 2001 + // Neither line names a number or a mechanism, because this notification + // cannot honour either. The caller accepts it anywhere from WARNING_FLOOR_MS + // to WARNING_LEAD_MS + WARNING_SLACK_MS remaining, so "5 minutes" can be + // off by four of them; and "watch an ad" is a dead end in a release build, + // where the support bypass is still kDebugMode-gated (rule 87). Put the + // number back once the warning is punctual, and the ad back once the + // support button works without a debug build. fun postExpiryWarning(context: Context) { post( context, WARNING_NOTIFICATION_ID, - "Revolt VPN disconnects in 5 minutes", - "Watch an ad to extend your session.", + "Revolt VPN disconnects soon", + "Open the app to extend your session.", ) }