Alex Rivera | Logout

How do I install APK using Android updater script

Asked 2013-02-01T19:05:33.620
8

I'm attempting to use Android's updater script language (Edify?) to install an APK over-the-air to an embedded device that I have control over. Here's a link that describes the language.

My first attempt was the following:

package_extract_file("added_files/data/app/test.apk", "/data/app/test.apk");

That resulted in test.apk being automatically installed in /data/data/com.acme.test, however the directory /data/data/com.acme.test/lib is empty, whereas it should contain test.so, a shared library contained in test.apk. (If I manually install using adb install test.apk, the library is extracted.)

I then tried extracting the APK into /data instead of /data/app so the OS wouldn't automatically install it into /data/data, and I could try installing using the script:

package_extract_file("added_files/data/app/test.apk", "/data/test.apk");
run_program("/system/bin/pm", "install", "/data/test.apk");

That resulted in the following error:

about to run program [/system/bin/pm] with 3 args
run_program: execv failed: Exec format error
run_program: child exited with status 1

I'm not sure why the above error happened.

Is there a way to install an APK and have its shared libraries extracted automatically? I could install the libraries manually, but I'm hoping to avoid that.

Edit
Report

1 Answer

0

Edify scripts run in a recovery mode and depending on your device not all partitions are available by default. Most likely your problem is that the partition you are trying to use is not mounted yet.

answered 2013-02-10T09:08:41.763

Your Answer