You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
switch from dalvik to art; NOTE: bionic translation linker not used yet
This commit is contained in:
21
src/main.c
21
src/main.c
@@ -68,13 +68,13 @@ JNIEnv* create_vm(char *apk_classpath) {
|
|||||||
|
|
||||||
// TODO: should probably not hardcode this
|
// TODO: should probably not hardcode this
|
||||||
char *boot_cp_arr[] = {
|
char *boot_cp_arr[] = {
|
||||||
"core-hostdex.jar",
|
|
||||||
"core-junit-hostdex.jar",
|
|
||||||
"conscrypt-hostdex.jar",
|
|
||||||
"okhttp-hostdex.jar",
|
|
||||||
"bouncycastle-hostdex.jar",
|
|
||||||
"apachehttp-hostdex.jar",
|
|
||||||
"apache-xml-hostdex.jar",
|
"apache-xml-hostdex.jar",
|
||||||
|
"core-junit-hostdex.jar",
|
||||||
|
"core-libart-hostdex.jar",
|
||||||
|
"dex-host.jar",
|
||||||
|
"dx.jar",
|
||||||
|
"hamcrest-hostdex.jar",
|
||||||
|
"jarjar.jar",
|
||||||
};
|
};
|
||||||
options[0].optionString = construct_boot_classpath("-Xbootclasspath:", boot_cp_arr, ARRAY_SIZE(boot_cp_arr));
|
options[0].optionString = construct_boot_classpath("-Xbootclasspath:", boot_cp_arr, ARRAY_SIZE(boot_cp_arr));
|
||||||
|
|
||||||
@@ -105,10 +105,7 @@ JNIEnv* create_vm(char *apk_classpath) {
|
|||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _Z17dvmLoadNativeCodePKcP6ObjectPPc(const char* pathName, void* classLoader, char** detail);
|
bool HAXX__JavaVMExt__LoadNativeLibrary(JNIEnv* env, char *path, jobject class_loader, char** error_msg);
|
||||||
void * _Z20dvmDecodeIndirectRefP6ThreadP8_jobject(void* self, jobject jobj);
|
|
||||||
void * _Z13dvmThreadSelfv(void);
|
|
||||||
|
|
||||||
struct jni_callback_data { char *apk_main_activity_class; uint32_t window_width; uint32_t window_height;};
|
struct jni_callback_data { char *apk_main_activity_class; uint32_t window_width; uint32_t window_height;};
|
||||||
static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* hint, struct jni_callback_data *d)
|
static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* hint, struct jni_callback_data *d)
|
||||||
{
|
{
|
||||||
@@ -163,11 +160,13 @@ static void open(GtkApplication *app, GFile** files, gint nfiles, const gchar* h
|
|||||||
jobject class_loader = (*env)->CallObjectMethod(env, handle_cache.view.class, getClassLoader);
|
jobject class_loader = (*env)->CallObjectMethod(env, handle_cache.view.class, getClassLoader);
|
||||||
|
|
||||||
char* reason = NULL;
|
char* reason = NULL;
|
||||||
if (!_Z17dvmLoadNativeCodePKcP6ObjectPPc("libtranslation_layer_main.so", _Z20dvmDecodeIndirectRefP6ThreadP8_jobject(_Z13dvmThreadSelfv(), class_loader), &reason)) {
|
if (!HAXX__JavaVMExt__LoadNativeLibrary(env, "libtranslation_layer_main.so", _REF(class_loader), &reason)) {
|
||||||
printf("[main] dvmLoadNativeCode failed for libtranslation_layer_main.so: %s", reason);
|
printf("[main] dvmLoadNativeCode failed for libtranslation_layer_main.so: %s", reason);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(reason);
|
||||||
|
|
||||||
/* -- run the main activity's onCreate -- */
|
/* -- run the main activity's onCreate -- */
|
||||||
|
|
||||||
(*env)->CallVoidMethod(env, handle_cache.apk_main_activity.object, handle_cache.apk_main_activity.onCreate, NULL);
|
(*env)->CallVoidMethod(env, handle_cache.apk_main_activity.object, handle_cache.apk_main_activity.onCreate, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user