FORUMS
Remove All Ads from XDA

[GUIDE] Workaround of flashing "New Sparse" Android Pie firmware by yourself

313 posts
Thanks Meter: 445
 
Post Reply Email Thread
This guide is a supplement of previous topic: https://forum.xda-developers.com/sho....php?t=3793791

And it can be applied on following models:
Nokia 6.1 / X6 / 6.1 Plus
Nokia 7 / 7.1 / 7 Plus
Nokia 8 / Sirocco

PLEASE ENSURE YOUR PHONE HAS UNLOCKED BOOTLOADER, OTHERWISE THIS GUIDE IS USELESS.


For some reason, new Android Pie firmware I've released on https://fih-firmware.hikaricalyx.com/index_en.html used new sparse format, that can't be processed properly with fastboot included by either OST LA 6.0.4 Patched for All or NOST by StollD, so the flash will fail, like this log mentioned:

Code:
[17:28:20::888][03536]	[COMMENT]: Sending sparse 1 of 'system_a' ( 361188 KB)
[17:28:20::893][03536]	[ADB]: [Send] download:160b9088
[17:28:20::899][03536]	[ADB]: [Recv] DATA160b9088
[17:28:20::904][03536]	[ADB]: [Send] <bin...>
[17:28:33::655][03536]	[ADB]: [Recv] OKAY
[17:28:33::659][03536]	[ADB]: [Send] flash:system_a
[17:28:33::717][03536]	[ADB]: [Recv] OKAY
[17:28:33::723][03536]	[COMMENT]: Sending sparse 2 of 'system_a' ( 261388 KB)
[17:28:33::727][03536]	[ADB]: [Send] download:ff4304c
[17:28:34::354][03536]	[ADB]: [Recv] DATAff4304c
[17:28:34::358][03536]	[ADB]: [Send] <bin...>
[17:28:43::635][03536]	[ADB]: [Recv] OKAY
[17:28:43::639][03536]	[ADB]: [Send] flash:system_a
[17:28:43::696][03536]	[ADB]: [Recv] OKAY
[17:28:43::701][03536]	[COMMENT]: Sending sparse 3 of 'system_a' ( 261388 KB)
[17:28:43::706][03536]	[ADB]: [Send] download:ff4304c
[17:28:43::758][03536]	[ADB]: [Recv] DATAff4304c
[17:28:43::762][03536]	[ADB]: [Send] <bin...>
[17:28:54::914][03536]	[ADB]: [Recv] OKAY
[17:28:54::919][03536]	[ADB]: [Send] flash:system_a
[17:28:54::979][03536]	[ADB]: [Recv] OKAY
[17:28:54::984][03536]	[COMMENT]: Sending sparse 4 of 'system_a' ( 261388 KB)
[17:28:54::989][03536]	[ADB]: [Send] download:ff4304c
[17:28:57::010][03536]	[ADB]: [Recv] DATAff4304c
[17:28:57::016][03536]	[ADB]: [Send] <bin...>
[17:29:08::394][03536]	[ADB]: [Recv] OKAY
[17:29:08::401][03536]	[ADB]: [Send] flash:system_a
[17:29:08::460][03536]	[ADB]: [Recv] OKAY
[17:29:08::465][03536]	[COMMENT]: Sending sparse 5 of 'system_a' ( 916756 KB)
[17:29:08::470][03536]	[ADB]: [Send] download:37f45040
[17:29:10::120][03536]	[ADB]: [Recv] FAILRequested download size is more than max allowed

[17:29:10::124][03536]	[ERROR DESCRIPTION]: (bootloader) [FAIL] requested download size is more than max allowed


However the system and vendor image can be flashed properly with fastboot included in Google Official Platform Tools.
Here's my easier trick:

For ES2, ROO, CO2, PDA, PL2, DRG, C1N, CTL, B2N, NB1, A1N, SS2, SAT, HH1, SD1 and SG1 models, now you can use my flashing script to reflash stock firmware (including New Sparse One) with few simple steps.
You can download packaged flashing script from: https://github.com/HikariCalyx/OSTRemote/releases/

Here's how to use:
- install required flashing driver by HMD Global / FIH Mobile
- unpack nb0
- place this executable in the unpacked firmware directory
- double click the executable and follow the procedure

Let me demonstrate how:

1. Download the packaged script file from Github.

For Nokia 6.1, Nokia 6.1 Plus X6, Nokia 7, Nokia 7.1, Nokia 7 Plus and Sharp Aquos S2 / S3 / mini, please download this one:

generic_flash_script_gsi_sdm660_64_en_1.0.1.exe
Quote:

For macOS / Linux users, please download it from
https://github.com/HikariCalyx/OSTRe...dm660_64_en.sh

For Nokia 8 / Sirocco, please download

generic_flash_script_nb1_a1n_0.0.1.m2.exe
Quote:

For macOS / Linux users, please download it from
https://github.com/HikariCalyx/OSTRe..._nb1_a1n_en.sh

