Decryption failed. - Xiaomi Mi A1 Questions & Answers

I had changed my password today on my January patch Oreo device with Magisk installed, and it had encrypted my device. After the reboot, my device had gone into a bootloop, and now after flashing the stock system image, it shows "Decryption failed" stating that although my password was correct, the data was corrupted. However, it does not ask me for a password when booting, unlike TWRP, which allowed my to access my data after entering my PIN.
As this is my primary phone and a lot of data such as 2FA keys are stored on it, is there a possibility of recovering my system without erasing the data?

Checking back in to say that I've managed to fix the phone with little to no loss of data.
For reference to those who might also have a similar problem, here's what I did:
1) Boot into TWRP.
2) Backed up data partition in TWRP, and copied backup to computer.
3) Backed up
Code:
/sdcard/
by copying every file manually to computer.
4) Ran
Code:
fastboot format userdata
. WARNING: THIS WILL DELETE YOUR DATA.
5) Boot into system, an "ERASING" screen should show for a second, then boot into system initial setup.
6) Reboot into TWRP.
7) Restore data partition backup.
8) Copy files back to
Code:
/sdcard/
.
9) Reboot into system.
Note: Phone did not accept my PIN, needed to remove password through TWRP like so:
1) Boot into TWRP.
2) Head to Advanced, then File Manager.
3) Go to
Code:
/data/system
4) Remove
Code:
gatekeeper.password.key
,
Code:
gatekeeper.pattern.key
,
Code:
locksettings.db
,
Code:
locksettings.db-shm
, and
Code:
locksettings.db-wal
.
5) Reboot back into system, everything should work as usual.
Also, I give up on formatting this..

decrption unsuccessful on mia1
I have an issue on my MiA1...my screen shows as" Decryption unsuccessful..The password you entered was correct but the data is corrupted."..please anyone help me out as i have my most imp documents inside and dont have any backup..please.!

Related

Lineage OS auto boot on charge connected

