How to remove data encryption on emui 9.1 stock roms and root - Huawei P20 Lite Guides, News, & Discussion

Im Using C432 .. Rom 9.1.0.147 Newest Stock Update Here In Denmark
First Unlock Bootloader : flash oem unlock ********code******
Enter Bootloader Again, Now Flash Modded_recovery_ramdisk : fastboot flash recovery_ramdisk r.ram.mod.img
And Flash Erecovery_ramdisk with TWRP.img From kilroystyx
Do NOT Remove USB Cable But Hold Power Untill You See Black Screen
Then Quickly Pres And Hold VOL + Untill You Read "Your Device Is Booting Now..."
Now You Should See/Enter Your TWRP Recovery , Now Wipe And Format Data, Then Reboot Recovery "Force Close With Power" .. Again When You See Black Screen Then Quickly Pres And Hold VOL + Untill You Read "Your Device Is Booting Now..."
And You Should ReEnter TWRP Again.. now Mount Vendor then Start Terminal In Recovery under advanced
In Terminal Type :
mount -o remount,rw /dev/block/mmcblk0p55
mount -o remount,rw /dev/block/mmcblk0p37
mount -o remount,rw /dev/block/mmcblk0p53
"patition name/table layout of editable partitions from recovery"
cust = mmcblk0p53
vendor = mmcblk0p55
modem_fw = mmcblk0p37
erecovery_ramdisk = mmcblk0p29
recovery_ramdisk = mmvblk0p33
Now Use File Manager In Recovery Under Advanced To Copy fstab.modem , fstab.hi6250 And recovery.fstab From /vendor/etc/ to /sdcard/ And from /sdcard/ Over To a PC .. Edit fstab.* With Notepad++ One By One Remove The Word "verify" including the comma and replace ALL "ro" with "rw" Also Remove The Words With fileencryption***************** Including The Comma ...
Do This in ALL 3 Files When Done Copy Back The 3 Files To Sdcard And Use File Manager To Move The Edited Files Back To /vendor/etc/ Overwriting The Old Files Now Do The Same With The 2 Files In The Root /fstab.hi6250.data And /fstab.hi6250
THEN FROM RECOVERY Select REBOOT And RECOVERY .... AND YOUR DONE .. You Should Now Automaticly Enter The Rom..
YOU ARE NOW MAGISK ROOTED "Use 19.3 Stable Settings In Magisk Only" Dont Directly Update Magisk ! Clear Repo!
From Now On To Enter The TWRP You Need To Put The USB Cable In The Phone And Hold VOL- And Power To Enter Bootloader From Here Force Power Off " Hold Power Untill Black Screen Then Quickly Hold VOL+ Alone Untill You Read "Your Device Is Booting Now..." Only Way To Enter TWRP Using "ERECOVERY_RAMDISK" Partition.. And Always Use Reboot Then Recovery to Enter Rom From TWRP .. If Not You Need To Reflash recovery_ramdisk with r.ram.mod.img
Now You Can Backup Data And Restore Data With Out Fork Errors We Should Also Be Able To Both Backup/Restore Cust , Modem_fw And Vendor. But We Only Need Data, System , Erecovery_ramdisk And Recovery_ramdisk To Get A Good Complete Backup.
Peace MarsDroid/BrokenWorm

Unlock Bootloader
First Unlock Bootloader : flash oem unlock ********code******???????
The question is, will it unlock the bootloader? . This is what i need, plis

KenynTM said:
First Unlock Bootloader : flash oem unlock ********code******???????
The question is, will it unlock the bootloader? . This is what i need, plis
Click to expand...
Click to collapse
Becoes your new ill be nice.. but plz dude.. u got to read more before you use this guide or you will end up with a pretty door stopper.
To unlock your bootloader use this DC UNLOCKER CLIENT : https://www.dc-unlocker.com/downloads
This is the 1 and only solution .

I cant flash Erecovery, i got
Writing 'Erecovery_ramdisk'
FAILED (remote: Comand not allowed)
My bootloader is unlocked, please help

I'm also stuck here^^^

Flash erecovery_ramdisk from twrp recovery... Sry forgot to mention that..
I recomend following or reading this post i wrote .. https://forum.xda-developers.com/showpost.php?p=80044263&postcount=9 .. about the same stuff

Welp, i managed to flash twrp to Erecocery, it's pretty easy
1 download twrp and patched recovery_ramdisk (i strongly recomend to extract the one from update.app with huawei firmware finder and huawei firmware extractor and pacth it with magisk manager)
2 copy twrp.img into your minimal adb folder and copy twrp and patched recovery_ramdisk into your micro sd
3 connect p20 lite (in fastboot Mode) to pc and open minimal adb and fastboot (cmd here) and flash twrp (fastboot flash recovery_ramdisk twrp.img)
3 Disconect and force power off, turn p20 lite and boot into recovery (power off and vol +) it Will boot into twrp
4 go to install and go to external storage, also select "Install image"
5 select your twrp.img, it will you ask where to Install, select "Erecocery_ramdisk" and Install it
6 repeat step 4 and now select your patched recovery_ramdisk.img and Install it on "recovery_ramdisk"
7 ???
8 profit
And now i'm stuck with the fstabs, i do all the steps on first post but when i try to move the modified ones shows an error, so what now?

RyogaIgnored said:
Welp, i managed to flash twrp to Erecocery, it's pretty easy
1 download twrp and patched recovery_ramdisk (i strongly recomend to extract the one from update.app with huawei firmware finder and huawei firmware extractor and pacth it with magisk manager)
2 copy twrp.img into your minimal adb folder and copy twrp and patched recovery_ramdisk into your micro sd
3 connect p20 lite (in fastboot Mode) to pc and open minimal adb and fastboot (cmd here) and flash twrp (fastboot flash recovery_ramdisk twrp.img)
3 Disconect and force power off, turn p20 lite and boot into recovery (power off and vol +) it Will boot into twrp
4 go to install and go to external storage, also select "Install image"
5 select your twrp.img, it will you ask where to Install, select "Erecocery_ramdisk" and Install it
6 repeat step 4 and now select your patched recovery_ramdisk.img and Install it on "recovery_ramdisk"
7 ???
8 profit
And now i'm stuck with the fstabs, i do all the steps on first post but when i try to move the modified ones shows an error, so what now?
Click to expand...
Click to collapse
i would try remounting the partitions rw

