diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 9cf534f..832c72b 100755 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="tf.nox.wifisetup" android:installLocation="auto" android:versionCode="20150809" android:versionName="0.17"> diff --git a/android/res/layout/logon.xml b/android/res/layout/logon.xml index 3075bdd..4d184a1 100755 --- a/android/res/layout/logon.xml +++ b/android/res/layout/logon.xml @@ -1,9 +1,16 @@ - + - + android:padding="20dp" /> + + + + + + + + + diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 3917ec2..233076a 100755 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -7,6 +7,8 @@ password Create connection entry + https://twitter.com/c3noc + This device supports the 5GHz band (Unfortunately, autodetecting 5GHz support is broken...) diff --git a/android/src/tf/nox/wifisetup/WifiSetup.java b/android/src/tf/nox/wifisetup/WifiSetup.java index 87f0b05..8df1c89 100755 --- a/android/src/tf/nox/wifisetup/WifiSetup.java +++ b/android/src/tf/nox/wifisetup/WifiSetup.java @@ -79,6 +79,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.CheckBox; +import android.widget.ViewFlipper; // API level 18 and up import android.net.wifi.WifiEnterpriseConfig; @@ -121,7 +122,7 @@ public class WifiSetup extends Activity { private int logoclicks = 0; private String s_username; private String s_password; - + private ViewFlipper flipper; private void toastText(final String text) { if (toast != null) @@ -146,6 +147,7 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.logon); + flipper = (ViewFlipper) findViewById(R.id.viewflipper); username = (EditText) findViewById(R.id.username); password = (EditText) findViewById(R.id.password); @@ -196,10 +198,9 @@ public void onClick(View _v) { @Override public void run() { try { - updateStatus("Installing WiFi profile..."); if (android.os.Build.VERSION.SDK_INT >= 18) { saveWifiConfig(); - updateStatus("All done!"); + resultStatus(true, "You should now have a wifi connection entry with correct security settings and certificate verification.\n\nMake sure to actually use it!"); // Clear the password field in the UI thread /* mHandler.post(new Runnable() { @@ -213,7 +214,7 @@ public void run() { throw new RuntimeException("What version is this?! API Mismatch"); } } catch (RuntimeException e) { - updateStatus("Runtime Error: " + e.getMessage()); + resultStatus(false, "Something went wrong: " + e.getMessage()); e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); @@ -396,15 +397,25 @@ public boolean onOptionsItemSelected(MenuItem item){ /* Update the status in the main thread */ - protected void updateStatus(final String text) { + protected void resultStatus(final boolean success, final String text) { mHandler.post(new Runnable() { @Override public void run() { + TextView res_title = (TextView) findViewById(R.id.resulttitle); + TextView res_text = (TextView) findViewById(R.id.result); + System.out.println(text); + res_text.setText(text); + if (success) + res_title.setText("Success!"); + else + res_title.setText("ERROR!"); + if (toast != null) toast.cancel(); - toast = Toast.makeText(getBaseContext(), text, Toast.LENGTH_LONG); - toast.show(); + /* toast = Toast.makeText(getBaseContext(), text, Toast.LENGTH_LONG); + toast.show(); */ + flipper.showNext(); }; }); }