So in my app Im trying to make it flash a .zip in clockwork recovery using this
Runtime run = Runtime.getRuntime();
Process p = null;
DataOutputStream out = null;
try{
p = run.exec("su");
out = new DataOutputStream(p.getOutputStream());
out.writeBytes("echo install_zip SDCARD:" +clickedFile.toString() +" > /cache/recovery/extendedcommand\n");
out.writeBytes("reboot recovery\n"); // testing
out.flush();
}catch(Exception e){
Log.e("FLASH", "Unable to reboot into recovery mode:", e);
e.printStackTrace();
}
It will boot into recovery but it will not flash the .zip.. Whats wrong.. oh, and if you need the whole .java file here it is:
I had the same issue but I was using a ListView combined with an ArrayAdapter to return the full path of the file. When I tried passing the path as 'SDCARD:' followed by the path to the file, it wasn't able to find the file as the method seems to be no longer supported by newer versions of CWM Recovery. I found an easy workaround though:
adb
commands would look like: