Skip to content

Releases: tokyoxpa3/5G-Proxy-Pro

v1.6.0

Choose a tag to compare

@github-actions github-actions released this 23 Aug 01:07

What's Changed

This release fixes the intermittent crashes (SIGSEGV) under heavy real-world traffic, and eliminates a long-hidden file-descriptor leak that degraded stability over time.

Fixed

  • Crash root cause (UAF): replaced heap-allocated connection structs with an immortal slot table; epoll events now carry (generation << 32 | slot) stamps so stale/ghost events are always detected instead of hitting reused memory.
  • FD leak: ParcelFileDescriptor.fromSocket() duplicates the descriptor — target sockets were only closed on one side, leaking one CLOSE_WAIT socket per proxied connection (fd count previously climbed toward 16384). Both references are now closed.
  • Racing connect: a "late winner" socket from abandoned Happy-Eyeballs attempts could leak; now reclaimed and closed.
  • Self-healing: stale epoll registrations are automatically purged (inode reverse-lookup), preventing event hot-loops even if a leak path ever reappears.
  • DebugActivity: proxy port now persists across restarts; fixed layout height inside ScrollView.

Verification

  • Stress suite T1–T4: 98% success at 16 concurrent threads × 30 s
  • Soak test: 5 mixed burst/idle rounds — zero crashes, fd count stable
  • Epoll registrations per worker dropped from ~266 to ~3–5; CLOSE_WAIT from 1000+ to transient 0–4

Full Changelog: v1.5.1...v1.6.0


更新內容(中文)

修復真實流量下數分鐘內崩潰(SIGSEGV)的問題,並根除長期隱藏的 fd 洩漏:

  • 崩潰根因(UAF):連線結構改用永不釋放的槽位表,epoll 事件帶世代戳記,殘留事件一律安全攔截
  • fd 洩漏fromSocket() 會複製描述符,target socket 過去只關一邊,每條連線洩漏一個 CLOSE_WAIT;現已雙邊關閉
  • 競速連線遲到勝者回收幽靈註冊自動清除
  • DebugActivity 埠號記憶 + 版面修正

5G Proxy Pro v1.5.0

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 21 Aug 03:12

Reproducible F-Droid build

v1.4.4

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 23:21

