Suppress NSME caused by isJavaDebuggable on 8.1 (#13)

This commit is contained in:
ZQY 2022-04-06 13:16:28 +08:00 committed by GitHub
parent 3d2e1f5fc7
commit d74ca0d4f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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");