brokenworm said:
i would try remounting the partitions rw
Click to expand...
Click to collapse
Hi. The code I wrote from the twrp terminal window gives an error.
mount -o remount,rw /dev/block/mmcblk0p55
mount: can't find /dev/block/mmcblk0p55 in /proc/mounts

akif688 said:
Hi. The code I wrote from the twrp terminal window gives an error.
mount -o remount,rw /dev/block/mmcblk0p55
mount: can't find /dev/block/mmcblk0p55 in /proc/mounts
Click to expand...
Click to collapse
When you enter "ls -l /dev/block/mmcblk*" in the terminal, what does it say then?

I want to transfer this procedure to Honor 7X. Can someone please send output from the following commands (first to get list of names of partitions, second to get list of mounted filesystems) executed via adb shell on the P20 lite:
ls -l /dev/block/by-name
mount
Thanks a lot in advance.

ZB2016 said:
I want to transfer this procedure to Honor 7X. Can someone please send output from the following commands (first to get list of names of partitions, second to get list of mounted filesystems) executed via adb shell on the P20 lite:
ls -l /dev/block/by-name
mount
Thanks a lot in advance.
Click to expand...
Click to collapse
the partitons change from rom build to rom build and is useless. ..
i moved on to new device sry ..
but this is the partitions i was playing with :
"patition name/table layout of editable partitions from recovery"
cust = mmcblk0p53
vendor = mmcblk0p55
modem_fw = mmcblk0p37
erecovery_ramdisk = mmcblk0p29
recovery_ramdisk = mmvblk0p33
im guessing this answers your question

brokenworm said:
the partitons change from rom build to rom build and is useless. ..
...
im guessing this answers your question
Click to expand...
Click to collapse
perfect! Thanks a lot!

Does anyone have a working link to the r.ram.mod.img file?
EDIT: Nevermind... figured out I had to extract it from my firmware.

Guys tell me how to decrypt huawei p20 lite, i.e. turn off encryption.
and this parameter is not quite clear what it is and how - disable verity.
The device - the data folder is already encrypted, of the more comprehensible methods are of interest to me these two
this 1) "https://forum.xda-developers.com/t/...tion-on-emui-9-1-stock-roms-and-root.3953946/"
and this 2)
"https://forum.xda-developers.com/t/...-mediapad-t3-10-ags-w0.3843728/#post-78558329 "
but the first method does not show what to do after you mount it
In Terminal Type :
mount -o remount,rw /dev/block/mmcblk0p55
mount -o remount,rw /dev/block/mmcblk0p37
mount -o remount,rw /dev/block/mmcblk0p53
"name/table layout of editable partitions from recovery"
cust = mmcblk0p53
vendor = mmcblk0p55
modem_fw = mmcblk0p37
erecovery_ramdisk = mmcblk0p29
recovery_ramdisk = mmvblk0p33
i don't know if it's necessary to go through these commands, when i can copy these files, edit them and replace them back via TWRP, do i understand correctly that these commands will unlock the partition to overwrite the files inside it?
but i don't know if this method will work with emui 9.1 yet and the links to img are broken. + i'm afraid to overwrite TWRP with erecovery, because i figured out that i can't flash emui from fastboot erecovery, it is closed for him, only with TWRP and i'm not sure if i can? "+ it's not clear, replaced the files and that's it? "
the second way I stopped
I don't understand why I can't see the boot img from the extracted firmware Anne-L01 9.1.0.370(C432E7R1P7T8)
Is it locked or what? but i saw verity in FASTBOOT.img - or should i edit it to disable verity? and the question is different things recovery and boot? so i doubt in the correct execution.
and in this video i saw how to remove veirty, but what is it ?
as i understand this will not remove the forced encryption , but as i understand this will move me one step closer to the goal of disabling all verity and encryption too.
I don't understand what vbmeta is either, do I have to dig around in my target just to remove this forced encryption or is it an extra parameter, I mean vbmeta ?

Related

help! deleted recovery.img

