fix(ads): pass the rewarded ad's nonce through to connect

With ads enabled the SSV nonce and the nonce the connect flow waited for
were minted separately, so the client rejected the very session the ad had
just created and failed with "Session not activated".

- showAd() returns the nonce it put in the SSV custom_data (null on no reward)
- fetchConfigDirectly({adNonce, resume}) replaces skipAdBypass: a real ad
  waits for exactly that nonce and polls ~36 s for Google's callback, the
  bypass path mints its own, and resume re-attaches to the session the
  device already owns
- SOCKS5 "Reconnect" uses resume: true instead of requesting a new session

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
esefxdzandClaude Opus 5 committed 2026-10-16 23:51:19 +03:00
1 parent e14e900276
commit 37753c6396
7 files changed
+68 -43

No files matched your search

+3 -3
View File
@@ -95,10 +95,10 @@ class _ConnectButtonState extends State<ConnectButton>
setState(() => _busy = true);
try {
final adWatched = await ad.showAd('main');
if (!adWatched && AdManager.adsEnabled) return;
final adNonce = await ad.showAd('main');
if (adNonce == null && AdManager.adsEnabled) return;
final ok = await vpn.connect();
final ok = await vpn.connect(adNonce: adNonce);
if (ok) {
await timer.start();
HapticSettings.success();