Some people may curious how does update-binary in your update.zip is created...And what is going on inside of it
This show you how to compile it in normal way.
- Execution speed is faster, binary size is much smaller than AOSP rom generated binary, even without any PE compression.
- Function is shrinked, but added set file permission.
- Compatible with most platform, ARM, x86, etc.
- SELinux is deleted from code.
Create a script file call "updater-script" inside your zip folder, e.g: ZIPFILE/META-INF/com/google/android/, edit your script here.
Put your compiled update-binary into that folder too, pack your zip correctly(7zip deflate) will do the job, finally test your zip installer.
- Incompatible binary is used. You may using x86 binary on ARM devices.
- Check your script, wrong syntax will cause error.
Example "updater-script" from JamesDSPManager .zip installer:
ui_print("**********************************************");
ui_print("*Installing JamesDSP for Android 5.X.X or above (ARM)*");
ui_print("**********************************************");
run_program("/sbin/busybox", "mount", "/system");
delete_recursive("/system/app/MusicFX");
delete_recursive("/system/priv-app/MusicFX");
delete_recursive("/system/priv-app/AudioFX");
delete_recursive("/system/priv-app/SoundAlive_20_L");
delete_recursive("/system/priv-app/SoundAlive_30");
delete_recursive("/data/data/org.cyanogenmod.audiofx");
delete_recursive("/data/data/com.android.musicfx");
delete_recursive("/data/data/com.sec.android.app.soundalive");
delete("/system/app/DSPManager_All.apk");
delete("/system/lib/libjamesDSPImpulseToolbox.so");
delete("/system/lib/soundfx/libjamesdsp.so");
delete("/system/vendor/etc/audio_effects.conf");
package_extract_dir("system", "/system");
ui_print("Fixing permissions...");
set_perm(0, 0, 0644, "/system/app/DSPManager_All.apk");
set_perm(0, 0, 0644, "/system/lib/libjamesDSPImpulseToolbox.so");
set_perm(0, 0, 0644, "/system/lib/soundfx/libjamesdsp.so");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
run_program("/sbin/busybox", "umount", "/system");
ui_print("**********************************************");
ui_print("* Installation complete... *");
ui_print("* Please reboot and launch JamesDSP *");
ui_print("**********************************************");
show_progress(0.100000, 0);