feat: WireGuard-транспорт, split-tunneling и тоггл логов

Порт фич из netzgiest/turn-proxy-android, адаптированный под текущую
кодовую базу (Koin DI, разделённые ViewModels, ProxyOrchestrator, без vless).

- WireGuardTunnelManager (GoBackend): поднимает VPN-туннель поверх
  локального прокси, Endpoint подменяется на localPort, split-tunnel
  через Included/ExcludedApplications в [Interface].
- ClientConfig: tunnelTransport, wireGuardConfig, wireGuardTunnelName,
  splitTunnelMode, splitTunnelApps, logsEnabled (+ datastore/JSON).
- ProxyService: поднятие WG в ветке hasConnection, остановка в finally
  и onDestroy. VPN-aware network callback (NET_CAPABILITY_NOT_VPN +
  physicalNetworkKey), иначе свой WG-интерфейс уводит прокси в рестарт.
- UI: секция WireGuard, split-tunnel с пикером приложений, тоггл логов.
- build: minSdk 24, Java 17, desugaring, com.wireguard.android:tunnel;
  манифест — GoBackend$VpnService, QUERY_ALL_PACKAGES, queries.
This commit is contained in:
Irkhin Sergey authored and samosvalishe committed 2026-06-02 14:36:38 +03:00
1 parent df2e21b648
commit e28e37816d
12 files changed
+724 -41

No files matched your search

+22
View File
@@ -14,6 +14,17 @@
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- Нужно для split-tunnel: показать список установленных приложений в пикере. -->
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
</queries>
<application
android:name=".App"
@@ -24,6 +35,7 @@
android:label="FreeTurn"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:extractNativeLibs="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/Theme.FreeTurn"
tools:targetApi="31">
@@ -54,6 +66,16 @@
android:value="Maintains an active local network proxy connection over TURN servers so the user can keep using a working tunnel while the app is in the background." />
</service>
<!-- VPN-сервис WireGuard GoBackend: поднимает туннель поверх локального прокси. -->
<service
android:name="com.wireguard.android.backend.GoBackend$VpnService"
android:exported="false"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"