Kaydet (Commit) 11c9125c authored tarafından Tor Lillqvist's avatar Tor Lillqvist
üst 0e4b3626
......@@ -395,18 +395,6 @@ window, and you probably also want to have set the stdout and stderr
of app processes to be redirected to logcat ("adb shell stop; adb
shell setprop log.redirect-stdio true; adb shell start").
Unfortunately you might notice that the command line passed to "adb
shell am start" is too long (actually, not "command line" as such, but
the length of the so-called "extra" arguments passed to the action, or
something like that, see Android bug
http://code.google.com/p/android/issues/detail?id=23351 , so you need
to shorten it somehow... for instance by creating a symlink to
/data/data/org.libreoffice.android.qa.sc in /system: "adb remount; adb
shell ln -s /data/data/org.libreoffice.android.qa.sc /system/sc" and
then use that shorter path /system/sc snippet in all places instead of
the longer /data/data/org.libreoffice.android.qa.sc on the "adb shell
am start" command line.
To debug, do manually what "make run" would do, adding args "-e
lo-main-delay 20" to the command line, and when the app has started,
run ndk-gdb. Unfortunately the gdb in NDK r7 is broken, use the one in
......
......@@ -37,6 +37,9 @@ import android.util.Log;
import fi.iki.tml.CommandLine;
import java.io.File;
import java.util.Scanner;
// We override NativeActivity so that we can get at the intent of the
// activity and its extra parameters, that we use to tell us what
// actual LibreOffice "program" to run. I.e. something that on desktop
......@@ -111,9 +114,22 @@ public class Bootstrap extends NativeActivity
// Get "command line" to pass to the LO "program"
String cmdLine = getIntent().getStringExtra("lo-main-cmdline");
if (cmdLine == null)
cmdLine = "/data/data/org.libreoffice.android/lib/libqa_sal_types.so";
if (cmdLine == null) {
String indirectFile = getIntent().getStringExtra("lo-main-indirect-cmdline");
if (indirectFile != null) {
try {
// Somewhat stupid but short way to read a file into a string
cmdLine = new Scanner(new File(indirectFile), "UTF-8").useDelimiter("\\A").next();
}
catch (java.io.FileNotFoundException e) {
Log.i(TAG, String.format("Could not read %s: %s",indirectFile, e.toString()));
}
}
if (cmdLine == null)
cmdLine = "/data/data/org.libreoffice.android/lib/libqa_sal_types.so";
}
// argv[0] will be replaced by android_main() in lo-bootstrap.c by the
// pathname of the mainLibrary.
cmdLine = "dummy-program-name " + cmdLine;
......
......@@ -162,7 +162,9 @@ uninstall:
adb uninstall $(APP_PACKAGE)
run:
adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-library libcppunittester -e lo-main-cmdline "$(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector '-env:CONFIGURATION_LAYERS=xcsxcu:file:///assets/xml/registry' '-env:UNO_TYPES=file:///assets/bin/udkapi.rdb file:///assets/bin/types.rdb' '-env:UNO_SERVICES=file:///assets/xml/ure/services.rdb file:///assets/ComponentTarget/framework/util/fwk.component file:///assets/ComponentTarget/i18npool/util/i18npool.component file:///assets/ComponentTarget/sfx2/util/sfx.component file:///assets/ComponentTarget/unoxml/source/service/unoxml.component file:///assets/ComponentTarget/configmgr/source/configmgr.component file:///assets/xml/ucb1.component file:///assets/xml/ucpfile1.component' -env:URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib -env:LO_LIB_DIR=file://$(APP_DATA_PATH)/lib"
echo "$(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector '-env:CONFIGURATION_LAYERS=xcsxcu:file:///assets/xml/registry' '-env:UNO_TYPES=file:///assets/bin/udkapi.rdb file:///assets/bin/types.rdb' '-env:UNO_SERVICES=file:///assets/xml/ure/services.rdb file:///assets/ComponentTarget/framework/util/fwk.component file:///assets/ComponentTarget/i18npool/util/i18npool.component file:///assets/ComponentTarget/sfx2/util/sfx.component file:///assets/ComponentTarget/unoxml/source/service/unoxml.component file:///assets/ComponentTarget/configmgr/source/configmgr.component file:///assets/xml/ucb1.component file:///assets/xml/ucpfile1.component' -env:URE_INTERNAL_LIB_DIR=file://$(APP_DATA_PATH)/lib -env:LO_LIB_DIR=file://$(APP_DATA_PATH)/lib" >cmdline
adb push cmdline $(APP_DATA_PATH)/cmdline
adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-library libcppunittester -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline"
clean:
ant clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment