I want to create C++ executables to flash ROMs over ADB on android phones, can anyone help me on this? I have a basic knowledge of C++ but cannot understand from where I should start The logic is Initialize header files-->Initialize ADB service-->Start ADB shell-->Flash the .img files using flash_image binary--> ADB reboot
Can anyone give me a simple example for flashing boot image? I m unaware what header files should I include, which compiler should I use. created a new thread as I didn't find anything regarding this
Thank you
adb has nothing to do with flashing ROMs, adb is the debugger interface, which requires system up and running on your phone. And trying to reflash the ROM image with fully running system is like performing a heart surgery without an anaesthetic.
There are two basic ways of reflashing of ROM images correctly:
The former one is when you copy/download your ROM image as update.zip to the sdcard and then use recovery to update the system. This usually involves users pushing some buttons and powering phone off and on back again. This is the best method, because the update file is already safely stored on the sdcard, can be checked and verified, and the chance of bricking the phone is slim to none.
The second one is when you connect your phone to the PC, switch it to fastboot mode with 'adb reboot bootloader' (or switching off/on and holding some buttons), and then use fastboot to perform ROM update magic. Problem is, when using fastboot you need a very reliable USB connection. Any communication error and the phone is bricked. This is why I don't use and don't recommend fastboot method to reflash ROMs.
If you don't mind bricking your phone using fastboot method, the C++ program would be quite simple.
Finally, I'd like to stress again, reflashing ROMs with fastboot is quite dangerous, and I'd recommend to avoid it if possible.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.