From cf1708f152bb9867c379aa67eacef23f34f5d3a3 Mon Sep 17 00:00:00 2001 From: luojitong Date: Wed, 23 Dec 2020 18:45:55 +0800 Subject: [PATCH] fix offset of inline_max_code_units_ in Android11 --- sandhook-hooklib/src/main/cpp/casts/cast_compiler_options.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sandhook-hooklib/src/main/cpp/casts/cast_compiler_options.cpp b/sandhook-hooklib/src/main/cpp/casts/cast_compiler_options.cpp index b5bcb7e2..60944962 100644 --- a/sandhook-hooklib/src/main/cpp/casts/cast_compiler_options.cpp +++ b/sandhook-hooklib/src/main/cpp/casts/cast_compiler_options.cpp @@ -15,6 +15,9 @@ namespace SandHook { Size calOffset(JNIEnv *jniEnv, art::CompilerOptions *p) override { if (SDK_INT < ANDROID_N) return getParentSize() + 1; + if (SDK_INT >= ANDROID_Q) { + return BYTE_POINT + 3 * sizeof(size_t); + } if (SDK_INT >= ANDROID_O) { return BYTE_POINT + 5 * sizeof(size_t); } else {