刷機
在安卓逆向工程中,經常會碰到一些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