刷机
在安卓逆向工程中,经常会碰到一些app无法在模拟器中正常运行,为了避免麻烦,一台测试机是必不可少的。这里推荐”Google亲儿子“Nexus系列和Pixel系列的测试机。笔者在本书中选择的是Nexus 5X。测试机有了,为了方便以及更加深入的研究,刷机的一些基本知识也要具备。
刷机前准备:
//操作成功之后打开cmd输入如下命令,将会有如下提示:
C:\Users\Kaiser>adb devices
List of devices attached
00d14953b264bd0f device
C:\Users\Kaiser>adb reboot bootloader
/*查看最后一行信息
*DEVICES STATE - locked OEM未解锁
*DEVICES STATE - unlocked OEM已解锁
*/
C:\Users\Kaiser>fastboot oem unlock
开始刷机
PS D:\刷机包\bullhead-opm1.171019.011> adb reboot bootloader
PS D:\刷机包\bullhead-opm1.171019.011> ./flash-all.bat
...
...
Rebooting OKAY [ 0.018s]
Finished. Total time: 92.891s
Press any key to exit...
PS D:\刷机包\bullhead-opm1.171019.011> adb shell settings put global captive_portal_http_url https://www.google.cn/generate_204
PS D:\刷机包\bullhead-opm1.171019.011> adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
PS D:\刷机包\bullhead-opm1.171019.011> adb shell settings put global ntp_server 1.hk.pool.ntp.org
至此,刷机完成
ROOT
PS D:\刷机包\Boot.Img> adb shell
bullhead:/ $ cd /sdcard
bullhead:/sdcard $ ls
Alarms DCIM Movies Notifications Podcasts TWRP magisk_patched-24200_tZl61.img
Android Download Music Pictures Ringtones boot.img
bullhead:/sdcard $ exit
PS D:\刷机包\Boot.Img> adb pull /sdcard/magisk_patched-24200_tZl61.img D:\刷机包
/sdcard/magisk_patched-24200_tZl61.img: 1 file pulled, 0 skipped. 24.3 MB/s (12580136 bytes in 0.493s)
PS D:\刷机包> adb reboot fastboot
PS D:\刷机包> fastboot flash boot magisk_patched.img
Sending 'boot_a' (31005 KB) OKAY [ 0.500s]
Writing 'boot_a' OKAY [ 0.144s]
Finished. Total time: 0.701s