[Support] Perfect boot image - disable verity and forced encrypt - OnePlus 5T ROMs, Kernels, Recoveries, & Other Dev

ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
Cliffs
- ive modified boot.img to try and disable verity and force encrypt - also enabling / disabling certain IO functions to improve throughput
- i need someone to go into twrp > flash the modifiedboot.img then format /data and check if it boots (i.e boots into OS if it does please report back)
-please make all necessary backups incase it doesnt work
-attached stock boot.img incase it doesnt work (please make external backup too)
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=154jrUAQ1oq7Fpjw7PgBKCJ_E6yBCxvaQ
stock boot.img
https://drive.google.com/open?id=17JU_OiEGdGm_9K1TcYlFtEkiiTJmODve
please report back if it works or not (i.e does it boot into OS or hang?)
background
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard,errors=panic wait,verify
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr wait,check,forceencrypt=footer,resize
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,fileencryption=ice,resize
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait,check
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
and fstab_nodata.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait,verify
#/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,forceencrypt=footer,resize
tmpfs /data tmpfs defaults defaults
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
Code:
/dev/block/bootdevice/by-name/system /system ext4 ro,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,data=writeback,nobh wait
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,nodiratime,discard,inline_data,inline_xattr wait,check,encryptable,resize
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,nodiratime,barrier=0,data=writeback,noauto_da_alloc,discard,nobh wait,check,encryptable,resize
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,noauto_da_alloc,nodiratime,barrier=0,data=writeback,nobh wait,check

virtyx said:
Hi guys
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
and fstab_nodata.qcom looks like this:
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=1BYH4J3Du9VBRyxM1hyTQhs_hKNLgOU0W
stock boot.img
https://drive.google.com/open?id=1IpByGusbuWXKOXGKamHHEwax3aSnsvfm
please report back if it works or not (i.e does it boot into OS or hang?)
Click to expand...
Click to collapse
You also need to make the kernel compatible, without verity. Otherwise won't boot

jgcaap said:
You also need to make the kernel compatible, without verity. Otherwise won't boot
Click to expand...
Click to collapse
please read OP again as ive done this

by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra

virtyx said:
If we flash the boot.Img then another kernel may it work? @jgcaap how would we get it to work?
Never needed to do that on a previous android
Click to expand...
Click to collapse
You need to compile kernel that will allow to boot without the verity and change the ram disk.

benny3 said:
by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra
Click to expand...
Click to collapse
which is why ive asked users to format /data before flashing the boot.img which should disable verity and forceencrypt
jgcaap said:
You need to compile kernel that will allow to boot without the verity and change the ram disk.
Click to expand...
Click to collapse
this is what im doing...

so if someone is brave enough to test this (as i dont have a 1+5T yet)
format /data then using mtp trasnfer the modifiedboot.img to the phone, then flash modified boot.img
and see if you can boot into OS if you can please report back.

updated the modifiedboot.img to omit discard flag - should slightly improve performance but requires a cron job to manually trim partitions, automatic trim can cause hangs upon large file deletion, plus i dont find the need to run trim on the block layer every time a file is deleted, i would rather run it daily with a cron job.

Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?

yung40oz84 said:
Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?
Click to expand...
Click to collapse
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead

virtyx said:
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead
Click to expand...
Click to collapse
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?

ground-zero said:
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?
Click to expand...
Click to collapse
No, doesnt prevent corruption.
we dont need the trim command to run every time a file is deleted that just causes unnecessary overhead, its better if we run the trim command daily via a cron job.
(imagine deleting files and running the trim command everytime we do so, its not needed, the OS does adequate garbage collection and the Trim command gets issued automatically from android 5 so its not needed to add it in the fstab)
for your reading
https://wiki.archlinux.org/index.php/Solid_State_Drives#Periodic_TRIM

Related

[Q] Is contents of Custom Recovery APK useful in obtaining custom recovery for vs985?

So I did some exploring in the posted custom recovery by AnZhi. There was some discussion over which partitions could be accessed. There is an fstab file in there that can be modified which should allow access to other partitions...
Recovery.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
Looking further it seems this works by overwriting the files in /system/recovery. The process can't be that simple... can it?
Also there is a keys file with a bunch of cryptic hex codes....not quite sure what they're used for.... useful?
I'm a very experienced programmer, but new when it comes to android bootloader/recovery exploit development.
Any ideas guys? What can we learn by perusing this apk?
PS
Newbies.... To see the contents of an apk file just rename *.apk to *.zip and unzip it
I'm also new to bootloaders, we can probably pull a fstab from a rooted g3 and edit the existing one from there
I'm Also curious to see what's in the apk, I'll extract it to see if I can gather some more info
Sent from my VS985 4G using XDA Premium 4 mobile app

