Android刷机
1、安装第三方recovery
下载自己手机适配的recovery包
https://twrp.me/lg/lgnexus5.html
fastboot 卡在 waiting for device
$ fastboot flash boot boot.img < waiting for device >
看看devices
$ fastboot devices
no permissions fastboot
以下操作,ok
seven@ThinkPad:~/srcAndroid/src4.4.4_r1/out/host/linux-x86/bin$ sudo chown root:root fastboot seven@ThinkPad:~/srcAndroid/src4.4.4_r1/out/host/linux-x86/bin$ sudo chmod +s fastboot seven@ThinkPad:~/srcAndroid/src4.4.4_r1/out/host/linux-x86/bin$ ./fastboot devices 072ba3800ae5fd9c fastboot seven@ThinkPad:~/srcAndroid/src4.4.4_r1/out/host/linux-x86/bin$ ./fastboot flash recovery ~/Desktop/twrp-3.3.0-0-hammerhead.img sending 'recovery' (13288 KB)... OKAY [ 0.641s] writing 'recovery'... OKAY [ 1.045s] finished. total time: 1.686s
2、单独root(可选)
recovery操作SR5-SuperSU-v2.82-SR5-20171001224502.zip包,root手机
1、将SR5-SuperSU-v2.82-SR5-20171001224502.zip传到手机
seven@Sevens-MacBook-Pro:~/Work/andriod/刷机$ adb push SR5-SuperSU-v2.82-SR5-20171001224502.zip /sdcard
2、进入recovery模式,在手机上操作
2.1、install
2.2、选SR5-SuperSU-v2.82-SR5-20171001224502.zip文件
2.3、重启手机,root成功
3、刷rom
自定义rom(放置app,xposed,tcpdump等,su和superSu.apk)
编辑脚本(updater-script)
路径为:/home/seven/Desktop/myROM/4.4.4/META-INF/com/google/android/updater-script
打包rom
seven@ThinkPad:~/Desktop/myROM/4.4.4$ zip -r ../444.zip *
签名zip(rom)
seven@ThinkPad:~/Desktop/myROM/Auto-sign$ java -jar signapk.jar testkey.x509.pem testkey.pk8 ../444.zip ../444_signed.zip
将签名过的zip(rom)上传到手机
seven@ThinkPad:~/Desktop/myROM$ adb push 444_signed.zip /sdcard/444_signed.zip 8023 KB/s (200093378 bytes in 24.352s)
重启手机到recovery
seven@ThinkPad:~/Desktop/myROM$ adb reboot recovery