just wondering if anyone can help me out here, i was trying to flash the cyanogen hero recovery image to my phone using fastboot so i erased my stock recovery image, only to get the message "remote: signature verify fail" so im now stuck with no recovery image and dont know how to get it back, can anyone help me out please?
ok so i managed to mount my system as read write in fastboot and put the recovery.img from the wwe version in to system which has gave me my recovery back but when i boot it just stays on the hero screen and says fastboot usb at the top if i have it plugged into my pc. i have no idea how to reset the original files and i didnt back up, can anyone help me pleas?
Well after trying for hours to fix this, I give up. I can't install the system.img from wwe rom posted on here it says verify failed or something similar so I stupidly tried to flash the magic 32a heroski port hoping it would work and still nothing. Is there anyway someone could post there nandroid backup file and help me flash it to see if that works? Or should I just give up. I'm really stuck now lol
you can't flash anything from fastboot because the images need to be signed.
what version of hero do you have?
if you have the wwe hero(it's not needed ) i can send you (later, now i'm at work) my nandroid backup (system,boot,recovery, splash...) so you can restore them
I have the orange hero. I used fastboot to load cyanogens recovery image then flashed the heroski rom hoping it might work lol so I ended up using fastboot to erase system. Question is do you think your nandroid backup would work? I sure hope so it would be a great help!!! Thanks.
i have the unlocked wwe hero. i'm uploading now the system, boot and recovery to rapidshare . it'll be up in a couple of minutes. if you find a orange hero backup you can restore in the same way ;-)
restoring hero wwe
download the backup from(it's better if you verify the md5):
http://rapidshare.com/files/263636068/bkp.rar.html
MD5: BEAE167BCBB1FF6D3D2701FB64604203
Put the contents on sdcard (i'm assuming that you put the images in a folder named bkp on the sdcard)
so:
download the recovery from here: http://rapidshare.com/files/262621147/cm-hero-recovery.img.zip and extract it
put your phone in fastboot mode (with the phone off, press the back key then turn the phone on).
then:
boot with the downloaded recovery
Code:
fastboot boot cm-hero-recovery.img
0) mount the partitions
Code:
adb shell mount /system
adb shell mount /sdcard
1) do a wipe
select the wipe option from the recovery menu
2) restore boot
Code:
adb shell flash_image boot /sdcard/bkp/boot.img
3) restore recovery
Code:
adb shell flash_image recovery /sdcard/bkp/recovery.img
4)restore system
Code:
adb shell
cd /system
rm -rf * (ignore the errors)
unyaffs /sdcard/bkp/system.img
5) unmount the partitions
Code:
umount /system
6) reboot
Code:
reboot
hope it helps
Ok thanks. Have to wait 4 hours to try it as I'm in work lol, what is an md5 for, just out of curiosity?
A MD5sum is a checksum to verifiy that your downloaded file isn't corrupt.
maxisma said:
A MD5sum is a checksum to verifiy that your downloaded file isn't corrupt.
Click to expand...
Click to collapse
Ok dude makes sense thanks.
thanks
enlightener said:
download the backup from(it's better if you verify the md5):
http://rapidshare.com/files/263636068/bkp.rar.html
MD5: BEAE167BCBB1FF6D3D2701FB64604203
Put the contents on sdcard (i'm assuming that you put the images in a folder named bkp on the sdcard)
so:
download the recovery from here: http://rapidshare.com/files/262621147/cm-hero-recovery.img.zip and extract it
put your phone in fastboot mode (with the phone off, press the back key then turn the phone on).
then:
boot with the downloaded recovery
Code:
fastboot boot cm-hero-recovery.img
0) mount the partitions
Code:
adb shell mount /system
adb shell mount /sdcard
1) do a wipe
select the wipe option from the recovery menu
2) restore boot
Code:
adb shell flash_image boot /sdcard/bkp/boot.img
3) restore recovery
Code:
adb shell flash_image recovery /sdcard/bkp/recovery.img
4)restore system
Code:
adb shell
cd /system
rm -rf * (ignore the errors)
unyaffs /sdcard/bkp/system.img
5) unmount the partitions
Code:
umount /system
6) reboot
Code:
reboot
hope it helps
Click to expand...
Click to collapse
ok so i finally got time to fix my phone and just did what you said and can now happily say it worked. thanks enlightener you enlightened me lol. in future i will refrain from doing random terminal stuff without researching first lol.
Bad new : My hero is out of service area
Hello,
Sorry for my english, i'm french
I made a big mistake in my files system ... A too long story
My Hero :
HBOOT-1?76.0004
Radio-6.35.04.25
July, 3 2009
Well, now, my htc hero do not work 'first page, out of service area"... I would like to make your post, but i had error :
First, fastboot Ok, Adb shell mount system and sdcard ok, wipe ok
Second, when i do this code" adb shell flash_image boot /sdcard/bkp/boot.img", my hero "said" : "header is the same, note flashing boot". Same thing for restore recovery
Can you help me ?
pitou21 said:
Hello,
Sorry for my english, i'm french
I made a big mistake in my files system ... A too long story
My Hero :
HBOOT-1?76.0004
Radio-6.35.04.25
July, 3 2009
Well, now, my htc hero do not work 'first page, out of service area"... I would like to make your post, but i had error :
First, fastboot Ok, Adb shell mount system and sdcard ok, wipe ok
Second, when i do this code" adb shell flash_image boot /sdcard/bkp/boot.img", my hero "said" : "header is the same, note flashing boot". Same thing for restore recovery
Can you help me ?
Click to expand...
Click to collapse
in this case, you don't have to restore boot or recovery because they are the same as the images posted here.
proceed with system
Ok thanks, now it's goog !

Sim not working after fastboot erase /config & twrp restore (Z00AD)

TLDR; I have a twrp backup of my zenfone2 at a working state, but sim cards are not detected or unable to unlock after restore
Hi all,
I was trying to restore a TWRP backup (twrp-3.1.1-0-Z00A.img) of my lineageos install (lineage-14.1-20170721-nightly-Z00A-signed.zip) and /config was not restoring (error: "Unable to wipe config."),
so I ended up doing "fastboot erase config" to force the restore, which didn't help and might have been a mistake ...
(the real error after looking at the twrp logs is: "error: build_default_directory_structure: cannot lookup security context for /config/lost+found" / "Unable to wipe config.")
At first I restored /config by hand extracting the backup file (config.ext4.win) on my computer and using cp in twrp terminal, but android was crashing as soon as I inserted a sim card (permissions / selinux problems I guess)
I tried some chown / chmod / restorecon but no luck
I then reflashed stock rom (tried multiple recent versions, Android L and M, using adb sideload) but no luck
I used the "Unlock Device App" but my bootlooder was not locked while reflashing stock rom.
I'm now running lineageos again, I was able to restore /config using "rm -rf" option in twrp, but I either don't see the sim cards, or the phone is unable to unlock them
looking at logcat, the phone is looping trying to flash the modem (https://pastebin.com/zBnjtW1v)
I haven't try Asus Flash Tool and "raw" firmware, would it help ? (I don't have a windows machine handy, only linux / mac)
Any recommended stock version I should try?
To sum up I have a TWRP backup at a know good state (but don't know if the backup is good as it's the first time I try a restore ...),
a zenfone with non working sim cards (working in an other phone), and I would like to make it work again
Thanks
Etienne
Now flashed WW_ZE551ML_4.21.40.223_20161216.raw using Asus Flash Tool (https://forum.xda-developers.com/zenfone2/general/z008-z00a-z00d-z00x-raw-fw-collection-t3448966)
but still no sim cards
Can someone share a dd dump of /config partition of a Z00AD?
Thanks
Etienne
Found some errors in the logcat:
08-06 21:02:21.683 263 1603 D : (NVM_1) OpenNvmBinFiles - NOTICE: Error in opening /config/telephony/1//calib.nvm
08-06 21:02:21.683 263 1603 D : (NVM_1) InitNvmModule - Error opening the NVM file
If someone can share /config permissions on their zenfone2 (permissions / owner / group / selinux)
Thanks
Etienne
champtar said:
Found some errors in the logcat:
08-06 21:02:21.683 263 1603 D : (NVM_1) OpenNvmBinFiles - NOTICE: Error in opening /config/telephony/1//calib.nvm
08-06 21:02:21.683 263 1603 D : (NVM_1) InitNvmModule - Error opening the NVM file
If someone can share /config permissions on their zenfone2 (permissions / owner / group / selinux)
Thanks
Etienne
Click to expand...
Click to collapse
kindly PM me your serial number i will send you config files
Same problem hefe !!!!
Hi,
it took me a lot of flashing and tries, but what fixed it was (I think):
0) make a full backup of your phone with TWRP (all partitions)
1) flash latest stock version (UL-Z00A-WW-4.21.40.352-user.zip)
at this point sim card where not working, I was seeing selinux error (avc: denied ...) for process mmgr (looking with adb logcat)
2) reunlock the phone if needed and install latest TWRP
3) in TWRP, mount all partitions, then go to the terminal
4) list selinux permissions for everything in /config
ls -RZ /config
take notes on a paper, we need to restore them later
5) change selinux permissions using
chcon -R -t config_file /config
(found this looking at /file_contexts file, line "/config(/.*)? ubject_r:config_file:s0")
6) reboot in the stock rom and wait (looking at logcat it seemed to recalibrate itself),
at some point (maybe 5min) it asked me for sim pin \o/
7) reinstall lineageos (in my case restore backup except /config)
8) change the selinux permissions of /config back to what they were (step 4)
9) reboot in lineage os and wait again (it took maybe 5 min for the phone to ask the sim card pin)
Hope this work for you
Fastboot erase config....
After that I stucked at boot logo
Used xfstk then aft but stucked at boot used fastboot commands for flashing system all gonna smooth but stucked at boot...
Used recovery to sideload marshmallow ... succeed. But also stucked at boot ..unlock boot loader flash TWRP flashing custom rom also stucked at boot logo... PLZZ help me guyzzz
And it shows error in TWRP
Unable:to mount Config(invalid argument)

