Skip to content

Commit 6294a23

Browse files
author
梁丽欣
authored
Fix getcallinguid crash on Q
1 parent 623ee49 commit 6294a23

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

VirtualApp/lib/src/main/jni/Foundation/VMPatch.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,10 @@ void hookAndroidVM(JArrayClass<jobject> javaMethods,
427427
}
428428
}
429429
measureNativeOffset(isArt);
430-
replaceGetCallingUid(isArt);
430+
// Crash on Q if hook directly by modify entrypoint of function.
431+
// Just skip this step on Q and get never crash
432+
if(apiLevel<=28)
433+
replaceGetCallingUid(isArt);
431434
replaceOpenDexFileMethod(javaMethods.getElement(OPEN_DEX).get(), isArt,
432435
apiLevel);
433436
replaceCameraNativeSetupMethod(javaMethods.getElement(CAMERA_SETUP).get(),
@@ -492,4 +495,4 @@ void *getDvmOrArtSOHandle() {
492495
soInfo = RTLD_DEFAULT;
493496
}
494497
return soInfo;
495-
}
498+
}

0 commit comments

Comments
 (0)