From d77b9aefea75491b50f28a6880906ba9496979f2 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 21 Sep 2017 01:28:24 +0200 Subject: update ics-openvpn: update classes, manifest, resources and build script --- .../java/se/leap/bitmaskclient/VpnFragment.java | 6 ++++-- .../main/java/se/leap/bitmaskclient/eip/EIP.java | 2 +- .../java/se/leap/bitmaskclient/eip/EipStatus.java | 24 +++++++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'app/src/main/java/se') diff --git a/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java b/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java index 6ffeacc1..9e9adef1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java @@ -19,6 +19,7 @@ package se.leap.bitmaskclient; import android.app.*; import android.content.*; import android.os.*; +import android.util.Log; import android.view.*; import android.widget.*; @@ -39,7 +40,7 @@ public class VpnFragment extends Fragment implements Observer { protected static final String IS_CONNECTED = TAG + ".is_connected"; public static final String START_ON_BOOT = "start on boot"; - @InjectView(R.id.vpn_Status_Image) + @InjectView(R.id.vpn_status_image) FabButton vpn_status_image; @InjectView(R.id.vpn_main_button) Button main_button; @@ -91,7 +92,8 @@ public class VpnFragment extends Fragment implements Observer { @Override public void onResume() { super.onResume(); - eipCommand(Constants.ACTION_CHECK_CERT_VALIDITY); + //FIXME: avoid race conditions while checking certificate an logging in at about the same time + //eipCommand(Constants.ACTION_CHECK_CERT_VALIDITY); handleNewState(eip_status); } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index 9ff7f1af..5b72a4e7 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -117,8 +117,8 @@ public final class EIP extends IntentService { Intent intent = new Intent(this, LaunchVPN.class); intent.setAction(Intent.ACTION_MAIN); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(LaunchVPN.EXTRA_NAME, gateway.getProfile().getName()); intent.putExtra(LaunchVPN.EXTRA_HIDELOG, true); + intent.putExtra(LaunchVPN.EXTRA_TEMP_VPN_PROFILE, gateway.getProfile()); startActivity(intent); } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java index 4bfef1cb..501543b8 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -26,7 +26,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { public static String TAG = EipStatus.class.getSimpleName(); private static EipStatus current_status; - private static VpnStatus.ConnectionStatus level = VpnStatus.ConnectionStatus.LEVEL_NOTCONNECTED; + private static ConnectionStatus level = ConnectionStatus.LEVEL_NOTCONNECTED; private static boolean wants_to_disconnect = false, is_connecting = false; @@ -47,7 +47,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { } @Override - public void updateState(final String state, final String logmessage, final int localizedResId, final VpnStatus.ConnectionStatus level) { + public void updateState(final String state, final String logmessage, final int localizedResId, final ConnectionStatus level) { updateStatus(state, logmessage, localizedResId, level); if (isConnected() || isDisconnected() || wantsToDisconnect()) { setConnectedOrDisconnected(); @@ -55,7 +55,11 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { setConnecting(); } - private void updateStatus(final String state, final String logmessage, final int localizedResId, final VpnStatus.ConnectionStatus level) { + @Override + public void setConnectedVPN(String uuid) { + } + + private void updateStatus(final String state, final String logmessage, final int localizedResId, final ConnectionStatus level) { current_status = getInstance(); current_status.setState(state); current_status.setLogMessage(logmessage); @@ -73,15 +77,15 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { } public boolean isConnected() { - return level == VpnStatus.ConnectionStatus.LEVEL_CONNECTED; + return level == ConnectionStatus.LEVEL_CONNECTED; } public boolean isDisconnected() { - return level == VpnStatus.ConnectionStatus.LEVEL_NOTCONNECTED; + return level == ConnectionStatus.LEVEL_NOTCONNECTED; } public boolean isPaused() { - return level == VpnStatus.ConnectionStatus.LEVEL_VPNPAUSED; + return level == ConnectionStatus.LEVEL_VPNPAUSED; } public void setConnecting() { @@ -116,7 +120,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { return localized_res_id; } - public VpnStatus.ConnectionStatus getLevel() { + public ConnectionStatus getLevel() { return level; } @@ -132,7 +136,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { this.localized_res_id = localized_res_id; } - private void setLevel(VpnStatus.ConnectionStatus level) { + private void setLevel(ConnectionStatus level) { EipStatus.level = level; } @@ -145,13 +149,13 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { String[] error_keywords = {"error", "ERROR", "fatal", "FATAL"}; - VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); + LogItem[] log = VpnStatus.getlogbuffer(); if(log.length < last_error_line) last_error_line = 0; String message = ""; for (int i = 1; i <= lines && log.length > i; i++) { int line = log.length - i; - VpnStatus.LogItem log_item = log[line]; + LogItem log_item = log[line]; message = log_item.getString(context); for (int j = 0; j < error_keywords.length; j++) if (message.contains(error_keywords[j]) && line > last_error_line) { -- cgit v1.2.3