F2FS question

Hello everyone i was using a i9300 for a quite while now and ive been changing roms and doing all things i could with it but, now ive seen this talk about f2fs and that its better than ext4 is that true and does it work on i9300? [emoji1] im a noob so sorry if this post already exists
its work, is better but you need kernel that use this,
i formated in twrp that partitions:
mkfs.f2fs /dev/block/mmcblk0p8
mkfs.f2fs /dev/block/mmcblk0p10 (not sure if /preload needed )
mkfs.f2fs /dev/block/mmcblk0p12
Is there any kind of tutorial if you can link me
twrp terminal write that commands and reboot
be carefull this mkfs.f2fs /dev/block/mmcblk0p12 destroy all data on sdcard (photos ect. in phone memory)- make backup
mmcblk0p8 is /cache
mmcblk0p12 /data include /sdcard
you may/can check layout partitons befor do anything - better do that:good:
exe98123q said:
twrp terminal write that commands and reboot
be carefull this mkfs.f2fs /dev/block/mmcblk0p12 destroy all data on sdcard (photos ect. in phone memory)- make backup
mmcblk0p8 is /cache
mmcblk0p12 /data include /sdcard
you may/can check layout partitons befor do anything - better do that:good:
Click to expand...
Click to collapse
i have a problem i tried those commands and i get this error "error not available on mounted device"
hmm, unmount in twrp,
funny is that i can use make_ext4fs without unmount ahaha
edit.
confirm if working for you
exe98123q said:
hmm, unmount in twrp,
funny is that i can use make_ext4fs without unmount ahaha
edit.
confirm if working for you
Click to expand...
Click to collapse
Yea it worked thank
if anyone want change back - change mkfs.f2fs to make_ext4fs (if somebody dont know )
work with all partitions
/efs , /boot , /data /system /preload ect. - didnt test on bootloader partition

[Q] Add EXT4 support to ROM to mount external hard drive

