Add proxy routing and sing-box support
This commit is contained in:
@@ -22,6 +22,16 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
def weblibreGoMobileAar = file("../../../native/go_mobile_runtime/build/weblibre-go.aar")
|
||||
def requireWebLibreGoMobileAar = {
|
||||
if (!weblibreGoMobileAar.exists()) {
|
||||
throw new GradleException(
|
||||
"Missing combined gomobile runtime AAR: ${weblibreGoMobileAar}. " +
|
||||
"Run native/go_mobile_runtime/scripts/build-android.sh from the repository root."
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "com.android.library"
|
||||
apply plugin: "kotlin-android"
|
||||
|
||||
@@ -53,8 +63,9 @@ android {
|
||||
implementation("info.guardianproject:tor-android:0.4.9.6")
|
||||
implementation("info.guardianproject:jtorctl:0.4.5.7")
|
||||
|
||||
// Pluggable transports
|
||||
implementation("com.netzarchitekten:IPtProxy:5.4.1")
|
||||
// Pluggable transports are provided by the app-level combined gomobile AAR.
|
||||
requireWebLibreGoMobileAar()
|
||||
compileOnly(files(weblibreGoMobileAar))
|
||||
|
||||
// Coroutines for async operations
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package eu.weblibre.flutter_tor
|
||||
|
||||
import IPtProxy.Controller
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ package eu.weblibre.flutter_tor
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import IPtProxy.Controller
|
||||
import IPtProxy.IPtProxy
|
||||
import IPtProxy.OnTransportEvents
|
||||
import io.nekohasekai.IPtProxy.Controller
|
||||
import io.nekohasekai.IPtProxy.IPtProxy
|
||||
import io.nekohasekai.IPtProxy.OnTransportEvents
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
*/
|
||||
package eu.weblibre.flutter_tor
|
||||
|
||||
import IPtProxy.IPtProxy
|
||||
import eu.weblibre.flutter_tor.generated.IPtProxyController
|
||||
import eu.weblibre.flutter_tor.generated.TransportType
|
||||
import io.nekohasekai.IPtProxy.Controller
|
||||
import io.nekohasekai.IPtProxy.IPtProxy
|
||||
|
||||
class ProxyImpl(val controller: IPtProxy.Controller) : IPtProxyController {
|
||||
class ProxyImpl(val controller: Controller) : IPtProxyController {
|
||||
override fun start(proxyType: TransportType, proxy: String): Long {
|
||||
val type = when (proxyType) {
|
||||
TransportType.SNOWFLAKE -> IPtProxy.Snowflake
|
||||
@@ -55,4 +56,4 @@ class ProxyImpl(val controller: IPtProxy.Controller) : IPtProxyController {
|
||||
|
||||
controller.stop(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package eu.weblibre.flutter_tor
|
||||
|
||||
import eu.weblibre.flutter_tor.generated.TorConfiguration
|
||||
import IPtProxy.IPtProxy
|
||||
import io.nekohasekai.IPtProxy.IPtProxy
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user