From d74ca0d4f89e113b91bbee934acf839074ec0704 Mon Sep 17 00:00:00 2001 From: ZQY <22442525+ryuunoakaihitomi@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:16:28 +0800 Subject: [PATCH] Suppress NSME caused by isJavaDebuggable on 8.1 (#13) --- lsplant/src/main/jni/common.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lsplant/src/main/jni/common.hpp b/lsplant/src/main/jni/common.hpp index c8b61cb..a59e326 100644 --- a/lsplant/src/main/jni/common.hpp +++ b/lsplant/src/main/jni/common.hpp @@ -55,6 +55,10 @@ inline auto GetAndroidApiLevel() { inline auto IsJavaDebuggable(JNIEnv *env) { static auto kDebuggable = [&env]() { + auto sdk_int = GetAndroidApiLevel(); + if (sdk_int < __ANDROID_API_P__) { + return false; + } auto runtime_class = JNI_FindClass(env, "dalvik/system/VMRuntime"); if (!runtime_class) { LOGE("Failed to find VMRuntime");