android - How to flash ROM from app? -
i trying make updater custom rom. can recovery app by:
process p = runtime.getruntime().exec("su"); outputstream os = p.getoutputstream(); os.write("mkdir -p /cache/recovery/\n".getbytes()); os.write("echo 'boot-recovery' >/cache/recovery/command\n".getbytes()); os.write("reboot recovery\n".getbytes()); os.flush();
if add next lines, device load recovery, clear cache , boot system.
os.write("echo '--whipe-cache' >>/cache/recovery/command\n".getbytes()); os.write("echo 'reboot' >> /cache/recovery/command\n".getbytes());
is there command execute flashing?
you can add line:
os.write("echo '--update_package=/sdcard/update.zip' >>/cache/recovery/command\n".getbytes());
before
os.write("reboot recovery\n".getbytes()); os.flush();
Comments
Post a Comment