[Q] HELP! -> Boot loop / No USB Debug / Encrypted / No Root / Can't Flash or Reset - Nexus 5 Q&A, Help & Troubleshooting

Hi all,
I have got a N5 that is not booting (infinite boot animation loop). It's bootloader is unlocked and I can push stuff via ADB so I am assuming eMMC is good.
Also, USB debugging is OFF, phone is ENCRYPTED and NOT rooted.
I can't mount or modify /data and /persist partitions.
I tried reformating with ext2 to destroy encryption but it is not working. I also tried dd method but was unsuccessful.
I am not interested in recovering or rescuing anything from the phone.
Currently trying to figure out how to activate download mode so I can reflash everything using LG Flash tool.
Thanks in advance
EDIT: Bootloader is unlocked but I can't root the phone with wugfresh's nexus root toolkit.

The encyption can disable only with command fastboot flash userdata userdata.img
The userdata.img you can find in the Google OEM ROM Google M4B30Z
It requires the SDK Platform Tools is installed SDK Platform Tools
You may give a chance and with this http://www.wugfresh.com/

Hi Sant514,
'fastboot flash userdata userdata.img' returns this error:
target reported max download size of 1073741824 bytes
erasing 'userdata'...
OKAY [ 0.460s]
sending 'userdata' (137318 KB)...
OKAY [ 4.511s]
writing 'userdata'...
FAILED (remote: flash write failure)
finished. total time: 5.151s
also tried to format userdata:
fastboot format userdata
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
mke2fs 1.45.5 (07-Jan-2020)
/tmp/TemporaryFile-GqLE95: Unimplemented ext2 library function while setting up superblock
/usr/lib/android-sdk/platform-tools/mke2fs failed with status 1
mke2fs failed: 1
error: Cannot generate image for userdata

This reformating with ext2, I don't think this helped the situation,
so can you give a chance with tool http://www.wugfresh.com/?
No you do not need to root your device with wugfresh. It has a choice about unbrick... unroot and resτore
in factory condition...
The menu-choice is "Back to Stock / Flash Stock and Unroot" and you will select "Current Status=Soft Bricked/Bootloop"

Nexus Root Toolkit is giving me multiple flash write failures so I think the eMMC is dead.
Thanks for the help...

I had a similar major crash with my D820 (Nexus 5, US version) last month after trying wireless charging with an aftermarket back cover (overheated followed by kernel panic green screen of death). Infinite reboots. Couldn't get past Google logo. Flashed the factory image without the "-w" option which wipes user data, no joy. I figured I was screwed.
So flashed factory image 4.4.4 totally (-w left in the flash-all.bat script). Then flashed the last 2016 factory image (M4B30Z), and it came back. I hate having to reinstall apps (including discontinued ones via the APK borrowed from my other Nexus device), but it's actually good to clean out old cruft.
https://developers.google.com/android/images#hammerhead
As you probably know, you only need to install the Android SDK, Platform-tools (fastboot, adb, etc), boot into bootloader (run "fastboot devices" to see the phone is connected), and the flash-all.bat file will do the rest. Don't interrupt it, the "warning: ... .sig not found" and "sending System.img" steps will take a while. On my phone, the whole script can take 2 mins.
I've never relocked the bootloader after unlocking, but that could resolve the encryption issue .. but IDK, I've never done it.
Good luck.

Related

[Q] Need some help with the 9020a

I have sitting here a Samsun Nexus S from Fido in Canada. From what I can tell that makes it the 9020a.
It belongs to a friend and he really wanted CM7 on it after seeing CM7 on my Nexus One.
I helped him root and unlock the phone along with installing ClockWork Recovery.
I left before getting around to installing the ROM. He downloaded it through the ROM manager. After the phone restarted though he was just presented with the white Google logo and it never moved on.
I am trying to help fix this, but he wiped the sdcard and the backup that was done when ROM Manager did a backup.
Here is the problem though, I have installed about 5 or 6 different recovery ROM's trying to get this to work, even more ROM's themselves.
I have tried combinations of ROM's and recovery ROM's.
All of them end with me staring at a white Google logo.
I have access to fastboot and the recovery ROM still. So I decided to just go back to stock by flashing the partitions from fastboot. Some of them will flash, but others won't. I can flash the cache, but I can't flash the recovery, data, or system partitions. When I try I get
sending 'recovery' (8192 KB).
OKAY [ 1.029s]
writing 'recovery'...
FAILED (remote: Write Fail)
or this for Data
FAILED (remote: Unkown Partition)
or this for System
FAILED (remote: Write Fail)
Any and all help would be greatly appreciated. Right now the phone is basically bricked. I am going to sleep but will check back in the morning. If I left some information out please let me know.
Did you unlock the bootloader?
fastboot oem unlock
Then follow the on screen instructions. I had to do that to flash certain *.imgs. I think it has to do with the security checks....
Sent from my Nexus S using XDA Premium App
Does the white Google logo have a padlock symbol at the bottom of the screen? If not then the bootloader is locked. What root method did you use?
Sent from my Nexus S 4G using xda premium
And also what were the commands you used to flash the images.
Sorry for the late reply. Some stuff at work blew up and kept me out late.
atrixboy:
Yes, the bootloader is unlocked.
Rem3Dy:
Yes, there is a pad lock at the bottom of the screen.
suksit:
The commands run originally was just to unlock the phone (fastboot.exe oem unlock). The phone was then rooted and the OS was launched. Once in the OS RomManager was downloaded and installed. Through RomManager clockwork recovery was installed. After that CM7 was selected as the Rom to install. The phone rebooted, did its thing in recovery, then booted to this black screen with white Google logo which I have yet to get passed.
Since then though I have flashed several different recovery images trying to get this to work, right now the recovery is: CWM-based Recovery v4.0.1.4
If I install a Rom from zip through the recovery it says it was OK, but I still get the white logo and nothing else on boot.
I have been trying to just flash boot and system images at this point and am having no luck.
When I try the following:
C:\1>fastboot.exe flash boot boot.img
sending 'boot' (8192 KB)...
OKAY [ 1.032s]
writing 'boot'...
FAILED (remote: Write Fail)
finished. total time: 1.039s
C:\1>fastboot.exe flash system system.img
sending 'system' (151459 KB)...
OKAY [ 19.073s]
writing 'system'...
FAILED (remote: Write Fail)
finished. total time: 19.078s
C:\1>fastboot.exe flash data data.img
sending 'data' (4 KB)...
OKAY [ 0.002s]
writing 'data'...
FAILED (remote: Unknown Partition)
finished. total time: 0.032s
If I boot the recovery and go into adb and try and mount the same 3 partitions I get the following:
mount /system - works fine
mount /boot - mount: can't find /boot in /etc/fstab
mount /data - this one runs for like 5 minutes and then fails with the following error: mounting /dev/block/platform/s3c-sdhci.0/by-name/userdata on /data failed
I just realized that there is some more information on the screen of the device while in fastboot and I try this. When I try "fasboot.exe flash boot boot.img" I get the following on screen:
Exceed blocks 0x00000020 > 0x0000001e (The exact number of zeros may be wrong, hard counting them at that size)
FASTBOOT STATUS - FAILWrite Fail
Fastboot also indicates at the top of the screen: FASTBOOT MODE - NO BOOT OR RECOVERY IMG
I am able to get into the recovery though...
Not sure what other information to include.
I have run out of ideas. Does anyone know where else could I go and get help with this?
are you flashing *.img files in cwm or bootloader mode?
In fastboot I am flashing .img files, from CWM I am trying to flash .zip. I downloaded a nandroid backup and tried restoring that from within CWM with no luck.
try formatting all memory locations except sd card in "mounts & storage" and fix permissions and then flash img files.
What exactly do you mean by "fix permissions" ?
Edit: Stupid question, found it under advanced.
So I formatted each of the partitions, did the fix permissions option, and then booted back into the bootloader and tried to flash the system.img file with fastboot. It failed.
C:\1>fastboot.exe flash system system.img
< waiting for device >
sending 'system' (151459 KB)...
OKAY [ 19.001s]
writing 'system'...
FAILED (remote: Write Fail)
finished. total time: 19.006s
Thank you in advance for trying to help, I really appreciate it.
Edit: I just realized at the bottom of the bootloader after trying to flash the system.img file it now says in bold orange text:
Invalid Magic Code! 0x00000003
When in CWM recovery, can you mount each of those partitions, or does it spit out an error? (mount /sdcard && mount /system && mount /data etc...)
On the subject of the model version, the model number should be on the sticker under the battery. Mine says "GT-i9020a" and in the bootloader it says my carrier is AT&T, even though my phone is from Telus.
did you try this? http://forum.xda-developers.com/showthread.php?t=884093
litanyoffail said:
When in CWM recovery, can you mount each of those partitions, or does it spit out an error? (mount /sdcard && mount /system && mount /data etc...)
On the subject of the model version, the model number should be on the sticker under the battery. Mine says "GT-i9020a" and in the bootloader it says my carrier is AT&T, even though my phone is from Telus.
Click to expand...
Click to collapse
I can mount:
/sdcard
/system
/cache
When I try and mount /data it takes 15 minutes and then fails. Says: Error mounting /data!
The model is most definitively i9020a, I just checked under the battery. Thanks for telling me where that is.
milesman said:
did you try this? http://forum.xda-developers.com/showthread.php?t=884093
Click to expand...
Click to collapse
I did, but I am trying it again now.
So, I tried that Nandroid backup again, and it says MD5 mismatch. I checked the MD5's myself and they match. The ones listed in the MD5 file, and the files match.
I tried flashing the *.img files from fastboot, and get that failed to write message I posted earlier.
install this in cwm su-2.3.6.1-ef-signed.zip
let me know if this lets you mount etc...
milesman said:
install this in cwm su-2.3.6.1-ef-signed.zip
let me know if this lets you mount etc...
Click to expand...
Click to collapse
Did this, still having the same problems.
Possible the bootloader unlock corrupted guys? Sounds to me like either a bootloader error else the nand may have died. Unlikely but possible. I read somewhere about loading a custom bootloader to the Nexus S. Maybe try looking for that, I know it was here on XDA, only place to get good help IMHO. The orange error codes are generally related to a corrupt bootloader/bad nand chip to the best of knowledge, feel free to correct me if I'm wrong.
Sent from my Nexus S using xda premium
If the nand was shot, data, SD and system wouldn't mount either. I had a busted nand on my nexus last month, had to send it in.
Seems like the bootloader is unlocked, but acting as if it is locked. Do fastboot devices, make sure the numbers match on your screen and your command prompt.
Something I noticed: If the fastboot flash recovery is failing, how did you get the multiple recoveries on prior to posting here?
Sent from my Nexus S