[HowTO] Get rid of annoying "Kernel is not seandroid enforcing" message....

Hi,
I started to play with kernel hacking/configuration and I found the annoying red message
After a lot of research i found that we can get rid of it by adding at the end of boot.img file the SEANDROIDENFORCE text string, as following
echo SEANDROIDENFORCE >> boot.img
Best regards,
Marc
serdeliuk said:
Hi,
I started to play with kernel hacking/configuration and I found the annoying red message
After a lot of research i found that we can get rid of it by adding at the end of boot.img file the SEANDROIDENFORCE text string, as following
echo SEANDROIDENFORCE >> boot.img
Best regards,
Marc
Click to expand...
Click to collapse
Thanks.. Work bro..
diphons said:
Thanks.. Work bro..
Click to expand...
Click to collapse
Yeah, I'd like recommend to find a solution to get also rid of "set warranty bit kernel/recovery", the yellow warning is really annoying!
I was able to append the boot.img file with SEANDROIDENFORCE text string.
But how do you exactly write it back?
I'm on samsung note 4.
Code:
adb reboot recovery
adb shell
dd if=/dev/block/bootdevice/by-name/BOOT of=/sdcard/boot.img
echo SEANDROIDENFORCE >> /sdcard/boot.img
If i try to switch if and of path, I get an error
Code:
dd if=/sdcard/boot.img of=/dev/block/bootdevice/by-name/BOOT
dd: writing '/dev/block/bootdevice/by-name/BOOT': No space left on device
UnknownPlanet said:
I was able to append the boot.img file with SEANDROIDENFORCE text string.
But how do you exactly write it back?
Code:
adb reboot recovery
adb shell
dd if=/dev/block/bootdevice/by-name/BOOT of=/sdcard/boot.img
echo SEANDROIDENFORCE >> /sdcard/boot.img
If i try to switch if and of path, I get an error
Code:
dd if=/sdcard/boot.img of=/dev/block/bootdevice/by-name/BOOT
dd: writing '/dev/block/bootdevice/by-name/BOOT': No space left on device
Click to expand...
Click to collapse
In order to write the boot.img you need to use fastboot/bootloader mode of your device, adb reboot bootloader, then use `fastboot flash boot boot.img`
Alternatively, you can put the boot.img on your /sdcard boot to twrp then `cat boot.img > /dev/your/boot/partition`
The no space left on the device means that your file is bigger than the destination which is unusual if you built that boot img, from your example it seems that you save your partition and do not use a built boot.img
serdeliuk said:
In order to write the boot.img you need to use fastboot/bootloader mode of your device, adb reboot bootloader, then use `fastboot flash boot boot.img`
Alternatively, you can put the boot.img on your /sdcard boot to twrp then `cat boot.img > /dev/your/boot/partition`
Click to expand...
Click to collapse
It doesn't work, I'm on samsung note 4. I also have latest TWRP installed.
fastboot device keep saying:
< waiting for any device >
UnknownPlanet said:
It doesn't work, I'm on samsung note 4. I also have latest TWRP installed.
fastboot device keep saying:
< waiting for any device >
Click to expand...
Click to collapse
you need to find how to boot your device in bootloader mode, usually volDOWN+power together
serdeliuk said:
Alternatively, you can put the boot.img on your /sdcard boot to twrp then `cat boot.img > /dev/your/boot/partition`
Click to expand...
Click to collapse
Still error
Code:
~ # cat /sdcard/boot.img > /dev/block/bootdevice/by-name/BOOT
cat: write error: No space left on device
serdeliuk said:
The no space left on the device means that your file is bigger than the destination which is unusual if you built that boot img, from your example it seems that you save your partition and do not use a built boot.img
Click to expand...
Click to collapse
I use Custom ROM of Hani Base v1.01 here:
[ROM][6.0.1][TW][N910C/H/U] Hani Base v1.01 [18-04-2016][Deodexed][PreRooted]
Welcome to Hani Base ROM thread! Samsung Galaxy Note 4 SM-N910C N910CXXU2DPCB TW 6.0.1 THREAD INDEX: I. INTRODUCTION II. FEATURES III. DOWNLOADS IV. HOW TO FLASH #_____________________________# #include ...
forum.xda-developers.com
I have succcessfuly get and edit the boot.img but I don't know how to flash it back. Forking to make another whole custom ROM is not an option. I won't learn anything.
It's just a tiny append why so difficult.
serdeliuk said:
you need to find how to boot your device in bootloader mode, usually volDOWN+power together
Click to expand...
Click to collapse
There's no bootloader in my samsung note 4, adb reboot bootloader goes to system instead.
Home+Power+VolumeDown enters the download mode, but even then fastboot device still doesn't respond.
Do I need to use Odin or what?
You may need to ask questions about your boot options on the dedicated channel for your device, i do not own such device, but download mode is the fastboot mode as far as can remember, "fastboot devices" should show your device listed when in download mode.
Your steps to flash the boot.img fail because the file is bigger than your boot partition, does not fit there, you may need to seek for help form the img developers to see what to do. You can try to flash the boot.img on recovery partitions which is usually bigger and reboot to recovery, but pay attention, if you don't know how to go back to fastboot mode you are stuck with a bricked device
I was able to flash it without any change in the boot partition size by editing it manually using hex editor.
These are my steps
Code:
adb reboot recovery
adb shell "dd if=/dev/block/bootdevice/by-name/BOOT of=/sdcard/boot.img"
adb pull /sdcard/boot.img
I use Frhed hex editor to edit the last 16 bytes of boot.img into SEANDROIDENFORCE
Code:
adb push boot.img /sdcard/boot.img
adb shell "dd if=/sdcard/boot.img of=/dev/block/bootdevice/by-name/BOOT"
The problem right now is that, the red text is still there. What should be my next step?
UnknownPlanet said:
I was able to flash it without any change in the boot partition size by editing it manually using hex editor.
These are my steps
Code:
adb reboot recovery
adb shell "dd if=/dev/block/bootdevice/by-name/BOOT of=/sdcard/boot.img"
adb pull /sdcard/boot.img
I use Frhed hex editor to edit the last 16 bytes of boot.img into SEANDROIDENFORCE
Code:
adb push boot.img /sdcard/boot.img
adb shell "dd if=/sdcard/boot.img of=/dev/block/bootdevice/by-name/BOOT"
The problem right now is that, the red text is still there. What should be my next step?
Click to expand...
Click to collapse
I don't know if editing the boot.img works, probably should do, however, i found this solution poking around with third party device trees and worked for my samsung galaxy tab, if do not work on your phone then you may need to dig a bit deeper, however, if you use a third party image maybe you ask them why you have that on your screen, maybe they have another fix. Probably a bit of more info can be found here https://github.com/osm0sis/dhtbsign but i didn't spent time to read it. You can ask the developer about more info.
Your solution of device tree / dhtb is impressive on it's own, that's another big learning curve.
But I think I know the problem, because the Custom ROM Hani Base above is using H-Vitamin Kernal which is SELinux Permissive. No matter how I edit the boot.img file the red text message will always appears, unless I flash it with another kernel which is SELinux Enforcing.
UPDATE
This is even weirder.
By updating SuperSU into the latest version, the red text is missing from system mode. It still persist in recovery mode tough, because, well twrp need full access to begin with.
No Magisk here, it was an old custom ROM.
All official app from playstore is now gone but the official xda thread still remain:
[STABLE][2017.05.27] SuperSU v2.82
*** Urgent Update Notice *** We are deeply sorry about the installation errors and failures happened in v2.80. The new update v2.81 has rolled out on XDA and Play Store to fix the problem occured in v2.80. Chainfire has also...
forum.xda-developers.com
From reading the last pages of the thread, I got the official site of chainfire to download it.
SuperSU Download
The file name is
sr5-supersu-v2.82-sr5-20171001224502.zip
Just flash it with latest TWRP and you're done.
I still don't understand how could updating SuperSU could fix the problem.
But what a long journey, thank you so much @serdiluk , I learn so much things.

