From f1ffe63223b7c2fc02b245dabedac4bddb5c8e3c Mon Sep 17 00:00:00 2001 From: ukanth Date: Sat, 19 Oct 2019 08:00:00 +0530 Subject: [PATCH] FC on broadcast register --- Changelog.md | 34 +++++++++---------- .../dev/ukanth/ufirewall/events/RxEvent.java | 5 ++- .../ufirewall/service/FirewallService.java | 23 +++++-------- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/Changelog.md b/Changelog.md index 007c10f6d..8d4ce8511 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,26 +1,24 @@ AFWall+ Changelog ================== -Version 3.2.0-BETA2 -* Log service process bug -* Fix: Install notification does not clear on open -* Fix: Applying dialog issue -* Fix: kernel in the logs even whitelisted -* Fix: Statusbar notification update on firewall status -* Fix: Possible memory leaks in async -* Fix: mDNS and CLAT on core apps (Android 10) -* Fix: Additional startup leak path for supersu -* Updated libraries - - -Version 3.2.0-BETA1 +Version 3.2.0 * Integrate basic themes (Dark/Light or Black (donate version only!) -* Fix: AFWall's Logservice stops after sometime -* Fix: Crash on LOS 16 due to permission -* Fix: Notification not getting cleared upon opening -* Fix: Tasker settings not applied bug due to crash -* Fix: Root progress showing on main screen (dismiss button added incase) * Preferences now showing selected values +* Updated libraries +* Bug Fixes: + - AFWall's Logservice stops after sometime + - Crash on LOS 16 due to permission + - Notification not getting cleared upon opening + - Tasker settings not applied bug due to crash + - Root progress showing on main screen (dismiss button added incase) + - Log service process bug + - Applying dialog issue + - kernel in the logs even whitelisted + - Statusbar notification update on firewall status + - Possible memory leaks in async + - mDNS and CLAT on core apps (Android 10) + - Additional startup leak path for supersu + Version 3.1.0 * Performance: IPv4 & IPv6 rules applying time reduced by half diff --git a/aFWall/src/main/java/dev/ukanth/ufirewall/events/RxEvent.java b/aFWall/src/main/java/dev/ukanth/ufirewall/events/RxEvent.java index 17b753557..c25dc5f40 100644 --- a/aFWall/src/main/java/dev/ukanth/ufirewall/events/RxEvent.java +++ b/aFWall/src/main/java/dev/ukanth/ufirewall/events/RxEvent.java @@ -1,5 +1,6 @@ package dev.ukanth.ufirewall.events; +import dev.ukanth.ufirewall.log.Log; import io.reactivex.annotations.NonNull; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; @@ -17,7 +18,9 @@ public RxEvent() { } public Disposable subscribe(@NonNull Consumer action) { - return sSubject.subscribe(action); + return sSubject.subscribe(action, throwable -> { + Log.i("AFWall", throwable.getLocalizedMessage()); + }); } public void publish(@NonNull Object message) { diff --git a/aFWall/src/main/java/dev/ukanth/ufirewall/service/FirewallService.java b/aFWall/src/main/java/dev/ukanth/ufirewall/service/FirewallService.java index c588a2584..dca7e0e6a 100644 --- a/aFWall/src/main/java/dev/ukanth/ufirewall/service/FirewallService.java +++ b/aFWall/src/main/java/dev/ukanth/ufirewall/service/FirewallService.java @@ -29,8 +29,7 @@ public class FirewallService extends Service { private static final int NOTIFICATION_ID = 1; BroadcastReceiver connectivityReciver; - BroadcastReceiver packageInstallReceiver; - BroadcastReceiver packageUninstallReceiver; + BroadcastReceiver packageReceiver; IntentFilter filter; @Override @@ -163,32 +162,28 @@ public int onStartCommand(Intent intent, int flags, int startId) { IntentFilter intentFilter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED); intentFilter.addDataScheme("package"); - packageInstallReceiver = new PackageBroadcast(); - registerReceiver(packageInstallReceiver, intentFilter); + packageReceiver = new PackageBroadcast(); + registerReceiver(packageReceiver, intentFilter); intentFilter = new IntentFilter(Intent.ACTION_PACKAGE_REMOVED); - packageUninstallReceiver = new PackageBroadcast(); intentFilter.addDataScheme("package"); - registerReceiver(packageUninstallReceiver, intentFilter); + registerReceiver(packageReceiver, intentFilter); return START_STICKY; } @Override public void onDestroy() { - super.onDestroy(); if (connectivityReciver != null) { unregisterReceiver(connectivityReciver); connectivityReciver = null; } - if (packageInstallReceiver != null) { - unregisterReceiver(packageInstallReceiver); - packageInstallReceiver = null; - } - if (packageUninstallReceiver != null) { - unregisterReceiver(packageUninstallReceiver); - packageUninstallReceiver = null; + if (packageReceiver != null) { + unregisterReceiver(packageReceiver); + packageReceiver = null; } + super.onDestroy(); + } }