For Nokia 3.1 / Plus, Nokia 5.1 / Plus X5, please download

generic_flash_script_mediatek_ab_0.0.1.m2.exe
Quote:

For macOS / Linux users, please download it from
https://github.com/HikariCalyx/OSTRe...iatek_ab_en.sh

Quote:

This executable packaged the script itself and required fastboot files.
Script source can be found at https://github.com/HikariCalyx/OSTRe...FlashingScript

Because I've used Bat2EXE converter by www.f2ko.de , it may marked as Trojan virus by few Antivirus App, but I can guarantee it's safety.
You can use script source instead if you still concern, but you'll need to prepare fastboot files by yourself.

2. Place it to the unpacked firmware directory.

3. Double click the packaged script.

4. If you want to erase userdata after flashed, type "yes" (without quotes) and press Enter. Otherwise, just press Enter with nothing typed.
For MediaTek AB devices, simply press Enter key.

5. Now connect your powered off phone, or a phone under fastboot / download mode.

6. The tool will recognize your phone automatically and compare if the firmware itself is suitable for your phone.
If you confirmed the phone is fully unlocked, press Enter key to start flashing.

7. Now wait for the procedure complete.
If your phone is not unlocked, it will reboot your phone to normal mode automatically.

That should be few simple steps, and wraps up the whole "New Sparse" stock firmware flashing workaround guide, hope this will be helpful.
 
 
5th April 2019, 02:13 PM |#2  
hikari_calyx's Avatar
OP Senior Member
Flag Wuhan
Thanks Meter: 445
 
Donate to Me
More
Backup of Old method
Edit the mlf file to bypass system and vendor flashing, then you flash these partitions manually with fastboot commands.
Let's take the B2N-339B-0-00WW-B03 firmware for example.

First part you need to edit are the INITOPTION, INITDLTYPE and SECURITY_VER.
You should know the target value you need to edit to:
Code:
INITOPTION = 0x20000
INITDLTYPE = 0x60
SECURITY_VER = 0x0001
Now this firmware can be accepted by OST LA 6.0.4 or NOST, but still far from enough.

As I've mentioned, you need to bypass system and vendor partition flashing, here's how:

Find these content:
Code:
[Package Info 31]
PACKAGE_NAME = "system_a"
BOOT_NAME = "system_a"
OPTION = 0x40000
IMAGE_FILE = "B2N-0-339B-00WW-system.img"

[Package Info 32]
PACKAGE_NAME = "system_b"
BOOT_NAME = "system_b"
OPTION = 0x40000
IMAGE_FILE = "B2N-0-339B-00WW-system_other.img"

...

[Package Info 49]
PACKAGE_NAME = "vendor_a"
BOOT_NAME = "vendor_a"
OPTION = 0x40000
IMAGE_FILE = "B2N-0-339B-00WW-vendor.img"
Digits after Package Info may vary from model from model, so please DO NOT simply copy and paste:

Code:
[Package Info 31]
PACKAGE_NAME = "getvar current-slot"
BOOT_NAME = "getvar current-slot"
OPTION = 0x1000000000000000
IMAGE_FILE = ""

[Package Info 32]
PACKAGE_NAME = "getvar current-slot"
BOOT_NAME = "getvar current-slot"
OPTION = 0x1000000000000000
IMAGE_FILE = ""

...

[Package Info 49]
PACKAGE_NAME = "getvar current-slot"
BOOT_NAME = "getvar current-slot"
OPTION = 0x1000000000000000
IMAGE_FILE = ""
The point of changing them, is to use simple fastboot oem commands to replace flashing command in order to bypass these partition flashing temporarily.

Also, please edit the last package info that mentioned about md4 flashing to power off command that can ensure your phone will not boot to normal OS properly.
Code:
[Package Info 60]
PACKAGE_NAME = "md4"
BOOT_NAME = "md4"
OPTION = 0x2
TIMEOUT = 360000
IMAGE_FILE = "md4.dat"
Code:
[Package Info 60]
PACKAGE_NAME = "oem HALT"
BOOT_NAME = "oem HALT"
OPTION = 0x1000000000000000
IMAGE_FILE = ""

After modification complete, use OST LA to open the modified mlf file, and ensure you have checked "Normal Download", "Erase user data" in Update Option.

After the flashing ends, it will hang at "Checking device status", this is expected. Now close OST LA and reopen it, then disconnect your phone and connect it again. When your phone booted to Download mode again, close OST LA.
Use fastboot to flash system and vendor partitions manually. Filename may vary from model from model, so please DO NOT simply copy and paste:

Code:
fastboot flash system_a B2N-0-339B-00WW-system.img
fastboot flash system_b B2N-0-339B-00WW-system_other.img
fastboot flash vendor_a B2N-0-339B-00WW-vendor.img
Then reboot your phone:

Code:
fastboot reboot
That wraps up the whole "New Sparse" stock firmware flashing workaround guide, hope this will be helpful, until a cross-platform mlf script flasher can be written by someone.
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