Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version/5.0.1 #211

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void success(@NonNull Boolean aBoolean) {
if (aBoolean) {
List<String> 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<String> bypassDomains = new LinkedList<>();
bypassDomains.add("*domain1.com");
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.ArrayList;
import java.util.List;

import unified.vpn.sdk.Country;
import unified.vpn.sdk.Location;


Expand Down
48 changes: 16 additions & 32 deletions app/src/main/java/com/northghost/hydraclient/deps/Fake.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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())
Expand All @@ -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(""))
Expand All @@ -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<AvailableLocations>() {
@Override
public void success(@NonNull AvailableLocations availableLocations) {
Expand All @@ -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);
Expand Down
Loading