diff --git a/android/android_framework/hidden-api/build.gradle.kts b/android/android_framework/hidden-api/build.gradle.kts index a0bb8daaf..aa3ac1983 100644 --- a/android/android_framework/hidden-api/build.gradle.kts +++ b/android/android_framework/hidden-api/build.gradle.kts @@ -8,5 +8,5 @@ java { } dependencies { - api(files("${rootProject.rootDir.path}/android_sdk/30/android-30.jar")) + api(files("${rootProject.rootDir.path}/android_sdk/33/android-33.jar")) } \ No newline at end of file diff --git a/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/ThanoxHookImpl.java b/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/ThanoxHookImpl.java index ab6d3b6d6..acb2f8915 100644 --- a/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/ThanoxHookImpl.java +++ b/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/ThanoxHookImpl.java @@ -96,19 +96,24 @@ public void runSafety() { private void waitForSystemReady(Runnable runnable) { XLog.w("waitForSystemReady, current thread: %s", Thread.currentThread()); new Thread(() -> { - ServiceManager.waitForService("package"); - ServiceManager.waitForService("activity"); - ServiceManager.waitForService(Context.USER_SERVICE); - ServiceManager.waitForService(Context.APP_OPS_SERVICE); - while (!ActivityThread.isSystem() || !isSystemReady()) { - try { - XLog.d("waitForSystemReady, wait a moment."); - Thread.sleep(100); - } catch (InterruptedException e) { - // Noop. + try { + ServiceManager.waitForService("package"); + ServiceManager.waitForService("activity"); + ServiceManager.waitForService(Context.USER_SERVICE); + ServiceManager.waitForService(Context.APP_OPS_SERVICE); + while (!ActivityThread.isSystem() || !isSystemReady()) { + try { + XLog.d("waitForSystemReady, wait a moment."); + Thread.sleep(100); + } catch (InterruptedException e) { + // Noop. + } } + XLog.i("Call runnable"); + runnable.run(); + } catch (Throwable e) { + XLog.e(e, "waitForSystemReady"); } - runnable.run(); }).start(); } diff --git a/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/ContextProxy.java b/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/ContextProxy.java index c27bd3ab1..678e5e9a9 100644 --- a/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/ContextProxy.java +++ b/android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/ContextProxy.java @@ -21,6 +21,11 @@ public ContextProxy(Context base, String tag) { this.tag = tag; } + @Override + public int getAssociatedDisplayId() { + return getBaseContext().getAssociatedDisplayId(); + } + @Override public void enforceCallingPermission(String permission, String message) { XLog.i("SystemServiceContextHooks enforceCallingPermission@%s %s %s", tag, permission, message); @@ -53,4 +58,6 @@ public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int fla return false; } } + + } \ No newline at end of file diff --git a/android/android_sdk/33/android-33.jar b/android/android_sdk/33/android-33.jar new file mode 100644 index 000000000..3358c0f56 Binary files /dev/null and b/android/android_sdk/33/android-33.jar differ diff --git a/android/internal/Thanox-Internal b/android/internal/Thanox-Internal index 03ec50edd..4e41c181c 160000 --- a/android/internal/Thanox-Internal +++ b/android/internal/Thanox-Internal @@ -1 +1 @@ -Subproject commit 03ec50edd523b3d823845e4dcde67e8ef5960c96 +Subproject commit 4e41c181c7dca6a59c4b34266156d0c8822a8604