From dd030a4d78b47face381a863e498d777aa82184c Mon Sep 17 00:00:00 2001 From: ukanth Date: Mon, 24 Dec 2018 23:01:12 +0530 Subject: [PATCH] Fixed hang issue on ping/resolve address --- Changelog.md | 6 ++ aFWall/build.gradle | 2 +- .../ufirewall/activity/LogDetailActivity.java | 87 +++++-------------- 3 files changed, 29 insertions(+), 66 deletions(-) diff --git a/Changelog.md b/Changelog.md index 1519d775c..21062b452 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,12 @@ Changelog AFWall+ ================== +Version 3.0.4 +* Fix: domain names resolve +* Fix: Removed notification dot on all notifications +* Fix: Inbound option causing firewall disable functionality +* Removed SUPER_USER permission which is not relevant anymore + Version 3.0.3 * Fix: Disable firewall issue diff --git a/aFWall/build.gradle b/aFWall/build.gradle index 4df48fb1c..08681fb4b 100644 --- a/aFWall/build.gradle +++ b/aFWall/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 21 targetSdkVersion 26 versionCode 17000 - versionName "3.1.0-BETA" + versionName "3.0.4" //buildConfigField 'boolean', 'DONATE', 'true' } diff --git a/aFWall/src/main/java/dev/ukanth/ufirewall/activity/LogDetailActivity.java b/aFWall/src/main/java/dev/ukanth/ufirewall/activity/LogDetailActivity.java index 64b56bf6c..3793b9b11 100644 --- a/aFWall/src/main/java/dev/ukanth/ufirewall/activity/LogDetailActivity.java +++ b/aFWall/src/main/java/dev/ukanth/ufirewall/activity/LogDetailActivity.java @@ -133,12 +133,7 @@ public boolean onContextItemSelected(MenuItem item) { String[] items = {current_selected_logData.getDst(), current_selected_logData.getSrc()}; new MaterialDialog.Builder(this) .items(items) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - return true; - } - }) + .itemsCallbackSingleChoice(-1, (dialog, view, which, text) -> true) .positiveText(R.string.choose) .show(); break; @@ -149,12 +144,9 @@ public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequ .title(R.string.destination_address) .neutralText(R.string.OK) .positiveText(R.string.copy_text) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - Api.copyToClipboard(LogDetailActivity.this, current_selected_logData.getDst() + ":" + current_selected_logData.getDpt()); - Api.toast(LogDetailActivity.this, getString(R.string.destination_copied)); - } + .onPositive((dialog, which) -> { + Api.copyToClipboard(LogDetailActivity.this, current_selected_logData.getDst() + ":" + current_selected_logData.getDpt()); + Api.toast(LogDetailActivity.this, getString(R.string.destination_copied)); }) .show(); @@ -166,77 +158,42 @@ public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) .title(R.string.source_address) .neutralText(R.string.OK) .positiveText(R.string.copy_text) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - Api.copyToClipboard(LogDetailActivity.this, current_selected_logData.getSrc() + ":" + current_selected_logData.getSpt()); - Api.toast(LogDetailActivity.this, getString(R.string.source_copied)); - } + .onPositive((dialog, which) -> { + Api.copyToClipboard(LogDetailActivity.this, current_selected_logData.getSrc() + ":" + current_selected_logData.getSpt()); + Api.toast(LogDetailActivity.this, getString(R.string.source_copied)); }) .show(); break; case 3: // Ping Destination - try { - new LogNetUtil.NetTask(this).execute( - new LogNetUtil.NetParam( - LogNetUtil.JobType.PING, current_selected_logData.getDst() - ) - ).get(); - - } catch (InterruptedException e) { - Log.e(TAG, "Exception(00): " + e.getMessage()); - } catch (ExecutionException e) { - Log.e(TAG, "Exception(01): " + e.getMessage()); - } + new LogNetUtil.NetTask(this).execute( + new LogNetUtil.NetParam(LogNetUtil.JobType.PING, current_selected_logData.getDst()) + ); + break; case 4: // Ping Source - try { - new LogNetUtil.NetTask(this).execute( - new LogNetUtil.NetParam( - LogNetUtil.JobType.PING, current_selected_logData.getSrc() - ) - ).get(); - } catch (InterruptedException e) { - Log.e(TAG, "Exception(03): " + e.getMessage()); - } catch (ExecutionException e) { - Log.e(TAG, "Exception(04): " + e.getMessage()); - } + new LogNetUtil.NetTask(this).execute( + new LogNetUtil.NetParam(LogNetUtil.JobType.PING, current_selected_logData.getSrc()) + ); break; case 5: // Resolve Destination - try { - new LogNetUtil.NetTask(this).execute( - new LogNetUtil.NetParam( - LogNetUtil.JobType.RESOLVE, current_selected_logData.getDst() - ) - ).get(); - } catch (InterruptedException e) { - Log.e(TAG, "Exception(05): " + e.getMessage()); - } catch (ExecutionException e) { - Log.e(TAG, "Exception(06): " + e.getMessage()); - } + new LogNetUtil.NetTask(this).execute( + new LogNetUtil.NetParam(LogNetUtil.JobType.RESOLVE, current_selected_logData.getDst()) + ); break; case 6: // Resolve Source - try { - new LogNetUtil.NetTask(this).execute( - new LogNetUtil.NetParam( - LogNetUtil.JobType.RESOLVE, current_selected_logData.getSrc() - ) - ).get(); - } catch (InterruptedException e) { - Log.e(TAG, "Exception(07): " + e.getMessage()); - } catch (ExecutionException e) { - Log.e(TAG, "Exception(08): " + e.getMessage()); - } + new LogNetUtil.NetTask(this).execute( + new LogNetUtil.NetParam(LogNetUtil.JobType.RESOLVE, current_selected_logData.getSrc()) + ); break; } return super.onContextItemSelected(item); } - public class NetTask extends AsyncTask { + /* public class NetTask extends AsyncTask { @Override protected String doInBackground(String... params) { InetAddress addr = null; @@ -248,7 +205,7 @@ protected String doInBackground(String... params) { return addr.getCanonicalHostName().toString(); } } - +*/ private List getLogData(final int uid) { return SQLite.select()