@@ -36,6 +36,7 @@ static jboolean init(JNIEnv *env, jobject thiz) {
3636 jboolean res = JNI_FALSE;
3737 procmaps_struct *maps_tmp = nullptr ;
3838 while ((maps_tmp = pmparser_next (maps)) != nullptr ) {
39+ // LOGI("%s", maps_tmp->pathname);
3940 if (strstr (maps_tmp->pathname , " libmemtrack_real.so" )) {
4041 res = JNI_TRUE;
4142 }
@@ -94,6 +95,15 @@ static jint get_nativeForkSystemServer_calls_count(JNIEnv *env, jobject thiz) {
9495 return -1 ;
9596}
9697
98+ static jint get_nativeSpecializeAppProcess_calls_count (JNIEnv *env, jobject thiz) {
99+ static void *sym;
100+ void *handle;
101+ if ((handle = get_handle ()) == nullptr ) return -1 ;
102+ if (sym == nullptr ) sym = dlsym (handle, " riru_get_nativeSpecializeAppProcess_calls_count" );
103+ if (sym) return static_cast <jboolean>(((int (*)()) sym)());
104+ return -1 ;
105+ }
106+
97107static jstring get_nativeForkAndSpecialize_signature (JNIEnv *env, jobject thiz) {
98108 static void *sym;
99109 void *handle;
@@ -108,14 +118,14 @@ static jstring get_nativeForkAndSpecialize_signature(JNIEnv *env, jobject thiz)
108118 return nullptr ;
109119}
110120
111- static jstring get_nativeSpecializeBlastula_signature (JNIEnv *env, jobject thiz) {
121+ static jstring get_nativeSpecializeAppProcess_signature (JNIEnv *env, jobject thiz) {
112122 static void *sym;
113123 void *handle;
114124 if ((handle = get_handle ()) == nullptr ) return nullptr ;
115125 if (sym == nullptr ) sym = dlsym (handle, " riru_get_original_native_methods" );
116126 if (sym) {
117127 auto method = ((const JNINativeMethod *(*)(const char *, const char *, const char *)) sym)(
118- " com/android/internal/os/Zygote" , " nativeSpecializeBlastula " , nullptr );
128+ " com/android/internal/os/Zygote" , " nativeSpecializeAppProcess " , nullptr );
119129 if (method != nullptr )
120130 return env->NewStringUTF (method->signature );
121131 }
@@ -137,15 +147,16 @@ static jstring get_nativeForkSystemServer_signature(JNIEnv *env, jobject thiz) {
137147}
138148
139149static JNINativeMethod gMethods [] = {
140- {" init" , " ()Z" , (void *) init},
141- {" isRiruModuleExists" , " (Ljava/lang/String;)Z" , (void *) is_riru_module_exists},
142- {" getRiruVersion" , " ()I" , (void *) get_riru_rersion},
143- {" isZygoteMethodsReplaced" , " ()Z" , (void *) is_zygote_methods_replaced},
144- {" getNativeForkAndSpecializeCallsCount" , " ()I" , (void *) get_nativeForkAndSpecialize_calls_count},
145- {" getNativeForkSystemServerCallsCount" , " ()I" , (void *) get_nativeForkSystemServer_calls_count},
146- {" getNativeForkAndSpecializeSignature" , " ()Ljava/lang/String;" , (void *) get_nativeForkAndSpecialize_signature},
147- {" getNativeSpecializeBlastulaSignature" , " ()Ljava/lang/String;" , (void *) get_nativeSpecializeBlastula_signature},
148- {" getNativeForkSystemServerSignature" , " ()Ljava/lang/String;" , (void *) get_nativeForkSystemServer_signature},
150+ {" init" , " ()Z" , (void *) init},
151+ {" isRiruModuleExists" , " (Ljava/lang/String;)Z" , (void *) is_riru_module_exists},
152+ {" getRiruVersion" , " ()I" , (void *) get_riru_rersion},
153+ {" isZygoteMethodsReplaced" , " ()Z" , (void *) is_zygote_methods_replaced},
154+ {" getNativeForkAndSpecializeCallsCount" , " ()I" , (void *) get_nativeForkAndSpecialize_calls_count},
155+ {" getNativeForkSystemServerCallsCount" , " ()I" , (void *) get_nativeForkSystemServer_calls_count},
156+ {" getNativeSpecializeAppProcessCallsCount" , " ()I" , (void *) get_nativeSpecializeAppProcess_calls_count},
157+ {" getNativeForkAndSpecializeSignature" , " ()Ljava/lang/String;" , (void *) get_nativeForkAndSpecialize_signature},
158+ {" getNativeSpecializeAppProcessSignature" , " ()Ljava/lang/String;" , (void *) get_nativeSpecializeAppProcess_signature},
159+ {" getNativeForkSystemServerSignature" , " ()Ljava/lang/String;" , (void *) get_nativeForkSystemServer_signature},
149160};
150161
151162static int registerNativeMethods (JNIEnv *env, const char *className,
0 commit comments