From 726569f0b9d18c311b307f6a108f6749f96423c5 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Wed, 5 Mar 2014 11:48:26 -0800 Subject: Rewrite "Server is down" message to "Server is unreachable" --- src/se/leap/bitmaskclient/ProviderAPI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java index 5344e471..62d86455 100644 --- a/src/se/leap/bitmaskclient/ProviderAPI.java +++ b/src/se/leap/bitmaskclient/ProviderAPI.java @@ -606,7 +606,7 @@ public class ProviderAPI extends IntentService { } catch (MalformedURLException e) { json_file_content = formatErrorMessage(R.string.malformed_url); } catch(SocketTimeoutException e) { - json_file_content = formatErrorMessage(R.string.server_is_down_message); + json_file_content = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { if(provider_url != null) { json_file_content = downloadWithProviderCA(string_url, danger_on); @@ -644,7 +644,7 @@ public class ProviderAPI extends IntentService { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnknownHostException e) { - json_file_content = formatErrorMessage(R.string.server_is_down_message); + json_file_content = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. if(danger_on) { @@ -727,7 +727,7 @@ public class ProviderAPI extends IntentService { System.out.println("String ignoring certificate = " + string); } catch (FileNotFoundException e) { e.printStackTrace(); - string = formatErrorMessage(R.string.server_is_down_message); + string = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. e.printStackTrace(); -- cgit v1.2.3 From b600226787227883b62ef0fecb2a56d82ba58e0b Mon Sep 17 00:00:00 2001 From: root Date: Sat, 8 Mar 2014 18:34:54 +0530 Subject: Remove 'Top padding' string from ConfigurationWizard (Bug #5260) --- src/se/leap/bitmaskclient/ConfigurationWizard.java | 4 ++-- src/se/leap/bitmaskclient/ProviderListFragment.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java index e5ad5b3d..1c5f6048 100644 --- a/src/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java @@ -137,9 +137,9 @@ implements ProviderListFragment.Callbacks, NewProviderDialogInterface, ProviderD public void refreshProviderList(int top_padding) { ProviderListFragment new_provider_list_fragment = new ProviderListFragment(); Bundle top_padding_bundle = new Bundle(); - top_padding_bundle.putInt(getResources().getString(R.string.top_padding), top_padding); + top_padding_bundle.putInt(ProviderListFragment.TOP_PADDING, top_padding); new_provider_list_fragment.setArguments(top_padding_bundle); - + FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction() .replace(R.id.configuration_wizard_layout, new_provider_list_fragment, ProviderListFragment.TAG) diff --git a/src/se/leap/bitmaskclient/ProviderListFragment.java b/src/se/leap/bitmaskclient/ProviderListFragment.java index 45047982..df39b86d 100644 --- a/src/se/leap/bitmaskclient/ProviderListFragment.java +++ b/src/se/leap/bitmaskclient/ProviderListFragment.java @@ -39,7 +39,7 @@ public class ProviderListFragment extends ListFragment { public static String TAG = "provider_list_fragment"; public static String SHOW_ALL_PROVIDERS = "show_all_providers"; - + public static String TOP_PADDING = "top padding"; private ProviderListAdapter content_adapter; /** @@ -120,7 +120,7 @@ public class ProviderListFragment extends ListFragment { && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); } - String top_padding_key = getResources().getString(R.string.top_padding); + String top_padding_key = TOP_PADDING; if(getArguments() != null && getArguments().containsKey(top_padding_key)) { int topPadding = getArguments().getInt(top_padding_key); View current_view = getView(); -- cgit v1.2.3 From c9918258ffd14ea3c3b9a936ba8a01add946920c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 10 Mar 2014 20:01:47 +0100 Subject: A bit more clean and concise. I've added "from providerlistfragment" just in case there is any other "top padding" string suitable in other class in the future. I've removed the auxiliar variable in the block of code from ProviderListFragment, there is no need of if now we have a constant in that class. --- src/se/leap/bitmaskclient/ProviderListFragment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/ProviderListFragment.java b/src/se/leap/bitmaskclient/ProviderListFragment.java index df39b86d..f35cf739 100644 --- a/src/se/leap/bitmaskclient/ProviderListFragment.java +++ b/src/se/leap/bitmaskclient/ProviderListFragment.java @@ -39,7 +39,7 @@ public class ProviderListFragment extends ListFragment { public static String TAG = "provider_list_fragment"; public static String SHOW_ALL_PROVIDERS = "show_all_providers"; - public static String TOP_PADDING = "top padding"; + public static String TOP_PADDING = "top padding from providerlistfragment"; private ProviderListAdapter content_adapter; /** @@ -120,9 +120,8 @@ public class ProviderListFragment extends ListFragment { && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); } - String top_padding_key = TOP_PADDING; - if(getArguments() != null && getArguments().containsKey(top_padding_key)) { - int topPadding = getArguments().getInt(top_padding_key); + if(getArguments() != null && getArguments().containsKey(TOP_PADDING)) { + int topPadding = getArguments().getInt(TOP_PADDING); View current_view = getView(); getView().setPadding(current_view.getPaddingLeft(), topPadding, current_view.getPaddingRight(), current_view.getPaddingBottom()); } -- cgit v1.2.3 From 87826ce5c276489d74b37618b9d534b32e446eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 10 Mar 2014 21:36:13 +0100 Subject: ConcurrentModification at switching provider fixed This fixes bug 5237. --- src/se/leap/bitmaskclient/EIP.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index 169178d1..b3b2c95d 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -280,9 +280,9 @@ public final class EIP extends IntentService { if(parsedEipSerial == 0) { // Delete all vpn profiles ProfileManager vpl = ProfileManager.getInstance(context); - Collection profiles = vpl.getProfiles(); - for (VpnProfile profile : profiles){ - vpl.removeProfile(context, profile); + VpnProfile[] profiles = (VpnProfile[]) vpl.getProfiles().toArray(new VpnProfile[vpl.getProfiles().size()]); + for (int current_profile = 0; current_profile < profiles.length; current_profile++){ + vpl.removeProfile(context, profiles[current_profile]); } } if (eipDefinition.optInt("serial") > parsedEipSerial) -- cgit v1.2.3 From 1df967637d432bccc405f0a2e7ce46dc236cffff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 11 Mar 2014 19:48:22 +0100 Subject: Locations in eip-service can be empty. --- src/se/leap/bitmaskclient/EIP.java | 5 +++-- src/se/leap/openvpn/ConfigParser.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index b3b2c95d..e773e3b9 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -332,14 +332,15 @@ public final class EIP extends IntentService { } } - String closestLocation = offsets.firstEntry().getValue().iterator().next(); + + String closestLocation = offsets.isEmpty() ? "" : offsets.firstEntry().getValue().iterator().next(); JSONArray gateways = null; String chosenHost = null; try { gateways = eipDefinition.getJSONArray("gateways"); for (int i = 0; i < gateways.length(); i++) { JSONObject gw = gateways.getJSONObject(i); - if ( gw.getString("location").equalsIgnoreCase(closestLocation) ){ + if ( gw.getString("location").equalsIgnoreCase(closestLocation) || closestLocation.isEmpty()){ chosenHost = gw.getString("host"); break; } diff --git a/src/se/leap/openvpn/ConfigParser.java b/src/se/leap/openvpn/ConfigParser.java index 36585d29..df4eae1b 100644 --- a/src/se/leap/openvpn/ConfigParser.java +++ b/src/se/leap/openvpn/ConfigParser.java @@ -357,7 +357,7 @@ public class ConfigParser { } // Parse remote config - Vector location = getOption("location",1,2); + Vector location = getOption("location",0,2); if(location != null && location.size() == 2){ np.mLocation = location.get(1).replace("__", ", "); } -- cgit v1.2.3 From ba1cfd6c63ad9ff372130247378f599c2e9fc7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Wed, 12 Mar 2014 12:42:13 +0100 Subject: Login action bar button shown when applicable. --- src/se/leap/bitmaskclient/Dashboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java index b4d06f23..65fd2d5b 100644 --- a/src/se/leap/bitmaskclient/Dashboard.java +++ b/src/se/leap/bitmaskclient/Dashboard.java @@ -110,7 +110,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf updateEIP.setAction(EIP.ACTION_UPDATE_EIP_SERVICE); startService(updateEIP); buildDashboard(); - + invalidateOptionsMenu(); if(data != null && data.hasExtra(LogInDialog.VERB)) { View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0); logInDialog(view, Bundle.EMPTY); -- cgit v1.2.3 From 718e4195d175ce4a7f0b5e5e1c3c14d8ccb237c4 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Mon, 3 Mar 2014 14:29:02 -0800 Subject: Remove crowdin.net references --- src/se/leap/bitmaskclient/AboutActivity.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/AboutActivity.java b/src/se/leap/bitmaskclient/AboutActivity.java index a3320c81..6d025422 100644 --- a/src/se/leap/bitmaskclient/AboutActivity.java +++ b/src/se/leap/bitmaskclient/AboutActivity.java @@ -18,7 +18,7 @@ public class AboutActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + super.onCreate(savedInstanceState); setContentView(R.layout.about); TextView ver = (TextView) findViewById(R.id.version); @@ -34,15 +34,7 @@ public class AboutActivity extends Activity { ver.setText(getString(R.string.version_info,name,version)); - - TextView translation = (TextView) findViewById(R.id.translation); - - // Don't print a text for myself - if ( getString(R.string.translationby).contains("Arne Schwabe")) - translation.setVisibility(TextView.INVISIBLE); - else - translation.setText(R.string.translationby); - setResult(VIEWED); + setResult(VIEWED); } } -- cgit v1.2.3 From 2601c824c0a8429326f3fb64533c6ecc56438a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 13 Mar 2014 21:09:42 +0100 Subject: Token correctly sent in the http request. --- src/se/leap/bitmaskclient/LeapSRPSession.java | 3 ++- src/se/leap/bitmaskclient/ProviderAPI.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/se') diff --git a/src/se/leap/bitmaskclient/LeapSRPSession.java b/src/se/leap/bitmaskclient/LeapSRPSession.java index 0849f777..a317d95e 100644 --- a/src/se/leap/bitmaskclient/LeapSRPSession.java +++ b/src/se/leap/bitmaskclient/LeapSRPSession.java @@ -41,7 +41,8 @@ public class LeapSRPSession { final public static String M1 = "M1"; final public static String M2 = "M2"; final public static String TOKEN = "token"; - + final public static String AUTHORIZATION_HEADER= "Authorization"; + private SRPParameters params; private String username; private String password; diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java index 62d86455..7aafa2e3 100644 --- a/src/se/leap/bitmaskclient/ProviderAPI.java +++ b/src/se/leap/bitmaskclient/ProviderAPI.java @@ -601,7 +601,7 @@ public class ProviderAPI extends IntentService { URLConnection url_connection = provider_url.openConnection(); url_connection.setConnectTimeout(seconds_of_timeout*1000); if(!LeapSRPSession.getToken().isEmpty()) - url_connection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken()); + url_connection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token = " + LeapSRPSession.getToken()); json_file_content = new Scanner(url_connection.getInputStream()).useDelimiter("\\A").next(); } catch (MalformedURLException e) { json_file_content = formatErrorMessage(R.string.malformed_url); @@ -638,7 +638,7 @@ public class ProviderAPI extends IntentService { (HttpsURLConnection)url.openConnection(); urlConnection.setSSLSocketFactory(getProviderSSLSocketFactory()); if(!LeapSRPSession.getToken().isEmpty()) - urlConnection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken()); + urlConnection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token=" + LeapSRPSession.getToken()); json_file_content = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); } catch (CertificateException e) { // TODO Auto-generated catch block -- cgit v1.2.3