Encryption Unsuccessful - after Fastboot Flash of MZ600_HRI39

Okay so I seem to be bricked in some way. I've tried fastboot flash a couple times using OEM images "MZ600-HRI39" I have the MZ600 so that should be correct. Attached is my log of what I did, I eventually tried erasing each partition and rebooting to see if that changes anything, theoretically I thought I should be stuck since everything should be erased. However, I still get the Encryption Unsuccessful screen. Went back to recovery and tried wipe/user data and cache get BP fail with user data wipe and tried e: dev a few times before it stops. Then reboot and same. Any help or suggestions would be great. Thanks in advance.
P.S. I just want to get a stock IMG in so I can OTA to current; trying to keep stock so I can exchange at BB for newer tablet.
I just kept the log short only showing I erased each partition, but pretty much same result with flashes. All performed and got OKAY.
I think I got it. So you erased all the partitions... No problems when erasing data and cache, but the worst error you did was erasing "boot" and "recovery", so what I recommend you to do is:
1 - (easier way) download LordAIOTool for LINUX! (Windows is outdated...) and use Stock Install tool
2 - (harder way) follow this guide:
- Open cmd
- Plug your Xoom on fastboot
- go to Stock Files folder
- type fastboot flash (not sure if it's flash or install, anyway, I think it's flash ) boot boot.img (if downloaded from Motorola)
- type fastboot flash system system.img
- type fastboot continue
- Pray lol
Now all I wish to you is Good Luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
XxLordxX said:
I think I got it. So you erased all the partitions... No problems when erasing data and cache, but the worst error you did was erasing "boot" and "recovery", so what I recommend you to do is:
1 - (easier way) download LordAIOTool for LINUX! (Windows is outdated...) and use Stock Install tool
2 - (harder way) follow this guide:
- Open cmd
- Plug your Xoom on fastboot
- go to Stock Files folder
- type fastboot flash (not sure if it's flash or install, anyway, I think it's flash ) boot boot.img (if downloaded from Motorola)
- type fastboot flash system system.img
- type fastboot continue
- Pray lol
Now all I wish to you is Good Luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
Click to expand...
Click to collapse
Okay I used CMD since I have more experience with DOS than Linux:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>fastboot devices
161c10c9434122d7 fastboot
C:\>fastboot flash boot boot.img
sending 'boot' (8192 KB)...
OKAY [ 0.731s]
writing 'boot'...
OKAY [ 0.587s]
finished. total time: 1.323s
C:\>fastboot flash system system.img
sending 'system' (262144 KB)...
OKAY [ 19.190s]
writing 'system'...
OKAY [ 6.427s]
finished. total time: 25.621s
C:\>fastboot continue
resuming boot...
FAILED (remote: (00120000))
finished. total time: 0.126s
C:\>fastboot continue
resuming boot...
FAILED (remote: (00120000))
finished. total time: 0.120s
C:\>fastboot reboot
rebooting...
finished. total time: 0.117s
***I still get to Encryption Unsuccessful screen.....my thing is I don't even feel like it's flashing over anything, but not sure if that's possible. Almost like some write protection to the partitions.
Any other suggestions or does anyone need a paper weight?
not sure if this means anything either or gives a better ideal of the state of the device, but when I try wipes i get.."E:format_volume: make_extf4fs failed on /dev/block/platform/sdhci-tegra.3/by-name/cache" yet it states cache wipe complete. Then a bunch of failed to mount and can't open.
Try reflashing a custom recovery and with it try formating everything... Then try again everything from my other post again good luck
Sent from my 3g JB Xoom - By the 1st Xoom RC
I've tried custom recovery, via fastboot flash recovery "recovery".img with no luck. It doesn't stick. Do you have any experience with RSD?
g14life said:
I've tried custom recovery, via fastboot flash recovery "recovery".img with no luck. It doesn't stick. Do you have any experience with RSD?
Click to expand...
Click to collapse
What do you mean with It doesn't stick?
Can you get into the recovery menu?
You could also do a oem lock and oem ulock again.
Then reflash everything again (boot, system, recovery if needed).
I go to flash with fastboot and when I try to access via power button, then volume down button I just back to OEM recovery. Was thinking if I try to rebuild system from bottom up that should clear everything out (bootloader, then IMG files). Was wondering if RSD would do that?
just noticed this in recovery when I perform wipe cache partition I get this message "E: format_volume: make_extf4fs failed on /dev/block/platform/sdhci-tegra.3/by-name/cache cache wipe complete".
So frustrated right now.....REALLY appreciate all the help!
Lord do you know how to enable USB debugging from fastboot, RSD, or OEM recovery? Found a forum mentioning a lock if OTA updates performed.
http://www.arvydas.co.uk/2012/05/installing-android-4-0-3-ice-cream-sandwich-ics-on-motorola-xoom/

