Return to stock after flashing custom ROMs (Fastboot method)

Search This thread

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi
Note- This is tested on BKL-L09 C675 Indian variant and BKL-L09 C432 EU variant but will work on any variant of V10.

Hi Folks,

As I shared my experience on the issues I faced while moving back to stock from custom ROMs here , in this thread, I will share the detailed steps to go back to on stock avoiding any issues.

If you are on any custom ROM i.e. with Android/EMUI 8.1 TWRP backup will not work except BKL-L04. And only way that comes handy is fastboot (haven't tested the dload method myself yet as didnt had the SD card when I faced the issue but you can follow that, it will not break anything).

So before you start moving further to stock, please have these 3 files handy-
1- Stock recovery ramdisk
2- Stock boot ramdisk
3- system.img

Case 1- Custom ROM + Stock Boot + Stock Recovery (Applicable for new Open Kirin ROMs- RR and LOS which needs stock Ramdisk and if you are not using magisk)
  • On custom ROM, connect your phone with USB debugging enabled. (please make sure all the drivers are installed, it will already be as you may have the same which flashing the custom ROM)
  • Run the command to boot to fastboot
    Code:
    adb reboot bootloader
  • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
  • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

    Code:
    PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
    target reported max download size of 471859200 bytes
    sending sparse 'system' (456507 KB)...
    OKAY [ 11.572s]
    writing 'system'...
    OKAY [  2.669s]
    sending sparse 'system' (457797 KB)...
    OKAY [ 11.722s]
    writing 'system'...
    OKAY [  2.630s]
    sending sparse 'system' (457585 KB)...
    OKAY [ 11.793s]
    writing 'system'...
    OKAY [  3.417s]
    sending sparse 'system' (460798 KB)...
    OKAY [ 12.008s]
    writing 'system'...
    OKAY [  2.611s]
    sending sparse 'system' (413494 KB)...
    OKAY [ 10.682s]
    writing 'system'...
    OKAY [  2.631s]
    sending sparse 'system' (453913 KB)...
    OKAY [ 11.785s]
    writing 'system'...
    OKAY [  2.973s]
    sending sparse 'system' (227740 KB)...
    OKAY [  5.856s]
    writing 'system'...
    OKAY [  1.260s]
    finished. total time: 93.634s
  • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
  • Code:
    fastboot reboot
  • Remove USB and press volume up key to boot to recovery.
  • Perform factory reset and wipe data as well.
  • Once completed, reboot to system.



Case 2- Custom ROM + Stock Recovery + Magisk (Root)
( applicable for New open Kirin ROMs- RR and LOS which needs stock ramdisk and if you are using magisk)
I forgot that I had magisk and had to gone through more issues as post boot, my IMEI was missing and no SIM service but if you have magisk installed, please be more careful and flash stock boot (attached for BKL-L09 EU version)
  • Run the command to boot to fastboot
    Code:
    adb reboot bootloader
  • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
  • Flash the stock boot ramdisk.img as
    Code:
    fastboot flash ramdisk BKL-L09_ramdisk.img
    Or fastboot flash ramdisk <ramdisk_File_Name>
  • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

    Code:
    PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
    target reported max download size of 471859200 bytes
    sending sparse 'system' (456507 KB)...
    OKAY [ 11.572s]
    writing 'system'...
    OKAY [  2.669s]
    sending sparse 'system' (457797 KB)...
    OKAY [ 11.722s]
    writing 'system'...
    OKAY [  2.630s]
    sending sparse 'system' (457585 KB)...
    OKAY [ 11.793s]
    writing 'system'...
    OKAY [  3.417s]
    sending sparse 'system' (460798 KB)...
    OKAY [ 12.008s]
    writing 'system'...
    OKAY [  2.611s]
    sending sparse 'system' (413494 KB)...
    OKAY [ 10.682s]
    writing 'system'...
    OKAY [  2.631s]
    sending sparse 'system' (453913 KB)...
    OKAY [ 11.785s]
    writing 'system'...
    OKAY [  2.973s]
    sending sparse 'system' (227740 KB)...
    OKAY [  5.856s]
    writing 'system'...
    OKAY [  1.260s]
    finished. total time: 93.634s
  • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
  • Code:
    fastboot reboot
  • Remove USB and press volume up key to boot to recovery.
  • Perform factory reset and wipe data as well.
  • Once completed, reboot to system.

Case 3- Custom ROM + Custom Recovery + (Stock Ramdisk/ modified Ramdisk with Magisk) (Applicable for any custom ROM installed with TWRP and on stock boot or Magisk)
I forgot that I had magisk and had to gone through more issues as post boot, my IMEI was missing and no SIM service but if you have magisk installed, please be more careful and flash stock boot (attached for BKL-L09 EU version)
  • Run the command to boot to fastboot
    Code:
    adb reboot bootloader
  • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
  • Flash the stock Recovery Ramdisk as
    Code:
    fastboot flash recovery_ramdisk recovery_ramdisk_bak.img
    Or fastboot flash recovery_ramdisk <Recovery_File_Name>.img
  • If you have stock Boot Ramdisk, proceed to flashing system image and skip flashing the boot ramdisk.
  • If you have installed magisk, flash the stock boot ramdisk.img as
    Code:
    fastboot flash ramdisk BKL-L09_ramdisk.img
    Or fastboot flash ramdisk <ramdisk_File_Name>
  • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

    Code:
    PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
    target reported max download size of 471859200 bytes
    sending sparse 'system' (456507 KB)...
    OKAY [ 11.572s]
    writing 'system'...
    OKAY [  2.669s]
    sending sparse 'system' (457797 KB)...
    OKAY [ 11.722s]
    writing 'system'...
    OKAY [  2.630s]
    sending sparse 'system' (457585 KB)...
    OKAY [ 11.793s]
    writing 'system'...
    OKAY [  3.417s]
    sending sparse 'system' (460798 KB)...
    OKAY [ 12.008s]
    writing 'system'...
    OKAY [  2.611s]
    sending sparse 'system' (413494 KB)...
    OKAY [ 10.682s]
    writing 'system'...
    OKAY [  2.631s]
    sending sparse 'system' (453913 KB)...
    OKAY [ 11.785s]
    writing 'system'...
    OKAY [  2.973s]
    sending sparse 'system' (227740 KB)...
    OKAY [  5.856s]
    writing 'system'...
    OKAY [  1.260s]
    finished. total time: 93.634s
  • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
  • Code:
    fastboot reboot
  • Remove USB and press volume up key to boot to recovery.
  • Perform factory reset and wipe data as well.
  • Once completed, reboot to system.

Once booted on any of the case, you will be on full stock with unlocked bootloader. (you need to either dload to lock the bootlaoder or run the command - fastboot oem urelock <16 digit bootlaoder code> to relock the bootlaoder).

Working and tested myself and confirmed by one more user(Sandeep Dash). So, if you follow the steps correctly, you should not face any issue but in case you get stuck anywhere or not clear with steps and I will try to help as much as I can.

Attached files for BKL-L09 EU version. I will add other files as an when I get it.

Stock Ramdisk for BKL-L09 EU version - Thanks to @topjohnwu for sharing here
Stock Recovery for BKL-L04 EU version -I extracted this but thanks to @shihabsoft for sharing the step which helped me doing this.
Stock system image for BKL-L09 EU Version - Thanks to @surdu_petru for sharing here
 
Last edited:

Smaehtin

Senior Member
May 8, 2017
96
71
Really nice guide! Just one thing: Aren't you missing a
Code:
fastboot flash recovery_ramdisk <recovery_ramdisk_file>
step somewhere?
 
  • Like
Reactions: shashank1320

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi

Attachments

  • IMG_20180628_224259.jpg
    IMG_20180628_224259.jpg
    125 KB · Views: 395
  • Like
Reactions: mondalakash

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi
Really nice guide! Just one thing: Aren't you missing a step somewhere?
Thanks. Nope buddy, as you already have stock recovery (for new Open Kirin ROMs) and only boot ramdisk was modified (for Magisk)
But yes, if you flashed twrp then you need it. Thanks for highlighting it, i will fix this.
 
Last edited:

Smaehtin

Senior Member
May 8, 2017
96
71
Thanks. Nope buddy, as you already have stock recovery and only boot ramdisk was modified.
But yes, if you flashed twrp then you need it. Thanks for highlighting it, i will fix this.

Oh, I see. I was just a little confused about this part then:
So before you start moving further to stock, please have these 3 files handy-
1- Stock recovery ramdisk
2- Stock boot ramdisk
3- system.img
 

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi
Thanks for the confirmation...one question should i use the official twrp or the unofficial one for installing custom roms , decrypting internal storage and so on...
FOr me it was unofficial as I was using OpenKirin ROM as per requirement it should be stock recovery only.
for other ROMs or backup, you can try the unofficial one as official doesnt work on Android 8.1 and it will show random content or character in TWRP so you can not restore or say access the stuffs on your internal memory. I used the unofficial one given here
 

mondalakash

Senior Member
Mar 11, 2017
122
34
FOr me it was unofficial as I was using OpenKirin ROM as per requirement it should be stock recovery only.
for other ROMs or backup, you can try the unofficial one as official doesnt work on Android 8.1 and it will show random content or character in TWRP so you can not restore or say access the stuffs on your internal memory. I used the unofficial one given here
Did you try dirty unicorn RC latest build?
 

mondalakash

Senior Member
Mar 11, 2017
122
34
Yes. Code will remain the same throughout the phone lifecycle. It is based on phone serial number, product if amd IMEI which remains the same and unique for every phone
Thanks buddy for these quick reply..I guess these recovery issues rom bootlopping issues will be fixed if huwaie gave l09 variants 8.1 update

---------- Post added at 07:07 PM ---------- Previous post was at 06:53 PM ----------

Yes. Code will remain the same throughout the phone lifecycle. It is based on phone serial number, product if amd IMEI which remains the same and unique for every phone
Bro if flash system IMG of EU variant will this mean that I will on the EU update cycle?..I mean the dev pulled the system IMG from his V10 EU variant.…
 

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi
Thanks buddy for these quick reply..I guess these recovery issues rom bootlopping issues will be fixed if huwaie gave l09 variants 8.1 update

---------- Post added at 07:07 PM ---------- Previous post was at 06:53 PM ----------


Bro if flash system IMG of EU variant will this mean that I will on the EU update cycle?..I mean the dev pulled the system IMG from his V10 EU variant.…
It will not allow to flash or wont boot.
You may need to flash the oeminfo file first and then system img. Had this been this easy, i would have rebranded to Indian version. See one of my debranding guide in signature :)
 

