[Q]Unlock VZW bootloader? Hard brick the Z2 - what would it take? - Xperia Z2 Tablet Q&A, Help & Troubleshooting

I'm pondering options with the vzw z2 tablet (sgp561) and before I start playing with this fire, I am curious what it would take to hard brick this so I know what NOT to try.
Any thoughts?

In theory as long as fastboot works it should be pretty tough to brick. I don't really know how fastboot works on Sony devices I have mostly Samsung devices but I assume download mode work largely the same as fastboot. I have brought back Samsung devices from being very near full hard brick. That said they were old and had unlocked bootloaders. I am not sure how relevant my two cents is but that is what I have. On another note I also have the 561 and am more than happy to help in any way I can. I really want some CM12 on this thing since VZW probably won't give it to us until everyone else has had it for 6 months.

Maxim512 said:
In theory as long as fastboot works it should be pretty tough to brick. I don't really know how fastboot works on Sony devices I have mostly Samsung devices but I assume download mode work largely the same as fastboot. I have brought back Samsung devices from being very near full hard brick. That said they were old and had unlocked bootloaders. I am not sure how relevant my two cents is but that is what I have. On another note I also have the 561 and am more than happy to help in any way I can. I really want some CM12 on this thing since VZW probably won't give it to us until everyone else has had it for 6 months.
Click to expand...
Click to collapse
Well, I can throw a couple of "kopeka's" (cents) in as well.
Fastboot is a life savior. Bar none. With it, you can wipe partitions and flash new partition images. Now this is taken that the fastboot capabilities in the given bootloader are "full" and not neutered in some way. Yes, it could possibly be so.
The only way I know, where you can perma-brick the device, is by flashing things on incorrect partition formats, or flashing a bootloader not meant for the device.
Incorrect custom recoveries are notorious for this, as they flash incorrect partition info. (been there, did that).
Also, nand memory can fail after some flashings. It happens. No rhyme or reason to it, it just does. Generally it gets corrupt to the point wipes and formats don't clean it.

Moscow Desire said:
Well, I can throw a couple of "kopeka's" (cents) in as well.
Fastboot is a life savior. Bar none. With it, you can wipe partitions and flash new partition images. Now this is taken that the fastboot capabilities in the given bootloader are "full" and not neutered in some way. Yes, it could possibly be so.
The only way I know, where you can perma-brick the device, is by flashing things on incorrect partition formats, or flashing a bootloader not meant for the device.
Incorrect custom recoveries are notorious for this, as they flash incorrect partition info. (been there, did that).
Also, nand memory can fail after some flashings. It happens. No rhyme or reason to it, it just does. Generally it gets corrupt to the point wipes and formats don't clean it.
Click to expand...
Click to collapse
In random readings, I've seen that "Unlock bootloader allowed=no" on some devices blocks fastboot. I can boot into fastboot mode, but I haven't tried flashing anything since I am not experienced in fastboot flashing. I think the easy test would be to read a partition in fastboot, then write it back. Do you know the commands to do so?

da_reeseboy said:
In random readings, I've seen that "Unlock bootloader allowed=no" on some devices blocks fastboot. I can boot into fastboot mode, but I haven't tried flashing anything since I am not experienced in fastboot flashing. I think the easy test would be to read a partition in fastboot, then write it back. Do you know the commands to do so?
Click to expand...
Click to collapse
You are correct. Some variants (Verizon for example), you can't unlock the bootloader. No unlock, no "full" fastboot or fastboot at all.
Although my original bootlocker was "unlockable" due to it turning out to be a "Demo" unit, I managed to flash an RU ftf, and got the unlocked bootloader. But it seems "some" carrier models don't allow for this. (as a sidenote, I've just reflashed my DRM keys back today, and now on a stock locked .167 build again. Just wanted to try it and see if it worked.)
Here's a list of useful commands (thanks to AndroidForums), but you can certainly find a ton by Google-it.
Code:
fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
formatting
-s <specific device> specify device serial number
or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default:
2048
-S <size>[K|M|G] automatically sparse files greater th
an
size. 0 to disable
A very useful thing to use, is for example;
fastboot boot boot.img
or
fastboot boot recovery.img
This is useful as it doesn't actually "write" the image to the device, but rather boots it in memory.
Usually how we test things such as new custom recoveries, boot.images and such.

