use C shim to start Android app

This should avoid relying on features of the Android builtin shell,
and so hopefully avoid failures like this one
http://git-annex.branchable.com/design/assistant/blog/day_197__template_haskell/#comment-07f90830f78f6495dcbdf90eb8636129

The C shim sets up busybox, and uses its builtin shell to run runshell.

It's important that busybox be configured with
CONFIG_FEATURE_SH_STANDALONE, so that while runshell is running, it
does not rely on either system utilities, or busybox being already
installed.
This commit is contained in:
Joey Hess 2013-02-24 13:25:55 -04:00
parent 920138d5fb
commit ac0292df95
6 changed files with 64 additions and 12 deletions

View file

@ -37,7 +37,7 @@ index f6952f0..4b2aa5f 100644
String execPath = LaunchActivity.getDataDir(this) + "/bin/execpty";
ProcessBuilder execBuild =
- new ProcessBuilder(execPath, "/system/bin/sh", "-");
+ new ProcessBuilder(execPath, "/data/data/ga.androidterm/lib/lib.runshell.so", "");
+ new ProcessBuilder(execPath, "/data/data/ga.androidterm/lib/lib.start.so", "");
execBuild.redirectErrorStream(true);
Process exec = null;
try {
@ -50,7 +50,7 @@ index 67287b2..1f9afa1 100644
<string name="pref_ime_default">0</string>
<bool name="pref_alt_sends_esc_default">false</bool>
- <string name="pref_shell_default">/system/bin/sh -</string>
+ <string name="pref_shell_default">/data/data/ga.androidterm/lib/lib.runshell.so</string>
+ <string name="pref_shell_default">/data/data/ga.androidterm/lib/lib.start.so</string>
<string name="pref_initialcommand_default"></string>
<string name="pref_termtype_default">screen</string>
- <bool name="pref_close_window_on_process_exit_default">true</bool>