mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-29 23:59:32 +00:00
The device-authorization poll for debrid providers (TorBox/Premiumize) treated any thrown redeem request as a fatal error and stopped polling, showing "Could not start sign-in". The only thrown error it tolerated was iOS request cancellation (isCancelledHttpRequest matched NSURLErrorDomain / code=-999); on Android a thrown request fell through to Failed(null) and terminated the loop. On aggressive ROMs (OxygenOS, MIUI, ...) the OS severs a backgrounded app's sockets and fails its DNS while the user is in the browser approving the code, so the in-flight poll throws UnknownHostException/IOException. That terminated the login even though approval succeeded — reproduced on OnePlus 13 / Android 16 (issue #1409): browser shows "logged in", app shows "Could not start sign-in". Treat a thrown redeem as Pending and keep polling instead of failing. To avoid polling forever when the failure is persistent (airplane mode, captive portal) rather than a brief background blip, a monotonic-clock watchdog (DEVICE_AUTH_MAX_POLL_DURATION) bounds the throwing path and surfaces failure once it elapses; a response-bearing expiry still stops the loop earlier via the Expired branch. This also removes the now-unused, iOS-only isCancelledHttpRequest helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| libs | ||
| src | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||