Moscow Desire said:
You are correct. Some variants (Verizon for example), you can't unlock the bootloader. No unlock, no "full" fastboot or fastboot at all.
Although my original bootlocker was "unlockable" due to it turning out to be a "Demo" unit, I managed to flash an RU ftf, and got the unlocked bootloader. But it seems "some" carrier models don't allow for this. (as a sidenote, I've just reflashed my DRM keys back today, and now on a stock locked .167 build again. Just wanted to try it and see if it worked.)
Here's a list of useful commands (thanks to AndroidForums), but you can certainly find a ton by Google-it.
Code:
fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
format <partition> format a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
formatting
-s <specific device> specify device serial number
or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default:
2048
-S <size>[K|M|G] automatically sparse files greater th
an
size. 0 to disable
A very useful thing to use, is for example;
fastboot boot boot.img
or
fastboot boot recovery.img
This is useful as it doesn't actually "write" the image to the device, but rather boots it in memory.
Usually how we test things such as new custom recoveries, boot.images and such.
Click to expand...
Click to collapse
Well I was going to give it a shot but I turned my tablet off to reboot without making any changes to it and now it won't turn back on. I haven't had time to RMA it yet. It did this before but it just started working again for no reason. It is probably a good thing since it sounds like I probably would have bricked it trying anyway.

Maxim512 said:
Well I was going to give it a shot but I turned my tablet off to reboot without making any changes to it and now it won't turn back on. I haven't had time to RMA it yet. It did this before but it just started working again for no reason. It is probably a good thing since it sounds like I probably would have bricked it trying anyway.
Click to expand...
Click to collapse
Wow, talk about "timing". Luckily you didn't make any changes. Had a similar issue with mine last night (coming out of fastboot coincidently).
Did a fastboot boot to TWRP, and when it went to reboot, I had to mess with the Vol + and - nd PWR combinations a few times before it would boot.

Do not play with verizon z2
I work with custom roms and such... I also have a Sony Z2 late tab... I built a rom for this device.... Never got to test it. Got two on it with no issues. And this is a pain as well due to anytime you use twrp you must reflash twrp or your in for a world of hurt. Well during my process twrp froze while wiping the system... I could get to fastboot but any command I tried to run It told me that it was locked and I couldn't use the command as I didn't have the rights. So long story short I wouldn't play with it till someone gets a unlock for it

Related

Soft bricked

