FORUMS
Remove All Ads from XDA

Return to stock after flashing custom ROMs (Fastboot method)

7,444 posts
Thanks Meter: 2,057
 
Post Reply Email Thread
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
The Following User Says Thank You to shashank1320 For This Useful Post: [ View ] Gift shashank1320 Ad-Free
 
 
28th June 2018, 04:34 PM |#2  
mondalakash's Avatar
Senior Member
Thanks Meter: 32
 
More
Will these method work on bkl l09 model (indian variant)?
28th June 2018, 04:47 PM |#3  
Honor Fanatic
Member
Thanks Meter: 59
 
More
Really nice guide! Just one thing: Aren't you missing a
Code:
fastboot flash recovery_ramdisk <recovery_ramdisk_file>
step somewhere?
The Following User Says Thank You to Smaehtin For This Useful Post: [ View ] Gift Smaehtin Ad-Free
28th June 2018, 06:13 PM |#4  
shashank1320's Avatar
OP Recognized Contributor
Flag Delhi
Thanks Meter: 2,057
 
Donate to Me
More
Quote:
Originally Posted by mondalakash

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.
Attached Thumbnails
Click image for larger version

Name:	IMG_20180628_224259.jpg
Views:	356
Size:	125.0 KB
ID:	4537422  
The Following User Says Thank You to shashank1320 For This Useful Post: [ View ] Gift shashank1320 Ad-Free
28th June 2018, 06:15 PM |#5  
shashank1320's Avatar
OP Recognized Contributor
Flag Delhi
Thanks Meter: 2,057
 
Donate to Me
More
Quote:
Originally Posted by Smaehtin

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.
28th June 2018, 06:17 PM |#6  
mondalakash's Avatar
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by shashank1320

Yes it will, 100%. The case 1 confirmation from Sandeep is for Indian variant only.

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...
28th June 2018, 06:21 PM |#7  
Honor Fanatic
Member
Thanks Meter: 59
 
More
Quote:
Originally Posted by shashank1320

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:
Quote:
Originally Posted by shashank1320

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

28th June 2018, 06:37 PM |#8  
shashank1320's Avatar
OP Recognized Contributor
Flag Delhi
Thanks Meter: 2,057
 
Donate to Me
More
Quote:
Originally Posted by mondalakash

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
28th June 2018, 06:39 PM |#9  
mondalakash's Avatar
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by shashank1320

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?
28th June 2018, 07:04 PM |#10  
shashank1320's Avatar
OP Recognized Contributor
Flag Delhi
Thanks Meter: 2,057
 
Donate to Me
More
Quote:
Originally Posted by Smaehtin

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.
The Following User Says Thank You to shashank1320 For This Useful Post: [ View ] Gift shashank1320 Ad-Free
28th June 2018, 07:05 PM |#11  
shashank1320's Avatar
OP Recognized Contributor
Flag Delhi
Thanks Meter: 2,057
 
Donate to Me
More
Quote:
Originally Posted by mondalakash

Did you try dirty unicorn RC latest build?

Nope buddy. Did you? Any feedback?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes