0

Situation
Device: HTC One M9
Recovery: TWRP
Custom ROM: Android Revolution HD (Android 6.0)

Problem
I want to flash the stock rom without wiping anything (I don't want to lose anything). I can flash the stock recovery. I have extracted the system.img and boot.img from the official RUU in order to flash the system image to get rid of the Custom ROM.
When I use fastboot to flash the boot image everything seems fine.
However, when I flash the system image which is about 4.5 gigs big, it again says OK but it only takes around 30 seconds to flash.
When I try to boot after flashing the images, the htc logo appears but nothing more happens. Trying to install an OTA with the stock recovery fails with "system partition has unexpected contents".
I assume that the flashing process wasn't really successful.

How can I correctly flash the system partition?
Or is there any other way to get back to the stock rom without wiping userdata?
And NO, it's not acceptable in any way to wipe (I know that aprox. 98% of android enthusiasts would answer: "Just wipe".)

Btw. the reason for all of this is that the custom rom might not be updated to android 7 so i want to install the ota.

[edit]:
I use htc's fastboot version since the system image is 4.5g big and it cannot be flashed with normal fastboot.

  • Just wipe, lol. The remaining data from custom ROM might not be compatible with stock ROM anyway, unless they're of the exact same version. – Andy Yan Feb 8 '17 at 10:11
  • What remaining data do you mean? Isn't nearly all data in the system partition which i want to completely reflash? Probably some data in the cache (since I wont lose anything by wiping the cache I tried that already but did not help)? It should also be the nearly exact same version. The custom rom is based on that exact system image and does not feature that many changes... – Walter Wolf Feb 8 '17 at 10:16
  • 1
    App data I mean. Also, I'm baffled by the fact that a system image can be that large... – Andy Yan Feb 8 '17 at 11:40
  • Yeah I was very surprised by the 4.5g. What app data does a custom rom have which might interfere with a new system? Anyway I'm pretty sure not even wiping would solve my problem, since I cannot really flash the system image. I don't think it's possible to flash a whole rom in just 30 seconds. Even the boot image which is ~20mb takes 15secs to flash... – Walter Wolf Feb 8 '17 at 11:49
  • 1
    Downgraded ROMs with downgraded apps usually can't accommodate to data generated by new versions - this is what I'm talking about. Have you considered the risky dd approach? That's the only one left that I can think of. – Andy Yan Feb 8 '17 at 12:03
1

Usually large images are flashed in sparse (parts). To flash a full image that large, consider using the dd command in a shell to directly write the image to /system - that's the only approach I can think of that doesn't seem to have size issues.

[edit]: dd worked (booted to twrp and opened adb shell):
dd if=/external_sd/system.img of=/dev/block/mmcblk0p66
where mmcblk0p66 is the system partition (in /dev/block/platform/<something>.sdhci/by-name you can find a list of all partitions)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.