Hello,
I have been trying to make my Samsung Galaxy Note 3 with Lineage OS boot automatically when the charger is connected instead of booting to the battery charging screen.
Since its a Samsung phone it doesn't have fastboot... it has ODIN instead. So using fastboot no-charge oem cant be done. from what i have googled.
I have also tried locating a file called "lpm" in /system/bin but lineage OS doesn't have that file, since i think its Samsung specific.
Lastly i tried adding the lpm service, and modifying the boot.img > init.rc to add the service to the "on charge" event. I found that the Samsung official ROM has a service configured like this:
Code:
service lpm /system/bin/lpm
class charger
critical
so i copy pasted this into the init.rc file of lineage OS and then created the file "lpm" under /system/bin and edit it to this:
Code:
#!/system/bin/sh
/system/bin/reboot
This didn't work, and i cant find a way to see if the file is being executed at all.
My question is, does anyone know how to make lineage OS boot automatically, from being powered off, instead of going to the battery charging boot screen?
Thanks Oliver
oliver92 said:
Hello,
I have been trying to make my Samsung Galaxy Note 3 with Lineage OS boot automatically when the charger is connected instead of booting to the battery charging screen.
Since its a Samsung phone it doesn't have fastboot... it has ODIN instead. So using fastboot no-charge oem cant be done. from what i have googled.
I have also tried locating a file called "lpm" in /system/bin but lineage OS doesn't have that file, since i think its Samsung specific.
Lastly i tried adding the lpm service, and modifying the boot.img > init.rc to add the service to the "on charge" event. I found that the Samsung official ROM has a service configured like this:
Code:
service lpm /system/bin/lpm
class charger
critical
so i copy pasted this into the init.rc file of lineage OS and then created the file "lpm" under /system/bin and edit it to this:
Code:
#!/system/bin/sh
/system/bin/reboot
This didn't work, and i cant find a way to see if the file is being executed at all.
My question is, does anyone know how to make lineage OS boot automatically, from being powered off, instead of going to the battery charging boot screen?
Thanks Oliver
Click to expand...
Click to collapse
Hi,
did you ever get this to work? I'm trying to do the same on a huawei pra-lx1 ...
tiagofalves said:
Hi,
did you ever get this to work? I'm trying to do the same on a huawei pra-lx1 ...
Click to expand...
Click to collapse
You guys solved this? I've been trying to figure this out too.
If you go to system folder, then bin folder, there is a file sysinit. Inside it reads:
#! /system/bin/sh
export PATH=/sbin: /system/sbin: /system/bin: /system/xbin
for i in /system/etc/init.d/*; do
if [ -x $i ]; then
/system/bin/log -t sysinit Running $i
fi
done
Do you think this is about booting?
guys is this still open?
I would like to make my i9300 auto boot the same way. cant find the lpm file.
thank you
For whom it may concern, a way to autoboot a device on lineage is to edit the init.rc file in boot.img. I tried this on a motorola motoG 4g. In /init.rc there is a section titled charger. While on charger, you have to add class stop charger trigger late init.
# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
on property:sys.boot_from_charger_mode=1
class_stop charger
trigger late-init
on charger
class_start charger
++ class_stop charger
++ trigger late-init
The same init.rc I found on Samsaung Galaxy S2 with lines 14.1, so there is a chance here as well.
Experience sharing
Peenoyako said:
You guys solved this? I've been trying to figure this out too.
Click to expand...
Click to collapse
Almost no other methods were successful on MIUI 10 Redmi Note 4x (Snapdragon) , which is already bootloader unlocked, rooted condition.
However after updation of
(1) existing TWRP_3.2.1-5_mido was updated with [Mido][Material][Twrp-Treble][3.2.1-10].zip to facilitate wiping
(ii) Total wipe was carried out from above latest twrp (wipe>Advance wipe>selected all like Delvik / ART Cache, System, Vendor, Data, Internal Storage and Cache>swiped to wipe
(now only 2 things left on phone fastboot and recovery
(iii) Installed lineage 15.1 (mido_lineage-15.1-20180807-nightly-mido-signed.zip) and gapps (mido_open_gapps-arm64-8.1-nano-20180812.zip)
rebooted and initial steps of phone setup was completed
Rebooted to TWRP and installed addonsu-15.1-arm64-signed.zip to root it. It may be noted for this type , root to be enabled at developer options.
(iv)LOS Boot image was extracted through TWRP (Backup> select boot > swiped to Backup , it backed up the boot file at TWRP folder on external SD card. The name of file is boot.emmc.win (64MB)
(v) I have renamed the file to boot and type to img (boot.img)
(vi) i have extracted the contents of the above boot.img with the help of Android.Image.Kitchen.v3.4-Win32 [we have to copy the above boot.img (it should should have word boot in the name and img type to be get recognized by the program ) to Android.Image.Kitchen.v3.4-Win32 folder ] on windows 10 pro 64bit
(vii) i have modified the init.rc at "on chrager" , after modification (including existing+added looks like below)
on charger
class_start charger
class_stop charger
trigger late-init
(viii) repacked it with the same windows program Android.Image.Kitchen.v3.4-Win32 , it will be repacked in the same directory with a name" image-new.img "
(xi) Transferred it to the phone and installed it with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install
Now the phone is booting automatically, if charger is connected (success).
But further work is needed to address important / critical situation like the phone is switched off while use (e.g. while talking on phone with some one while walking little away from office or home or excessive use due excessive follow ups, we will keep it on charging but there is some possibility to forget for considerable amount of time. To avoid this, if the phone is boot up in auto after some 2 or 3 % of charge (like iphones) it will be great. Further if some body wants shutdown and charge it (or it can be kept in silence also), simply charger may be connected before shutdown and it should not wake up in auto.
Most of the credit goes to many netgens , it is only the experience sharing without any responsibility since if not understood properly , if not done planned way, carefully, accurately relevant to phone make , model , model no , sub no , sub spec as applicable , within no time data loss and / or phone bricking may happen.
Another Experience sharing with Redmi Note 4 ( 4x )Snapdragon Auto Boot on Charger
knreddy said:
Almost no other methods were successful on MIUI 10 Redmi Note 4x (Snapdragon) , which is already bootloader unlocked, rooted condition.
However after updation of
(1) existing TWRP_3.2.1-5_mido was updated with [Mido][Material][Twrp-Treble][3.2.1-10].zip to facilitate wiping
(ii) Total wipe was carried out from above latest twrp (wipe>Advance wipe>selected all like Delvik / ART Cache, System, Vendor, Data, Internal Storage and Cache>swiped to wipe
(now only 2 things left on phone fastboot and recovery
(iii) Installed lineage 15.1 (mido_lineage-15.1-20180807-nightly-mido-signed.zip) and gapps (mido_open_gapps-arm64-8.1-nano-20180812.zip)
rebooted and initial steps of phone setup was completed
Rebooted to TWRP and installed addonsu-15.1-arm64-signed.zip to root it. It may be noted for this type , root to be enabled at developer options.
(iv)LOS Boot image was extracted through TWRP (Backup> select boot > swiped to Backup , it backed up the boot file at TWRP folder on external SD card. The name of file is boot.emmc.win (64MB)
(v) I have renamed the file to boot and type to img (boot.img)
(vi) i have extracted the contents of the above boot.img with the help of Android.Image.Kitchen.v3.4-Win32 [we have to copy the above boot.img (it should should have word boot in the name and img type to be get recognized by the program ) to Android.Image.Kitchen.v3.4-Win32 folder ] on windows 10 pro 64bit
(vii) i have modified the init.rc at "on chrager" , after modification (including existing+added looks like below)
on charger
class_start charger
class_stop charger
trigger late-init
(viii) repacked it with the same windows program Android.Image.Kitchen.v3.4-Win32 , it will be repacked in the same directory with a name" image-new.img "
(xi) Transferred it to the phone and installed it with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install
Now the phone is booting automatically, if charger is connected (success).
But further work is needed to address important / critical situation like the phone is switched off while use (e.g. while talking on phone with some one while walking little away from office or home or excessive use due excessive follow ups, we will keep it on charging but there is some possibility to forget for considerable amount of time. To avoid this, if the phone is boot up in auto after some 2 or 3 % of charge (like iphones) it will be great. Further if some body wants shutdown and charge it (or it can be kept in silence also), simply charger may be connected before shutdown and it should not wake up in auto.
Most of the credit goes to many netgens , it is only the experience sharing without any responsibility since if not understood properly , if not done planned way, carefully, accurately relevant to phone make , model , model no , sub no , sub spec as applicable , within no time data loss and / or phone bricking may happen.
Click to expand...
Click to collapse
The above procedure is successful on the following ROM (similar to LOS15.1 , used magisk 16.7 or higher for rooting)
xiaomi.eu_multi_HMNote4X_8.12.20_v10-7.0.zip
downloaded from
https://excellmedia.dl.sourceforge..../xiaomi.eu_multi_HMNote4X_8.12.20_v10-7.0.zip
knreddy said:
Almost no other methods were successful on MIUI 10 Redmi Note 4x (Snapdragon) , which is already bootloader unlocked, rooted condition.
However after updation of
(1) existing TWRP_3.2.1-5_mido was updated with [Mido][Material][Twrp-Treble][3.2.1-10].zip to facilitate wiping
(ii) Total wipe was carried out from above latest twrp (wipe>Advance wipe>selected all like Delvik / ART Cache, System, Vendor, Data, Internal Storage and Cache>swiped to wipe
(now only 2 things left on phone fastboot and recovery
(iii) Installed lineage 15.1 (mido_lineage-15.1-20180807-nightly-mido-signed.zip) and gapps (mido_open_gapps-arm64-8.1-nano-20180812.zip)
rebooted and initial steps of phone setup was completed
Rebooted to TWRP and installed addonsu-15.1-arm64-signed.zip to root it. It may be noted for this type , root to be enabled at developer options.
(iv)LOS Boot image was extracted through TWRP (Backup> select boot > swiped to Backup , it backed up the boot file at TWRP folder on external SD card. The name of file is boot.emmc.win (64MB)
(v) I have renamed the file to boot and type to img (boot.img)
(vi) i have extracted the contents of the above boot.img with the help of Android.Image.Kitchen.v3.4-Win32 [we have to copy the above boot.img (it should should have word boot in the name and img type to be get recognized by the program ) to Android.Image.Kitchen.v3.4-Win32 folder ] on windows 10 pro 64bit
(vii) i have modified the init.rc at "on chrager" , after modification (including existing+added looks like below)
on charger
class_start charger
class_stop charger
trigger late-init
(viii) repacked it with the same windows program Android.Image.Kitchen.v3.4-Win32 , it will be repacked in the same directory with a name" image-new.img "
(xi) Transferred it to the phone and installed it with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install
Now the phone is booting automatically, if charger is connected (success).
But further work is needed to address important / critical situation like the phone is switched off while use (e.g. while talking on phone with some one while walking little away from office or home or excessive use due excessive follow ups, we will keep it on charging but there is some possibility to forget for considerable amount of time. To avoid this, if the phone is boot up in auto after some 2 or 3 % of charge (like iphones) it will be great. Further if some body wants shutdown and charge it (or it can be kept in silence also), simply charger may be connected before shutdown and it should not wake up in auto.
Most of the credit goes to many netgens , it is only the experience sharing without any responsibility since if not understood properly , if not done planned way, carefully, accurately relevant to phone make , model , model no , sub no , sub spec as applicable , within no time data loss and / or phone bricking may happen.
Click to expand...
Click to collapse
Thanks for this but my nose bled from reading this. I'm not really good in programming stuff. Hopefully you or somebody could post a video in youtube for the step by step process. I might understand this with visual instructions. If this does work then you've done a great job finding a solution for this.
I tried editing init.rc and another method below, both do turn on with usb power, but get stuck in the boot animation. It seems it doesn't complete loading. Unplugged the power, and reboot the tablet, and it will turn on normal and get past the boot screen.
The other method I tried, we know "on charge" loads up /sbin/charger. So I changed that file with
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=15
echo $CAPACITY
if [ $((CAPACITY)) -gt $MIN_CAPACITY ]
then
/system/bin/reboot
fi
/system/sbin/charger_orig
Same thing. Boots up on usb power, but gets stuck in the lineage boot animation.
OK so I got it to work.
1. Extracted Boot image through TWRP (Backup> select boot > swiped to Backup)
2. Rename boot.emmc.win to boot.img
3. Copy boot.img to the root dir of the program Android.Image.Kitchen, and run "unpackimg.bat"
4. Open up folder /ramdisk/sbin/ and rename "charger" to "charger_orig"
4. Create "charger" and put in
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=5
if [ $CAPACITY -gt $MIN_CAPACITY ]
then
sleep 1
/system/bin/reboot
fi
/sbin/charger_orig
4. Go back to the root of Android.Image.Kitchen and run "repackimg.bat"
5. Take "image-new.img" and copy to phone
5. Install img with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install)
MolsonB said:
OK so I got it to work.
1. Extracted Boot image through TWRP (Backup> select boot > swiped to Backup)
2. Rename boot.emmc.win to boot.img
3. Copy boot.img to the root dir of the program Android.Image.Kitchen, and run "unpackimg.bat"
4. Open up folder /ramdisk/sbin/ and rename "charger" to "charger_orig"
4. Create "charger" and put in
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=5
if [ $CAPACITY -gt $MIN_CAPACITY ]
then
sleep 1
/system/bin/reboot
fi
/sbin/charger_orig
4. Go back to the root of Android.Image.Kitchen and run "repackimg.bat"
5. Take "image-new.img" and copy to phone
5. Install img with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install)
Click to expand...
Click to collapse
Hey,
I tried to open charger file on Windows 10 (with SublimeText & Notepad++) but always get weird characters.. So I have a fear that when I create the new charger file it won't work, as it is not encoded the same.. Maybe you can attach the new charger file..? Thanks you very much..
Caught in bootloop, is rooting mandatory?
knreddy said:
Almost no other methods were successful on MIUI 10 Redmi Note 4x (Snapdragon) , which is already bootloader unlocked, rooted condition.
However after updation of
(1) existing TWRP_3.2.1-5_mido was updated with [Mido][Material][Twrp-Treble][3.2.1-10].zip to facilitate wiping
(ii) Total wipe was carried out from above latest twrp (wipe>Advance wipe>selected all like Delvik / ART Cache, System, Vendor, Data, Internal Storage and Cache>swiped to wipe
(now only 2 things left on phone fastboot and recovery
(iii) Installed lineage 15.1 (mido_lineage-15.1-20180807-nightly-mido-signed.zip) and gapps (mido_open_gapps-arm64-8.1-nano-20180812.zip)
rebooted and initial steps of phone setup was completed
Rebooted to TWRP and installed addonsu-15.1-arm64-signed.zip to root it. It may be noted for this type , root to be enabled at developer options.
(iv)LOS Boot image was extracted through TWRP (Backup> select boot > swiped to Backup , it backed up the boot file at TWRP folder on external SD card. The name of file is boot.emmc.win (64MB)
(v) I have renamed the file to boot and type to img (boot.img)
(vi) i have extracted the contents of the above boot.img with the help of Android.Image.Kitchen.v3.4-Win32 [we have to copy the above boot.img (it should should have word boot in the name and img type to be get recognized by the program ) to Android.Image.Kitchen.v3.4-Win32 folder ] on windows 10 pro 64bit
(vii) i have modified the init.rc at "on chrager" , after modification (including existing+added looks like below)
on charger
class_start charger
class_stop charger
trigger late-init
(viii) repacked it with the same windows program Android.Image.Kitchen.v3.4-Win32 , it will be repacked in the same directory with a name" image-new.img "
(xi) Transferred it to the phone and installed it with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install
Now the phone is booting automatically, if charger is connected (success).
But further work is needed to address important / critical situation like the phone is switched off while use (e.g. while talking on phone with some one while walking little away from office or home or excessive use due excessive follow ups, we will keep it on charging but there is some possibility to forget for considerable amount of time. To avoid this, if the phone is boot up in auto after some 2 or 3 % of charge (like iphones) it will be great. Further if some body wants shutdown and charge it (or it can be kept in silence also), simply charger may be connected before shutdown and it should not wake up in auto.
Most of the credit goes to many netgens , it is only the experience sharing without any responsibility since if not understood properly , if not done planned way, carefully, accurately relevant to phone make , model , model no , sub no , sub spec as applicable , within no time data loss and / or phone bricking may happen.
Click to expand...
Click to collapse
Hey man, I've done everything you said except rooting part. System now stuck at bootloader. Why is rooting needed here? Do you think rooting will fix the issue?
Update: Successful, with another method!! Copied reboot file from system/bin to and paste to /ramdisk/sbin/ and rename "charger". Remove or rename the original charger file. Device will boot and then reboot to normal!
xxxwatari said:
Hey man, I've done everything you said except rooting part. System now stuck at bootloader. Why is rooting needed here? Do you think rooting will fix the issue?
Update: Successful, with another method!! Copied reboot file from system/bin to and paste to /ramdisk/sbin/ and rename "charger". Remove or rename the original charger file. Device will boot and then reboot to normal!
Click to expand...
Click to collapse
what file you copy? reboot? and you paste reboot into ramdisk/sbin? rename charger to charger_old? rename reboot to charger?
is it right?
ahhl said:
what file you copy? reboot? and you paste reboot into ramdisk/sbin? rename charger to charger_old? rename reboot to charger?
is it right?
Click to expand...
Click to collapse
Yes, there is a file named `reboot` in system/bin to and paste to /ramdisk/sbin/ where you can see `charger` file. You can rename the original `charger` file to anything or even delete it. Rename `reboot` to `charger` so when you plug in, the device triggers reboot instead of charging display. But it takes much longer for boot to complete this way
My boot.emmc.win file is empty after unpacking? any tips.
MolsonB said:
OK so I got it to work.
1. Extracted Boot image through TWRP (Backup> select boot > swiped to Backup)
2. Rename boot.emmc.win to boot.img
3. Copy boot.img to the root dir of the program Android.Image.Kitchen, and run "unpackimg.bat"
4. Open up folder /ramdisk/sbin/ and rename "charger" to "charger_orig"
4. Create "charger" and put in
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=5
if [ $CAPACITY -gt $MIN_CAPACITY ]
then
sleep 1
/system/bin/reboot
fi
/sbin/charger_orig
4. Go back to the root of Android.Image.Kitchen and run "repackimg.bat"
5. Take "image-new.img" and copy to phone
5. Install img with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install)
Click to expand...
Click to collapse
Did you used Magisk for this to root your device?
Auto shutdown of phone on disconnection of charger plug ( for Car) etc
knreddy said:
The above procedure is successful on the following ROM (similar to LOS15.1 , used magisk 16.7 or higher for rooting)
xiaomi.eu_multi_HMNote4X_8.12.20_v10-7.0.zip
downloaded from
https://excellmedia.dl.sourceforge..../xiaomi.eu_multi_HMNote4X_8.12.20_v10-7.0.zip
Click to expand...
Click to collapse
https://forum.xda-developers.com/android/apps-games/app-automate-t2870633/post80126909#post80126909
MolsonB said:
OK so I got it to work.
1. Extracted Boot image through TWRP (Backup> select boot > swiped to Backup)
2. Rename boot.emmc.win to boot.img
3. Copy boot.img to the root dir of the program Android.Image.Kitchen, and run "unpackimg.bat"
4. Open up folder /ramdisk/sbin/ and rename "charger" to "charger_orig"
4. Create "charger" and put in
Code:
#!/system/bin/sh
#Skip offline charge and start device if enough juice on battery. If low on battery do offline charge
CAPACITY=$(cat /sys/class/power_supply/battery/capacity)
MIN_CAPACITY=5
if [ $CAPACITY -gt $MIN_CAPACITY ]
then
sleep 1
/system/bin/reboot
fi
/sbin/charger_orig
4. Go back to the root of Android.Image.Kitchen and run "repackimg.bat"
5. Take "image-new.img" and copy to phone
5. Install img with TWRP (install>install image> select above "image-new.img" >select boot > swiped to install)
Click to expand...
Click to collapse
Doesn't seem to work on pie.. Or maybe im missing some things
jprimero15 said:
Doesn't seem to work on pie.. Or maybe im missing some things
Click to expand...
Click to collapse
Maybe the tool you're using is older than Pie?

Forgotten pattern - how to unlock phone without loosing data

Don't ask me how, but I somehow set pattern and forgot it in one hour. I use face rec. as well but after reboot I need to unlock with pattern.
For last 10h I tried all methods how to unlock phone, but no success.
I'm using original, ROM, my G6 model is H870, running Pie, unlocked bootloader, so I can use TWRP. I spent most of my time and knowledge to unlock phone with adb/twrp. Best option I found is to delete gesture.key file which is located under /data/system.
Problem is, that /data is encrypted ...
Is there anyone who managed to remove pattern/lock without loosing data?
Thank you for your time!
akulp said:
Don't ask me how, but I somehow set pattern and forgot it in one hour. I use face rec. as well but after reboot I need to unlock with pattern.
For last 10h I tried all methods how to unlock phone, but no success.
I'm using original, ROM, my G6 model is H870, running Pie, unlocked bootloader, so I can use TWRP. I spent most of my time and knowledge to unlock phone with adb/twrp. Best option I found is to delete gesture.key file which is located under /data/system.
Problem is, that /data is encrypted ...
Is there anyone who managed to remove pattern/lock without loosing data?
Thank you for your time!
Click to expand...
Click to collapse
Maybe this will work: https://************/delete-android-security-pin/
Edit: link gets truncated... Just search 'Remove pin twrp' on Google and click the first result.
krilok said:
Maybe this will work: https://************/delete-android-security-pin/
Edit: link gets truncated... Just search 'Remove pin twrp' on Google and click the first result.
Click to expand...
Click to collapse
Non of this solutions work.
This is pretty the same as I said. My problem is that /data is encrypted and I can't find/see any .key files.
Also I can't do "su" command inside adb shell because of "insuff. privileges" ...
I tried all this solutions:
https://forum.xda-developers.com/showthread.php?p=49666433#post49666433
For method 1 -5 there is a problem with .key files which are not seen to my TWRP/Aroma browser. I don't know If I'm doing anything wrong in method 7, but also after mount I can't access /data/system (/data is empty).
In method 6 I'm stucked on
"Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone." step.
I get "insuff. privileges" error.
akulp said:
Non of this solutions work.
This is pretty the same as I said. My problem is that /data is encrypted and I can't find/see any .key files.
Also I can't do "su" command inside adb shell because of "insuff. privileges" ...
I tried all this solutions:
https://forum.xda-developers.com/showthread.php?p=49666433#post49666433
For method 1 -5 there is a problem with .key files which are not seen to my TWRP/Aroma browser. I don't know If I'm doing anything wrong in method 7, but also after mount I can't access /data/system (/data is empty).
In method 6 I'm stucked on
"Run pull settings.db.cmd inside By-pass security Hacks folder to pull out the setting file out of your phone." step.
I get "insuff. privileges" error.
Click to expand...
Click to collapse
Have you tried this?
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008
Basically, the files you have to delete in the /data/system folder in TWRP are:
password.key
pattern.key
locksettings.db
locksettings.db-shm
locksettings.db-wal
It happened to me a while ago and I didn't have any '.key' files either; I just deleted the rest and when I booted up, I had no lock screen security PIN nor registered fingerprints but could re-set them again through security settings. I didn't need to flash any files nor fiddle around with adb commands, and all my data remained untouched...
If you can't find all those five files or the '.key' files, just delete the ones you can find and it should work. Otherwise, you'll probably have to do a full reset and reinstall...
krilok said:
Have you tried this?
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008
Basically, the files you have to delete in the /data/system folder in TWRP are:
password.key
pattern.key
locksettings.db
locksettings.db-shm
locksettings.db-wal
It happened to me a while ago and I didn't have any '.key' files either; I just deleted the rest and when I booted up, I had no lock screen security PIN nor registered fingerprints but could re-set them again through security settings. I didn't need to flash any files nor fiddle around with adb commands, and all my data remained untouched...
If you can't find all those five files or the '.key' files, just delete the ones you can find and it should work. Otherwise, you'll probably have to do a full reset and reinstall...
Click to expand...
Click to collapse
Problem is, that I don't have any files/folders at all in my /data. I even don't see system folder inside data.
akulp said:
Problem is, that I don't have any files/folders at all in my /data. I even don't see system folder inside data.
Click to expand...
Click to collapse
Sounds like your data folder is not mounted when you boot to TWRP... Have you checked? Reboot to TWRP, select the Mount option; data should be ticked by default. It it isn't, select it, go back to TWRP file manager, and see if you can now browse folders and files...
krilok said:
Sounds like your data folder is not mounted when you boot to TWRP... Have you checked? Reboot to TWRP, select the Mount option; data should be ticked by default. It it isn't, select it, go back to TWRP file manager, and see if you can now browse folders and files...
Click to expand...
Click to collapse
Unfortunately it's checked ... It's seems from this post:
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008/page12
nobody managed to get to (encrypted) /data on Pie.
akulp said:
Unfortunately it's checked ... It's seems from this post:
https://forum.xda-developers.com/android/software-hacking/remove-lockscreen-recovery-t3530008/page12
nobody managed to get to (encrypted) /data on Pie.
Click to expand...
Click to collapse
Last comment on that thread says the solution also works on Havoc Os 2.9, which is based on Pie... Maybe that person wasn't encrypted to begin with, but, if it doesn't work for you, I guess then the only way to go is a full reset... Good luck!
krilok said:
Last comment on that thread says the solution also works on Havoc Os 2.9, which is based on Pie... Maybe that person wasn't encrypted to begin with, but, if it doesn't work for you, I guess then the only way to go is a full reset... Good luck!
Click to expand...
Click to collapse
Yep, I saw that post ... I relly don't have any more ideas. Should be inside "mount modul" in TWRP /data listed?
I only have System, Cache and SD ... and i can check System only if i check bottom "mount system partition read-only" option.
But that's nothing to do with /data.
akulp said:
Yep, I saw that post ... I relly don't have any more ideas. Should be inside "mount modul" in TWRP /data listed?
I only have System, Cache and SD ... and i can check System only if i check bottom "mount system partition read-only" option.
But that's nothing to do with /data.
Click to expand...
Click to collapse
Data option should show. At least it does on mine... You can maybe try updating Twrp version?
I'm on last TWRP.... Meantime I already made full reset ....
If you have encrypted data partition, you're pretty much banned from messing with it, unless you manage to exploit your way through the adb, which requires you to have it enabled and in trust relation with your PC to begin with.
The way I'd go around this is to place an "always yes su" binary and perform pattern removal process through init.d or similar solution. In case if su commands are restricted, kernel with permissive SELinux needs to be flashed.
On a side note, isn't this Q&A?
I also had a problem with data folder not being mounted when booting to TWRP. I tried a full reset and immediately i have access to the Data folder (but theres nothing left inside so this is kinda useless). Then later when i did a reboot into the TWRP it happened again, couldnt access to anything even when the "mount Data" option is ticked, only until i did the full reset again that it could finally work.
It turned out the problem is with the TWRP itself, i flashed another custom recovery (OrangeFox-R10-Stable-h870, which is btw a better recovery than TWRP in my opinion) and the problem never occurred again.
So either try out that new Recovery or a different version of TWRP and see if it solves the problem. And always, ALWAYS, make a full backup of all your data before messing with anything (i had to learn that the hard way so trust me).
Do this,
- you should know that I am using "orange fox recovery" not "twrp",and stock "pie"
- reboot to recovery and go to system/data
- delete this files:
gatekeeper.password.key
gatekeeper.pattern.key
locksettings.db
-reboot the phone and that's it.