Fix: failed DNS lookups negatively cached 3s (degraded 5G no longer stalls all new connections on DNS timeout)
Fix: DNS timeout 2s -> 1s for faster failover
Reliability: handshake thread pool 128 -> 256 (burst traffic can't exhaust it)

v1.4.3

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 23:09

Fix: DNS lookups no longer serialize on a global lock (slow 5G no longer blocks all handshake threads)
Fix: client-closed connections recycled 2s after data flush (CLOSE_WAIT pileup fixed)
Reliability: handshake threads churn fast under heavy parallel connections

v1.4.2

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 22:39

v1.4.2 — 握手執行緒池耗盡修復

問題

5G 網路劣化時 DNS 解析(network.getAllByName)無逾時,最壞可卡 10-30 秒。128 個握手執行緒全被卡住後,新連線被直接拒絕(connection to proxy closed)→ 伺服器看似當掉。

修正

  • DNS 解析加 3 秒逾時(共享執行緒池,避免線程洩漏)
  • 目標連線逾時 5 秒→3 秒,失敗更快釋放握手執行緒

驗證

  • 3 輪 x 150 條並行連線壓力測試:450/450 全部成功,執行緒數穩定 63-65(修復前:128 全滿、新連線全被拒)
  • 單次 5MB 下載 0.28s 正常

v1.4.1

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 22:11

v1.4.1 — fd 洩漏修復

修正

  • 連線回收(GC)溢位不再洩漏檔案描述符:即使單次掃描超過 128 條超時連線,也會全部確實銷毀,不再有 fd 永久洩漏
  • 服務停止時一併銷毀尚未處理的待回收連線(shutdown 路徑補漏)
  • epoll 事件容量提升至 512(MAX_EVENTS),應付 5G client 的爆量並行連線

驗證

  • 150 條並行連線壓力測試後,128 條 CLOSE_WAIT 連線於 300 秒超時後全部回收(舊版 fd 只升不降)
  • 代理功能正常(5MB 下載 ~0.28s)

5G Proxy Pro v1.4.0

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 21:04

v1.4.0 — fixes all findings from F-Droid testing

  • Stop now fully closes the SOCKS5 listener — stop-request flag blocks the auto-restart watchdog, no more START_STICKY zombie restarts, native quit closes every listener; port 1080 is fully released after Stop
  • LAN-only binding — the listener binds only to LAN interface addresses (Wi-Fi / hotspot / USB tethering) plus loopback for the health check; it can no longer be reached from the cellular interface
  • Auth hardening — authentication (RFC 1929) is enabled only when both username and password are non-empty; empty fields no longer match anything
  • Battery-optimization dialog — added "Continue Anyway" so starting is never a dead end
  • Real status reporting — the service reports its actual state (starting/running/paused/restarting/stopped/failed) to the UI via callback; status line and Refresh no longer guess
  • POST_NOTIFICATIONS — now requested at runtime on Android 13+; proxy still runs if denied, with a warning
  • Docs — README updated (features, usage, network-usage disclosure); fastlane feature graphic added

Signed APK: 5G-Proxy-Pro-v1.4.0.apk (arm64-v8a + armeabi-v7a, minSdk 26, targetSdk 34)

5G Proxy Pro v1.3.2

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 16 Aug 01:09

v1.3.2 — UDP-in-TCP relay + 協定文件化 + 字串資源化

新增

  • UDP-in-TCP relay:自訂 SOCKS5 擴充指令(cmd=0x04),將 UDP datagram 封裝於 TCP 連線傳輸,解決 5G 環境下 UDP 壟斷或遭阻擋的問題(需搭配 5G Proxy Client v1.0.0)
  • 協定文件化:README 新增完整協定規格(UDP-in-TCP frame 格式、SOCKS5 擴充流程)
  • 字串資源化:UI 字串抽離至 res/values,支援多語言(en / zh-rTW)

檔案

  • 5G-Proxy-Pro-v1.3.2.apk(arm64-v8a + armeabi-v7a,已簽署)
  • SHA256: 6F735C1ED8BBCFCC4AE7204013002578A7AF56C64365199F4ECE53417C85C888

5G Proxy Pro v1.3.1

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 15 Aug 15:58

v1.3.1 原生崩潰修正

修正

  • 修復大量並發連線時的原生崩潰:UDP relay 原本使用 select()/FD_SET,受 FD_SETSIZE(1024) 硬限制。當進程開啟的 fd 超過 1024(例如大量 TCP 連線各佔 2 個 fd)時,FD_SET 會觸發 bionic FORTIFY 檢查並 SIGABRT:
    FORTIFY: FD_SET: file descriptor NNNN >= FD_SETSIZE 1024
  • 改用 poll() 管理 fd,無 1024 上限,高 TCP/UDP 流量下更穩定

檔案

  • 5G-Proxy-Pro-v1.3.1.apk(arm64-v8a + armeabi-v7a,已簽署)
  • SHA256: 35C7284A84B4E3409FDAA2A1E2F657F30AE7A8A78CF2E2748A72CE87187AB847

5G Proxy Pro v1.3.0

Choose a tag to compare

@tokyoxpa3 tokyoxpa3 released this 13 Aug 17:36

v1.3.0 5G IP 切換自動恢復代理

新增

  • 電信端切換 5G IP 時自動重建代理連線,不再需要手動「停止代理 → 一鍵開啟」
  • 長期監控行動網路變更事件(onLost / 新 Network 物件),偵測到 IP 切換立即自動恢復
  • 網路健康檢查(網路能力 + 真實連線測試)連續異常時自動重啟代理,作為無事件通知時的保險

修正

  • 代理建立的所有 socket 綁定在啟動時取得的舊網路物件上,電信端切換 IP 後全部連線失效的問題
  • 一次性網路請求不再累積註冊 ConnectivityManager callback

使用說明

電信端自動切換 5G IP 時,服務會自動重新取得行動網路並重建代理(前台通知會顯示重建中),無需任何手動操作。

檔案

  • 5G-Proxy-Pro-v1.3.0.apk(arm64-v8a + armeabi-v7a,已簽署)
  • SHA256: B27DF45DC1C63F7BD19C20E216F0073311C7DC67D127CD809A1D979A9720DE3C