From e7dddd734c52a520183d05d1b60e8b28434423dd Mon Sep 17 00:00:00 2001 From: Kr328 Date: Sun, 22 Oct 2023 11:43:43 +0800 Subject: [PATCH] Chore: bump dependencies (#23) --- build.gradle.kts | 2 +- .../main/java/com/github/kr328/ifw/Firewall.java | 2 ++ .../src/main/java/com/github/kr328/ifw/Main.java | 16 ++++++++++++---- settings.gradle.kts | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 89da824..7b74a62 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import com.android.build.gradle.BaseExtension plugins { val agp = "8.1.2" - val zygote = "3.0" + val zygote = "3.1" id("com.android.library") version agp apply false id("com.android.application") version agp apply false diff --git a/module/src/main/java/com/github/kr328/ifw/Firewall.java b/module/src/main/java/com/github/kr328/ifw/Firewall.java index baeca83..2df4b28 100644 --- a/module/src/main/java/com/github/kr328/ifw/Firewall.java +++ b/module/src/main/java/com/github/kr328/ifw/Firewall.java @@ -20,6 +20,8 @@ public final class Firewall { private static IntentFirewall instance; private static void tryGetIntentFirewall() { + Log.d(Main.TAG, "Try get intent firewall"); + final Object instance = LocalServices.getService(ActivityManagerInternal.class); if (instance == null) { return; diff --git a/module/src/main/java/com/github/kr328/ifw/Main.java b/module/src/main/java/com/github/kr328/ifw/Main.java index e982a7a..aaf73ba 100644 --- a/module/src/main/java/com/github/kr328/ifw/Main.java +++ b/module/src/main/java/com/github/kr328/ifw/Main.java @@ -27,10 +27,18 @@ public static void main() { @Override public Binder addService(final String name, final Binder service) { if ("package".equals(name)) { - BinderInterceptors.install(service, next -> { - final IPackageManager original = IPackageManager.Stub.asInterface(next); - return Proxy.FACTORY.create(original, new Proxy(original)); - }); + Log.d(TAG, "PackageManagerService found"); + + try { + BinderInterceptors.install(service, next -> { + final IPackageManager original = IPackageManager.Stub.asInterface(next); + return Proxy.FACTORY.create(original, new Proxy(original)); + }); + + Log.d(TAG, "Binder interceptor installed"); + } catch (Exception e) { + Log.e(TAG, "Initialize binder interceptor failed", e); + } } return super.addService(name, service); diff --git a/settings.gradle.kts b/settings.gradle.kts index d2abb65..816d5d9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,7 @@ dependencyResolutionManagement { } versionCatalogs { create("libs") { - val magic = "1.8" + val magic = "1.9" library("magic-library", "com.github.kr328.magic", "library").version(magic) }