How to do full system backup to PC?

Before I handing in my OnePlus 6T for repair, I want to create a full system backup and reset the phone to factory defaults. Afterwards, I want to restore the original state. My phone is rooted with Magisk.
How do I do a full system backup?
What I tried:
adb backup -apk -obb -shared -all -system: This finishes, but at 5.5GB, even if compressed, the backup file is suspiciously small. According to the settings app, my phone uses 55GB of storage, so ten times that!
OK, so I thought adb root needs to be run before. However, that doesn't work: adbd cannot run as root in production builds
So I installed the adb_root module. But now when I run the above backup command, then it simply quits. No backup is created.
feklee said:
Before I handing in my OnePlus 6T for repair, I want to create a full system backup and reset the phone to factory defaults. Afterwards, I want to restore the original state. My phone is rooted with Magisk.
How do I do a full system backup?
What I tried:
adb backup -apk -obb -shared -all -system: This finishes, but at 5.5GB, even if compressed, the backup file is suspiciously small. According to the settings app, my phone uses 55GB of storage, so ten times that!
OK, so I thought adb root needs to be run before. However, that doesn't work: adbd cannot run as root in production builds
So I installed the adb_root module. But now when I run the above backup command, then it simply quits. No backup is created.
Click to expand...
Click to collapse
Do you have TWRP on your device? If so, just backup everything with it and copy the TWRP backup folder elsewhere.
ALSO (with the help of PC) copy the /sdcard (emulated sdcard; media storage). TWRP itself does not do that.
Done.
The reinstall TWRP in your device and restore everything. And copy back /sdcard
By the way, this is not Magisk related. For more information, better ask in your device specific section.
wilsonhlacerda said:
Do you have TWRP on your device? If so, just backup everything with it and copy the TWRP backup folder elsewhere.
Click to expand...
Click to collapse
Thanks for pointing me in the right direction! Here's how I proceeded in the end:
Downloaded TWRP for my device.
Rebooted the phone into fastboot mode by pressing volume down plus the power button and following the menu displayed on the phone. Note the process of entering fastboot mode varies from phone to phone.
Connected the phone to the PC, then booted TWRP from the Windows command line (cmd.exe):
Code:
fastboot boot twrp-3.4.0-0-fajita.img
I installed fastboot as part of the Chocolatey package adb.
In TWRP, I entered my password, then selected Backup.
Backed up all partitions to internal storage. See also the TWRP FAQ: What should I back up in TWRP?
Note that not all partitions need to be backed up, and in fact, according to the TWRP FAQ, it may be a bad idea to restore certain partitions. Still, it doesn’t hurt to have the backup of all of them.
Not included is /data/media (internal storage). This needs to be backed up separately. See the TWRP FAQ: What is EXCLUDED from a TWRP backup?
With TWRP running, I connected the phone via USB to my PC. Then I moved the following folder to my PC, which contains the TWRP backup of the phone:
Code:
This PC\OnePlus A6013\Internal Storage\TWRP
This step is not strictly necessary as in the following step I did back up the entire internal storage. However, it makes the next step execute faster as less data needs to be copied. The next step does not give feedback about progress.
For backing up internal storage I decided on the method found in Tadej Janež’s article Backing up Android's /data/media (i.e. internal storage) using adb and TWRP. From the Windows command line I ran:
Code:
adb exec-out "tar --create data/media/0 2>/backup-errors.txt | gzip" >internal_storage.tar.gz
After completion, to check for errors, I ran (no errors):
Code:
adb shell cat /backup-errors.txt
To leave TWRP, I rebooted the phone. Note that it is not necessary to install TWRP.
Restoration still needs to be tested.
By the way, this is not Magisk related. For more information, better ask in your device specific section.
Click to expand...
Click to collapse
I thought there was a Magisk way of doing a full system backup, making use of root privileges. Now I know better.
you can also try Migrator of vr25.
{Mod Edit: TG link removed}
https://github.com/VR-25/migrator
Just use Migrate
End of story.....
datsoy said:
you can also try Migrator of vr25.
{Mod Edit: TG link removed}
https://github.com/VR-25/migrator
Click to expand...
Click to collapse
Thanks! This looks nice, but I already backed up with TWRP. The idea was to get a 1:1 binary backup, and the backup did work. However, I am running into issues during restore of the Data partition: Error 255 when trying to restore Data

