From 966ac406322f0c6b36b2fe746cd3f738bd0f5a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Fri, 20 Mar 2015 13:22:19 +0100 Subject: Detect error in last 5 lines of the log. --- app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 5 +---- .../main/java/se/leap/bitmaskclient/eip/EipStatus.java | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 5e5b76b2..ed507de4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -53,7 +53,6 @@ public class EipFragment extends Fragment implements Observer { private boolean is_starting_to_connect; private boolean wants_to_connect; - @Override public void onAttach(Activity activity) { super.onAttach(activity); @@ -293,12 +292,10 @@ public class EipFragment extends Fragment implements Observer { private void setDisconnectedUI(){ hideProgressBar(); adjustSwitch(); - String last_log_message = eip_status.getLastLogMessage(dashboard.getApplicationContext()); - if((last_log_message.contains("error") || last_log_message.contains("ERROR")) + if(eip_status.errorInLast(5, dashboard.getApplicationContext()) && !status_message.getText().toString().equalsIgnoreCase(dashboard.getString(R.string.eip_state_not_connected))){ dashboard.showLog(); } - status_message.setText(dashboard.getString(R.string.eip_state_not_connected)); } private void adjustSwitch() { 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 14158696..adbbaef3 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -136,9 +136,19 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { EipStatus.level = level; } - public String getLastLogMessage(Context context) { - VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); - return log[log.length-1].getString(context); + public boolean errorInLast(int lines, Context context) { + boolean result = false; + String[] error_keywords = {"error", "ERROR", "fatal", "FATAL"}; + + VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); + String message = ""; + for (int i = 0; i < lines; i++) { + message = log[log.length-1].getString(context); + for(int j = 0; j < error_keywords.length; j++) + if(message.contains(error_keywords[i])) + result = true; + } + return result; } @Override -- cgit v1.2.3 From 7c17d2654d9b6f32580e71e22ea08fca1893aa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 23 Mar 2015 14:45:07 +0100 Subject: Ammend. --- .../java/se/leap/bitmaskclient/EipFragment.java | 7 ++-- .../main/java/se/leap/bitmaskclient/eip/EIP.java | 8 +++- .../java/se/leap/bitmaskclient/eip/EipStatus.java | 9 ++-- .../se/leap/bitmaskclient/eip/VoidVpnLauncher.java | 15 +++++-- .../se/leap/bitmaskclient/eip/VoidVpnService.java | 49 ++++++++-------------- .../leap/bitmaskclient/eip/VpnConfigGenerator.java | 3 +- 6 files changed, 46 insertions(+), 45 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index ed507de4..43e0c2aa 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -197,9 +197,9 @@ public class EipFragment extends Fragment implements Observer { eipCommand(Constants.ACTION_START_EIP); } - private void stop() { - if(eip_status.isConnecting()) - VoidVpnService.stop(); + public void stop() { + Intent intent = new Intent(dashboard.getApplicationContext(), VoidVpnService.class); + dashboard.stopService(intent); disconnect(); } @@ -296,6 +296,7 @@ public class EipFragment extends Fragment implements Observer { && !status_message.getText().toString().equalsIgnoreCase(dashboard.getString(R.string.eip_state_not_connected))){ dashboard.showLog(); } + status_message.setText(dashboard.getString(R.string.eip_state_not_connected)); } private void adjustSwitch() { 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 3b72a486..5cac4588 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -126,8 +126,12 @@ public final class EIP extends IntentService { private void stopEIP() { EipStatus eip_status = EipStatus.getInstance(); int result_code = Activity.RESULT_CANCELED; - if(eip_status.isConnected() || eip_status.isConnecting()) - result_code = Activity.RESULT_OK; + if(eip_status.isConnected() || eip_status.isConnecting()) { + Intent intent = new Intent(); + intent.setComponent(VoidVpnLauncher.getService()); + stopService(intent); + result_code = Activity.RESULT_OK; + } tellToReceiver(ACTION_STOP_EIP, result_code); } 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 adbbaef3..3b9dad1c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -22,6 +22,7 @@ import android.content.*; import java.util.*; import de.blinkt.openvpn.core.*; +import se.leap.bitmaskclient.EipFragment; public class EipStatus extends Observable implements VpnStatus.StateListener { public static String TAG = EipStatus.class.getSimpleName(); @@ -48,8 +49,6 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { updateStatus(state, logmessage, localizedResId, level); if(isConnected() || isDisconnected()) { setConnectedOrDisconnected(); - if(isDisconnected()) - VoidVpnService.stop(); } else if(isConnecting()) setConnecting(); Log.d(TAG, "update state with level " + level); @@ -142,10 +141,10 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); String message = ""; - for (int i = 0; i < lines; i++) { - message = log[log.length-1].getString(context); + for (int i = 1; i <= lines && i < log.length; i++) { + message = log[log.length-i].getString(context); for(int j = 0; j < error_keywords.length; j++) - if(message.contains(error_keywords[i])) + if(message.contains(error_keywords[j])) result = true; } return result; diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java index d79d8003..e7ce74d4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java @@ -1,6 +1,7 @@ package se.leap.bitmaskclient.eip; import android.app.Activity; +import android.content.ComponentName; import android.content.Intent; import android.net.VpnService; import android.os.Bundle; @@ -9,6 +10,8 @@ public class VoidVpnLauncher extends Activity { private static final int VPN_USER_PERMISSION = 71; + private static ComponentName service; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -27,11 +30,17 @@ public class VoidVpnLauncher extends Activity { protected void onActivityResult(int requestCode, int resultCode, Intent data){ if(requestCode == VPN_USER_PERMISSION) { if(resultCode == RESULT_OK) { - Intent void_vpn_service = new Intent(getApplicationContext(), VoidVpnService.class); - void_vpn_service.setAction(Constants.START_BLOCKING_VPN_PROFILE); - startService(void_vpn_service); + Intent intent = new Intent(getApplicationContext(), VoidVpnService.class); + intent.setAction(Constants.START_BLOCKING_VPN_PROFILE); + android.util.Log.d(VoidVpnLauncher.class.getSimpleName(), "VoidVpnService starting from Launcher"); + + service = startService(intent); } } finish(); } + + public static ComponentName getService() { + return service; + } } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java index 0a707ab1..367a9f1d 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java @@ -13,42 +13,29 @@ public class VoidVpnService extends VpnService { @Override public int onStartCommand(Intent intent, int flags, int startId) { - String action = intent != null ? intent.getAction() : ""; - if (action == Constants.START_BLOCKING_VPN_PROFILE) { - new Thread(new Runnable() { - public void run() { - Builder builder = new Builder(); - builder.setSession("Blocking until running"); - builder.addAddress("10.42.0.8",16); - builder.addRoute("0.0.0.0", 1); - builder.addRoute("192.168.1.0", 24); - builder.addDnsServer("10.42.0.1"); - try { - fd = builder.establish(); - } catch (Exception e) { - e.printStackTrace(); - } - android.util.Log.d(TAG, "VoidVpnService set up"); - } - }).run(); - } - return 0; - } + String action = intent != null ? intent.getAction() : ""; + if (action == Constants.START_BLOCKING_VPN_PROFILE) { + start(); + } - @Override - public void onRevoke() { - super.onRevoke(); + return 0; } - public static boolean stop() { + protected void start() { + Builder builder = new Builder(); + builder.setSession("Blocking until running"); + builder.addAddress("10.42.0.8", 16); + builder.addRoute("0.0.0.0", 1); + builder.addRoute("192.168.1.0", 24); + builder.addDnsServer("10.42.0.1"); try { - if(fd != null) - fd.close(); - return true; - } catch (IOException | NullPointerException e) { - android.util.Log.d(TAG, "VoidVpnService didn't stop"); + fd = builder.establish(); + if (fd != null) + android.util.Log.d(TAG, "VoidVpnService set up"); + else + android.util.Log.d(TAG, "VoidVpnService failed to set up"); + } catch (Exception e) { e.printStackTrace(); - return false; } } } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java index 5f5dcabd..c29cc180 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java @@ -148,6 +148,7 @@ public class VpnConfigGenerator { + new_line + "persist-tun" + new_line - + "auth-retry nointeract"; + + "auth-retry nointeract" + + "fragment 1400"; } } -- cgit v1.2.3 From 92a48eda9956193cfb143875a849ff979e16e4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 24 Mar 2015 12:53:51 +0100 Subject: Revert "Ammend." This reverts commit 7c17d2654d9b6f32580e71e22ea08fca1893aa93. --- .../java/se/leap/bitmaskclient/EipFragment.java | 7 ++-- .../main/java/se/leap/bitmaskclient/eip/EIP.java | 8 +--- .../java/se/leap/bitmaskclient/eip/EipStatus.java | 9 ++-- .../se/leap/bitmaskclient/eip/VoidVpnLauncher.java | 15 ++----- .../se/leap/bitmaskclient/eip/VoidVpnService.java | 49 ++++++++++++++-------- .../leap/bitmaskclient/eip/VpnConfigGenerator.java | 3 +- 6 files changed, 45 insertions(+), 46 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 43e0c2aa..ed507de4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -197,9 +197,9 @@ public class EipFragment extends Fragment implements Observer { eipCommand(Constants.ACTION_START_EIP); } - public void stop() { - Intent intent = new Intent(dashboard.getApplicationContext(), VoidVpnService.class); - dashboard.stopService(intent); + private void stop() { + if(eip_status.isConnecting()) + VoidVpnService.stop(); disconnect(); } @@ -296,7 +296,6 @@ public class EipFragment extends Fragment implements Observer { && !status_message.getText().toString().equalsIgnoreCase(dashboard.getString(R.string.eip_state_not_connected))){ dashboard.showLog(); } - status_message.setText(dashboard.getString(R.string.eip_state_not_connected)); } private void adjustSwitch() { 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 5cac4588..3b72a486 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -126,12 +126,8 @@ public final class EIP extends IntentService { private void stopEIP() { EipStatus eip_status = EipStatus.getInstance(); int result_code = Activity.RESULT_CANCELED; - if(eip_status.isConnected() || eip_status.isConnecting()) { - Intent intent = new Intent(); - intent.setComponent(VoidVpnLauncher.getService()); - stopService(intent); - result_code = Activity.RESULT_OK; - } + if(eip_status.isConnected() || eip_status.isConnecting()) + result_code = Activity.RESULT_OK; tellToReceiver(ACTION_STOP_EIP, result_code); } 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 3b9dad1c..adbbaef3 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -22,7 +22,6 @@ import android.content.*; import java.util.*; import de.blinkt.openvpn.core.*; -import se.leap.bitmaskclient.EipFragment; public class EipStatus extends Observable implements VpnStatus.StateListener { public static String TAG = EipStatus.class.getSimpleName(); @@ -49,6 +48,8 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { updateStatus(state, logmessage, localizedResId, level); if(isConnected() || isDisconnected()) { setConnectedOrDisconnected(); + if(isDisconnected()) + VoidVpnService.stop(); } else if(isConnecting()) setConnecting(); Log.d(TAG, "update state with level " + level); @@ -141,10 +142,10 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); String message = ""; - for (int i = 1; i <= lines && i < log.length; i++) { - message = log[log.length-i].getString(context); + for (int i = 0; i < lines; i++) { + message = log[log.length-1].getString(context); for(int j = 0; j < error_keywords.length; j++) - if(message.contains(error_keywords[j])) + if(message.contains(error_keywords[i])) result = true; } return result; diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java index e7ce74d4..d79d8003 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnLauncher.java @@ -1,7 +1,6 @@ package se.leap.bitmaskclient.eip; import android.app.Activity; -import android.content.ComponentName; import android.content.Intent; import android.net.VpnService; import android.os.Bundle; @@ -10,8 +9,6 @@ public class VoidVpnLauncher extends Activity { private static final int VPN_USER_PERMISSION = 71; - private static ComponentName service; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -30,17 +27,11 @@ public class VoidVpnLauncher extends Activity { protected void onActivityResult(int requestCode, int resultCode, Intent data){ if(requestCode == VPN_USER_PERMISSION) { if(resultCode == RESULT_OK) { - Intent intent = new Intent(getApplicationContext(), VoidVpnService.class); - intent.setAction(Constants.START_BLOCKING_VPN_PROFILE); - android.util.Log.d(VoidVpnLauncher.class.getSimpleName(), "VoidVpnService starting from Launcher"); - - service = startService(intent); + Intent void_vpn_service = new Intent(getApplicationContext(), VoidVpnService.class); + void_vpn_service.setAction(Constants.START_BLOCKING_VPN_PROFILE); + startService(void_vpn_service); } } finish(); } - - public static ComponentName getService() { - return service; - } } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java index 367a9f1d..0a707ab1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VoidVpnService.java @@ -13,29 +13,42 @@ public class VoidVpnService extends VpnService { @Override public int onStartCommand(Intent intent, int flags, int startId) { - String action = intent != null ? intent.getAction() : ""; - if (action == Constants.START_BLOCKING_VPN_PROFILE) { - start(); - } + String action = intent != null ? intent.getAction() : ""; + if (action == Constants.START_BLOCKING_VPN_PROFILE) { + new Thread(new Runnable() { + public void run() { + Builder builder = new Builder(); + builder.setSession("Blocking until running"); + builder.addAddress("10.42.0.8",16); + builder.addRoute("0.0.0.0", 1); + builder.addRoute("192.168.1.0", 24); + builder.addDnsServer("10.42.0.1"); + try { + fd = builder.establish(); + } catch (Exception e) { + e.printStackTrace(); + } + android.util.Log.d(TAG, "VoidVpnService set up"); + } + }).run(); + } + return 0; + } - return 0; + @Override + public void onRevoke() { + super.onRevoke(); } - protected void start() { - Builder builder = new Builder(); - builder.setSession("Blocking until running"); - builder.addAddress("10.42.0.8", 16); - builder.addRoute("0.0.0.0", 1); - builder.addRoute("192.168.1.0", 24); - builder.addDnsServer("10.42.0.1"); + public static boolean stop() { try { - fd = builder.establish(); - if (fd != null) - android.util.Log.d(TAG, "VoidVpnService set up"); - else - android.util.Log.d(TAG, "VoidVpnService failed to set up"); - } catch (Exception e) { + if(fd != null) + fd.close(); + return true; + } catch (IOException | NullPointerException e) { + android.util.Log.d(TAG, "VoidVpnService didn't stop"); e.printStackTrace(); + return false; } } } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java index c29cc180..5f5dcabd 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java @@ -148,7 +148,6 @@ public class VpnConfigGenerator { + new_line + "persist-tun" + new_line - + "auth-retry nointeract" - + "fragment 1400"; + + "auth-retry nointeract"; } } -- cgit v1.2.3 From 4d1ee9cd65d10161d3e818e99cbd06b93e211277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 24 Mar 2015 12:58:18 +0100 Subject: Error in last lines fixed. --- app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java | 4 ++-- app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/src/main') 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 adbbaef3..f9ddc0d2 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -143,9 +143,9 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); String message = ""; for (int i = 0; i < lines; i++) { - message = log[log.length-1].getString(context); + message = log[log.length-i].getString(context); for(int j = 0; j < error_keywords.length; j++) - if(message.contains(error_keywords[i])) + if(message.contains(error_keywords[j])) result = true; } return result; diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java index 5f5dcabd..25c85585 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java @@ -148,6 +148,6 @@ public class VpnConfigGenerator { + new_line + "persist-tun" + new_line - + "auth-retry nointeract"; + + "auth-retry nointeract remove"; } } -- cgit v1.2.3 From 7dba6442fb80cb55fe66f3d9510f71b80cb9e2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 24 Mar 2015 13:06:55 +0100 Subject: Show log if an error is reported in last 5 log messages. --- app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 1 + app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java | 2 +- app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index ed507de4..8b532e24 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -296,6 +296,7 @@ public class EipFragment extends Fragment implements Observer { && !status_message.getText().toString().equalsIgnoreCase(dashboard.getString(R.string.eip_state_not_connected))){ dashboard.showLog(); } + status_message.setText(dashboard.getString(R.string.eip_state_not_connected)); } private void adjustSwitch() { 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 f9ddc0d2..17e290b8 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -142,7 +142,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { VpnStatus.LogItem[] log = VpnStatus.getlogbuffer(); String message = ""; - for (int i = 0; i < lines; i++) { + for (int i = 1; i <= lines && log.length > i; i++) { message = log[log.length-i].getString(context); for(int j = 0; j < error_keywords.length; j++) if(message.contains(error_keywords[j])) diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java index 25c85585..5af8b8f1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java @@ -148,6 +148,6 @@ public class VpnConfigGenerator { + new_line + "persist-tun" + new_line - + "auth-retry nointeract remove"; + + "auth-retry nointeract" } } -- cgit v1.2.3