Prepare for EMF 2022 and MCH 2022

This commit is contained in:
Wilco Baan Hofman 2022-05-24 14:20:50 +02:00
parent fb248d405c
commit 6baf5196f7
9 changed files with 80 additions and 51 deletions

View file

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -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" />
<TextView
android:layout_width="wrap_content"
@ -84,7 +84,6 @@
android:inputType="textEmailAddress"
android:padding="5dp"
>
<requestFocus />
</EditText>
<EditText

Binary file not shown.

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="profiles_array">
<item>Enable me - no filters = full inbound/outbound</item>
<item>Enable me on-site = outbound only, inbound from event</item>
<item>Enable me - no filters = full inbound/outbound</item>
<item>Protect me = outbound traffic only</item>
<item>I am special = custom username/password</item>
</string-array>

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">36C3 Wifi Setup</string>
<string name="app_name">EMF/MCH 2022 Wifi Setup</string>
<string name="TITLE_LOGON">Please logon</string>
<string name="Username">username@realm</string>
<string name="Password">password</string>
<string name="Logon">Create connection entry</string>
<string name="twitter">https://twitter.com/c3noc</string>
<string name="twitter">https://twitter.com/emfnoc\nhttps://twitter.com/mch2022noc</string>
<string name="c5ghz">This device supports the 5GHz band</string>
<string name="l5ghz">(Unfortunately, autodetecting 5GHz support is broken&#8230;)</string>
@ -18,6 +18,6 @@
<string name="ABOUT_TITLE">About</string>
<string name="EXIT_TITLE">Exit</string>
<string name="ABOUT_CONTENT">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.</string>
<string name="LOGO">36c3 Logo</string>
<string name="ABOUT_CONTENT">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.</string>
<string name="LOGO">EMF / MCH 2022 Logos</string>
</resources>