diff --git a/app/build.gradle b/app/build.gradle index e6bd76e..a49e778 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,10 +55,10 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.21" implementation fileTree(dir: 'libs', include: ['*.aar']) - implementation 'co.pango:sdk-core:4.9.3' - implementation 'co.pango:sdk-hydra:4.9.3' - implementation 'co.pango:sdk-openvpn:4.9.3' - implementation 'co.pango:sdk-wireguard:4.9.3' + implementation 'co.pango:sdk-core:5.0.1' + implementation 'co.pango:sdk-hydra:5.0.1' + implementation 'co.pango:sdk-openvpn:5.0.1' + implementation 'co.pango:sdk-wireguard:5.0.1' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.cardview:cardview:1.0.0' diff --git a/app/src/main/java/com/northghost/hydraclient/activity/MainActivity.java b/app/src/main/java/com/northghost/hydraclient/activity/MainActivity.java index f9ad324..1d2e224 100644 --- a/app/src/main/java/com/northghost/hydraclient/activity/MainActivity.java +++ b/app/src/main/java/com/northghost/hydraclient/activity/MainActivity.java @@ -119,8 +119,8 @@ public void success(@NonNull Boolean aBoolean) { if (aBoolean) { List fallbackOrder = new ArrayList<>(); fallbackOrder.add(HydraTransport.TRANSPORT_ID); -// fallbackOrder.add(OpenVpnTransport.TRANSPORT_ID_TCP); -// fallbackOrder.add(OpenVpnTransport.TRANSPORT_ID_UDP); + fallbackOrder.add(OpenVpnTransport.TRANSPORT_ID_TCP); + fallbackOrder.add(OpenVpnTransport.TRANSPORT_ID_UDP); showConnectProgress(); List bypassDomains = new LinkedList<>(); bypassDomains.add("*domain1.com"); @@ -141,7 +141,7 @@ public void success(@NonNull Boolean aBoolean) { .build()) .withLocation(selectedCountry) - .addDnsRule(TrafficRule.dns().bypass().fromDomains(bypassDomains)) +// .addDnsRule(TrafficRule.dns().bypass().fromDomains(bypassDomains)) .build(), new CompletableCallback() { @Override public void complete() { diff --git a/app/src/main/java/com/northghost/hydraclient/adapter/RegionListAdapter.java b/app/src/main/java/com/northghost/hydraclient/adapter/RegionListAdapter.java index f86e1b6..9812af9 100644 --- a/app/src/main/java/com/northghost/hydraclient/adapter/RegionListAdapter.java +++ b/app/src/main/java/com/northghost/hydraclient/adapter/RegionListAdapter.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.List; -import unified.vpn.sdk.Country; import unified.vpn.sdk.Location; diff --git a/app/src/main/java/com/northghost/hydraclient/deps/Fake.java b/app/src/main/java/com/northghost/hydraclient/deps/Fake.java index 80a13d9..c78950b 100644 --- a/app/src/main/java/com/northghost/hydraclient/deps/Fake.java +++ b/app/src/main/java/com/northghost/hydraclient/deps/Fake.java @@ -17,7 +17,6 @@ public class Fake { public void sdkMethodsList() { final UnifiedSdk instance = UnifiedSdk.getInstance(); ClientInfo.newBuilder().addUrl("").carrierId("test").addUrls(new ArrayList<>()).build(); - instance.getCarrierId(); backend(instance); cnl(instance); @@ -26,7 +25,6 @@ public void sdkMethodsList() { // final String id1 = OpenVpnTransport.TRANSPORT_ID_TCP; // final String id2 = OpenVpnTransport.TRANSPORT_ID_UDP; UnifiedSdk.getVpnState(Callback.EMPTY); - UnifiedSdk.getConnectionStatus(Callback.EMPTY); UnifiedSdk.setLoggingLevel(Log.VERBOSE); UnifiedSdk.getStatus(Callback.EMPTY); VpnPermissions.request(CompletableCallback.EMPTY); @@ -132,24 +130,22 @@ private void vpn(UnifiedSdk instance) { private SessionConfig getSessionConfig() { return new SessionConfig.Builder() .withReason(TrackingConstants.GprReasons.M_UI) - .addProxyRule(TrafficRule.Builder.blockDns().fromAssets("")) - .addDnsRule(TrafficRule.Builder.blockDns().fromAssets("")) - .addDnsRule(TrafficRule.Builder.blockPkt().fromAssets("")) - .addDnsRule(TrafficRule.Builder.bypass().fromAssets("")) - .addDnsRule(TrafficRule.Builder.proxy().fromAssets("")) - .addDnsRule(TrafficRule.Builder.vpn().fromAssets("")) - .addDnsRule(TrafficRule.Builder.vpn().fromDomains(new ArrayList<>())) - .addDnsRule(TrafficRule.Builder.vpn().fromFile("")) - .addDnsRule(TrafficRule.Builder.vpn().fromResource(0)) - .addDnsRule(TrafficRule.Builder.vpn().fromIp("", 0)) - .addDnsRule(TrafficRule.Builder.vpn().fromIp("", 0, 0)) - .addDnsRule(TrafficRule.Builder.vpn().fromIp("", 0, 0, 0)) - .addDnsRule(TrafficRule.Builder.vpn().tcp()) - .addDnsRule(TrafficRule.Builder.vpn().tcp(0)) - .addDnsRule(TrafficRule.Builder.vpn().tcp(0, 0)) - .addDnsRule(TrafficRule.Builder.vpn().udp()) - .addDnsRule(TrafficRule.Builder.vpn().udp(0)) - .addDnsRule(TrafficRule.Builder.vpn().udp(0, 0)) + .addDnsRule(TrafficRule.dns().block().fromAssets("")) + .addDnsRule(TrafficRule.dns().bypass().fromAssets("")) + .addDnsRule(TrafficRule.dns().proxyPeer().fromAssets("")) + .addDnsRule(TrafficRule.dns().vpn().fromAssets("")) + .addDnsRule(TrafficRule.dns().vpn().fromDomains(new ArrayList<>())) + .addDnsRule(TrafficRule.dns().vpn().fromFile("")) + .addDnsRule(TrafficRule.dns().vpn().fromResource(0)) + .addProxyRule(TrafficRule.proxy().vpn().fromIp("", 0)) + .addProxyRule(TrafficRule.proxy().vpn().fromIp("", 0, 0)) + .addProxyRule(TrafficRule.proxy().vpn().fromIp("", 0, 0, 0)) + .addProxyRule(TrafficRule.proxy().vpn().tcp()) + .addProxyRule(TrafficRule.proxy().vpn().tcp(0)) + .addProxyRule(TrafficRule.proxy().vpn().tcp(0, 0)) + .addProxyRule(TrafficRule.proxy().vpn().udp()) + .addProxyRule(TrafficRule.proxy().vpn().udp(0)) + .addProxyRule(TrafficRule.proxy().vpn().udp(0, 0)) .exceptApps(new ArrayList<>()) .captivePortalBlockBypass(false) .withVpnParams(VpnParams.newBuilder().build()) @@ -159,8 +155,6 @@ private SessionConfig getSessionConfig() { .withSessionId("") .forApps(new ArrayList<>()) .withLocation("") - .withCountry("") - .withVirtualLocation("") .withPolicy(AppPolicy.newBuilder().build()) .withFireshieldConfig(new FireshieldConfig.Builder() .addCategory(FireshieldCategory.Builder.block("")) @@ -175,16 +169,7 @@ private SessionConfig getSessionConfig() { private void backend(UnifiedSdk instance) { Backend backend = instance.getBackend(); - backend.credentials(Callback.EMPTY); - backend.credentials(new CredentialsRequest.Builder() - .withConnectionType(ConnectionType.HYDRA_TCP) - .withCountry("") - .withLocation("") - .withExtras(new HashMap<>()) - .withPrivateGroup("") - .build(), Callback.EMPTY); backend.currentUser(Callback.EMPTY); - backend.countries(ConnectionType.HYDRA_TCP, Callback.EMPTY); backend.locations(ConnectionType.HYDRA_TCP, new Callback() { @Override public void success(@NonNull AvailableLocations availableLocations) { @@ -204,7 +189,6 @@ public void failure(@NonNull VpnException e) { backend.login(AuthMethod.anonymous(), Bundle.EMPTY, Callback.EMPTY); backend.logout(CompletableCallback.EMPTY); backend.remainingTraffic(Callback.EMPTY); - backend.remoteConfig(Callback.EMPTY); backend.deletePurchase(0, CompletableCallback.EMPTY); backend.purchase("", CompletableCallback.EMPTY); backend.purchase("", "", CompletableCallback.EMPTY);