aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFil <fil.bergamo@riseup.net>2017-03-11 20:52:13 +0100
committerFil <fil.bergamo@riseup.net>2017-03-11 20:52:13 +0100
commit5b71fe514e7650b392a01cc2c4398a68062b32cb (patch)
treed783c50a29c883b906fdc8065a64c6a4478eee2b
parent0c66ca923b51037ac15658989e1bc687b6aaf501 (diff)
downloadRepWifiApp-5b71fe514e7650b392a01cc2c4398a68062b32cb.zip
RepWifiApp-5b71fe514e7650b392a01cc2c4398a68062b32cb.tar.gz
RepWifiApp-5b71fe514e7650b392a01cc2c4398a68062b32cb.tar.bz2
Fix broken compilation from last commit
-rw-r--r--app/AndroidManifest.xml28
-rw-r--r--app/gen/fil/libre/repwifiapp/R.java172
-rw-r--r--app/ic_launcher-web.pngbin0 -> 41793 bytes
-rw-r--r--app/res/menu/activity_main.xml6
-rw-r--r--app/res/values/array.xml16
-rw-r--r--app/res/values/strings.xml10
-rw-r--r--app/res/values/strings_activity_settings.xml57
-rw-r--r--app/res/xml/settings.xml12
-rw-r--r--app/res/xml/settings_headers.xml11
-rw-r--r--app/src/fil/libre/repwifiapp/Commons.java15
-rw-r--r--app/src/fil/libre/repwifiapp/activities/InputPasswordActivity.java11
-rw-r--r--app/src/fil/libre/repwifiapp/activities/LongTaskActivity.java5
-rw-r--r--app/src/fil/libre/repwifiapp/activities/MainActivity.java7
-rw-r--r--app/src/fil/libre/repwifiapp/activities/NetworkDetailsActivity.java6
-rw-r--r--app/src/fil/libre/repwifiapp/activities/SelectNetworkActivity.java7
-rw-r--r--app/src/fil/libre/repwifiapp/helpers/Utils.java22
16 files changed, 269 insertions, 116 deletions
diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml
index ba324d2..908cdc5 100644
--- a/app/AndroidManifest.xml
+++ b/app/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fil.libre.repwifiapp"
- android:versionCode="0"
- android:versionName="0.0.9" >
+ android:versionCode="1"
+ android:versionName="0.0.9(1)" >
<uses-sdk
android:minSdkVersion="17"
@@ -13,14 +13,14 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
+ android:allowBackup="true"
android:icon="@drawable/ic_launcher_bis"
android:label="@string/app_name"
- android:theme="@style/AppTheme"
- android:allowBackup="true" >
+ android:theme="@style/AppTheme" >
<activity
android:name="fil.libre.repwifiapp.activities.MainActivity"
- android:screenOrientation="portrait"
- android:label="@string/app_name" >
+ android:label="@string/app_name"
+ android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -32,7 +32,8 @@
android:label="@string/title_activity_select_network" >
</activity>
<activity
- android:name="fil.libre.repwifiapp.activities.InputPasswordActivity" android:label="@string/title_activity_input_password"
+ android:name="fil.libre.repwifiapp.activities.InputPasswordActivity"
+ android:label="@string/title_activity_input_password"
android:windowSoftInputMode="adjustResize|stateVisible" >
</activity>
<activity
@@ -40,17 +41,18 @@
android:label="@string/title_activity_connect" >
</activity>
<activity
- android:name="fil.libre.repwifiapp.activities.ShowStatusActivity"
+ android:name="fil.libre.repwifiapp.activities.ShowStatusActivity"
android:label="@string/title_activity_show_status" >
</activity>
- <activity
- android:name="fil.libre.repwifiapp.activities.LongTaskActivity" >
+ <activity android:name="fil.libre.repwifiapp.activities.LongTaskActivity" >
</activity>
- <activity
- android:name="fil.libre.repwifiapp.activities.NetworkDetailsActivity" >
+ <activity android:name="fil.libre.repwifiapp.activities.NetworkDetailsActivity" >
+ </activity>
+ <activity android:name="fil.libre.repwifiapp.activities.CreditsActivity" >
</activity>
<activity
- android:name="fil.libre.repwifiapp.activities.CreditsActivity">
+ android:name="fil.libre.repwifiapp.activities.SettingsActivity"
+ android:label="@string/title_activity_settings" >
</activity>
</application>
diff --git a/app/gen/fil/libre/repwifiapp/R.java b/app/gen/fil/libre/repwifiapp/R.java
index e145272..be4d006 100644
--- a/app/gen/fil/libre/repwifiapp/R.java
+++ b/app/gen/fil/libre/repwifiapp/R.java
@@ -8,13 +8,21 @@
package fil.libre.repwifiapp;
public final class R {
+ public static final class array {
+ public static final int debug_priority=0x7f050001;
+ public static final int debug_priority_names=0x7f050000;
+ public static final int pref_example_list_titles=0x7f050002;
+ public static final int pref_example_list_values=0x7f050003;
+ public static final int pref_sync_frequency_titles=0x7f050004;
+ public static final int pref_sync_frequency_values=0x7f050005;
+ }
public static final class attr {
}
public static final class color {
- public static final int ThemeDark=0x7f040001;
- public static final int ThemeLight=0x7f040000;
- public static final int White=0x7f040003;
- public static final int black=0x7f040002;
+ public static final int ThemeDark=0x7f060001;
+ public static final int ThemeLight=0x7f060000;
+ public static final int White=0x7f060003;
+ public static final int black=0x7f060002;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
@@ -23,31 +31,33 @@ public final class R {
public static final int ic_launcher_tris=0x7f020003;
}
public static final class id {
- public static final int btn_back=0x7f080017;
- public static final int btn_delete=0x7f08000f;
- public static final int btn_disconnect=0x7f080016;
- public static final int btn_manage_nets=0x7f08000b;
- public static final int btn_rescan=0x7f080012;
- public static final int btn_scan=0x7f08000a;
- public static final int chk_show_pass=0x7f080004;
- public static final int chk_show_pass_details=0x7f08000e;
- public static final int img_logo=0x7f08000c;
- public static final int layout=0x7f080006;
- public static final int layout_selnets=0x7f080010;
- public static final int login_form=0x7f080001;
- public static final int menu_credits=0x7f080018;
- public static final int progbar=0x7f080007;
- public static final int scrollview=0x7f080013;
- public static final int sign_in_button=0x7f080005;
- public static final int table_networks=0x7f080014;
- public static final int txt_credits=0x7f080000;
- public static final int txt_insert_pass=0x7f080002;
- public static final int txt_main=0x7f080009;
- public static final int txt_msg=0x7f080008;
- public static final int txt_net_details=0x7f08000d;
- public static final int txt_password=0x7f080003;
- public static final int txt_selnets=0x7f080011;
- public static final int txt_status=0x7f080015;
+ public static final int btn_back=0x7f0a0017;
+ public static final int btn_delete=0x7f0a000f;
+ public static final int btn_disconnect=0x7f0a0016;
+ public static final int btn_manage_nets=0x7f0a000b;
+ public static final int btn_rescan=0x7f0a0012;
+ public static final int btn_scan=0x7f0a000a;
+ public static final int chk_show_pass=0x7f0a0004;
+ public static final int chk_show_pass_details=0x7f0a000e;
+ public static final int img_logo=0x7f0a000c;
+ public static final int layout=0x7f0a0006;
+ public static final int layout_selnets=0x7f0a0010;
+ public static final int login_form=0x7f0a0001;
+ public static final int menu_config=0x7f0a001a;
+ public static final int menu_credits=0x7f0a0019;
+ public static final int pref_debug_prio=0x7f0a0018;
+ public static final int progbar=0x7f0a0007;
+ public static final int scrollview=0x7f0a0013;
+ public static final int sign_in_button=0x7f0a0005;
+ public static final int table_networks=0x7f0a0014;
+ public static final int txt_credits=0x7f0a0000;
+ public static final int txt_insert_pass=0x7f0a0002;
+ public static final int txt_main=0x7f0a0009;
+ public static final int txt_msg=0x7f0a0008;
+ public static final int txt_net_details=0x7f0a000d;
+ public static final int txt_password=0x7f0a0003;
+ public static final int txt_selnets=0x7f0a0011;
+ public static final int txt_status=0x7f0a0015;
}
public static final class layout {
public static final int activity_credits=0x7f030000;
@@ -59,42 +69,72 @@ public final class R {
public static final int activity_show_status=0x7f030006;
}
public static final class menu {
- public static final int activity_main=0x7f070000;
+ public static final int activity_main=0x7f090000;
}
public static final class string {
- public static final int action_sign_in_register=0x7f050017;
- public static final int action_sign_in_short=0x7f050018;
- public static final int app_name=0x7f050000;
- public static final int back_main=0x7f05000b;
- public static final int button_text_next=0x7f050005;
- public static final int credit_text=0x7f050013;
- public static final int delete=0x7f050010;
- public static final int disconnect=0x7f05000c;
- public static final int error_field_required=0x7f05001e;
- public static final int error_incorrect_password=0x7f05001d;
- public static final int error_invalid_email=0x7f05001b;
- public static final int error_invalid_password=0x7f05001c;
- public static final int force_disconnect=0x7f05000d;
- public static final int hello_world=0x7f050009;
- public static final int insert_nets_password=0x7f050006;
- public static final int login_progress_signing_in=0x7f05001a;
- public static final int manage_networks=0x7f050011;
- public static final int menu_credits=0x7f050001;
- public static final int menu_forgot_password=0x7f050019;
+ public static final int action_sign_in_register=0x7f07001f;
+ public static final int action_sign_in_short=0x7f070020;
+ public static final int app_name=0x7f070000;
+ public static final int back_main=0x7f07000b;
+ public static final int button_text_next=0x7f070005;
+ public static final int credit_text=0x7f070013;
+ public static final int delete=0x7f070010;
+ public static final int disconnect=0x7f07000c;
+ public static final int error_field_required=0x7f070026;
+ public static final int error_incorrect_password=0x7f070025;
+ public static final int error_invalid_email=0x7f070023;
+ public static final int error_invalid_password=0x7f070024;
+ public static final int force_disconnect=0x7f07000d;
+ public static final int hello_world=0x7f070009;
+ public static final int insert_nets_password=0x7f070006;
+ public static final int login_progress_signing_in=0x7f070022;
+ public static final int manage_networks=0x7f070011;
+ public static final int menu_config=0x7f070014;
+ public static final int menu_credits=0x7f070001;
+ public static final int menu_forgot_password=0x7f070021;
+ public static final int msg_confirm_delete_network=0x7f070016;
+ public static final int msg_interface_not_found=0x7f070015;
+ public static final int msg_root_denied=0x7f07001b;
+ public static final int msg_root_disabled=0x7f07001a;
+ public static final int no=0x7f070018;
+ public static final int pref_default_display_name=0x7f07002c;
+ public static final int pref_description_social_recommendations=0x7f07002a;
+ /** Example settings for Data & Sync
+ */
+ public static final int pref_header_data_sync=0x7f07002e;
+ /** Strings related to Settings
+ Example General settings
+ */
+ public static final int pref_header_general=0x7f070028;
+ /** Example settings for Notifications
+ */
+ public static final int pref_header_notifications=0x7f070031;
+ public static final int pref_ringtone_silent=0x7f070034;
+ public static final int pref_title_add_friends_to_messages=0x7f07002d;
+ public static final int pref_title_display_name=0x7f07002b;
+ public static final int pref_title_new_message_notifications=0x7f070032;
+ public static final int pref_title_ringtone=0x7f070033;
+ public static final int pref_title_social_recommendations=0x7f070029;
+ public static final int pref_title_sync_frequency=0x7f07002f;
+ public static final int pref_title_system_sync_settings=0x7f070030;
+ public static final int pref_title_vibrate=0x7f070035;
/** Strings related to login
*/
- public static final int prompt_email=0x7f050015;
- public static final int prompt_password=0x7f050016;
- public static final int rescan=0x7f050004;
- public static final int scan_networks=0x7f050002;
- public static final int show_password=0x7f050007;
- public static final int title_activity_connect=0x7f050008;
- public static final int title_activity_credits=0x7f050012;
- public static final int title_activity_input_password=0x7f050014;
- public static final int title_activity_long_task=0x7f05000e;
- public static final int title_activity_manage_networks=0x7f05000f;
- public static final int title_activity_select_network=0x7f050003;
- public static final int title_activity_show_status=0x7f05000a;
+ public static final int prompt_email=0x7f07001d;
+ public static final int prompt_password=0x7f07001e;
+ public static final int rescan=0x7f070004;
+ public static final int retry=0x7f070019;
+ public static final int scan_networks=0x7f070002;
+ public static final int show_password=0x7f070007;
+ public static final int title_activity_connect=0x7f070008;
+ public static final int title_activity_credits=0x7f070012;
+ public static final int title_activity_input_password=0x7f07001c;
+ public static final int title_activity_long_task=0x7f07000e;
+ public static final int title_activity_manage_networks=0x7f07000f;
+ public static final int title_activity_select_network=0x7f070003;
+ public static final int title_activity_settings=0x7f070027;
+ public static final int title_activity_show_status=0x7f07000a;
+ public static final int yes=0x7f070017;
}
public static final class style {
/**
@@ -118,11 +158,15 @@ public final class R {
API 14 theme customizations can go here.
*/
- public static final int AppBaseTheme=0x7f060000;
+ public static final int AppBaseTheme=0x7f080000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
- public static final int AppTheme=0x7f060001;
- public static final int LoginFormContainer=0x7f060002;
+ public static final int AppTheme=0x7f080001;
+ public static final int LoginFormContainer=0x7f080002;
+ }
+ public static final class xml {
+ public static final int settings=0x7f040000;
+ public static final int settings_headers=0x7f040001;
}
}
diff --git a/app/ic_launcher-web.png b/app/ic_launcher-web.png
new file mode 100644
index 0000000..df56b4e
--- /dev/null
+++ b/app/ic_launcher-web.png
Binary files differ
diff --git a/app/res/menu/activity_main.xml b/app/res/menu/activity_main.xml
index cd7c0cb..7855b0d 100644
--- a/app/res/menu/activity_main.xml
+++ b/app/res/menu/activity_main.xml
@@ -5,5 +5,11 @@
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_credits" />
+
+ <item
+ android:id="@+id/menu_config"
+ android:orderInCategory="100"
+ android:showAsAction="never"
+ android:title="@string/menu_config" />
</menu> \ No newline at end of file
diff --git a/app/res/values/array.xml b/app/res/values/array.xml
new file mode 100644
index 0000000..ac6da05
--- /dev/null
+++ b/app/res/values/array.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string-array name="debug_priority_names">
+ <item >Log everything</item>
+ <item >Log medium priority events</item>
+ <item >Log high priority events only</item>
+ <item >Logging disabled</item>
+ </string-array>
+ <string-array name="debug_priority">
+ <item >0</item>
+ <item >1</item>
+ <item >2</item>
+ <item >3</item>
+ </string-array>
+
+</resources> \ No newline at end of file
diff --git a/app/res/values/strings.xml b/app/res/values/strings.xml
index 00168b5..0771c3e 100644
--- a/app/res/values/strings.xml
+++ b/app/res/values/strings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">RepWifi App</string>
+ <string name="app_name">RepWifi</string>
<string name="menu_credits">Info and Credits</string>
<string name="scan_networks">Scan for Networks</string>
<string name="title_activity_select_network">Select Network</string>
@@ -21,5 +21,13 @@
<string name="manage_networks">Manage Networks</string>
<string name="title_activity_credits">Credits</string>
<string name="credit_text">Copyright 2017 Filippo \&quot;Fil\&quot; Bergamo&lt;br/&gt;&lt;br/&gt;This app is Free Software.&lt;br/&gt;It\'s licensed under the terms of &lt;a href=&quot;https://www.gnu.org/licenses/gpl.txt&quot;&gt;GPL v3&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;This app is developed as a contribution to &lt;br/&gt;&lt;a href=&quot;http://www.replicant.us&quot;&gt;The Replicant Project&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;&lt;u&gt;&lt;big&gt;Thank GNUs:&lt;/big&gt;&lt;/u&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Tibi \&quot;tct\&quot; Turbureanu&lt;/b&gt;&lt;br/&gt;for having done the initial job of porting libre WiFi to Replicant 4.2.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Wolfgang Wiedmeyer&lt;/b&gt;&lt;br/&gt;for porting libre WiFi to Replicant 6.0 and for helping with the scripts.&lt;br/&gt;&lt;br/&gt;To report on bugs, request features, or any help request, please refer to:&lt;br/&gt;&lt;a href=&quot;http://redmine.replicant.us/projects/replicant/boards&quot;&gt;Replicant\'s Forum&lt;/a&gt;&lt;br/&gt;</string>
+ <string name="menu_config">Settings</string>
+ <string name="msg_interface_not_found">External WiFi adapter not found!\nPlease plug in a supported WiFi adapter and retry.</string>
+ <string name="msg_confirm_delete_network">Are you sure you want to delete this network?</string>
+ <string name="yes">Yes</string>
+ <string name="no">No</string>
+ <string name="retry">Retry</string>
+ <string name="msg_root_disabled">Root access is disabled.\n\nSeems like root access is disabled on this device.\nRepWifi needs root access in order to work.\nPlease, enable root access for applications in:\nSettings > Developer options > Root access > "Apps only"\nWhen done so, restart RepWifi and grant the permission to use root, if asked.</string>
+ <string name="msg_root_denied">Root access denied.\nSeems like you denied root access to RepWifi.\nRepWifi needs root access in order to work.\nPlease, restart the application, and grant RepWifi the permission to use root, when asked.</string>
</resources> \ No newline at end of file
diff --git a/app/res/values/strings_activity_settings.xml b/app/res/values/strings_activity_settings.xml
new file mode 100644
index 0000000..d7bab93
--- /dev/null
+++ b/app/res/values/strings_activity_settings.xml
@@ -0,0 +1,57 @@
+<resources>
+
+ <string name="title_activity_settings">Settings</string>
+
+ <!-- Strings related to Settings -->
+
+
+ <!-- Example General settings -->
+ <string name="pref_header_general">General</string>
+ <string name="pref_title_social_recommendations">Enable social recommendations</string>
+ <string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>
+ <string name="pref_title_display_name">Display name</string>
+ <string name="pref_default_display_name">John Smith</string>
+ <string name="pref_title_add_friends_to_messages">Add friends to messages</string>
+
+ <string-array name="pref_example_list_titles">
+ <item>Always</item>
+ <item>When possible</item>
+ <item>Never</item>
+ </string-array>
+ <string-array name="pref_example_list_values">
+ <item>1</item>
+ <item>0</item>
+ <item>-1</item>
+ </string-array>
+
+ <!-- Example settings for Data & Sync -->
+ <string name="pref_header_data_sync">Data &amp; sync</string>
+ <string name="pref_title_sync_frequency">Sync frequency</string>
+
+ <string-array name="pref_sync_frequency_titles">
+ <item>15 minutes</item>
+ <item>30 minutes</item>
+ <item>1 hour</item>
+ <item>3 hours</item>
+ <item>6 hours</item>
+ <item>Never</item>
+ </string-array>
+ <string-array name="pref_sync_frequency_values">
+ <item>15</item>
+ <item>30</item>
+ <item>60</item>
+ <item>180</item>
+ <item>360</item>
+ <item>-1</item>
+ </string-array>
+
+ <string name="pref_title_system_sync_settings">System sync settings</string>
+
+ <!-- Example settings for Notifications -->
+ <string name="pref_header_notifications">Notifications</string>
+ <string name="pref_title_new_message_notifications">New message notifications</string>
+ <string name="pref_title_ringtone">Ringtone</string>
+ <string name="pref_ringtone_silent">Silent</string>
+ <string name="pref_title_vibrate">Vibrate</string>
+
+</resources> \ No newline at end of file
diff --git a/app/res/xml/settings.xml b/app/res/xml/settings.xml
new file mode 100644
index 0000000..f53f00f
--- /dev/null
+++ b/app/res/xml/settings.xml
@@ -0,0 +1,12 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <ListPreference
+ android:key="debug_priority"
+ android:title="Log priority"
+ android:id="@+id/pref_debug_prio"
+ android:entries="@array/debug_priority_names"
+ android:entryValues="@array/debug_priority"
+ android:defaultValue="3" />
+
+
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/res/xml/settings_headers.xml b/app/res/xml/settings_headers.xml
new file mode 100644
index 0000000..d2212da
--- /dev/null
+++ b/app/res/xml/settings_headers.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<preference-headers
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <header
+ android:fragment="fil.libre.repwifiapp.activities.SettingsActivity$RepWifiFragment"
+ android:title="Debug"
+ android:summary="set debugging variables" />
+
+</preference-headers> \ No newline at end of file
diff --git a/app/src/fil/libre/repwifiapp/Commons.java b/app/src/fil/libre/repwifiapp/Commons.java
index 202e67f..f938310 100644
--- a/app/src/fil/libre/repwifiapp/Commons.java
+++ b/app/src/fil/libre/repwifiapp/Commons.java
@@ -75,7 +75,9 @@ public abstract class Commons {
}
public static SharedPreferences getSettings(){
+
return PreferenceManager.getDefaultSharedPreferences(currentContext);
+
}
//----------------------------------------------------
@@ -90,6 +92,7 @@ public abstract class Commons {
public static final String EXTRA_DELETE = "ExDelete";
public class RequestCode{
+
public static final int NONE = 0;
public static final int SELECT_CONN = 1;
public static final int PASS_INPUT = 2;
@@ -100,6 +103,7 @@ public abstract class Commons {
public static final int SELECT_DETAILS = 7;
public static final int DETAILS_SHOW = 8;
public static final int NETWORK_DELETE = 9;
+
}
//----------------------------------------------------
@@ -114,24 +118,31 @@ public abstract class Commons {
return APP_DATA_FOLDER + "/repwifi_storage.conf";
}
}
+
public static String getScriptScan(){
return APP_DATA_FOLDER + "/scan.sh";
- }
+ }
+
public static String getScriptScanRes(){
return APP_DATA_FOLDER + "/get_scan_results.sh";
}
+
public static String getScriptDhcpcd(){
return APP_DATA_FOLDER + "/run_dhcpcd.sh";
}
+
public static String getScanFile(){
return APP_DATA_FOLDER + "/scanres.txt";
}
+
public static String getStatusFile(){
return APP_DATA_FOLDER + "/tmpStatus";
}
+
public static String getGwFile(){
return APP_DATA_FOLDER + "/gw.txt";
}
+
public static String getTempOutFile(){
return APP_DATA_FOLDER + "/tmpout.txt";
}
@@ -144,7 +155,6 @@ public abstract class Commons {
currentContext = context;
try {
-
colorThemeDark = currentContext.getResources().getColor(R.color.ThemeDark);
colorThemeLight = currentContext.getResources().getColor(R.color.ThemeLight);
@@ -153,7 +163,6 @@ public abstract class Commons {
initEngine();
initNetworkStorage();
-
return true;
diff --git a/app/src/fil/libre/repwifiapp/activities/InputPasswordActivity.java b/app/src/fil/libre/repwifiapp/activities/InputPasswordActivity.java
index e46d7d9..239c082 100644
--- a/app/src/fil/libre/repwifiapp/activities/InputPasswordActivity.java
+++ b/app/src/fil/libre/repwifiapp/activities/InputPasswordActivity.java
@@ -63,8 +63,7 @@ public class InputPasswordActivity extends Activity implements OnCheckedChangeLi
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- //super.onCreateOptionsMenu(menu);
- //getMenuInflater().inflate(R.menu.activity_input_password, menu);
+ //disable menu
return true;
}
@@ -74,12 +73,14 @@ public class InputPasswordActivity extends Activity implements OnCheckedChangeLi
if(buttonView == findViewById(R.id.chk_show_pass)){
chkShowPassChanged();
}
+
}
public void onBtnNextClick(View v){
EditText txpass = (EditText)findViewById(R.id.txt_password);
String pass = txpass.getText().toString();
+
if (pass.length()>0){
this.apinfo.setPassword(pass);
@@ -87,11 +88,11 @@ public class InputPasswordActivity extends Activity implements OnCheckedChangeLi
Intent intent = new Intent();
intent.putExtra(Commons.EXTRA_APINFO, this.apinfo);
setResult(RESULT_OK, intent);
+
finish();
}
-
-
+
}
public void chkShowPassChanged(){
@@ -102,9 +103,11 @@ public class InputPasswordActivity extends Activity implements OnCheckedChangeLi
if (c.isChecked()){
txtPass.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
txtPass.setSelection(txtPass.getText().length());
+
}else{
txtPass.setInputType(129);
txtPass.setSelection(txtPass.getText().length());
+
}
}
diff --git a/app/src/fil/libre/repwifiapp/activities/LongTaskActivity.java b/app/src/fil/libre/repwifiapp/activities/LongTaskActivity.java
index f9e7685..63063d8 100644
--- a/app/src/fil/libre/repwifiapp/activities/LongTaskActivity.java
+++ b/app/src/fil/libre/repwifiapp/activities/LongTaskActivity.java
@@ -96,7 +96,8 @@ public class LongTaskActivity extends Activity {
case Commons.RequestCode.CONNECT:
setTitle("Connecting...");
- setMessage("Connecting...");
+ setMessage("Connecting...");
+
//Extract AccessPointInfo
input = intent.getExtras().getSerializable(Commons.EXTRA_APINFO);
currentNetwork = (AccessPointInfo)input;
@@ -167,7 +168,7 @@ public class LongTaskActivity extends Activity {
@Override
public void onBackPressed() {
- //suppress
+ //suppress back button
}
diff --git a/app/src/fil/libre/repwifiapp/activities/MainActivity.java b/app/src/fil/libre/repwifiapp/activities/MainActivity.java
index abe7dc2..aa179fb 100644
--- a/app/src/fil/libre/repwifiapp/activities/MainActivity.java
+++ b/app/src/fil/libre/repwifiapp/activities/MainActivity.java
@@ -20,12 +20,7 @@
package fil.libre.repwifiapp.activities;
-
-
-
-
import java.io.IOException;
-
import fil.libre.repwifiapp.Commons;
import fil.libre.repwifiapp.R;
import fil.libre.repwifiapp.Commons.RequestCode;
@@ -34,9 +29,7 @@ import fil.libre.repwifiapp.helpers.ConnectionStatus;
import fil.libre.repwifiapp.helpers.NetworkManager;
import fil.libre.repwifiapp.helpers.RootCommand;
import fil.libre.repwifiapp.helpers.Utils;
-
import android.os.Bundle;
-import android.R.integer;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
diff --git a/app/src/fil/libre/repwifiapp/activities/NetworkDetailsActivity.java b/app/src/fil/libre/repwifiapp/activities/NetworkDetailsActivity.java
index f0aa26d..6d7ed56 100644
--- a/app/src/fil/libre/repwifiapp/activities/NetworkDetailsActivity.java
+++ b/app/src/fil/libre/repwifiapp/activities/NetworkDetailsActivity.java
@@ -86,6 +86,7 @@ public class NetworkDetailsActivity extends Activity implements OnCheckedChangeL
v.append("\nBSSID: " + this.currentNetwor.getBSSID());
long lastused = this.currentNetwor.getLastTimeUsed();
+
if (lastused > 0){
Date ts = new Date(lastused);
String formstring = "dd-MMM-yyyy kk:mm:ss";
@@ -94,7 +95,8 @@ public class NetworkDetailsActivity extends Activity implements OnCheckedChangeL
if (showPassword){
v.append("\n\nPassword:\n" + this.currentNetwor.getPassword());
- }else{
+ }
+ else{
v.append("\n\n\n");
}
@@ -117,7 +119,7 @@ public class NetworkDetailsActivity extends Activity implements OnCheckedChangeL
dlgAlert.setNegativeButton(no,new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
- //nothing
+ return;
}
});
diff --git a/app/src/fil/libre/repwifiapp/activities/SelectNetworkActivity.java b/app/src/fil/libre/repwifiapp/activities/SelectNetworkActivity.java
index 6731846..9b07246 100644
--- a/app/src/fil/libre/repwifiapp/activities/SelectNetworkActivity.java
+++ b/app/src/fil/libre/repwifiapp/activities/SelectNetworkActivity.java
@@ -20,15 +20,11 @@
package fil.libre.repwifiapp.activities;
-
-
-
import fil.libre.repwifiapp.Commons;
import fil.libre.repwifiapp.R;
import fil.libre.repwifiapp.helpers.AccessPointInfo;
import fil.libre.repwifiapp.helpers.NetworkButton;
import fil.libre.repwifiapp.helpers.Utils;
-
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
@@ -60,8 +56,7 @@ public class SelectNetworkActivity extends Activity implements OnClickListener {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- //getMenuInflater().inflate(R.menu.activity_select_network, menu);
+ //Suppress menu button
return true;
}
diff --git a/app/src/fil/libre/repwifiapp/helpers/Utils.java b/app/src/fil/libre/repwifiapp/helpers/Utils.java
index bb3c682..d30eb2e 100644
--- a/app/src/fil/libre/repwifiapp/helpers/Utils.java
+++ b/app/src/fil/libre/repwifiapp/helpers/Utils.java
@@ -27,21 +27,13 @@ import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
-
import fil.libre.repwifiapp.Commons;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.SharedPreferences;
import android.util.Log;
public class Utils {
private static final long MILLIS_IN_DAY = 86400000;
-
public static final String APP_NAME = "RepWifi";
private static Exception _lastException = null;
@@ -73,10 +65,10 @@ public class Utils {
public static boolean writeFile(String filePath, String text, boolean overwrite){
-
-
+
FileWriter writer = null;
boolean retval = false;
+
try {
writer = new FileWriter(filePath, (! overwrite));
@@ -94,7 +86,7 @@ public class Utils {
try {
writer.close();
} catch (IOException e) {
- //suppress
+ logError("error while closing filewriter",e);
}
}
@@ -112,6 +104,7 @@ public class Utils {
FileWriter writer = null;
boolean retval = false;
+
try {
writer = new FileWriter(filePath, (! overwrite));
@@ -136,7 +129,7 @@ public class Utils {
try {
writer.close();
} catch (IOException e) {
- //suppress
+ logError("error while closing filewriter",e);
}
}
@@ -169,6 +162,7 @@ public class Utils {
fr = new FileReader(filePath);
bufr = new BufferedReader(fr);
String line ="";
+
while((line = bufr.readLine()) != null){
lines.add(line);
}
@@ -186,14 +180,14 @@ public class Utils {
bufr.close();
}
} catch (IOException ex) {
- //suppress
+ logError("error while closing filereader",ex);
}
try {
if (fr != null){
fr.close();
}
}catch(IOException exc){
- //suppress
+ logError("error while closing filereader",exc);
}
}