PLEASE HELP! Cannot Create Folders or Download any files from Chrome or Magisk Repository

I have the global version of OnePlus 6t. Ever since I rooted my device, I used fastboot to boot the twrp .img then, I flashed the newest OTA, then twrp, then Magisk apk. I can no longer Download anything from Chrome or The Magisk app. I also cannot create any new folders in my internal storage when using either of the default file manager apps. They also do not show any folders in the internal storage. It's like I no longer have write permissions. I would post a screen shot but it also says I cannot save screenshots when I try.
I am able to download off the play store and got a file manager with root access, and that's the only way I can see or create folders, but I can't access those folders anywhere except there.
Please help, I'm new to all of this and am beginning to think I am in over my head as far as rooting a device goes.
Did you format data then do a factory reset in twrp before you flashed the full ota?
I suggest formatting data in twrp, not data wipe but format where it makes you type in "yes" and swipe to proceed. Just remember that wipes all your pictures and everything. You can also do format data from your PC with fastboot just do: sudo fastboot -w
Then reboot system. You should be good then.

[SOLVED] Restore decrypted nandroid backup of FBE

Tried restoring a nandroid backup of the data partition with twrp.
also copied the /data/media partition back from an external copy.
when booting up the phone immediately reboots back into twrp with an error message:
Android Rescue Party...
The reported problem is:
'--reason=set_policy_failed_:/data/vendor'
the vendor partition seems to be intact and i do have a backup of it taken at the same time as the data backup, restoring it doesn't yield results..
i'm wondering if FBE is throwing it off, as the backup was taken when the phone was decrypted (within twrp) however the data on the partitions is referencing some sort of encryption key?
you may also exhibit the following error upon bootup of a restored nandroid backup.
immediately after booting, the phone reboots back into recovery.
viewing the log in twrp will show:
Android Rescue Party...
The reported problem is:
'--reason=set_policy_failed_:/data/bootchart'
1. the solution to this is editing fstab.​​under twrp or other recovery​mount /vendor from the mount icon.​​in twrp: Advanced > File Manager > /vendor/etc/fstab.qcom​select edit file under userdata, find where it says fileencryption=ice​rename fileencryption to encryptable.​​Original​
Code:
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,fileencryption=ice,quota,reservedsize=512M
​​Modified​
Code:
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=ice,quota,reservedsize=512M
​save file.​
2. next delete the following directories:​
/data/unencrypted
/data/misc/vold/user_keys
3. Lastly delete any of the existing files from /data/system/ :​
locksettings.db
Gatekeeper.password.key
gatekeeper.pattern.key
locksettings.db-shm
locksettings.db-wal
recoverablekeystore.db
password.key
pattern.key
4. Reboot and re-encrypt​​
At this point rebooting from recovery will result in a running and successfully recovery backup.
one thing to note is the data and data/media partitions are at this point unencrypted
TRYING TO REINCRYPT NOW WILL FAIL to reencrypt got to settings > security > re set your pin or password for the phone
(optional) then select encryption and there will be an orange button to encrypt device.
the encryption process will take quite a while as it will reencrypt your entire phone.
The above doesn't work as it's trying to accomplish FDE, and the fstab line for encryptable=ice, isn't compatible with this.
i could not find an fstab string to follow the same option but for FBE.
​
Thanks for sharing, nice guide to disable forced FBE encryption! I think this applies to Android 12+ in general, not just OnePlus devices.
I ended up with the same problem on my Mi 10 Ultra with MIUI 13 after a /data partition restore and it was a real pain to solve ("set_policy_failed:..." rescue party error for different directories). It's strange though why it fails to set the fscrypt policy for existing directories with no policy, correct permissions and SELinux context...
(Btw: whether a fscrypt policy is applied to a directory ("is this directory encrypted?") can be checked with fscryptpolicyget in terminal.)
Unfortunately, this didn't directly solve my TWRP backup restore problem and I still had to do a manual restore, but now I can at least disable FBE and it's always nice to have actual control over the device you paid money for (you should really have control by default, but oh well...)
(Some of) the troubleshooting I did:
Like I mentioned, I first thought the issue might be with the SE linux context, so I tried running restorecon, but this didn't help - I eventually found that in init.rc, restorecon is usually already automatically run during each boot for directories under /data/... so running it manually makes no difference.
To edit /vendor/etc/fstab.qcom (or /system) on my device, I had to first disable the shared blocks EXT4 optional feature. I followed this nice guide to unpack/repack super.img. But this is missing the step for disabling shared blocks: when I tried to mount any of the unpacked images (e.g. vendor.img) as R/W, it failed with the useless generic error:
wrong fs type, bad option, bad superblock on ...
Click to expand...
Click to collapse
Then dmesg gave me another clue, but at the same time was still cryptic and not immediately helpful:
EXT4-fs (loop*): couldn't mount RDWR because of unsupported optional features (4000)`.
Click to expand...
Click to collapse
So I guess 4000 is the code for shared blocks and you can disable these with e2fsck -E unshare_blocks <your .img file or loop device> (and probably need a filesystem check with e2fsck -yf <file>). Again very annoying that these numerical feature codes are not mentioned anywhere in the e2fsck manual pages for example.
Anyway, I was finally able to either:
1. mount vendor.img on my PC (mount -o loop vendor.img /mnt/vendor) and edit the /mnt/vendor/etc/fstab.qcom right there before repacking the .img and flashing the new edited super.img to my device
or
2. just repacking the vendor.img with shared blocks disabled and size increased (resize2fs vendor.img <new size>) and flashing the new super.img without other modifications - this way /vendor can also be mounted as r/w in Android and changes made later (mount -o remount,rw /vendor).
The worst part is that in the end, even with decryption disabled and the keys deleted, the device still wouldn't boot after a /data restore from TWRP (and after multiple days spent on debugging )... I still had to manually extract the TWRP backup and move directories/files individually - thankfully no issues with app/ or data/ - I think the problem was with some files in either system/ or misc/, but idk for sure. I just manually went through and kept only what seemed important (saved wifi APs, BT devices, SMSs etc, but not saved accounts). And after this it finally booted with all my apps and (most of) my settings!
(Btw2: a TWRP/nandroid backup is apparently just a bunch of separate tar.gz files, not a split archive, so you can just extract them with for file in ../data.f2fs.win*; do echo "extracting $file..."; busybox tar -xzf $file; done)

Categories

Resources