Well, I guess I unintentionally softbricked my Hero...
So the story:
I downloaded via OTA the update. And i tried to install, but in the middle the install just stopped, and... stood still for a long long time... ok, battery ran out and i plugged the charger and tried to turn on ... annnd stucked at HERO sign...
i tried hard reset and nothing.. im trying that with the SDK and CMD and the fastboot devices doesn't show anything.
I tried to boot one of millions of customed ROMs and nothing, i guess i had to root earlier, or something /noob here.
I kinda ran out of options here and i don't know what to do...
Could you guys please help me out?
Taiwanese version of HTC Hero here.
yep, and i'm kinda desperate here too.
---
HERO CVT SHIP S-ON
HBOOT-1.76.0007 (HERO10000)
MICROP-010f
TOUCH PANEL-SYN0104
RADIO-6.35.08.29
Can you force into hboot/fastboot via holding volume down and power for a bit from cold start?
-------------------------------------
Sent via the XDA Tapatalk App
Yes, I Can access HBoot and fastboot...
aaaaaand i found my device at the fastboot devices.
HTxxxxxxxxxx64
Excellent then you should now be able to redo things ... let us know
OK, accessed the hero... then, tried to apply the update and...
E:Failure at line 11: run_program PACKAGE:checkspace -f /data 26214400 "ro.build.fingerprint=chunghwa/htc_hero/hero/hero:1.5CUPCAKE" FOTAERRORMESSAGES
actually i don't know what to do... :/
Try this ... http://forum.xda-developers.com/showpost.php?p=6714023&postcount=14
Basically go back into fastboot and try to install the official 1.5 (which will fail) but the process clears something up and allowed another member here to reflash cleanly ...
Try to wipe your data and then install the next ROM, i had the same problem
I do not think he has rooted or installed a modded recovery image if I read his first post correctly
i guess i had to root earlier, or something /noob here.
Click to expand...
Click to collapse
Yeah, i didn't root or anything... and i tried the other dude footsteps... and... blank, nothing...
and waiting for HTC Response team says something...
tried installing official rom, nothing.
tried updating the official update, also nothing.
tried wipe data, same thing.
well, i guess i have a new brick :/
If you can get it to fastboot ok and open the conversation, there must be something that can be done.
According to the definitive fastboot docs (http://android-dls.com/wiki/index.php?title=Fastboot) there might be a few options to try ...
HTML:
<pre>usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall 'flash boot' + 'flash system'
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline</pre>
Perhaps the -w to clear those areas might do it ...
Alternatively, I _believe_ you could flash the 1.62 recovery image to the phone in fastboot and then wipe from in there, or flash an 'update.zip' style rom from in here as well ...
Good luck, someone more knowledgeable than I may have other ideas ...
Broken Root???????
WELLLLLL...
I'm not sure how I did it, but I cannot open my custom recovery image. Happened a couple weeks after I flashed a new image. When I tried to apply an update.zip, the image froze at the 'opening update package' stage. I tried multiple roms and wipes to fix the problem, but none worked.
I've flashed multiple images through the terminal, and cannot open any. I've tried using flashrec again, but command line error always pops up. The error in fastboot when trying to load the image is as follows "Wrong or no image!"
This error reoccurs several times as the image recovery is attemped to be retrieved several times.
My rom is Darchdroid 262, and works 100%.
chachi said:
If you can get it to fastboot ok and open the conversation, there must be something that can be done.
According to the definitive fastboot docs (http://android-dls.com/wiki/index.php?title=Fastboot) there might be a few options to try ...
Click to expand...
Click to collapse
I was having a play with those commands yesterday to see if it was possible to restore to a ROM through fastboot but had no luck unfortunately.
chachi said:
If you can get it to fastboot ok and open the conversation, there must be something that can be done.
According to the definitive fastboot docs there might be a few options to try ...
HTML:
<pre>usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall 'flash boot' + 'flash system'
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline</pre>
Perhaps the -w to clear those areas might do it ...
Alternatively, I _believe_ you could flash the 1.62 recovery image to the phone in fastboot and then wipe from in there, or flash an 'update.zip' style rom from in here as well ...
Good luck, someone more knowledgeable than I may have other ideas ...
Click to expand...
Click to collapse
tried the fastboot -w and... not allow. I will try with the gold card.
Yeah, i'll try the 1.62, but the ADB don't find my device.
Try this,...
Go into fastboot on your phone.
Open CMD and type the following, obviously you will have to change slightly depending on where you extracted the sdk to.
cd c:\sdk\tools
fastboot oem rebootRUU
Then try running one of the 1.5 RUU .exe files on your pc/lappy.
ddotpatel said:
Try this,...
Go into fastboot on your phone.
Open CMD and type the following, obviously you will have to change slightly depending on where you extracted the sdk to.
cd c:\sdk\tools
fastboot oem rebootRUU
Then try running one of the 1.5 RUU .exe files on your pc/lappy.
Click to expand...
Click to collapse
i tried running one of the southeast asia RUU, the 2.73.728.5 file yesterday, and... nothing show up. Sayin' ive got to use the correct one.
The thing i thinked about is to rewrite the checksum in the update (the taiwanese 1.5 to 2.1 the one i've tried to update), verifying if its cupcake (in the fact that the update stopped in the middle), so if delete the verification code, it will continue the installation, and hopefuly, boot correctly.
-
update: ok trying to update again, then he says:
Error in checkspace (Status 256)
run_program PACKAGE:checkspace -f /data 26214400 "ro.build.fingerprint=chunghwa/htc_hero/hero/hero:1.5/CUPCAKE" FOTAERRORMESSAGES
Instalation aborted.
Click to expand...
Click to collapse
OK,... Now this,...
cd c:\sdk\tools
fastboot oem rebootRUU
fastboot erase cache
then try running the RUU again....... ?
Customer ID error... can't it erase the previous update?
it hasn't the original taiwanese RUU available?
the 2.73.751.13 file?
Customer ID Error?.... Ahaaaa,..... We might be on to something. Try with a goldcard now.
Use an old RUU with 1.5, not the new 2.1 ROM.
If you need to know how to make a goldcard follow BTDAGs guide linked in my signature.
ddotpatel said:
Customer ID Error?.... Ahaaaa,..... We might be on to something. Try with a goldcard now.
Use an old RUU with 1.5, not the new 2.1 ROM.
If you need to know how to make a goldcard follow BTDAGs guide linked in my signature.
Click to expand...
Click to collapse
This is beginning to sound like a happy ending is more than a remote possibility now
chachi said:
This is beginning to sound like a happy ending is more than a remote possibility now
Click to expand...
Click to collapse
Don't speak too soon, we might not be on to a winner just yet,.... Fingers crossed.

"""WARNING"""

Just wanted to give everyone a heads up so no one makes the mistake i did. If you get into a postition where your bootlooping and no matter how much you wipe, flash, nand, whatever. And you still get htc bootloop. DO NOT flash any of the PG86IMG that are derived from the RUU(not saying there is anything wrong with those files). By doing that you will remove the revolutionary fastboot drivers from your hboot. Which in turn will lead to you not being able to fix the problem since fastboot will no longer work to run commands from your pc. So to make a long story short if you run into this problem just take the time to install SDK and use fastboot to flash and wipe the partitions(specifically the boot partition). Hope this helps someone.
Thanks for the tip bro
Sent from my 3VO
I figure id put it out there so we dont get anymore bricks. I know everyone says there not bricked unless you cant power into bootloader. But i have tried everything that i know of. Unless there is a way to remount and format the boot partition and flash just using adb instead of fastboot since adb works in recovery. who knows i bought a new one last night im still gonna play around and try to find a fix but i been without a phone for two days lol.
Just for the record I'm sure you've tried these:
http://android-dls.com/wiki/index.php?title=Fastboot
wiki said:
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall 'flash boot' + 'flash system'
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
Click to expand...
Click to collapse
an example of how to use it for the installation of revolutionary: (albeit in virtual box)
http://forum.xda-developers.com/showthread.php?p=16267669#post16267669
example said:
Next let's try fast boot.
With the phone, check the status of fastboot, in Settings>power>fastboot check marked.
Power off, remove battery, reboot while holding volume down key.
You'll see in red, "Fastboot Usb"
The VirtualBox usb icon should now show "Htc....[0100]".
Check mark it.
In terminal type "Fastboot devices (cr)".
You should get the serial number again.
Experiment until it's consistent.
Click to expand...
Click to collapse
Good luck
Yea tried all that. There is no working fastboot now that the hboot was flashed. I can only get the adb to connect while in recovery. If i try to run revolutionary from recovery it says sbin/sh bootloader not supported. And if i am in the bootloader or fastboot usb it just says waiting for device. I can however get revolutionary to start if i flash a custom ROM and try to reboot but it bootloops before the exploit can finish. Oh yeah even if the phone is off revolutionary will tell me device not supported.
Sent from my PG86100 using XDA App
IIRC revolutionary only works on certain hboot versions. You need to down grade if you're s-off. Actually google xda 3d hboot down grade.
Luck
willy900wonka said:
IIRC revolutionary only works on certain hboot versions. You need to down grade if you're s-off. Actually google xda 3d hboot down grade.
Luck
Click to expand...
Click to collapse
My phone has hboot 1.4 already
Sent from my PG86100 using XDA App

Bootloop after device encryption

Hi,
I have unlocked bootloader, installed TWRP recovery, flashed image "AospExtended" and started the device w/o issues.
Then I enabled device encryption, entered the password and the device started to reboot.
However it did not reach the phase where the password must be entered.
Instead, it ends up in a boot loop where the display shows "Kindle" and then reboots.
I can boot into both fastboot and recovery.
But even after deleting everything in TWRP and installing "AospExtended" image again, the boot loop is still there.
How can I fix this?
c.monty said:
Hi,
I have unlocked bootloader, installed TWRP recovery, flashed image "AospExtended" and started the device w/o issues.
Then I enabled device encryption, entered the password and the device started to reboot.
However it did not reach the phase where the password must be entered.
Instead, it ends up in a boot loop where the display shows "Kindle" and then reboots.
I can boot into both fastboot and recovery.
But even after deleting everything in TWRP and installing "AospExtended" image again, the boot loop is still there.
How can I fix this?
Click to expand...
Click to collapse
Yeah, encryption is not supported. You will need to format (vs. simply wipe) the system and/or data partitions. There was a recent discussion that addresses the commands needed. I will try to scare up a link and add to this post (check for updates).
Edit: This post should supply what you need; be sure to whap the 'thanks' button for @draxie if it solves your problem.
I boot into recovery, but then there's an issue with adb shell:
Code:
[email protected]:~/Hardware/Amazon/thor$ adb shell su -c "make_ext4fs /dev/block/mmcblk0p23"
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Could I format this partition in fastboot, too?
Or in TWRP?
In recovery I tried to fix the bootloop issue by deleting/formating any partition.
Then, when I plugin the device to USB, I can only transfer data via file manager, means adb is not working.
Any file can be copied over to device (using file manager) and installed in TWRP.
A fool with a tool...
c.monty said:
Code:
error: device unauthorized.
Click to expand...
Click to collapse
Right... if you bothered checking that thread
for *all* the relevant messages, you would've
realized that the person with the encryption
problem had rolled back to Lineage 13; so, adb
with TWRP was not an issue for them...
Luckily, for you, that's not actually necessary.
c.monty said:
Could I format this partition in fastboot, too?
Click to expand...
Click to collapse
Probably not, although you could try
Code:
fastboot -i 0x1949 erase userdata
and hope that AEX does the right thing
and formats the partition as required.
c.monty said:
Or in TWRP?
Click to expand...
Click to collapse
Yes, of course, you can, but I'd prefer
that you tried the fastboot method first
and report back if that worked (since
that's simpler and would be helpful
for others stuck in the same place).
Code:
[email protected]:~$ fastboot -i 0x1949 erase userdata
******** Did you mean to fastboot format this ext4 partition?
erasing 'userdata'...
OKAY [ 0.085s]
finished. total time: 0.085s
[email protected]:~$ fastboot reboot
rebooting...
finished. total time: 0.320s
Reboot is successfull.
THX

Can't install rom from fasboot ,stuck on fastboot

Hello,
My A3 was unlocked with root, android 9 February security patch
Randomly Google play service stop working, after deleting cache it was fine.
Again randomly the prone start to act weird, restart it and then appear " Can't load android system. Your data may be corrupt."
The only options are try again and Factory data reset. ( like in the image https://i.redd.it/8nf9k5v33u1z.jpg )
Because i have important information i can't do factory reset so tried to flash stock fastboot rom with miflash.
Fastboot was accessible, BUT after trying to adb devices check it shows- List of devices attached* daemon not running. starting it now on port 5037 ** daemon started successfully * so it was not really able to connect. My Computer does not recognise it as Mi A3.
So after flashing fastboot Android One logo unlocked, appear several time, like blinking 4-5 times, and again jump in to fastboot mode.
First tried to flash V10.3.15.0.PFQEUXM, than V10.3.14.0.PFQEUXM. None of them did the work.
Attaching some logs.
By the way i use MiFlash20181115 it was the latest found
Thank you in advance , BE HAPPY and SAFE
Tried to add before fastboot %* reboot , fastboot $* set_active a , bur the result was the same
1. avoid downgrades, your data might get corrupted and you'll end up with factory reset anyway
2. per the logs it seems that everything flashes correctly, make sure that you have partition A as active (https://forum.xda-developers.com/showpost.php?p=81408355&postcount=2). Type both commands (one will fail) in cmd window with phone connected via fastboot.
_mysiak_ said:
1. avoid downgrades, your data might get corrupted and you'll end up with factory reset anyway
2. per the logs it seems that everything flashes correctly, make sure that you have partition A as active (https://forum.xda-developers.com/showpost.php?p=81408355&postcount=2). Type both commands (one will fail) in cmd window with phone connected via fastboot.
Click to expand...
Click to collapse
Phone is not recognised in cmd, only if use- Install from ADB option from recovery it show the device.
alexandarpb said:
Phone is not recognised in cmd, only if use- Install from ADB option from recovery it show the device.
Click to expand...
Click to collapse
You seem to confuse ADB and Fastboot. Connect mobile in FASTBOOT mode and type in those two commands. If there's an error, paste the output here.
_mysiak_ said:
You seem to confuse ADB and Fastboot. Connect mobile in FASTBOOT mode and type in those two commands. If there's an error, paste the output here.
Click to expand...
Click to collapse
PS C:\Users\Sashko\Desktop\platform-tools> fastboot set_active a
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot, system, vendor and if found,
recovery
flash <partition> [ <filename> ] write a file to a flash partition
flashing lock locks the device. Prevents flashing partitions
flashing unlock unlocks the device. Allows user to flash any partition except the ones that are related to bootloader
flashing lock_critical Prevents flashing bootloader related partitions
flashing unlock_critical Enables flashing bootloader related partitions
flashing get_unlock_ability Queries bootloader to see if the device is unlocked
erase <partition> erase a flash partition
format[:[<fs type>][:[<size>]] <partition> format a flash partition.
Can override the fs type and/or
size the bootloader reports.
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot [bootloader] reboot device, optionally into bootloader
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
formatting
-s <specific device> specify device serial number
or path to device port
-l with "devices", lists device paths
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address.
default: 0x10000000
-n <page size> specify the nand page size.
default: 2048
-S <size>[K|M|G] automatically sparse files greater
than size. 0 to disable
PS C:\Users\Sashko\Desktop\platform-tools> fastboot --set-active=a
C:\adb\fastboot.exe: unknown option -- set-active=a
PS C:\Users\Sashko\Desktop\platform-tools>
alexandarpb said:
PS C:\Users\Sashko\Desktop\platform-tools> fastboot set_active a
usage: fastboot [ <option> ] <command>
...
PS C:\Users\Sashko\Desktop\platform-tools> fastboot --set-active=a
C:\adb\fastboot.exe: unknown option -- set-active=a
PS C:\Users\Sashko\Desktop\platform-tools>
Click to expand...
Click to collapse
Uninstall/remove existing fastboot.exe from all locations on your PC and use the latest version https://developer.android.com/studio/releases/platform-tools
_mysiak_ said:
Uninstall/remove existing fastboot.exe from all locations on your PC and use the latest version https://developer.android.com/studio/releases/platform-tools
Click to expand...
Click to collapse
From my previous PC i managed to get proper result
C:\Users\PC-1\Desktop\mi a3\platform-tools>fastboot set_active a
Setting current slot to 'a' OKAY [ 0.002s]
Finished. Total time: 0.012s
C:\Users\PC-1\Desktop\mi a3\platform-tools>
Should i now use miflash again to flash the fastboot rom or?
Thank you so much for all your answers!!!
alexandarpb said:
From my previous PC i managed to get proper result
C:\Users\PC-1\Desktop\mi a3\platform-tools>fastboot set_active a
Setting current slot to 'a' OKAY [ 0.002s]
Finished. Total time: 0.012s
C:\Users\PC-1\Desktop\mi a3\platform-tools>
Should i now use miflash again to flash the fastboot rom or?
Thank you so much for all your answers!!!
Click to expand...
Click to collapse
Just start the phone. Re-flash only if it won't boot.
_mysiak_ said:
Just start the phone. Re-flash only if it won't boot.
Click to expand...
Click to collapse
Thank you, you are my saviour, unfortunately my data is gone... but at least it work now.
Thank you for everything
alexandarpb said:
Thank you, you are my saviour, unfortunately my data is gone... but at least it work now.
Thank you for everything
Click to expand...
Click to collapse
I suppose that you already performed the factory reset, but for the future - you could try flashing TWRP first, backup/export data and perform factory reset only after that.
_mysiak_ said:
I suppose that you already performed the factory reset, but for the future - you could try flashing TWRP first, backup/export data and perform factory reset only after that.
Click to expand...
Click to collapse
Definitely, but i was thinking that if the phone is not recognised in adb command it would not be able to do anything with fastboot command. It is nonsense i know...
Thank again, by the way which recovery is better OrangeFox Recovery or TWRP ?
alexandarpb said:
Definitely, but i was thinking that if the phone is not recognised in adb command it would not be able to do anything with fastboot command. It is nonsense i know...
Thank again, by the way which recovery is better OrangeFox Recovery or TWRP ?
Click to expand...
Click to collapse
I haven't used custom recovery for A3 yet, but TWRP would be my first choice if a need occured.

[Fastboot] Invalid sparse file format at header magic. How to fix?

Okay, so I own a Red Magic 6 and it's currently bricked. There is no unbrick tool for this device yet and there isn't going to be one for a while.
My bootloader is unlocked. I have tried reflashing the files using fastboot. However when I go to flash the system, it prints out:
Invalid sparse file format at header magic
Sending sparse 'system' 1/4 (786352 KB) OKAY [ 18.114s]
Writing 'system' FAILED (remote: 'Partition not found')
fastboot: error: Command failed
(Phone came with a/b partition just a heads up and it runs on Stock android 11)
I have searched EVERYWHERE, from forums, to tools, to python scripts.... EVERYTHING. No solution.
Yes, my fastboot is on the lastest version and yes I tried the --force command on fastboot. Still no luck.
I have researched everything about sparse images but am still having problems. I tried converting the image to a RAW ext4 img but it fails.
Is there any workaround for this?
chocolote4444 said:
Okay, so I own a Red Magic 6 and it's currently bricked. There is no unbrick tool for this device yet and there isn't going to be one for a while.
My bootloader is unlocked. I have tried reflashing the files using fastboot. However when I go to flash the system, it prints out:
Invalid sparse file format at header magic
Sending sparse 'system' 1/4 (786352 KB) OKAY [ 18.114s]
Writing 'system' FAILED (remote: 'Partition not found')
fastboot: error: Command failed
(Phone came with a/b partition just a heads up and it runs on Stock android 11)
I have searched EVERYWHERE, from forums, to tools, to python scripts.... EVERYTHING. No solution.
Yes, my fastboot is on the lastest version and yes I tried the --force command on fastboot. Still no luck.
I have researched everything about sparse images but am still having problems. I tried converting the image to a RAW ext4 img but it fails.
Is there any workaround for this?
Click to expand...
Click to collapse
I am looking for the same thing. Can't find the answer. Have you found a solution?
same here
Out of curiosity, was there ever a resolution to this issue?
Have RM6SP, was rooted- all good. Battery ran empty and shut off. When I rebooted it just boots directly to fastboot. Recovery is useless (wiped user data but no cache to erase(?)).
Extracted payload.bin, tried flashing boot.img, rebooted, only goes to fastboot. Tried flashing everything from payload.bin- some flashed, others had errors. Just endless loading to fastboot.
Curious if anyone has actually SUCCESSFULLY unbricked these devices?
Looks like your partition table may be corrupted... I don't own this device myself but have a fairly good understanding of android partitions and am happy to help.
Please show the output of
Code:
fastboot getvar ptable
and the errors you get when trying to flash
Hello DavidxxxD and thank you for replying.
Execution of "getvar ptable" results in "FAILED (remote: 'Unknown variable')
I then executed "getvar all" and attached the result. Same whether on fastboot or fastbootd.
As for your other question, when I try to flash product, system, and vendor I get the above "Invalid Sparse File Format at Header Magic" error.
Thank you for any suggestions and your time. This is not my daily driver so there is no urgent, pressing need (I'll never get rid of my trusty S7edge, lol).
EDIT: thanks to the unbrick tool in the 6S Pro forum, I have successfully unbricked this phone. Up and running and on way to getting re-rooted.
Thanks to everyone who offered help!
Glad to hear you already got it unbricked!
For the sake of it being an intresting case, here is the more complicated way I put together and what I could find out from looking at the attatchment and a payload file for your device:
Good news - Your device is not too badly bricked.
Like some other new devices, this phone does not use a cache partition. That is why the recovery has no option to wipe cache.
The "invalid sparse header" message gets triggered when using fastboot to send a filesystem image that is not in the expected android sparse format. This can safely be ignored as the images for your device are uncompressed and the program doesn't know what they're suppsed to look like.
The NX669J uses a dynamic partition and the one on yours appears messed up in a way where I have no idea how it got to this point - all partitions for the A-slot are missing and instead there is a "system" (not system_a) and "system_b-cow" (!?) - This is probably why the bootloader is freaking out.
Usually, something like this can be fixed by just reflashing the super partition. However the update payload does not seem to contain one, so - unless you have a super.img from somewhere else - you would have to manually fix the current layout.
- Put the device is fastbootd mode
Code:
fastboot reboot-fastboot
Note: To verify, you can run
Code:
fastboot getvar is-userspace
Note: Didn't expect to have to say this, but don't run these commands on devices with correctly assigned partitions, unless you know what you are doing! They can be used as an example of how to modify dynamic partitions. "system" is also used as an alias for the active system partition. You will likely softbrick your device and have to fix it!!
- Firstly, remove the strange partition entries
Code:
fastboot delete-logical-partition system
fastboot delete-logical-partition system_b-cow
- Next, re-create the missing entries
Code:
fastboot create-logical-partition system_a 1000
fastboot create-logical-partition system_ext_a 1000
fastboot create-logical-partition product_a 1000
fastboot create-logical-partition vendor_a 1000
fastboot create-logical-partition odm_a 1000
Note: 1000 will set the partition size to a kilobyte. This doesn't matter as flashing will automatically resize them.
- After that, you should be able to flash to the newly created partitions
Code:
fastboot flash system_a system.img
fastboot flash system_ext_a system_ext.img
fastboot flash product_a product.img
fastboot flash vendor_a vendor.img
fastboot flash odm_a odm.img
Note: If you get an error saying "not enough space to resize partition", try
Code:
fastboot erase system_b
fastboot resize-logical-partition system_b 1000
- Finally, set the active slot to A and reboot
Code:
fastboot set_active a
fastboot reboot
Note: If it doesn't boot or the system starts crashing, you may have to flash the other firmware images as well or try using slot B.
In case this doesn't work, you can ask someone with a rooted NX669J to dump their super partition and send it to you. If you do, make sure to check it first using lpdump. Flashing a corrupted image is going to make it worse 100% guaranteed.
I hope this gives you a better idea of what was wrong and how to deal with similar issues in the future. Of course, a low-level unbrick tool works fine too - but where's the fun in that?
P. S: I'm actually typing this on a flat S7 - still an amazing device, 6 years after release : )
Thank you, DavidxxxD, for taking the time out and providing a detailed reply. Hopefully this info might come in useful to someone one day.
I have no idea why a dead battery would "zonk" the phone, but it did. I wonder if it might have been something with magisk...?
¯\_(ツ)_/¯
Sadly, these phones are not popular and support from Nubia is painful, at best. Thanks to folks like you there is still help for those in need.
Again, many thanks for your time and help!
DavidxxxD said:
Glad to hear you already got it unbricked!
For the sake of it being an intresting case, here is the more complicated way I put together and what I could find out from looking at the attatchment and a payload file for your device:
Good news - Your device is not too badly bricked.
Like some other new devices, this phone does not use a cache partition. That is why the recovery has no option to wipe cache.
The "invalid sparse header" message gets triggered when using fastboot to send a filesystem image that is not in the expected android sparse format. This can safely be ignored as the images for your device are uncompressed and the program doesn't know what they're suppsed to look like.
The NX669J uses a dynamic partition and the one on yours appears messed up in a way where I have no idea how it got to this point - all partitions for the A-slot are missing and instead there is a "system" (not system_a) and "system_b-cow" (!?) - This is probably why the bootloader is freaking out.
Usually, something like this can be fixed by just reflashing the super partition. However the update payload does not seem to contain one, so - unless you have a super.img from somewhere else - you would have to manually fix the current layout.
- Put the device is fastbootd mode
Code:
fastboot reboot-fastboot
Note: To verify, you can run
Code:
fastboot getvar is-userspace
- Firstly, remove the strange partition entries
Code:
fastboot delete-logical-partition system
fastboot delete-logical-partition system_b-cow
- Next, re-create the missing entries
Code:
fastboot create-logical-partition system_a 1000
fastboot create-logical-partition system_ext_a 1000
fastboot create-logical-partition product_a 1000
fastboot create-logical-partition vendor_a 1000
fastboot create-logical-partition odm_a 1000
Note: 1000 will set the partition size to a kilobyte. This doesn't matter as flashing will automatically resize them.
- After that, you should be able to flash to the newly created partitions
Code:
fastboot flash system_a system.img
fastboot flash system_ext_a system_ext.img
fastboot flash product_a product.img
fastboot flash vendor_a vendor.img
fastboot flash odm_a odm.img
Note: If you get an error saying "not enough space to resize partition", try
Code:
fastboot erase system_b
fastboot resize-logical-partition system_b 1000
- Finally, set the active slot to A and reboot
Code:
fastboot set_active a
fastboot reboot
Note: If it doesn't boot or the system starts crashing, you may have to flash the other firmware images as well or try using slot B.
In case this doesn't work, you can ask someone with a rooted NX669J to dump their super partition and send it to you. If you do, make sure to check it first using lpdump. Flashing a corrupted image is going to make it worse 100% guaranteed.
I hope this gives you a better idea of what was wrong and how to deal with similar issues in the future. Of course, a low-level unbrick tool works fine too - but where's the fun in that?
P. S: I'm actually typing this on a flat S7 - still an amazing device, 6 years after release : )
Click to expand...
Click to collapse
Hi DavidxxxD,
I had a quite a similar problem here, sometimes ago while trying to install TWRP and Magisk onto my nubia Z20 NX627J, unfortunately did not succeed and got myself a bricked phone. Now phone can only go into fastboot mode.
Had been trying to flash everything from scratch via fastbboot, did not get any error messages with flashing all the img, bin except while flashing system. img, it returned with a " Invalid sparse file format at header magic" but went on with the process without issue. However, the phone still enable to boot up normally.
Is it possible that that the rom I have is not the original stock rom?
So while searching for an answer, was happy to found this thread at XDA forum. After going through the thread on your reply to SkylineDriver, i was hoping you can help and enlighten me if I had miss anything.
Attached is the getvar file from my bricked phone after flashing, another file is the fastboot command I followed, except the flash system command, i just did a "fastboot flash system system.img" without the "-S 100M' because I didn't know what "-S 100M" means".
Thanks in advance
@cksy1112 A bit late, but here are some things I noticed:
Are you sure your bootloader is unlocked? The device says it's locked. What happens when you send the unlock command?
You may need to flash vbmeta with the option --disable-verity.
This device has a painful ammount of partitions and whoever designed it should be punished for making my head hurt.
Not sure about the -S 100M thing, haven't seen that before and the system has to be larger than 100 megabytes.
Also, I don't think it's necessary to erase that many partitions before flashing.
It even has UEFI with a partition to store variables - that is very intresting and could have some great potential for multi-booting and other fun stuff - if we can understand how their implementation works.
chocolote4444 said:
Okay, so I own a Red Magic 6 and it's currently bricked. There is no unbrick tool for this device yet and there isn't going to be one for a while.
My bootloader is unlocked. I have tried reflashing the files using fastboot. However when I go to flash the system, it prints out:
Invalid sparse file format at header magic
Sending sparse 'system' 1/4 (786352 KB) OKAY [ 18.114s]
Writing 'system' FAILED (remote: 'Partition not found')
fastboot: error: Command failed
(Phone came with a/b partition just a heads up and it runs on Stock android 11)
I have searched EVERYWHERE, from forums, to tools, to python scripts.... EVERYTHING. No solution.
Yes, my fastboot is on the lastest version and yes I tried the --force command on fastboot. Still no luck.
I have researched everything about sparse images but am still having problems. I tried converting the image to a RAW ext4 img but it fails.
Is there any workaround for this?
Click to expand...
Click to collapse
Hello,
Have you find a solution to your pronlem?
is there an unbrick tool for red magic 6s pro?
I think I messed up my phone and it is brick because the super image is not updating for product system etc when I tried to flash the extracted ROM images. system and product coyld not be flashed. and sparse error apperas.
Did you install them in fastbootd mode? (Not regular fastboot)
DavidxxxD said:
Did you install them in fastbootd mode? (Not regular fastboot)
Click to expand...
Click to collapse
Thanks for the quick reply
I can’t boot to fastbootd. It gives an error and boot back to fastboot
You can try to flash the non-dynamic partitions first and then try again.
DavidxxxD said:
You can try to flash the non-dynamic partitions first and then try again.
Click to expand...
Click to collapse
hey so i also deleted cache partition
should i do
fastboot create-logical-partition cache 1000
to make cache partition?
i did do that and now its flashing, its showing less errors then last time lol
edit: what should i do to make cache partition?
Hello, I tried the commands DavidxxxD gave, but my phone is now stucked in a bootloop, I have a Xiaomi 11T. And the commands weren't working, it said "deleting 'system'..." but after it said "command failed".
Try creating it again and flash the image in fastbootd.
Is your device A/B? Use
Code:
fastboot getvar all
to learn more.
solution - Use SDK platform 33.03 instead

Categories

Resources