Hey folks.
So, I have installed a custom rom to an android box, it runs on EXT4 itself for the system but if I try to connect an external hard drive formatted as EXT4 it only says it's unsupported and will give me the option to format it, which I won't do. I don't want FAT32 or ExFAT or NTFS. I need EXT4 for reasons.
I was using this hard drive with my RaspberryPi before and it worked fine. Also this box is rooted and I can mount it manually with "mount -t ext4 /dev/block/sda /mnt/hd" or whatever and I can see the files, have read/write BUT other apps can't see it due to Android security (even messing with chown/chmod).
I'm not sure how to add EXT4 support to mountable storage at all to a ROM. The dev seems to be busy with other projects and won't help, so I have to figure it out on my own.
I have searched left and right but couldn't find any answer on how to do it myself, nothing very conclusive.
Should I just add the hdd to fstab.amlogic? Does it have anything to do with vold? I wanted the system to be able to recognize it and mount it, not mount it myself like this.
Futher info:
This is the BLKID for the hdd:
Code:
/dev/block/sda: UUID="4de...d5" TYPE="ext4"
/dev/block/vold/disk:8,0: UUID="4de...d5" TYPE="ext4"
This is the fstab.amlogic:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/misc /misc emmc defaults defaults
/dev/block/system /system ext4 ro wait
/dev/block/data /data ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check,encryptable=footer
/dev/block/cache /cache ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check
/devices/*.sd/mmc_host/sd* auto auto defaults voldmanaged=sdcard1:auto,noemulatedsd
/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sd* auto auto defaults voldmanaged=udisk:auto
/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sr* auto auto defaults voldmanaged=sr0:auto
/dev/block/loop auto loop defaults voldmanaged=loop:auto
# Add for zram. zramsize can be in numeric (byte) , in percent
/dev/block/zram0 /swap_zram0 swap defaults wait,zramsize=524288000
/dev/block/tee /tee ext4 noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic wait,check
Thank you.

[HELP] TWRP on MT6771V/CT Android 9 (Pie)

Hello, I have Blackview BV9800Pro with MT6771V/CT and Stock Android Pie and Magisk roots + Riru ckre and edXposed. I need TWRP so I could easily backup and restore system at any time. I test EdXposed and Magisk modules and it is PAIN to do factory reset if something fails cause this is my only smartphone. I tried different twrp already, but it didn't worked. Unofficial twrp contact form on website does not work (gives error). Can You help me guys, please? PLEASE!!
this one works for me (at mega)
#!GWwXDKjC!vPERdlfIiP-hylz3R7SEcU105PGAP4oi0QC3FtNWsyU
from the hovatek forum (32580)
the only problem is that, like said on that forum, it won't decrypt the user partition. Someone on there says to use the Disable_Dm-Verity_ForceEncrypt_03.04.2020.zip
to disable encryption, but another poster says that it disables the phone, no touch, no mouse, etc. I have the same issue. I'd like to be able to decrypt with TWRP or turn off encryption. Then ill be able to make backups of the user partition. Anyone have any ideas?
tecs.ottawa said:
this one works for me (at mega)
#!GWwXDKjC!vPERdlfIiP-hylz3R7SEcU105PGAP4oi0QC3FtNWsyU
from the hovatek forum (32580)
the only problem is that, like said on that forum, it won't decrypt the user partition. Someone on there says to use the Disable_Dm-Verity_ForceEncrypt_03.04.2020.zip
to disable encryption, but another poster says that it disables the phone, no touch, no mouse, etc. I have the same issue. I'd like to be able to decrypt with TWRP or turn off encryption. Then ill be able to make backups of the user partition. Anyone have any ideas?
Click to expand...
Click to collapse
that TWRP looks fine to me, the one who did this was expert. the display driver is hex patched against getbootmode in order to get touch screen working. some user reported that TWRP is asking for password, that indicates to me encryption is supported (/etc/recovery.fstab has entry for full-disk encryption with metadata partition). furthermore this TWRP build is signed with AVBv1 signature that mean it passes Verified Boot and is flashable even on locked bootloader
have you seen Method 3 for disabling dm-verity by disabling AVB with dummy vbmeta?
Code:
fastboot --disable-verity -disable-verification flash vbmeta vbmeta.img
also it seems like you can do it with Method 2 patching boot.img with Magisk Manager, the only discrepancy i recommend on step 4. to keep the checkbox for preserve force encryption enabled, then patch it manually in fstab against force encryption by changing the flag from forceencrypt= into encryptable=
if this device has fstab in boot.img then you can use Android.Image.Kitchen.v3.7-Win32.zip for unpack/repack boot.img and do the change in ramdisk/fstab.mt6771 with Notepad++
otherwise fstab is located /system_root/system/vendor/etc/fstab.mt6771 you can use adb pull in TWRP recovery, modify the file, and adb push it back
Code:
adb pull /vendor/etc/fstab.mt6771
adb push fstab.mt6771 /tmp
adb shell
cat /tmp/fstab.mt6771 > /vendor/etc/fstab.mt6771
or do it directly with sed
Code:
adb shell
sed -r ',s,(^/[^[:space:]]+[[:space:]]+/data[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]*)force[def]+[cno]+r[befpty]{3}=([^[:space:]]+),\1encryptable=\2,' /vendor/etc/fstab.mt6771 > /tmp/fstab.mt6771
cat /tmp/fstab.mt6771 > /vendor/etc/fstab.mt6771
of course vendor must be mounted. cat is recommended to preserve file permissions
But, before modifying vendor, make sure AVB is disabled (flash empty vbmeta.img)
I tried method 1:
it just stalled on the first splash screen when turned on.
for method 3:
i looked in the root and there's no vmbeta folder (vendor is the last one)
for method 2:
i tried it and it has the same issue as when i use the disabler, no touch. i made the boot img in magisk with the force encryption unchecked and the verity checked. i unpacked the boot img but there was no fstab in it. i found the one on the phone but it already had "encryptable=", here is the main section:
/dev/block/platform/bootdevice/by-name/system / ext4 ro wait,recoveryonly
/dev/block/platform/bootdevice/by-name/vendor /vendor ext4 ro wait,recoveryonly
/dev/block/platform/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,errors=panic wait,check,formattable,quota,resize,reservedsize=128m,=/dev/block/platform/bootdevice/by-name/metadata
/dev/block/platform/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,formattable
/dev/block/platform/bootdevice/by-name/protect1 /mnt/vendor/protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/protect2 /mnt/vendor/protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/nvdata /mnt/vendor/nvdata ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,formattable
/dev/block/platform/bootdevice/by-name/nvcfg /mnt/vendor/nvcfg ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/apd /mnt/vendor/apd ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/devices/platform/externdevice* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
when i flashed back the magisk boot img that doesnt have the custom settings, it booted OK, but then twrp cant access the userdata again.
please read more careful
method 2
force encryption checked and the verity unchecked
i can see your fstab is broken already, there is no forceencrypt= forcefdeorfbe= or encryptable= flag (it's gone) furthermore this is not the only file otherwise it wouldn't encrypt again
method 3
flashing vbmeta is required. please download dummy vbmeta and flash it from fastboot
in TWRP you can list partitions with
Code:
ls -d $(find /dev/block -name by-name)/*
don't flash magisk zip this will affect encryption. patch fstab manually in the respective line for /data in the flags in 5th column
Code:
/dev/block/platform/bootdevice/by-name/userdata /data ext4
noatime,nosuid,nodev,noauto_da_alloc,errors=panic
wait,check,formattable,quota,resize,reservedsize=128m,encryptable=/dev/block/platform/bootdevice/by-name/metadata
which fstab is it? maybe there is another one in nvdata? at least, it is the only explanation i have why device encryptes anyway..
i am not sure why TWRP does not work for you, please provide recovery.log
edit: btw i wonder why magisk only boot with dm-verity enabled.. are you sure you have unlocked bootloader?
sorry about that, i was really tired. that is what i had. under advanced settings in magisk manager: preserve force encryption (checked), preserve AVB 2.0/dm-verity (unchecked), recovery mode (unchecked)
I just typed it wrong in my message
I didn't modify that fstab actually. So unless the disabler did it, that is the original one. I tried to unpack the vendor.img from the stock rom to see if that fstab is the same, but that image kitchen .bat threw an error.
i've added "encryptable" after "reservedsize=128m,". i then flashed the magisk boot.img and replaced the fstab using cat with the new one by copying it to /tmp/ and then running cat /tmp/fstab.mt6771 > /vendor/etc/fstab.mt6771
there is also an fstab in nvdata, that one says:
/dev/block/platform/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,errors=panic wait,check,formattable,quota,resize,reservedsize=128m,forcefdeorfbe=/dev/block/platform/bootdevice/by-name/metadata
i edited that one : replaced forcefdeorfbe with encryptable and replaced the file in the same way as the other.
after rebooting with the 2 fstab files with "encryptable" and the custom magisk boot.img (that had no touch before), it works!
i guess that second nvdata fstab was the one we needed to edit or the regular one had been broken somehow and fixing it was the thing. im guessing it was the nvdata one.
now the phone says its unencrypted and twrp can backup the userpartition.
thank you so much

Bugged - no chance to fix?

Hi everybody
Currently i have attached a F1 to my pc which has some weird conditions...
The phone itself seems to be flashed to latest LineageOS, but it is encrypted.
Maybe because of the latest sideload, i can't really tell because the owner gave this to a friend...
So, prefered solution would be: decrypt the phone, get all the pictures/videos from it.
Another acceptable solution would be: install from scratch.
But:
fastboot seems to be botched.
Code:
C:\adb>adb devices
List of devices attached
22fd65f3 recovery
Looking good, adb can access this device.
So, if i could flash some decrypt-voodoo that the device boots and decrypts system...
But no, failing so far.
Then i thought, well, as it is already gone, just fastboot flash and forward.
Nope:
Code:
C:\adb>fastboot devices
???????????? fastboot
And the device goes back to bootloop.
Booting to recovery gives me a TWRP 3.5.2_10-0
Full access, except the encrypted data.
recovery is fully working, so i tried to flash vbmeta with fastboot (--disable-verity --disable-verification) but fastboot seems to be broken.
So... any thoughts where to start first?
Thx
I pulled fstab from phone:
twrp.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
# mount point type device device2 flags
/boot emmc /dev/block/bootdevice/by-name/boot flags=display="Boot"
/cache ext4 /dev/block/bootdevice/by-name/cache
/recovery emmc /dev/block/bootdevice/by-name/recovery flags=display="Recovery";backup=1
/system ext4 /dev/block/bootdevice/by-name/system flags=backup=1;wipeingui;display="System"
/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=backup=1;wipeingui;display="Vendor"
/system_image emmc /dev/block/bootdevice/by-name/system flags=backup=1;flashimg=1
/vendor_image emmc /dev/block/bootdevice/by-name/vendor flags=backup=1;flashimg=1
/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;length=-16384;fileencryption=ice:aes-256-cts:aes-256-heh
/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";mounttodecrypt
/cust ext4 /dev/block/bootdevice/by-name/cust flags=display="Cust"
/misc emmc /dev/block/bootdevice/by-name/misc
/modem emmc /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem"
/bluetooth emmc /dev/block/bootdevice/by-name/bluetooth flags=backup=1;subpartitionof=/modem
/dsp emmc /dev/block/bootdevice/by-name/dsp flags=backup=1;subpartitionof=/modem
/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display=EFS
/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1
/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;subpartitionof=/efs1
/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;subpartitionof=/efs1
/persist ext4 /dev/block/bootdevice/by-name/persist flags=display="Persist"
/storage ext4 /data/media/0 flags=display="Internal Storage";usermrf;backup=1;fsflags="bind";removable
# Removable storage
/usb_otg vfat /dev/block/sdg1 /dev/block/sdg flags=display="USB-OTG";storage;wipeingui;removable
/external_sd vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 flags=display="MicroSD Card";storage;wipeingui;removable
recovery.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem e2fsck binary (typically /system) cannot
# specify 'check', and must come before any filesystems that do specify 'check'
# NOTE: /system and /vendor partitions are early-mounted and the fstab entry is specified in device tree (duplicated below for recovery image purposes only):
# /proc/device-tree/firmware/android/fstab/system
# /proc/device-tree/firmware/android/fstab/vendor
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=0,noauto_da_alloc latemount,wait,check,fileencryption=ice,quota,encryptable=footer
/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,recoveryonly
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,recoveryonly
/devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
and the regular fstab
Code:
/dev/block/sda20 /cache ext4 rw 0 0
/dev/block/sde48 /system_root ext4 ro 0 0
/dev/block/sde47 /vendor ext4 ro 0 0
/dev/block/sda21 /data ext4 rw 0 0
/dev/block/sde46 /firmware vfat rw 0 0
/dev/block/sda18 /cust ext4 rw 0 0
/dev/block/sda14 /persist ext4 rw 0 0
/storage ext4 rw 0 0
/usb_otg vfat rw 0 0
/external_sd vfat rw 0 0
Lonesome Walker said:
Hi everybody
Currently i have attached a F1 to my pc which has some weird conditions...
The phone itself seems to be flashed to latest LineageOS, but it is encrypted.
Maybe because of the latest sideload, i can't really tell because the owner gave this to a friend...
So, prefered solution would be: decrypt the phone, get all the pictures/videos from it.
Another acceptable solution would be: install from scratch.
But:
fastboot seems to be botched.
Code:
C:\adb>adb devices
List of devices attached
22fd65f3 recovery
Looking good, adb can access this device.
So, if i could flash some decrypt-voodoo that the device boots and decrypts system...
But no, failing so far.
Then i thought, well, as it is already gone, just fastboot flash and forward.
Nope:
Code:
C:\adb>fastboot devices
???????????? fastboot
And the device goes back to bootloop.
Booting to recovery gives me a TWRP 3.5.2_10-0
Full access, except the encrypted data.
recovery is fully working, so i tried to flash vbmeta with fastboot (--disable-verity --disable-verification) but fastboot seems to be broken.
So... any thoughts where to start first?
Thx
Click to expand...
Click to collapse
If the phone doesn't recognize in fastboot you need the fix and the drivers.
You can find everything you need in my POCO F1 Ultimate Collection & Guides.
Check AMD/Intel Fastboot Fix.
If you know pin/pattern you can flash the TWRP by REIGNZ go to recovery put pin/pattern to decrypt then connect your device to pc while you are in twrp (if MTP doesn't work at first go advanced>file manager> and choose sdcard0 (internal storage) then your device shoule recognized in pc and get your data.
To clean flash follow my clean installation guide.
Everything you need is on my thread I mentioned above.
Okay, this is interesting...
My own Poco F1 had no issues with the drivers installed before.
After updating, the actual bugged F1 can fastboot but my own can't anymore.
WTF?
I also switched cables, doesn't matter.
Okay, nevertheless, mine is not broken, so this will be a task for later...
Thank you so far for this working hint!
So, i now finally have rescued all the pictures, videos and Whatsapp stuff.
My friend is happy.
The next step would be flashing the Pixel Experience.
But: how to find out which Android version is currently installed?
Or should i flash the latest stock rom from Xiaomi? I mean, it can't be higher than that, right?
Thank you for your response!

Categories

Resources