Permalink
Browse files

version 1.1.6 changes & bugfixes

  • Loading branch information...
1 parent 9a0dbc4 commit edaa1cdde5074214c936e3e57b0e891a45af9567 @ukanth committed Dec 30, 2012
View
@@ -29,8 +29,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="dev.ukanth.ufirewall"
- android:versionCode="115"
- android:versionName="1.1.5" >
+ android:versionCode="116"
+ android:versionName="1.1.6" >
<!-- Android 2.2 up to 4.x -->
<uses-sdk
View
@@ -4,6 +4,14 @@ Changelog AFWall+
-------------
Download links are right here on the ["Downloads" front page](https://github.com/ukanth/afwall/downloads).
+Version 1.1.6
+* Back to Chainfire's SU library. More stable but little slower compare to RootTools. Performance will be improved going forward.
+ I'm planning to rewrite the entire code to make it faster and stable. But for now, it will be continue as it is.
+* Fixed issue with rules were not applied after system reboot for couple of devices.
+* Fixed issue with custom rules were broken completely.
+* Fixed issue with Notification icon size is huge.
+* Fixed Force Close of some devices when alert message is displayed.
+
Version 1.1.5
* New Busybox binary (atleast I feel little faster loading on logs ) compiled from latest busybox source . This is packed with handpicked additional and useful busybox commands which will be used in the future versions of AFWall+ to build more advance features ! Stay tuned
* Fixed issue with widget size 1x1 on newer devices
View
@@ -40,7 +40,7 @@ report any bugs or feature requests and to see the list of known issues.
This project also uses many other open source libraries such as:
* [ActionBarSherlock](https://github.com/JakeWharton/ActionBarSherlock) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [Unified Preferences] (https://github.com/saik0/UnifiedPreference/) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
-* [RootTools] (https://code.google.com/p/roottools/) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
+* [Libsuperuser] (https://github.com/Chainfire/libsuperuser) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [Android Color Picker](https://code.google.com/p/android-color-picker) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [Crouton](https://github.com/johnkil/Android-AppMsg) [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
View
@@ -22,6 +22,4 @@
</LinearLayout>
<ListView android:layout_width="wrap_content" android:fastScrollEnabled="true" android:layout_height="wrap_content" android:id="@+id/listview"></ListView>
- <ListView android:layout_width="wrap_content" android:fastScrollEnabled="true" android:layout_height="wrap_content" android:id="@+id/listview2"></ListView>
-
</LinearLayout>
@@ -27,7 +27,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">AFWall+</string>
- <string name="app_version">1.1.5</string>
+ <string name="app_version">1.1.6</string>
<string name="title_enabled">AFWall+ </string>
<string name="title_disabled">AFWall+ (Deaktiviert)</string>
<string name="whitelist_array_item">Whitelist(erlaube ausgewählte)</string>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AFWall+</string>
- <string name="app_version">1.1.5</string>
+ <string name="app_version">1.1.6</string>
<string name="title_enabled">AFWall+ </string>
<string name="title_disabled">AFWall+ (désactivé)</string>
<string name="whitelist_array_item">Liste blanche (sélection permise)</string>
@@ -17,7 +17,7 @@
<string name="abs__searchview_description_voice">Голосовой поиск</string>
<string name="ringtone_silent">Silent</string>
<string name="app_name">AFWall+</string>
- <string name="app_version">1.1.5</string>
+ <string name="app_version">1.1.6</string>
<string name="title_enabled">AFWall+</string>
<string name="title_disabled">AFWall+ (отключено)</string>
<string name="whitelist_array_item">Белый список (разрешить выбранные)</string>
View
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AFWall+</string>
- <string name="app_version">1.1.5</string>
+ <string name="app_version">1.1.6</string>
<string name="title_enabled">AFWall+ </string>
<string name="title_disabled">AFWall+ (Disabled)</string>
<string name="whitelist_array_item">White list (allow selected)</string>
@@ -123,7 +123,7 @@
//private static final int BUFF_LEN = 0;
// Cached applications
- public static DroidApp applications[] = null;
+ public static PackageInfoData applications[] = null;
static enum TOASTTYPE {
ERROR, INFO, MESSAGE
@@ -554,7 +554,7 @@ public static boolean applyIptablesRules(Context ctx, boolean showErrors) {
*/
public static void saveRules(Context ctx) {
final SharedPreferences prefs = ctx.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
- final DroidApp[] apps = getApps(ctx);
+ final PackageInfoData[] apps = getApps(ctx);
// Builds a pipe-separated list of names
final StringBuilder newpkg_wifi = new StringBuilder();
final StringBuilder newpkg_3g = new StringBuilder();
@@ -721,7 +721,7 @@ public static String showLog(Context ctx) {
}
}
}
- final DroidApp[] apps = getApps(ctx);
+ final PackageInfoData[] apps = getApps(ctx);
Integer id;
String appName = "";
int appId = -1;
@@ -730,7 +730,7 @@ public static String showLog(Context ctx) {
StringBuilder address = new StringBuilder();
id = map.keyAt(i);
if (id != unknownUID) {
- for (DroidApp app : apps) {
+ for (PackageInfoData app : apps) {
if (app.uid == id) {
appId = id;
appName = app.names[0];
@@ -816,14 +816,24 @@ public static String showLog(Context ctx) {
}
}*/
+ static <T> List<List<T>> splitListForPerformance(List<T> list, final int L) {
+ List<List<T>> parts = new ArrayList<List<T>>();
+ final int N = list.size();
+ for (int i = 0; i < N; i += L) {
+ parts.add(new ArrayList<T>(
+ list.subList(i, Math.min(N, i + L)))
+ );
+ }
+ return parts;
+ }
/**
* @param ctx application context (mandatory)
* @return a list of applications
*/
- public static DroidApp[] getApps(Context ctx) {
- initSpecial();
+ public static PackageInfoData[] getApps(Context ctx) {
if (applications != null) {
// return cached instance
+ initSpecial();
return applications;
}
final SharedPreferences prefs = ctx.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
@@ -842,6 +852,8 @@ public static String showLog(Context ctx) {
try {
final PackageManager pkgmanager = ctx.getPackageManager();
final List<ApplicationInfo> installed = pkgmanager.getInstalledApplications(0);
+
+ List<List<ApplicationInfo>> parts = splitListForPerformance(installed, 5);
/*
0 - Root
1000 - System
@@ -874,12 +886,12 @@ public static String showLog(Context ctx) {
*/
- final HashMap<Integer, DroidApp> map = new HashMap<Integer, DroidApp>();
+ final HashMap<Integer, PackageInfoData> map = new HashMap<Integer, PackageInfoData>();
final Editor edit = prefs.edit();
boolean changed = false;
String name = null;
String cachekey = null;
- DroidApp app = null;
+ PackageInfoData app = null;
for (final ApplicationInfo apinfo : installed) {
boolean firstseem = false;
app = map.get(apinfo.uid);
@@ -898,7 +910,7 @@ public static String showLog(Context ctx) {
firstseem = true;
}
if (app == null) {
- app = new DroidApp();
+ app = new PackageInfoData();
app.uid = apinfo.uid;
app.names = new String[] { name };
app.appinfo = apinfo;
@@ -922,19 +934,20 @@ public static String showLog(Context ctx) {
app.selected_roam = true;
}
}
+
if (changed) {
edit.commit();
}
/* add special applications to the list */
- final DroidApp special[] = {
- new DroidApp(SPECIAL_UID_ANY,ctx.getString(R.string.all_item), false, false,false,"dev.afwall.special.any"),
- new DroidApp(SPECIAL_UID_KERNEL,"(Kernel) - Linux kernel", false, false,false,"dev.afwall.special.kernel"),
- new DroidApp(android.os.Process.getUidForName("root"), ctx.getString(R.string.root_item), false, false,false,"dev.afwall.special.root"),
- new DroidApp(android.os.Process.getUidForName("media"), "Media server", false, false,false,"dev.afwall.special.media"),
- new DroidApp(android.os.Process.getUidForName("vpn"), "VPN networking", false, false,false,"dev.afwall.special.vpn"),
- new DroidApp(android.os.Process.getUidForName("shell"), "Linux shell", false, false,false,"dev.afwall.special.shell"),
- new DroidApp(android.os.Process.getUidForName("gps"), "GPS", false, false,false,"dev.afwall.special.gps"),
- new DroidApp(android.os.Process.getUidForName("adb"), "ADB(Android Debug Bridge)", false, false,false,"dev.afwall.special.adb")
+ final PackageInfoData special[] = {
+ new PackageInfoData(SPECIAL_UID_ANY,ctx.getString(R.string.all_item), false, false,false,"dev.afwall.special.any"),
+ new PackageInfoData(SPECIAL_UID_KERNEL,"(Kernel) - Linux kernel", false, false,false,"dev.afwall.special.kernel"),
+ new PackageInfoData(android.os.Process.getUidForName("root"), ctx.getString(R.string.root_item), false, false,false,"dev.afwall.special.root"),
+ new PackageInfoData(android.os.Process.getUidForName("media"), "Media server", false, false,false,"dev.afwall.special.media"),
+ new PackageInfoData(android.os.Process.getUidForName("vpn"), "VPN networking", false, false,false,"dev.afwall.special.vpn"),
+ new PackageInfoData(android.os.Process.getUidForName("shell"), "Linux shell", false, false,false,"dev.afwall.special.shell"),
+ new PackageInfoData(android.os.Process.getUidForName("gps"), "GPS", false, false,false,"dev.afwall.special.gps"),
+ new PackageInfoData(android.os.Process.getUidForName("adb"), "ADB(Android Debug Bridge)", false, false,false,"dev.afwall.special.adb")
};
for (int i=0; i<special.length; i++) {
app = special[i];
@@ -955,7 +968,7 @@ public static String showLog(Context ctx) {
}
}
/* convert the map into an array */
- applications = map.values().toArray(new DroidApp[map.size()]);;
+ applications = map.values().toArray(new PackageInfoData[map.size()]);;
return applications;
} catch (Exception e) {
alert(ctx, ctx.getString(R.string.error_common) + e, TOASTTYPE.ERROR);
@@ -1203,7 +1216,7 @@ public static void applicationRemoved(Context ctx, String pkgRemoved) {
/**
* Small structure to hold an application info
*/
- public static final class DroidApp {
+ public static final class PackageInfoData {
/** linux user id */
int uid;
/** application names belonging to this user id */
@@ -1227,9 +1240,9 @@ public static void applicationRemoved(Context ctx, String pkgRemoved) {
/** first time seem? */
boolean firstseem;
- public DroidApp() {
+ public PackageInfoData() {
}
- public DroidApp(int uid, String name, boolean selected_wifi, boolean selected_3g,boolean selected_roam, String pkgNameStr) {
+ public PackageInfoData(int uid, String name, boolean selected_wifi, boolean selected_3g,boolean selected_roam, String pkgNameStr) {
this.uid = uid;
this.names = new String[] {name};
this.selected_wifi = selected_wifi;
@@ -1528,4 +1541,14 @@ public static boolean hasRootAccess(Context ctx, boolean showErrors) {
}
return false;
}
+
+ public static boolean isNetfilterSupported() {
+ if ((new File("/proc/config.gz")).exists() == false) {
+ if ((new File("/proc/net/netfilter")).exists() == false)
+ return false;
+ if ((new File("/proc/net/ip_tables_targets")).exists() == false)
+ return false;
+ }
+ return true;
+ }
}
@@ -76,7 +76,7 @@
import com.actionbarsherlock.view.MenuItem;
import com.devspark.appmsg.AppMsg;
-import dev.ukanth.ufirewall.Api.DroidApp;
+import dev.ukanth.ufirewall.Api.PackageInfoData;
import dev.ukanth.ufirewall.Api.TOASTTYPE;
/**
@@ -354,6 +354,9 @@ protected Void doInBackground(Void... params) {
Api.getApps(MainActivity.this);
return null;
}
+
+ protected void onProgressUpdate(final Integer... values) {
+ }
@Override
protected void onPostExecute(Void result) {
@@ -375,10 +378,10 @@ protected void onPostExecute(Void result) {
*/
private void showApplications(final boolean checkWifi,final boolean check3G,final boolean checkRoam ,final boolean resetAll,final String searchStr) {
this.dirty = false;
- List<DroidApp> searchApp = new ArrayList<DroidApp>();
- final DroidApp[] apps = Api.getApps(this);
+ List<PackageInfoData> searchApp = new ArrayList<PackageInfoData>();
+ final PackageInfoData[] apps = Api.getApps(this);
if(!searchStr.equals("")) {
- for(DroidApp app:apps) {
+ for(PackageInfoData app:apps) {
for(String str: app.names) {
if(str.toLowerCase().contains(searchStr)) {
searchApp.add(app);
@@ -387,12 +390,12 @@ private void showApplications(final boolean checkWifi,final boolean check3G,fina
}
}
- final DroidApp[] apps2 = searchApp.size() > 0 ? searchApp.toArray(new DroidApp[searchApp.size()]) : apps;
+ final PackageInfoData[] apps2 = searchApp.size() > 0 ? searchApp.toArray(new PackageInfoData[searchApp.size()]) : apps;
// Sort applications - selected first, then alphabetically
if(!checkWifi && !check3G && !resetAll){
- Arrays.sort(apps2, new Comparator<DroidApp>() {
+ Arrays.sort(apps2, new Comparator<PackageInfoData>() {
@Override
- public int compare(DroidApp o1, DroidApp o2) {
+ public int compare(PackageInfoData o1, PackageInfoData o2) {
if (o1.firstseem != o2.firstseem) {
return (o1.firstseem ? -1 : 1);
}
@@ -413,7 +416,7 @@ public int compare(DroidApp o1, DroidApp o2) {
final int defaultColor = Color.WHITE;
final android.view.LayoutInflater inflater = getLayoutInflater();
- final ListAdapter adapter = new ArrayAdapter<DroidApp>(this,
+ final ListAdapter adapter = new ArrayAdapter<PackageInfoData>(this,
R.layout.listitem, R.id.itemtext, apps2) {
public View getView(final int position, View convertView,
ViewGroup parent) {
@@ -511,7 +514,7 @@ public View getView(final int position, View convertView,
}
}
}
- final DroidApp app = apps2[position];
+ final PackageInfoData app = apps2[position];
entry.app = app;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
@@ -911,6 +914,7 @@ public void handleMessage(Message msg) {
if (enabled) {
Log.d("AFWall+", "Applying rules.");
if(!Api.hasRootAccess(MainActivity.this,true)) return;
+ //if(!Api.isNetfilterSupported())return;
if (Api.applyIptablesRules(MainActivity.this, true)) {
displayToasts(MainActivity.this,
R.string.rules_applied, Toast.LENGTH_SHORT);
@@ -926,6 +930,8 @@ public void handleMessage(Message msg) {
Api.setEnabled(getApplicationContext(), true, true);
} else {
Log.d("AFWall+", "Failed - Disabling firewall.");
+ displayToasts(MainActivity.this,
+ R.string.error_apply, Toast.LENGTH_SHORT);
Api.setEnabled(MainActivity.this, false, true);
getSupportActionBar().setIcon(R.drawable.widget_off);
if(mainMenu !=null) {
@@ -987,7 +993,7 @@ public void handleMessage(Message msg) {
*/
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- final DroidApp app = (DroidApp) buttonView.getTag();
+ final PackageInfoData app = (PackageInfoData) buttonView.getTag();
if (app != null) {
switch (buttonView.getId()) {
case R.id.itemcheck_wifi:
@@ -1123,7 +1129,7 @@ public void onClick(DialogInterface dialog, int which) {
@Override
protected View doInBackground(Object... params) {
try {
- final DroidApp app = (DroidApp) params[0];
+ final PackageInfoData app = (PackageInfoData) params[0];
final PackageManager pkgMgr = (PackageManager) params[1];
final View viewToUpdate = (View) params[2];
if (!app.icon_loaded) {
@@ -1178,7 +1184,7 @@ public static void displayToasts(Context context, int resId, int duration) {
private CheckBox box_roam;
private TextView text;
private ImageView icon;
- private DroidApp app;
+ private PackageInfoData app;
}
@Override

0 comments on commit edaa1cd

Please sign in to comment.