[Q] Huawei Ascend G6-L11 Unlocked. Error on system img flashing.

Hi, so I got this phone about a month ago, with stock rom and filled up with bloat and unnessecary crap. So being the fundamentalist I am, I rooted this phone too (5th android phone I've had), and started playing with it.
By default, the bootloader is locked, so I unlocked it using Huawei's website unlock helper and fastboot.
I have no memory card to go with this phone, so I've had to try out the fastboot/adb way of doing this, and so far it's been a hit and miss.
I've been testing with SlimStock KK, and with Ascend G6 Mod, and I'm able to flash the boot and recovery successfully, but when it comes to flashing the system, it fails. Here's the output of that:
Code:
Karls-MBP% fastboot devices
90587873 fastboot
Karls-MBP% fastboot flash system /Volumes/ODIN/karleirik/Downloads/Firefox/Huawei_Ascend_G6-L11_Modded_B370_ROM/SYSTEM.img
target reported max download size of 1073741824 bytes
erasing 'system'...
OKAY [ 0.039s]
sending 'system' (1048576 KB)...
ERROR: usb_write failed with status e00002ed
FAILED (data transfer failure (Undefined error: 0))
finished. total time: 26.000s
So right now my device is softbricked. Does anyone know how to get around this problem ? Or have another approach to flashing it?
Edit: I might add that I've tried different system images, and different hardware USB ports on my laptop to no avail. I have also tried the flashall, which fails due to no product ID and adb sideload <zip> fails because of a timeout:
Code:
* failed to write data 'protocol fault (couldn't read status length): Connection reset by peer' *
- Phossk
Phossk said:
Hi, so I got this phone about a month ago, with stock rom and filled up with bloat and unnessecary crap. So being the fundamentalist I am, I rooted this phone too (5th android phone I've had), and started playing with it.
By default, the bootloader is locked, so I unlocked it using Huawei's website unlock helper and fastboot.
I have no memory card to go with this phone, so I've had to try out the fastboot/adb way of doing this, and so far it's been a hit and miss.
I've been testing with SlimStock KK, and with Ascend G6 Mod, and I'm able to flash the boot and recovery successfully, but when it comes to flashing the system, it fails. Here's the output of that:
So right now my device is softbricked. Does anyone know how to get around this problem ? Or have another approach to flashing it?
Edit: I might add that I've tried different system images, and different hardware USB ports on my laptop to no avail. I have also tried the flashall, which fails due to no product ID and adb sideload <zip> fails because of a timeout:
- Phossk
Click to expand...
Click to collapse
Try putting the .zip file inside your adb and fastboot files and just type the .zip file name when flashing instead of the whole path to the .zip
Hope this will solve your problem.

Phone bootlooping on Mi logo after updating firmware, unable to go into recovery

I was using official Lineage 14.1 on Lollipop bootloader with firmware libra_miui_v8120_fw_patch, then today stupidly decided to update firmware with libra-firmware_miui9-7.8.21_7.0.zip which is probably for Nougat bootloader. Now I am unable to go into recovery and also when trying to flash recovery through fastboot I end up with this:
Code:
fastboot flash recovery twrp.img
target reported max download size of 536870912 bytes
sending 'recovery' (40704 KB)...
OKAY [ 1.343s]
writing 'recovery'...
FAILED (remote: Partition flashing is not allowed)
finished. total time: 1.362s
So can't even flash recovery. Fastboot oem unlock ends up with this:
Code:
FAILED (remote: Token verification failed, reboot the device)
finished. total time: 0.031s
tried also flashing logo.bin into bk2 just to verify if partition is logged and end up with same issue as with recovery, apparently bootloader locked:
Code:
fastboot flash bk2 logo.bin
target reported max download size of 536870912 bytes
sending 'bk2' (9591 KB)...
OKAY [ 0.329s]
writing 'bk2'...
FAILED (remote: Partition flashing is not allowed)
finished. total time: 0.341s
Is there any way to flash through fastboot just firmware and get back to where I was before screwed update so I don't need to go through flashing fastboot MIUI ROM, losing all my data in phone and setting up phone from scratch? At least in worst case I hope that's an option and it would work just to flash old libra_images_6.1.7_20151221.0000.11_5.1_cn_b09dac70a0, then do oem unlock flash TWRP and the go to lineage, as i did without official unlocking before, but I would rather avoid this since I have still some data not backed up in the phone (luckily i backed up photos just before flashing).
EDIT: Or is there a way to at least back up my data out of phone through fastboot?
EDIT 2: according google results not possible to do backup through fastboot and according fastboot oem device-info it's locked bootloader, so back to square one, losing files, grr and start from scratch
https://www.google.ro/amp/s/forum.x...-unlocking-mi4c-bl-verification-t3336779/amp/
Steps 2 to 9. It should work.
Might be another way to save your data but I didn't found one. Maybe your pc will se your folders in fastboot so you can save the data.
Sent from my Mi-4c using Tapatalk
You can also try to unlock the bootloader the official way, then install TWRP and flash a lollipop firmware zip with the lollipop bootloader and try to boot your ROM that way. The zip floats around in one of the ROM threads.
cezarmed2 said:
https://www.google.ro/amp/s/forum.x...-unlocking-mi4c-bl-verification-t3336779/amp/
Steps 2 to 9. It should work.
Might be another way to save your data but I didn't found one. Maybe your pc will se your folders in fastboot so you can save the data.
Sent from my Mi-4c using Tapatalk
Click to expand...
Click to collapse
yeah, I did that as usual when unlocking unofficially, but there is no way to see your data, though in miflash it says in bottom "save user data" but nothing was saved, I looked through all phone, can't find it anywhere
OK, I noticed another issue, my available space significantly shrank. I guess it's because during fastboot oem edl flashing fastboot MIUI dev ROM through miflash I left "keep user data" checked instead erase, hoping I can recover them somehow.
Now Settings/Storage shows me that my System takes 21GB out of all 29GB, which is nonsense, since it's pretty much fresh system with few apps and little data used.
So my question is, can I somewhere find my original user data taking all this space and manage them? Or is user data partition (internal storage) somehow corrupted and I should just format it and this should hopefully fix problem with lack of free space (although Settings are showing System is taking all the 21GB)? In Mixplorer Internal storage is showing capacity 7.75GB and Root 1.82GB, so I would think it's corrupted internal storage which should be formatted, although best would be if original data would be somewhere hidden and I could just delete them manually.
EDIT: SOLVED - go to TWRP / Wipe / select Data / Repair button / Resize / and partition was properly resized from 7900MB back to 26136MB without loss of current data, of course original data from before are gone, but I am already over it.

Android - Corrupted system after security update

After installing a security update, my device won’t boot. Is there a way out of this without losing my data?
In more details:
My device is a Moto e7 XT2095-2 with Android 10.
Today I got a notification for the latest security update. I downloaded it. My phone tried to restart but failed, and looped several times.
In the end it displayed a black screen with a barcode and “fastboot mode ...”.
After trying to reboot again, now I’m getting this message:
Android Recovery
motorola/malta_reteu/malta
10/QOFS30.569-36-31/095c7
user/release-keys
Use volume up/down and power
Can’t load Android system. Your data may be corrupt. If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device.
If I select “Try again”, I’m getting an “Error!” screen then the device reboots (tries to, I mean).
The device is not rooted. I haven’t unlocked the bootloader, installed a custom ROM, or a custom recovery.
Developer options are enabled – that’s the only difference from the average person’s smartphone.
I have no backup of my data.
I know very little about Android, but as a developer I’m comfortable enough learning about it.
I searched online what I could do, and tried to ADB sideload the stock OTA as described here:
https://www.droidwin.com/fix-cant-load-android-system-your-data-may-be-corrupt-without-reset/
with the 2 latest files from here https://mirrors.lolinet.com/firmware/moto/malta/official/RETEU/
On my laptop terminal, I got this:
serving: 'update.zip' (~0%) adb: failed to read command: Undefined error: 0
And on the device:
Finding update package…
Opening update package…
Verifying update package…
E:footer is wrong
Update package verification took 0.2s (result 1)
E:Signature verification failed
E:error: 21
Install from ADB completed with status 2.
Installation aborted.
I’m a bit confused from reading a lot of contradictory information. Is this method supposed to work or is it failing because my bootloader is locked or because I’m using the stock recovery?
Is there a way to fix this bootloop without losing my data? Is there any way to backup the device’s data before a factory reset?
I would really appreciate if someone could point me to things worth trying!
Thanks
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
(replied to the wrong post)
aIecxs said:
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
Click to expand...
Click to collapse
Thanks for the suggestions!
2) I had never heard of A/B slots before, I will read a bit about it and try
1) Error 21 seems to be caused by a ROM that isn’t signed by the manufacturer. https://gossipfunda.com/android-update-error-21/
All the ROMS on https://mirrors.lolinet.com/firmware/moto/malta/official/RETEU/ seem to be “user signed”, the 2 I tried have these filenames:
XT2095-2_MALTA_RETEU_10_QOFS30.569-36-29_2201_220222_user_SIGN_008_SVC.zip
XT2095-2_MALTA_RETEU_10_QOFS30.569-36-31_2203_220331_user_SIGN_008_SVC.zip
I read that the signature verification can be bypassed using a custom recovery, but this requires unlocking the bootloader and erasing all data.
I will try to find a signed ROM.
please double check maybe it's zip in zip
aIecxs said:
please double check maybe it's zip in zip
Click to expand...
Click to collapse
It's not, the zip contains a few dozen files, mostly .img
aIecxs said:
you will find lot of contradictory information, also on xda. so please handle my information with care, too
1) no problem for official OTAs, stock recovery is intented to flash (proper signed) update.zip on locked bootloader. have a look into zip META-INF/com/google/android/updater-script and figure out where the error 21 comes from, or search for it...
2) it is A/B device so you might be able to switch slot from fastboot and boot into other working slot (if not flagged as invalid)
3) you can backup (encrypted) userdata partition from mtkclient. unfortunately this won't help on factory reset, as every android device run several proprietary OS (which can't backed up) so factory reset will destroy encryption regardless of your backup
Click to expand...
Click to collapse
I tried to change the slot, but no luck. It's only possible with an unlocked device.
That's a pity. If it's meant to help average users who just get into a bootloop caused by a faulty update, they're unlikely to have unlocked their device, why would they?
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot --set-active=b
Setting current slot to 'b' FAILED (remote: 'set_active command is not allowed on locked devices')
fastboot: error: Command failed
$
Also found this: https://www.droidwin.com/fix-failed-remote-slot-change-is-not-allowed-in-lock-state/
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
aIecxs said:
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
Click to expand...
Click to collapse
Thanks! I'll read more about this, to be sure I understand what I'm doing, then give it a go.
Is there a step to relock with mtkclient at some point, or should I leave it unlocked and boot normally at the end?
as mentioned, do not try to boot in unlocked state you will lose all data. re-lock bootloader by restoring (locked) seccfg first!
aIecxs said:
as mentioned, do not try to boot in unlocked state you will lose all data. re-lock bootloader by restoring (locked) seccfg first!
Click to expand...
Click to collapse
Ok, I didn't know that would restore the locked state as well.
aIecxs said:
too bad. you can backup seccfg, unlock with mtkclient (no fastboot flashing unlock needed) switch slots and restore seccfg. it's a bit dangerous as accidentially booting into android while in unlocked state will make encryption invalid, so make sure you boot into fastboot mode only (maybe use hair tie for volume key?)
unlocking with mtkclient does not factory reset, but do not erase metadata, userdata or md_udc (backup recommended)
Click to expand...
Click to collapse
I'm delayed by other issues while trying to get a win10 virtualbox running so that I can run mtkclient... Am I right to assume it can run in virtualbox, and doesn't require a non-virtual win OS?
virtalbox requires usb passthrough. why not use native OS all platform supported. or just try the Live DVD V4 provided?
aIecxs said:
virtalbox requires usb passthrough. why not use native OS all platform supported. or just try the Live DVD V4 provided?
Click to expand...
Click to collapse
You're right. I think I had seen only Win and Linux, not MacOS. I was probably confused with some other tool I came across in my search!
tom353 said:
You're right. I think I had seen only Win and Linux, not MacOS. I was probably confused with some other tool I came across in my search!
Click to expand...
Click to collapse
Actually that was for SP Flash Tool, not mtkclient. So that I can backup seccfg.
mtkclient is replacement for SP Flash Tool, you can backup all partitions at once into directory out (rl = read all)
Code:
python3 mtk rl out
aIecxs said:
mtkclient is replacement for SP Flash Tool, you can backup all partitions at once into directory out (rl = read all)
Code:
python3 mtk rl out
Click to expand...
Click to collapse
Ah, great. Thanks!
In following the steps in https://github.com/bkerler/mtkclient I'm reading this:
If the device has a vendor interface 0xFF (like LG), make sure to add "blacklist qcaux" to the "/etc/modprobe.d/blacklist.conf".
How can I find out whether my device "has a vendor interface 0xFF"?
check bDeviceClass on lsusb -vv
https://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors
It’s been a while (life happens...), but I haven’t given up on this!
I couldn’t get MTKClient to run on MacOSX, but I eventually got my hands on an old PC and used the liveDVD.
So, I did what you suggested. Backup up seccfg, unlocked bootloader with MTKClient, switched slots with fastboot, then restored seccfg.
Unfortunately, the device is still stuck in the same bootloop. Then after maybe 5 tries it goes into either fastboot, or that “Can’t load Android system. Your data may be corrupt.” screen from my first post.
Also, it switches back to slot A during that bootloop.
I could verify that after a ./fastboot reboot (into fastboot again) , the current-slot was indeed changed to B.
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot --set-active=b
Setting current slot to 'b' OKAY [ 0.011s]
Finished. Total time: 0.014s
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot set_active b
Setting current slot to 'b' OKAY [ 0.008s]
Finished. Total time: 0.011s
$ ./fastboot getvar current-slot
current-slot: a
Finished. Total time: 0.003s
$ ./fastboot reboot
Rebooting OKAY [ 0.003s]
Finished. Total time: 0.003s
$ ./fastboot getvar current-slot
current-slot: b
Finished. Total time: 0.003s
During the bootloop , I also diverted it into fastboot to verify, after 2 or 3 boot attempts, it was still on B. But later on it switched back to A.
Actually, I noticed that I could change the slot without unlocking the bootloader.
There are 2 ways to access fastboot on that device. One way is from within recovery mode, which I had been using initially, and in this fastboot I’m getting this message “set_active command is not allowed on locked devices”. But the other way is to access fastboot from the first menu, and that fastboot lets me use set_active.
This restriction that applies to one fastboot and not the other made me wonder whether the “OKAY” message actually did the job, but the different responses from getvar current-slot seem to confirm that.
Anyway, the short conclusion is that switching slots didn’t make the device to boot, and it sets itself back to slot A after trying to boot on B.
Another observation I made is that I’m not sure MTKClient effectively unlocked my device. It reported that it unlocked it, but then when I used it the second time to restore seccfg, it said “Device is protected”.
[09:56:23]: Loading payload from mt6765_payload.bin, 0x264 bytes
[09:56:23]: Kamakiri / DA Run
[09:56:23]: Trying kamakiri2..
[09:56:23]: Done sending payload...
[09:56:24]: Successfully sent payload: /opt/mtkclient/mtkclient/payloads/mt6765_payload.bin
[09:56:24]: Device is protected.
[09:56:24]: Device is in BROM mode. Trying to dump preloader.
[09:56:58]: Bootloader: unlock
[10:05:07]: Loading payload from mt6765_payload.bin, 0x264 bytes
[10:05:07]: Kamakiri / DA Run
[10:05:07]: Trying kamakiri2..
[10:05:07]: Done sending payload...
[10:05:07]: Successfully sent paylad: /opt/mtkclient/mtkclient/payloads/mt6765_payload.bin
[10:05:07]: Device is protected.
[10:05:07]: Device is in BROM mode. Trying to dump preloader.
[10:07:25]: test
[10:07:35]: write done!
I also went to see what fastboot was reporting after unlocking with MTKClient:
$ ./fastboot getvar unlocked
unlocked: no
Finished. Total time: 0.003s
However, that doesn’t necessarily matters, as I didn’t need to unlock it to switch slots.
Now, is there anything else I could try?
I was thinking of retrying to ADB sideload the stock OTA while the device is “maybe unlocked”.
I mean, by the look of it, it’s still locked, but I have limited trust in what my 2 inconsistent fastboot report.
So, assuming it is unlocked, is it safe to try ADB sideload while unlocked, or could this cause data loss?

Categories

Resources