diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/android/libreofficekit-jni.c | 15 | ||||
-rw-r--r-- | sal/android/lo-bootstrap.c | 18 |
2 files changed, 9 insertions, 24 deletions
diff --git a/sal/android/libreofficekit-jni.c b/sal/android/libreofficekit-jni.c index cf8308afa01b..3dcf773e9cf1 100644 --- a/sal/android/libreofficekit-jni.c +++ b/sal/android/libreofficekit-jni.c @@ -37,7 +37,6 @@ extern int apk_file_size; extern void Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env, jobject clazz, jstring string); extern void Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env, jobject clazz, jboolean state); -extern void Java_org_libreoffice_android_Bootstrap_extract_1files(JNIEnv* env, jobject clazz); extern LibreOfficeKit *libreofficekit_hook(const char* install_path); @@ -63,15 +62,6 @@ Java_org_libreoffice_android_LibreOfficeKit_redirect_1stdio(JNIEnv* env, Java_org_libreoffice_android_Bootstrap_redirect_1stdio(env, clazz, state); } -/// Call the same method from Bootstrap. -__attribute__ ((visibility("default"))) -void -Java_org_libreoffice_android_LibreOfficeKit_extract_1files(JNIEnv* env, - jobject clazz) -{ - Java_org_libreoffice_android_Bootstrap_extract_1files(env, clazz); -} - /// Initialize the LibreOfficeKit. __attribute__ ((visibility("default"))) jboolean @@ -136,6 +126,11 @@ Java_org_libreoffice_android_LibreOfficeKit_init__Ljava_lang_String_2Ljava_lang_ return JNI_FALSE; } + // Extract files from the .apk that can't be used mmapped directly from it + extract_files(UNPACK_TREE, UNPACK_TREE, 0); + extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1); + + // Initialize LibreOfficeKit pOffice = libreofficekit_hook(data_dir); if (!pOffice) { diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c index a7765bed563e..d1a7521fb0d0 100644 --- a/sal/android/lo-bootstrap.c +++ b/sal/android/lo-bootstrap.c @@ -311,6 +311,10 @@ Java_org_libreoffice_android_Bootstrap_setup__Ljava_lang_String_2Ljava_lang_Stri if (!setup_assets_tree()) return JNI_FALSE; + // Extract files from the .apk that can't be used mmapped directly from it + extract_files(UNPACK_TREE, UNPACK_TREE, 0); + extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1); + return JNI_TRUE; } @@ -807,20 +811,6 @@ extract_files(const char *root, lo_apk_closedir(tree); } -// static native void extract_files(); - -__attribute__ ((visibility("default"))) -void -Java_org_libreoffice_android_Bootstrap_extract_1files(JNIEnv* env, - jobject clazz) -{ - (void) env; - (void) clazz; - - extract_files(UNPACK_TREE, UNPACK_TREE, 0); - extract_files(UNPACK_TREE_GZ, UNPACK_TREE_GZ, 1); -} - /* Android's JNI works only to libraries loaded through Java's * System.loadLibrary(), it seems. But now with just one big app-specific .so * on Android, that would not be a problem, but for historical reasons, we |