From 0aea1c6e1cd6e56e79311698226019f515d597bd Mon Sep 17 00:00:00 2001 From: deroko <132438089+cr4zyserb@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:31:53 +0100 Subject: [PATCH] android: Fix hooking art_quick_resolution_trampoline (#307) When using --enable-optimizations on newer ARTs, the quick entrypoint= can be art_quick_resolution_trampoline. Fixes #306. --- lib/android.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/android.js b/lib/android.js index fefc57e..27e2096 100644 --- a/lib/android.js +++ b/lib/android.js @@ -483,6 +483,7 @@ function _getApi () { temporaryApi.artQuickGenericJniTrampoline = getArtQuickEntrypointFromTrampoline(quickGenericJniTrampoline, vm); temporaryApi.artQuickToInterpreterBridge = getArtQuickEntrypointFromTrampoline(quickToInterpreterBridgeTrampoline, vm); + temporaryApi.artQuickResolutionTrampoline = getArtQuickEntrypointFromTrampoline(quickResolutionTrampoline, vm); if (temporaryApi['art::JavaVMExt::AddGlobalRef'] === undefined) { temporaryApi['art::JavaVMExt::AddGlobalRef'] = makeAddGlobalRefFallbackForAndroid5(temporaryApi); @@ -1825,7 +1826,8 @@ function instrumentArtQuickEntrypoints (vm) { // Entrypoints that dispatch method invocation from the quick ABI. const quickEntrypoints = [ api.artQuickGenericJniTrampoline, - api.artQuickToInterpreterBridge + api.artQuickToInterpreterBridge, + api.artQuickResolutionTrampoline ]; quickEntrypoints.forEach(entrypoint => {