diff --git a/app/src/main/java/nl/eventinfra/wifisetup/WifiSetup.java b/app/src/main/java/nl/eventinfra/wifisetup/WifiSetup.java index e2cac4d..5899ba7 100644 --- a/app/src/main/java/nl/eventinfra/wifisetup/WifiSetup.java +++ b/app/src/main/java/nl/eventinfra/wifisetup/WifiSetup.java @@ -137,6 +137,7 @@ public class WifiSetup extends Activity { username = (EditText) findViewById(R.id.username); password = (EditText) findViewById(R.id.password); + check5g = (CheckBox) findViewById(R.id.check5g); check5g.setChecked(true); /* @@ -158,14 +159,15 @@ public class WifiSetup extends Activity { View logindata = findViewById(R.id.logindata);; logindata.setVisibility(View.INVISIBLE); switch((int) id) { - case 0: + case 0: + selected_profile = Profile.PROFILE_SITEONLY; + toastText("You trust people on-site more than the internet! Thank you!"); + break; + case 1: selected_profile = Profile.PROFILE_UNFILTERED; toastText("Don't filter me!"); break; - case 1: - selected_profile = Profile.PROFILE_SITEONLY; - toastText("You trust people on-site more than the internet! Thank you!"); - break; + case 2: selected_profile = Profile.PROFILE_PROTECTME; toastText("You don't trust anyone? Or maybe not your device?"); @@ -240,6 +242,71 @@ public class WifiSetup extends Activity { } private void saveWifiConfig() { + + + subject_match = "/CN=radius.emf.camp"; + altsubject_match = "DNS:radius.emf.camp"; + + realm = ""; + switch (selected_profile) { + case PROFILE_UNFILTERED: + s_username = "allowany"; + s_password = "allowany"; + break; + case PROFILE_SITEONLY: + s_username = "emf"; + s_password = "emf"; + break; + case PROFILE_PROTECTME: + s_username = "outboundonly"; + s_password = "outboundonly"; + break; + case PROFILE_SPECIAL: + s_username = username.getText().toString(); + s_password = password.getText().toString(); + if (s_username.contains("@")) { + int idx = s_username.indexOf("@"); + realm = s_username.substring(idx); + } + break; + } + StoreWifiProfile(ssid, subject_match, altsubject_match, s_username, s_password); + + // MCH2022 + if (check5g.isChecked()) { + ssid = "MCH2022"; + } else { + ssid = "MCH2022-legacy"; + } + subject_match = "/CN=radius.mch2022.nl"; + altsubject_match = "DNS:radius.mch2022.nl"; + + realm = ""; + switch (selected_profile) { + case PROFILE_UNFILTERED: + s_username = "allowany"; + s_password = "allowany"; + break; + case PROFILE_SITEONLY: + s_username = "mch2022"; + s_password = "mch2022"; + break; + case PROFILE_PROTECTME: + s_username = "outboundonly"; + s_password = "outboundonly"; + break; + case PROFILE_SPECIAL: + s_username = username.getText().toString(); + s_password = password.getText().toString(); + if (s_username.contains("@")) { + int idx = s_username.indexOf("@"); + realm = s_username.substring(idx); + } + break; + } + StoreWifiProfile(ssid, subject_match, altsubject_match, s_username, s_password); + } + void StoreWifiProfile(String ssid, String subject_match, String altsubject_match, String s_username, String s_password) { WifiManager wifiManager = (WifiManager) this.getApplicationContext().getSystemService(WIFI_SERVICE); if (wifiManager == null) { return; @@ -253,46 +320,10 @@ public class WifiSetup extends Activity { configs = wifiManager.getConfiguredNetworks(); try { Thread.sleep(1); - } - catch(InterruptedException e) { + } catch (InterruptedException e) { // Do nothing ;-) } } - - if (check5g.isChecked()) { - ssid = "36C3"; - } else { - ssid = "36C3-legacy"; - } - subject_match = "/CN=radius.c3noc.net"; - altsubject_match = "DNS:radius.c3noc.net"; - - - realm = ""; - switch(selected_profile) { - case PROFILE_UNFILTERED: - s_username = "36C3"; - s_password = "36C3"; - break; - case PROFILE_SITEONLY: - s_username = "congressonly"; - s_password = "congressonly"; - break; - case PROFILE_PROTECTME: - s_username = "outboundonly"; - s_password = "outboundonly"; - break; - case PROFILE_SPECIAL: - s_username = username.getText().toString(); - s_password = password.getText().toString(); - if (s_username.contains("@")) { - int idx = s_username.indexOf("@"); - realm = s_username.substring(idx); - } - break; - } - - // Use the existing ssid profile if it exists. boolean ssidExists = false; if (configs != null) { @@ -304,7 +335,6 @@ public class WifiSetup extends Activity { } } } - currentConfig.SSID = surroundWithQuotes(ssid); currentConfig.hiddenSSID = false; currentConfig.priority = 40; diff --git a/app/src/main/res/drawable-hdpi/emfmch2022.png b/app/src/main/res/drawable-hdpi/emfmch2022.png new file mode 100644 index 0000000..60e3bac Binary files /dev/null and b/app/src/main/res/drawable-hdpi/emfmch2022.png differ diff --git a/app/src/main/res/drawable-hdpi/icon.png b/app/src/main/res/drawable-hdpi/icon.png index 8a12ea0..c27b39e 100644 Binary files a/app/src/main/res/drawable-hdpi/icon.png and b/app/src/main/res/drawable-hdpi/icon.png differ diff --git a/app/src/main/res/drawable-ldpi/icon.png b/app/src/main/res/drawable-ldpi/icon.png index 6739f9a..7c32aa1 100644 Binary files a/app/src/main/res/drawable-ldpi/icon.png and b/app/src/main/res/drawable-ldpi/icon.png differ diff --git a/app/src/main/res/drawable-mdpi/icon.png b/app/src/main/res/drawable-mdpi/icon.png index 6739f9a..2a22bb3 100644 Binary files a/app/src/main/res/drawable-mdpi/icon.png and b/app/src/main/res/drawable-mdpi/icon.png differ diff --git a/app/src/main/res/layout/logon.xml b/app/src/main/res/layout/logon.xml index d7b0b37..092c4e6 100644 --- a/app/src/main/res/layout/logon.xml +++ b/app/src/main/res/layout/logon.xml @@ -24,10 +24,10 @@ android:id="@+id/logo" android:layout_width="fill_parent" android:layout_height="200dp" - android:contentDescription="@string/LOGO" + android:contentDescription="EMF logo" android:padding="0dp" android:scaleType="fitCenter" - android:src="@drawable/ccc36c3" /> + android:src="@drawable/emfmch2022" /> - - Enable me - no filters = full inbound/outbound Enable me on-site = outbound only, inbound from event + Enable me - no filters = full inbound/outbound Protect me = outbound traffic only I am special = custom username/password diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eff5202..ff63c6c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,13 +1,13 @@ - 36C3 Wifi Setup + EMF/MCH 2022 Wifi Setup Please logon username@realm password Create connection entry - https://twitter.com/c3noc + https://twitter.com/emfnoc\nhttps://twitter.com/mch2022noc This device supports the 5GHz band (Unfortunately, autodetecting 5GHz support is broken…) @@ -18,6 +18,6 @@ About Exit - This small helper app creates a Wifi connection entry for the CCC/EMF/SHA2017 networks. It configures the correct SSL CA and subject name match, making it a little more secure than a hand-created entry. - 36c3 Logo + This small helper app creates a Wifi connection entry for the CCC/EMF/MCH2022 networks. It configures the correct SSL CA and subject name match, making it a little more secure than a hand-created entry. + EMF / MCH 2022 Logos