Skip to content

Commit

Permalink
Version/5.0.1 (#211)
Browse files Browse the repository at this point in the history
* źadded custom logger

* updated sdk to 5.0.1

* uncomment
  • Loading branch information
timoshenkoav authored Sep 16, 2024
1 parent 0f2e898 commit d749c7b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 40 deletions.
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

0 comments on commit d749c7b

Please sign in to comment.