mondalakash

Senior Member
Mar 11, 2017
122
34
It will not allow to flash or wont boot.
You may need to flash the oeminfo file first and then system img. Had this been this easy, i would have rebranded to Indian version. See one of my debranding guide in signature :)
Or I can pull my system ,boot,ramdisk by ADB since I haven't messed with the device apart from unlocking it

---------- Post added at 08:19 PM ---------- Previous post was at 08:11 PM ----------

Same bootloader unlock can be used multiple times for unlocking? Any idea
Using erecovery would be easier if u have fast internet and I heard it doesn't relock the bootloader
I mean the relock doesn't matter according to u as we can just use the code several times ...then I guess dload is easier only need a SD card...I mean it doesn't even matter which one of the scenarios we are in as mentioned by u in the OP.
 

shashank1320

Inactive Recognized Contributor
May 26, 2015
7,502
2,084
Delhi
Or I can pull my system ,boot,ramdisk by ADB since I haven't messed with the device apart from unlocking it

---------- Post added at 08:19 PM ---------- Previous post was at 08:11 PM ----------


Using erecovery would be easier if u have fast internet and I heard it doesn't relock the bootloader
I mean the relock doesn't according to u as we can just use the code several times ...then I guess dload is easier only need a SD card...I mean it doesn't even matter which one of the scenarios we are in as mentioned by u in the OP.
Erecovery download is difficult and give error many times.
Dload actually lock the bootloader and you will be on full stock.
In my case, i had to relock the bootloader as it was in bootloop and i knew relocking will give me erecovery to download.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Note- This is tested on BKL-L09 C675 Indian variant and BKL-L09 C432 EU variant but will work on any variant of V10.

    Hi Folks,

    As I shared my experience on the issues I faced while moving back to stock from custom ROMs here , in this thread, I will share the detailed steps to go back to on stock avoiding any issues.

    If you are on any custom ROM i.e. with Android/EMUI 8.1 TWRP backup will not work except BKL-L04. And only way that comes handy is fastboot (haven't tested the dload method myself yet as didnt had the SD card when I faced the issue but you can follow that, it will not break anything).

    So before you start moving further to stock, please have these 3 files handy-
    1- Stock recovery ramdisk
    2- Stock boot ramdisk
    3- system.img

    Case 1- Custom ROM + Stock Boot + Stock Recovery (Applicable for new Open Kirin ROMs- RR and LOS which needs stock Ramdisk and if you are not using magisk)
    • On custom ROM, connect your phone with USB debugging enabled. (please make sure all the drivers are installed, it will already be as you may have the same which flashing the custom ROM)
    • Run the command to boot to fastboot
      Code:
      adb reboot bootloader
    • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
    • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

      Code:
      PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
      target reported max download size of 471859200 bytes
      sending sparse 'system' (456507 KB)...
      OKAY [ 11.572s]
      writing 'system'...
      OKAY [  2.669s]
      sending sparse 'system' (457797 KB)...
      OKAY [ 11.722s]
      writing 'system'...
      OKAY [  2.630s]
      sending sparse 'system' (457585 KB)...
      OKAY [ 11.793s]
      writing 'system'...
      OKAY [  3.417s]
      sending sparse 'system' (460798 KB)...
      OKAY [ 12.008s]
      writing 'system'...
      OKAY [  2.611s]
      sending sparse 'system' (413494 KB)...
      OKAY [ 10.682s]
      writing 'system'...
      OKAY [  2.631s]
      sending sparse 'system' (453913 KB)...
      OKAY [ 11.785s]
      writing 'system'...
      OKAY [  2.973s]
      sending sparse 'system' (227740 KB)...
      OKAY [  5.856s]
      writing 'system'...
      OKAY [  1.260s]
      finished. total time: 93.634s
    • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
    • Code:
      fastboot reboot
    • Remove USB and press volume up key to boot to recovery.
    • Perform factory reset and wipe data as well.
    • Once completed, reboot to system.



    Case 2- Custom ROM + Stock Recovery + Magisk (Root)
    ( applicable for New open Kirin ROMs- RR and LOS which needs stock ramdisk and if you are using magisk)
    I forgot that I had magisk and had to gone through more issues as post boot, my IMEI was missing and no SIM service but if you have magisk installed, please be more careful and flash stock boot (attached for BKL-L09 EU version)
    • Run the command to boot to fastboot
      Code:
      adb reboot bootloader
    • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
    • Flash the stock boot ramdisk.img as
      Code:
      fastboot flash ramdisk BKL-L09_ramdisk.img
      Or fastboot flash ramdisk <ramdisk_File_Name>
    • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

      Code:
      PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
      target reported max download size of 471859200 bytes
      sending sparse 'system' (456507 KB)...
      OKAY [ 11.572s]
      writing 'system'...
      OKAY [  2.669s]
      sending sparse 'system' (457797 KB)...
      OKAY [ 11.722s]
      writing 'system'...
      OKAY [  2.630s]
      sending sparse 'system' (457585 KB)...
      OKAY [ 11.793s]
      writing 'system'...
      OKAY [  3.417s]
      sending sparse 'system' (460798 KB)...
      OKAY [ 12.008s]
      writing 'system'...
      OKAY [  2.611s]
      sending sparse 'system' (413494 KB)...
      OKAY [ 10.682s]
      writing 'system'...
      OKAY [  2.631s]
      sending sparse 'system' (453913 KB)...
      OKAY [ 11.785s]
      writing 'system'...
      OKAY [  2.973s]
      sending sparse 'system' (227740 KB)...
      OKAY [  5.856s]
      writing 'system'...
      OKAY [  1.260s]
      finished. total time: 93.634s
    • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
    • Code:
      fastboot reboot
    • Remove USB and press volume up key to boot to recovery.
    • Perform factory reset and wipe data as well.
    • Once completed, reboot to system.

    Case 3- Custom ROM + Custom Recovery + (Stock Ramdisk/ modified Ramdisk with Magisk) (Applicable for any custom ROM installed with TWRP and on stock boot or Magisk)
    I forgot that I had magisk and had to gone through more issues as post boot, my IMEI was missing and no SIM service but if you have magisk installed, please be more careful and flash stock boot (attached for BKL-L09 EU version)
    • Run the command to boot to fastboot
      Code:
      adb reboot bootloader
    • On fastboot screen, you will have bootloader state as Unlocked and FRP Unlocked.
    • Flash the stock Recovery Ramdisk as
      Code:
      fastboot flash recovery_ramdisk recovery_ramdisk_bak.img
      Or fastboot flash recovery_ramdisk <Recovery_File_Name>.img
    • If you have stock Boot Ramdisk, proceed to flashing system image and skip flashing the boot ramdisk.
    • If you have installed magisk, flash the stock boot ramdisk.img as
      Code:
      fastboot flash ramdisk BKL-L09_ramdisk.img
      Or fastboot flash ramdisk <ramdisk_File_Name>
    • Flash System image as below, Wait for process to finish, it may take 1-2 minutes for entire flash (93 seconds in my case)

      Code:
      PS C:\adb> fastboot flash system BKL-C432B130_system.img or fastboot flash system <system_filename>.img
      target reported max download size of 471859200 bytes
      sending sparse 'system' (456507 KB)...
      OKAY [ 11.572s]
      writing 'system'...
      OKAY [  2.669s]
      sending sparse 'system' (457797 KB)...
      OKAY [ 11.722s]
      writing 'system'...
      OKAY [  2.630s]
      sending sparse 'system' (457585 KB)...
      OKAY [ 11.793s]
      writing 'system'...
      OKAY [  3.417s]
      sending sparse 'system' (460798 KB)...
      OKAY [ 12.008s]
      writing 'system'...
      OKAY [  2.611s]
      sending sparse 'system' (413494 KB)...
      OKAY [ 10.682s]
      writing 'system'...
      OKAY [  2.631s]
      sending sparse 'system' (453913 KB)...
      OKAY [ 11.785s]
      writing 'system'...
      OKAY [  2.973s]
      sending sparse 'system' (227740 KB)...
      OKAY [  5.856s]
      writing 'system'...
      OKAY [  1.260s]
      finished. total time: 93.634s
    • Once the system image is flashed successfully, run the command to boot but immediately remove USB and press volume up key to boot to recoevery rather than system (even if you skip, it may not boot to system)
    • Code:
      fastboot reboot
    • Remove USB and press volume up key to boot to recovery.
    • Perform factory reset and wipe data as well.
    • Once completed, reboot to system.

    Once booted on any of the case, you will be on full stock with unlocked bootloader. (you need to either dload to lock the bootlaoder or run the command - fastboot oem urelock <16 digit bootlaoder code> to relock the bootlaoder).

    Working and tested myself and confirmed by one more user(Sandeep Dash). So, if you follow the steps correctly, you should not face any issue but in case you get stuck anywhere or not clear with steps and I will try to help as much as I can.

    Attached files for BKL-L09 EU version. I will add other files as an when I get it.

    Stock Ramdisk for BKL-L09 EU version - Thanks to @topjohnwu for sharing here
    Stock Recovery for BKL-L04 EU version -I extracted this but thanks to @shihabsoft for sharing the step which helped me doing this.
    Stock system image for BKL-L09 EU Version - Thanks to @surdu_petru for sharing here
    1
    Really nice guide! Just one thing: Aren't you missing a
    Code:
    fastboot flash recovery_ramdisk <recovery_ramdisk_file>
    step somewhere?
    1
    Will these method work on bkl l09 model (indian variant)?
    Yes it will, 100%. The case 1 confirmation from Sandeep is for Indian variant only.
    1
    Oh, I see. I was just a little confused about this part then:
    Fixed in OP. Added one more case for custom recovery users.
    Thanks for valuable input buddy.
    1
    I have BKL-L09 EU variant
    Let me check. I may have the file handy on mega drive.