Cannot boot to system - Always boot to TWRP

I've recently tried out some Generic System Images (or Project Treble ROMs). I did this by flashing the system.img and then doing a factory reset after every image. Some images later I wanted to go back to my daily system.img but It stopped working.
I don't know which step cause this error, but since I flashed my daily system.img again and wanted to boot it, it would always boot into TWRP.
I really don't know how to handle this error since I don't have the knowledge but I'll try to supply as much information as possible, starting with TWRP Logs
One strange thing I noticed is this:
Code:
ro.product.name=omni_berlin
ro.product.board=hi6250
ro.product.brand=Honor
ro.product.model=HONOR-6X
ro.product.device=berlin
ro.product.locale=en-US
ro.product.platform=hi6250
It says Honor-6X although I'm using the 7X and didn't flash anything for the 6X, but it seems like I must have overlooked something...
recovery.log
dmesg.log (1/2)
dmesg.log (2/2)
I'll provide any information needed as soon as possible and I'll be very thankful for any help!
Edit: I usually use [ROM][8.1][OpenKirin's RROS Oreo v6.0.0 - For Honor 7X], but today I've tries these:
[8.1.0][TREBLE] Pixel Experience [AOSP][r26][2018/05/27]
[Resurrection Remix] [Unofficial] [2018-05-19] Phh-Treble
[Lineage] [Unofficial] [2018-05-19] Phh-Treble
supervis0r said:
I've recently tried out some Generic System Images (or Project Treble ROMs). I did this by flashing the system.img and then doing a factory reset after every image. Some images later I wanted to go back to my daily system.img but It stopped working.
I don't know which step cause this error, but since I flashed my daily system.img again and wanted to boot it, it would always boot into TWRP.
I really don't know how to handle this error since I don't have the knowledge but I'll try to supply as much information as possible, starting with TWRP Logs
One strange thing I noticed is this:
Code:
ro.product.name=omni_berlin
ro.product.board=hi6250
ro.product.brand=Honor
ro.product.model=HONOR-6X
ro.product.device=berlin
ro.product.locale=en-US
ro.product.platform=hi6250
It says Honor-6X although I'm using the 7X and didn't flash anything for the 6X, but it seems like I must have overlooked something...
recovery.log
dmesg.log (1/2)
dmesg.log (2/2)
I'll provide any information needed as soon as possible and I'll be very thankful for any help!
Edit: I usually use [ROM][8.1][OpenKirin's RROS Oreo v6.0.0 - For Honor 7X], but today I've tries these:
[8.1.0][TREBLE] Pixel Experience [AOSP][r26][2018/05/27]
[Resurrection Remix] [Unofficial] [2018-05-19] Phh-Treble
https://forum.xda-developers.com/project-treble/trebleenabled-device-development/lineage-phh-treble-t3767690
Click to expand...
Click to collapse
The recovery was borrowed. or ported from Honor 6x, so that line is not a concern.
As far as the logs, I browsed through them. Nothing jumps out to me. There is some selinux permissive = 0 type errors, but dont think that is causing your problem.
I had to use stock recovery to do wipes (factory reset) between different treble rom installs. Without i had bootloop. I never had forced boot to recovery. .
as long as frp is not locked i would suggest flashing stock recovery to try a reset. And if it boots, put twrp back.
mrmazak said:
The recovery was borrowed. or ported from Honor 6x, so that line is not a concern.
As far as the logs, I browsed through them. Nothing jumps out to me. There is some selinux permissive = 0 type errors, but dont think that is causing your problem.
I had to use stock recovery to do wipes (factory reset) between different treble rom installs. Without i had bootloop. I never had forced boot to recovery. .
as long as frp is not locked i would suggest flashing stock recovery to try a reset. And if it boots, put twrp back.
Click to expand...
Click to collapse
Thanks for your fast response.
I've tried installing the stock recovery but I either get a 'Software install failed!' message and can only choose to reboot out of the recovery or it fails to flash through fastboot with this error message 'FAILED (remote: partition length get error)'
I've tried the recovery I can download through the Huawei Multi-Tool 8.0.4.9 'SR_BND-L21_B3xx_EMUI8.img' <- This flashed successfully but I get the Software install failed message.
And I've tried the recovery from this Google Drive folder 'BND-RECOVERY-NoCheck.img' but here I'll get the partition length error while trying to flash it through fastboot.
I think I caused the Software install failed through trying to reset my phone using these instructions
Code:
- Type in these commands:
dd if=/external_sd/BND-RECOVERY-NoCheck.img of=/dev/block/bootdevice/by-name/recovery
dd if=/external_sd/BND-RECOVERY-NoCheck.img of=/dev/block/bootdevice/by-name/recovery2
- If those went well type these as next:
echo --update_package=/sdcard/update.zip > /cache/recovery/command
echo --update_package=/sdcard/update_data_full_public.zip >> /cache/recovery/command
echo --update_package=/sdcard/update_full_BND-L21C_hw_eu.zip >> /cache/recovery/command
I've replaced 'external_sd' and 'sdcard' with 'usbotg' since I had the files on a usbotg device and not on an external sd card.
supervis0r said:
Thanks for your fast response.
I've tried installing the stock recovery but I either get a 'Software install failed!' message and can only choose to reboot out of the recovery or it fails to flash through fastboot with this error message 'FAILED (remote: partition length get error)'
I've tried the recovery I can download through the Huawei Multi-Tool 8.0.4.9 'SR_BND-L21_B3xx_EMUI8.img' <- This flashed successfully but I get the Software install failed message.
And I've tried the recovery from this Google Drive folder 'BND-RECOVERY-NoCheck.img' but here I'll get the partition length error while trying to flash it through fastboot.
I think I caused the Software install failed through trying to reset my phone using these instructions
Code:
- Type in these commands:
dd if=/external_sd/BND-RECOVERY-NoCheck.img of=/dev/block/bootdevice/by-name/recovery
dd if=/external_sd/BND-RECOVERY-NoCheck.img of=/dev/block/bootdevice/by-name/recovery2
- If those went well type these as next:
echo --update_package=/sdcard/update.zip > /cache/recovery/command
echo --update_package=/sdcard/update_data_full_public.zip >> /cache/recovery/command
echo --update_package=/sdcard/update_full_BND-L21C_hw_eu.zip >> /cache/recovery/command
I've replaced 'external_sd' and 'sdcard' with 'usbotg' since I had the files on a usbotg device and not on an external sd card.
Click to expand...
Click to collapse
I have been trying to get usbotg to work, with that method. Twrp recognize s it but the no-check recovery does not.
And the partition you are calling for recovery are wrong for emui8
Both the recovery file you are using and the partition name are nougat.
Oreo partition name is "recovery_ramdisk"
Do not do it to recovery2, "erecovery". It is not needed, or advised.
I have made this manual install process into an install zip. For twrp.
You can see it here
https://forum.xda-developers.com/honor-7x/how-to/guide-honor-7x-flash-oreo-update-t3781649
mrmazak said:
I have been trying to get usbotg to work, with that method. Twrp recognize s it but the no-check recovery does not.
And the partition you are calling for recovery are wrong for emui8
Both the recovery file you are using and the partition name are nougat.
Oreo partition name is "recovery_ramdisk"
Do not do it to recovery2, "erecovery". It is not needed, or advised.
Click to expand...
Click to collapse
Just before I read this message I retried it, I used these commands through TWRP
Code:
echo --update_package=/sdcard/update.zip > /cache/recovery/command
echo --update_package=/sdcard/update_data_full_public.zip >> /cache/recovery/command
echo --update_package=/sdcard/update_full_BND-L21C_hw_eu.zip >> /cache/recovery/command
and then flashed the recovery through Huawei Multi-Tool on recovery_ramdisk.
After a reboot the stock recovery showed up, and did something like verifying the update package (i couldn't read it since it passed very fast) and then stayed at 5% installing.
I now managed to get eRecovery to work but when i choose 'Wipe data/factory reset' it reboots back into eRecovery where it stops at exactly 5%, showing Reset failed!
Edit: I am now downloading a FullOTA-MF-PV for BND-L21 8.0.0.330(C432CUSTC432D2) and will try to follow your tutorial for updates while on Oreo.
supervis0r said:
Just before I read this message I retried it, I used these commands through TWRP
Code:
echo --update_package=/sdcard/update.zip > /cache/recovery/command
echo --update_package=/sdcard/update_data_full_public.zip >> /cache/recovery/command
echo --update_package=/sdcard/update_full_BND-L21C_hw_eu.zip >> /cache/recovery/command
and then flashed the recovery through Huawei Multi-Tool on recovery_ramdisk.
After a reboot the stock recovery showed up, and did something like verifying the update package (i couldn't read it since it passed very fast) and then stayed at 5% installing.
I now managed to get eRecovery to work but when i choose 'Wipe data/factory reset' it reboots back into eRecovery where it stops at exactly 5%, showing Reset failed!
Click to expand...
Click to collapse
Did install go past 5% ?
If not did you force it reboot to get out.
Do you have those update files on your sdcard?
If you have those files are they the correct ones for your region device?
mrmazak said:
Did install go past 5% ?
If not did you force it reboot to get out.
Do you have those update files on your sdcard?
If you have those files are they the correct ones for your region device?
Click to expand...
Click to collapse
I was thinking about forcing it to reboot since it stayed at 5% for some time, but eventually it rebooted by itself but as it did that it was still at 5%.
I might have used the wrong files since I already tried out a lot of things and didn't organize all those files at all :/
I will now retry this using the files I have stated in the update of my previous post and also using your zip file.
I put the files into the root directory of my sd card. So the root directory looks like this
Code:
PS J:\> ls
Verzeichnis: J:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 29.05.2018 22:09 21276664 update_data_full_public.zip
-a---- 29.05.2018 22:18 1834159779 update.zip
-a---- 29.05.2018 22:11 715530773 update_full_BND-L21C_hw_eu.zip
-a---- 29.05.2018 22:08 37144576 BND-RECOVERY-NoCheck.img
-a---- 06.04.2018 09:37 33554432 SR_BND-L21_B3xx_EMUI8.img
-a---- 29.05.2018 22:36 15024128 complete_twrp_ramdisk.img
supervis0r said:
I was thinking about forcing it to reboot since it stayed at 5% for some time, but eventually it rebooted by itself but as it did that it was still at 5%.
I might have used the wrong files since I already tried out a lot of things and didn't organize all those files at all :/
I will now retry this using the files I have stated in the update of my previous post and also using your zip file.
I put the files into the root directory of my sd card. So the root directory looks like this
Code:
PS J:\> ls
Verzeichnis: J:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 29.05.2018 22:09 21276664 update_data_full_public.zip
-a---- 29.05.2018 22:18 1834159779 update.zip
-a---- 29.05.2018 22:11 715530773 update_full_BND-L21C_hw_eu.zip
-a---- 29.05.2018 22:08 37144576 BND-RECOVERY-NoCheck.img
-a---- 06.04.2018 09:37 33554432 SR_BND-L21_B3xx_EMUI8.img
-a---- 29.05.2018 22:36 15024128 complete_twrp_ramdisk.img
Click to expand...
Click to collapse
They need to be in folder "HWOTA8" on sdcard
mrmazak said:
They need to be in folder "HWOTA8" on sdcard
Click to expand...
Click to collapse
Thank you
Edit: I now installed TWRP and copied the files onto the SD Card
The directory now looks like this
Code:
PS J:\HWOTA8> ls
Verzeichnis: J:\HWOTA8
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 30.05.2018 13:54 82757105 update_data_full_public.zip
-a---- 30.05.2018 13:59 769778671 update_full_BND-L21C_hw_eu.zip
-a---- 30.05.2018 14:02 1803590616 update.zip
-a---- 23.05.2018 02:42 1241 hwota8_update-auto-rename.zip
-a---- 15.04.2018 22:22 26314752 RecoveryNoCheckOreoHi6250.img
Update 1: EMUI Recovery is now 'Installing update...' at 25% and rising. This really looks promising! Im so hyped right now
Update 2: Honor Boot animation came up and now I'm waiting for the first use setup to prompt me.
Update 3: So I was at the first use setup but I couldn't activate Wifi and my internal memory was 0B. I'm now doing another Factory Reset from eRecovery
I am now back at EMUI 8 with the Build-Number BND-L21 8.0.0.330(C432) but I'm still unsure if C432 is from my device or from the files I flashed.
Nevertheless my phone is now working again and I am very happy about that! Internal storage is showing up correctly and I can use mobile data as well as WiFi.
Thank you so much for your help!

[Fixed] FireTV Stick 2nd Gen (tank) stuck on logo. Potentially broken file system/partitions. (Unlocked + TWRP available)

Hey folks! I unlocked my FireTV stick and was able to install TWRP following the amazing guide by @k4y0z (https://forum.xda-developers.com/t/unlock-root-twrp-unbrick-fire-tv-stick-2nd-gen-tank.3907002/).
I can boot into TWRP just OK.
I am using adb shell to issue TWRP commands. (I don't have an OTG cable with power input).
I began by flashing stock ROMs by @0815hoffi from here (https://forum.xda-developers.com/t/...-7-ota-zip-launcher-replacement-root.4155489/).
Then I tried installing pre-rooted images by @rbox (https://forum.xda-developers.com/t/fire-tv-stick-2-tank-prerooted-stock-images-5-2-7-3_r1.3912271/) along with magisk.
Here are the general steps I followed while flashing these images :
1. wiping everything. I suspect my first issue here :
Code:
$ adb shell
$ twrp wipe cache
$ twrp wipe data
$ twrp wipe dalvik
$ twrp wipe /system
~ # twrp wipe cache
Formatting Cache using make_ext4fs...
Failed to mount '/cache' (No such device)
Done processing script file
Click to expand...
Click to collapse
~ # twrp wipe /system
Formatting System using make_ext4fs...
Failed to mount '/system' (No such device)
Done processing script file
Click to expand...
Click to collapse
~ # mount /cache
mount: mounting /dev/block/mmcblk0p12 on /cache failed: No such device
Click to expand...
Click to collapse
~ # stat /dev/block/mmcblk0p12
File: '/dev/block/mmcblk0p12'
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: ch/12d Inode: 5332 Links: 1 Device type: b3,c
Access: (0600/brw-------) Uid: ( 0/ root) Gid: ( 0/ root)
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Access: 2010-01-01 00:17:58.000000000
Modify: 2010-01-01 00:17:57.000000000
Change: 2010-01-01 00:17:57.000000000
Click to expand...
Click to collapse
2. push images to /sdcard
Code:
$ adb push update-kindle-full_tank-288.6.6.4_user_664657620.bin /sdcard/firm.zip
update-kindle-full_tank-288.6.6.4_user... 6.1 MB/s (532252995 bytes in 83.009s)
3. Install image
adb shell
~ # twrp install /sdcard/firm.zip
Installing zip file '/sdcard/firm.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
[amonet] Remove boot patch...
[amonet] OK
Patching system image unconditionally...
Copying preloader_prod.img to boot partition 0 for secure device...
script succeeded: result was [][amonet] Install boot patch...
[amonet] OK
[amonet] Install recovery patch...
[amonet] ALREADY_INSTALLED
Done processing script file
Click to expand...
Click to collapse
4. `adb shell reboot`
They all install just OK. But in all cases, every time I do `reboot` in `adb shell` after `adb install` commands, it boots and gets stuck on 'fireTV Stick' logo.
At first I thought maybe it takes time to boot for first time, but I let it go for as long as half an hour and still no good.
I tried wiping cache and dalvik before rebooting too, no avail (had same could not mount /cache prompt).
I am pretty sure I am doing something stupid, I'd really appreciate any help. I'll be happy if I get it back to a working state, I do not really need root. This all started because the stick went into bootloop outta nowhere. My initial finding pointed at a failed update, see :
https://twitter.com/i/web/status/1393963756426698756
Maybe try with 5.2.7.7
ftvs2k-5.2.7.7
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
0815hoffi said:
Maybe try with 5.2.7.7
ftvs2k-5.2.7.7
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
Click to expand...
Click to collapse
Thanks @0815hoffi , that's actually the very first image I tried with from your thread.
Looking back, I think there's something wrong with my partitions.
If I see logs of other people from these threads, it says
script succeeded: result was [ALL DONE][amonet] Install boot patch...
Click to expand...
Click to collapse
Whereas for me, it says
script succeeded: result was [][amonet] Install boot patch...
Click to expand...
Click to collapse
This may mean that my flash is not successful, right? It's same everytime I flash.
I wonder, is there a way to bring everything to a clean state?
Given your expertise in amonet, @k4y0z from the thread and this comment, do you have a suspicion of what could be going wrong?
It looks like like it indeed were messed up partitions. My initial plan was to flash GPT fix in DL mode (by @k4y0z : link). But I thought might as well play with few things if am anyway going to re-do everything.
I started by going deleting directories manually (e.g. `rm -rf /system`). My plan was to manually flash each partition through fastboot.
Before that I attempted
Code:
fastboot format all
and received a bunch of errors, specifically
Code:
Formatting is not supported for file system with type ''.
Though format didn't work, I decided to wipe anyway
Code:
fastboot -w
It finished with few errors, but looked like it created those directories which I deleted earlier. So I rebooted to TWRP and did
Code:
twrp wipe data
Re-flashed @0815hoffi 's image and luckily it booted into "Optimising storage" screen. Post boot-up it appears to be working OK so far. Had an issue with wifi, but restart fixed it.
tl;dr
Code:
rm -rf /cache
rm -rf /data/dalvik
rm -rf /system
fastboot format userdata # errors
fastboot -w # completed but some errors
twrp wipe data
twrp install <img.zip>
reboot
EDIT : Looks like @Sus_i and @racega went through a similar journey and ended up with a similar fix. Good to know the fix is reproducible. Here's their posts : https://forum.xda-developers.com/t/...ck-2nd-gen-tank.3907002/page-61#post-83031003
saurabhshri said:
It looks like like it indeed were messed up partitions. My initial plan was to flash GPT fix in DL mode (by @k4y0z : link). But I thought might as well play with few things if am anyway going to re-do everything.
I started by going deleting directories manually (e.g. `rm -rf /system`). My plan was to manually flash each partition through fastboot.
Before that I attempted
Code:
fastboot format all
and received a bunch of errors, specifically
Code:
Formatting is not supported for file system with type ''.
Though format didn't work, I decided to wipe anyway
Code:
fastboot -w
It finished with few errors, but looked like it created those directories which I deleted earlier. So I rebooted to TWRP and did
Code:
twrp wipe data
Re-flashed @0815hoffi 's image and luckily it booted into "Optimising storage" screen. Post boot-up it appears to be working OK so far. Had an issue with wifi, but restart fixed it.
tl;dr
Code:
rm -rf /cache
rm -rf /data/dalvik
rm -rf /system
fastboot format userdata # errors
fastboot -w # completed but some errors
twrp wipe data
twrp install <img.zip>
reboot
EDIT : Looks like @Sus_i and @racega went through a similar journey and ended up with a similar fix. Good to know the fix is reproducible. Here's their posts : https://forum.xda-developers.com/t/...ck-2nd-gen-tank.3907002/page-61#post-83031003
Click to expand...
Click to collapse
Usually when this corrupted partitions happen you may try the command:
fastboot format userdata
followed by :
adb shell
(to call twrp#)
Then :
twrp wipe data
twrp wipe system
twrp wipe cache
twrp wipe dalvik
Then adb push the rom, gapps/magisk to /sdcard
twrp install nameofyourrom.zip
twrp install gappsxx.zip
Let it boot once and go back and update magisk via recovery.
(adb reboot recovery once permissions set or use powermenu little vic apk for quickness)
Another method I found which works good with fireos is :
When faced with corrupted/encrypted partition issues and/or unable to mount/format data issues
goto advanced wipe
select change file system
change it to EXT2
it will format data and data should appear become mount
hit back and change to EXT4 Filesystem again.
Then push rom and any other zips etc to /sdcard and install in usual way.
Good you got it working
Regards
Thank you for writing this down @Bertonumber1, I am sure it'll be very helpful to people who will encounter such situation in future.
Bertonumber1 said:
select change file system
change it to EXT2
it will format data and data should appear become mount
hit back and change to EXT4 Filesystem again.
Click to expand...
Click to collapse
I sincerely wish I could have done this. But I don't have an OTG with power input and deliveries are closed due to the pandemic. I was issuing TWRP commands through adb. I'll keep this in mind for future!
Thanks!
saurabhshri said:
Thank you for writing this down @Bertonumber1, I am sure it'll be very helpful to people who will encounter such situation in future.
I sincerely wish I could have done this. But I don't have an OTG with power input and deliveries are closed due to the pandemic. I was issuing TWRP commands through adb. I'll keep this in mind for future!
Thanks!
Click to expand...
Click to collapse
Ah I see, I'm sure the twrp can be commanded to repair change file systems. However, you are correct it is much easier via otg mouse or keyboard.
Regards

Categories

Resources