| 154 | } |
| 155 | |
| 156 | void init(JNIEnv *env, jobject clazz, jint api_level) { |
| 157 | ALOGD("VmCore init."); |
| 158 | VMEnv.api_level = api_level; |
| 159 | VMEnv.VMCoreClass = (jclass) env->NewGlobalRef(env->FindClass(VMCORE_CLASS)); |
| 160 | VMEnv.getCallingUidId = env->GetStaticMethodID(VMEnv.VMCoreClass, "getCallingUid", "(I)I"); |
| 161 | VMEnv.redirectPathString = env->GetStaticMethodID(VMEnv.VMCoreClass, "redirectPath", |
| 162 | "(Ljava/lang/String;)Ljava/lang/String;"); |
| 163 | VMEnv.redirectPathFile = env->GetStaticMethodID(VMEnv.VMCoreClass, "redirectPath", |
| 164 | "(Ljava/io/File;)Ljava/io/File;"); |
| 165 | VMEnv.loadEmptyDex = env->GetStaticMethodID(VMEnv.VMCoreClass, "loadEmptyDex", |
| 166 | "()[J"); |
| 167 | VMEnv.findMethod = env->GetStaticMethodID(VMEnv.VMCoreClass, "findMethod", |
| 168 | "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;"); |
| 169 | |
| 170 | ArtM::InitArtMethod(env, api_level); |
| 171 | JniHook::InitJniHook(env, api_level); |
| 172 | } |
| 173 | |
| 174 | void addIORule(JNIEnv *env, jclass clazz, jstring target_path, |
| 175 | jstring relocate_path) { |
no outgoing calls
no test coverage detected