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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -