- 進入fastboot
- adb reboot bootloader
- unlock bootloader
- fastboot flashing unlock
- fastboot oem unlock <==舊裝置用這個
- 燒image
- 執行flash-all script
- lock bootloader
- fastboot flashing lock
- fastboot oem lock <==舊裝置用這個
Nexus4: occam
目前最新image 為5.1.1 (LMY48T)
private boolean copyFile(String fName, int rawId){
InputStream inS = null;
OutputStream outS = null;
byte [] buf = new byte[1024];
int readByte = 0;
try {
inS = getApplicationContext().getResources().openRawResource(rawId);
outS = openFileOutput(fName,MODE_PRIVATE);
while((readByte = inS.read(buf, 0, 1024)) != -1){
outS.write(buf, 0, readByte);
}
inS.close();
outS.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}