diff --git a/app/build.gradle b/app/build.gradle index 8a0c3481..9297ef6e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "org.bepass.oblivion" minSdk 21 targetSdk 34 - versionCode 8 - versionName "1.7" + versionCode 9 + versionName "1.8" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -49,7 +49,6 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'com.squareup.okhttp3:okhttp:4.9.0' implementation 'com.github.zcweng:switch-button:0.0.3@aar' implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar']) } diff --git a/app/libs/go.mod b/app/libs/go.mod index 2585fda9..e9baa17a 100644 --- a/app/libs/go.mod +++ b/app/libs/go.mod @@ -7,7 +7,7 @@ replace github.com/Psiphon-Labs/psiphon-tunnel-core => github.com/uoosef/psiphon replace github.com/eycorsican/go-tun2socks => github.com/trojan-gfw/go-tun2socks v1.16.3-0.20210702214000-083d49176e05 require ( - github.com/bepass-org/wireguard-go v1.0.2-rc1 + github.com/bepass-org/wireguard-go v1.0.3-rc2 github.com/eycorsican/go-tun2socks v1.16.11 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 github.com/xjasonlyu/tun2socks/v2 v2.5.2 diff --git a/app/src/main/java/org/bepass/oblivion/OblivionVpnService.java b/app/src/main/java/org/bepass/oblivion/OblivionVpnService.java index 92f1d12b..c29a06f1 100644 --- a/app/src/main/java/org/bepass/oblivion/OblivionVpnService.java +++ b/app/src/main/java/org/bepass/oblivion/OblivionVpnService.java @@ -23,22 +23,15 @@ import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; import tun2socks.Tun2socks; import tun2socks.StartOptions; import java.io.FileOutputStream; import java.io.IOException; import java.lang.ref.WeakReference; -import java.net.InetSocketAddress; -import java.net.Proxy; import java.net.ServerSocket; import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.concurrent.TimeUnit; public class OblivionVpnService extends VpnService { private static final String TAG = "oblivionVPN"; @@ -135,39 +128,6 @@ public static Map splitHostAndPort(String hostPort) { return result; } - - public static String pingOverHTTP(String bindAddress) { - Map result = splitHostAndPort(bindAddress); - if (result == null) { - return "exception"; - } - String socksHost = result.keySet().iterator().next(); - int socksPort = result.values().iterator().next(); - - // Set up the SOCKS proxy - Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(socksHost, socksPort)); - - // Create OkHttpClient with SOCKS proxy - OkHttpClient client = new OkHttpClient.Builder() - .proxy(proxy) - .connectTimeout(5, TimeUnit.SECONDS) // 5 seconds connection timeout - .readTimeout(5, TimeUnit.SECONDS) // 5 seconds read timeout - .build(); - - // Build the request - Request request = new Request.Builder() - .url("https://1.1.1.1") // Replace with actual URL - .build(); - - // Execute the request - try (Response response = client.newCall(request).execute()) { - return response.isSuccessful() ? "true" : "false"; - } catch (IOException e) { - //e.printStackTrace(); - return Objects.requireNonNull(e.getMessage()).contains("ECONNREFUSED") || e.getMessage().contains("general failure") || e.getMessage().contains("timed out") ? "false" : "exception"; - } - } - private static int findFreePort() { ServerSocket socket = null; try { @@ -473,7 +433,7 @@ private void createNotification() { this, 2, new Intent(this, MainActivity.class), PendingIntent.FLAG_IMMUTABLE); notification = new NotificationCompat.Builder(this, notificationChannel.getId()) .setContentTitle("Vpn service") - .setContentText("Testing Tun2Socks") + .setContentText("Oblivion WARP") .setSmallIcon(R.mipmap.ic_launcher) .setOnlyAlertOnce(true) .setOngoing(true) diff --git a/app/src/main/res/layout/activity_info.xml b/app/src/main/res/layout/activity_info.xml index 3d57c86a..76458479 100644 --- a/app/src/main/res/layout/activity_info.xml +++ b/app/src/main/res/layout/activity_info.xml @@ -96,7 +96,7 @@ android:fontFamily="@font/shabnam" android:textColor="@color/black" android:gravity="center" - android:text="App Version: 0.0.7-test" /> + android:text="App Version: 0.0.8-test" /> \ No newline at end of file