Fix pendding hook condition
This commit is contained in:
parent
e5379ea27e
commit
b27398fbe0
|
|
@ -131,8 +131,8 @@ namespace art {
|
||||||
|
|
||||||
if (api_level >= __ANDROID_API_R__) {
|
if (api_level >= __ANDROID_API_R__) {
|
||||||
// In android R, FixupStaticTrampolines won't be called unless it's marking it as
|
// In android R, FixupStaticTrampolines won't be called unless it's marking it as
|
||||||
// invisiblyInitialized.
|
// visiblyInitialized.
|
||||||
// So we miss some calls between initialized and invisiblyInitialized.
|
// So we miss some calls between initialized and visiblyInitialized.
|
||||||
// Therefore we hook the new introduced MarkClassInitialized instead
|
// Therefore we hook the new introduced MarkClassInitialized instead
|
||||||
// This only happens on non-x86 devices
|
// This only happens on non-x86 devices
|
||||||
lspd::HookSyms(handle, hook_func, MarkClassInitialized);
|
lspd::HookSyms(handle, hook_func, MarkClassInitialized);
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,14 @@ public class ClassUtils {
|
||||||
* 5.0-8.0: kInitialized = 10 int
|
* 5.0-8.0: kInitialized = 10 int
|
||||||
* 8.1: kInitialized = 11 int
|
* 8.1: kInitialized = 11 int
|
||||||
* 9.0+: kInitialized = 14 uint8_t
|
* 9.0+: kInitialized = 14 uint8_t
|
||||||
|
* 11.0+: kInitialized = 14 uint8_t
|
||||||
|
* kVisiblyInitialized = 15 uint8_t
|
||||||
*/
|
*/
|
||||||
@ApiSensitive(Level.MIDDLE)
|
@ApiSensitive(Level.MIDDLE)
|
||||||
public static boolean isInitialized(Class clazz) {
|
public static boolean isInitialized(Class clazz) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
return getClassStatus(clazz, true) >= 14;
|
||||||
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
return getClassStatus(clazz, true) == 14;
|
return getClassStatus(clazz, true) == 14;
|
||||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1) {
|
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1) {
|
||||||
return getClassStatus(clazz, false) == 11;
|
return getClassStatus(clazz, false) == 11;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue