Finally there is a TWRP capable of decrypting /data on android versions > nougat.
Big thanks @NeoArian
I haven't tested everything in detail as I mostly focused on decryption. If you experience issues or can confirm something working that's not green in the table down below, please share.
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you. Hard & a lot.
*
*/
Status
List template by TWRP
Code:
[B]Blocking checks[/B]
- [COLOR="green"]Correct screen/recovery size[/COLOR]
- [COLOR="green"]Working Touch, screen[/COLOR]
- [COLOR="green"]Backup to internal/microSD[/COLOR]
- Restore from internal/microSD
- [COLOR="green"]reboot to system[/COLOR]
- [COLOR="green"]ADB[/COLOR]
[B]Medium checks[/B]
- update.zip sideload
- [COLOR="green"]UI colors (red/blue inversions)[/COLOR]
- [COLOR="green"]Screen goes off (and on :))[/COLOR]
- F2FS/EXT4 Support, exFAT/NTFS where supported
- [COLOR="green"]all important partitions listed in mount/backup lists[/COLOR]
- backup/restore to/from external (USB-OTG) storage
- backup/restore to/from adb
- [COLOR="green"]decrypt /data[/COLOR]
- Correct date
[B]Minor checks[/B]
- MTP export
- [COLOR="green"]reboot to bootloader[/COLOR]
- [COLOR="green"]reboot to recovery[/COLOR]
- [COLOR="green"]poweroff[/COLOR]
- [COLOR="green"]battery level[/COLOR]
- [COLOR="green"]temperature[/COLOR]
- encrypted backups
- [COLOR="green"]input devices via USB (USB-OTG) - keyboard, mouse[/COLOR]
- USB mass storage export
- [COLOR="green"]set brightness[/COLOR]
- [COLOR="green"]vibrate[/COLOR]
- [COLOR="green"]screenshot[/COLOR]
Limitations
Following limitations are known:
none
Click to expand...
Click to collapse
prerequisites
For reboot to recovery from your android system (and OTA updates) your ROM needs the following patches 1, 2 and 3. Following ROM's currently support this:
AICP 14
AICP 15
LineageOS 15
LineageOS 16
LineageOS 17
Click to expand...
Click to collapse
For correct time inside TWRP your ROM needs the following patch. Following ROM's currently support this:
AICP 15
LineageOS 16
LineageOS 17
Click to expand...
Click to collapse
Download
SourceForge
AndroidFileHost
Click to expand...
Click to collapse
How to build
https://github.com/115ek/manifest#build-twrp
Click to expand...
Click to collapse
XDA:DevDB Information
[RECOVERY][Unofficial][amami] TWRP 3.4.0, Tool/Utility for the Sony Xperia Z1 Compact
Contributors
115ek, NeoArian
Source Code: https://github.com/115ek/twrp_device_sony_amami
Version Information
Status: Beta
Created 2019-08-25
Last Updated 2020-08-22
Changelog
15.09.2020 3.4.0-1
again: fix non working OTA update in rare cases (rebooting to recovery and stucking there unable to install update automatically)
22.08.2020 3.4.0-0
latest TWRP changes
29.02.2020 3.3.1-0.4
display sony bootlogo at boot
show version number
remove TWRP app
19.09.2019 3.3.1-0.3
fix non working OTA update (rebooting to recovery and stucking there unable to install update automatically)
05.09.2019 3.3.1-0.2
enable reboot to bootloader (fastboot mode) (you have to connect the phone via usb BEFORE rebooting)
25.08.2019 3.3.1-0.1
decrease size
allow decryption in any case of patchlevel value
25.08.2019 3.3.1-0
initial release
Reserved
Backup to microSD seems to be working fine (haven't restored anything yet):good:
I uploaded a new build 3.3.1-0.1 with decreased size and a "more clean" way to allow /data decryption.
Furthermore I thought about getting this official.
BTW: You won't see the increased version number in TWRP. It's still 3.1.1-0
115ek said:
I uploaded a new build 3.3.1-0.1 with decreased size and a "more clean" way to allow /data decryption.
Furthermore I thought about getting this official.
BTW: You won't see the increased version number in TWRP. It's still 3.1.1-0
Click to expand...
Click to collapse
Hi, thank you for this build. I was waiting to try Pie on my z1 compact and I'm glad I did because the version of TWRP was blocking my use of encryption.
Sadly I didn't have luck installing the latest builds (the ones from 3 days ago and one week ago) on my Z1 Compact. I got this error:
Code:
fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.
When trying to flash to recovery partition. The same command worked to flash back to 3.2.3 (not sure if necessary, done just in case). If there's any way you could look into these builds I'd appreciate it!
bananabytes said:
Hi, thank you for this build. I was waiting to try Pie on my z1 compact and I'm glad I did because the version of TWRP was blocking my use of encryption.
Sadly I didn't have luck installing the latest builds (the ones from 3 days ago and one week ago) on my Z1 Compact. I got this error:
Code:
fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.
When trying to flash to recovery partition. The same command worked to flash back to 3.2.3 (not sure if necessary, done just in case). If there's any way you could look into these builds I'd appreciate it!
Click to expand...
Click to collapse
What command did you use?
Code:
fastboot flash recovery
or
Code:
fastboot flash FOTAKernel
Do you have the newest bootloader installed? So can you boot directly into recovery with VOL down and power pressed (with 3.2.3 version where flashing was successful)?
Or do you use the method with pressing VOL down when the LED lights up?
EDIT:
By looking at your error code I get the feeling it has something to do with fastboot directly. libsparse is a build dependency of the fastboot binary.
What version of fastboot are you using?
I'm using fastboot installed from the packetmanager with
Code:
apt install fastboot
.
Code:
fastboot --version
gives fastboot version 1:8.1.0+r23-5~18.04.
This would mean 27.0.0 or 27.0.1 according to this scheme. I don't know why they are using different naming schema
However, I'd guess you're using an outdated version (or a very current one - but I don't think so).
115ek said:
What command did you use?.
Click to expand...
Click to collapse
I used fastboot flash recovery, with the newest bootloader. This time I got into recovery by selecting it in my older TWRP because I always get the up/down method mixed up, I have done it before it's just easier that way.
115ek said:
By looking at your error code I get the feeling it has something to do with fastboot directly. libsparse is a build dependency of the fastboot binary.
...
However, I'd guess you're using an outdated version (or a very current one - but I don't think so).
Click to expand...
Click to collapse
I am actually indeed using a very current version, 29.0.2 (so your second less likely guess was correct!) I'm on Manjaro/Arch so we get the bleeding edge updates unlike if you are on a Debian/Ubuntu system that's tied to a lot of different libraries and held back. This is exactly why I stopped using those distros but this is the first time I've had the problem in reverse. I don't know if this is a bug that was introduced into fastboot or what. I do see that the more recent versions have things to do with partitioning. This may be a bug to open with fastboot or to look into further with them? But if it's not a bug with them it would be good to have the build working on the latest fastboot.
bananabytes said:
I used fastboot flash recovery, with the newest bootloader. This time I got into recovery by selecting it in my older TWRP because I always get the up/down method mixed up, I have done it before it's just easier that way.
I am actually indeed using a very current version, 29.0.2 (so your second less likely guess was correct!) I'm on Manjaro/Arch so we get the bleeding edge updates unlike if you are on a Debian/Ubuntu system that's tied to a lot of different libraries and held back. This is exactly why I stopped using those distros but this is the first time I've had the problem in reverse. I don't know if this is a bug that was introduced into fastboot or what. I do see that the more recent versions have things to do with partitioning. This may be a bug to open with fastboot or to look into further with them? But if it's not a bug with them it would be good to have the build working on the latest fastboot.
Click to expand...
Click to collapse
Can you please verify that you also fail with the fastboot binary from here
It's also 29.0.2 and it works fine for me.
I have tried this version with LOS 16 and it worked well. Some things to improve
boot to fastboot is not possible
backup and restore of boot is not possible
good catch with encryption, I have give it up :good:
Micha_Btz said:
boot to fastboot is not possible
Click to expand...
Click to collapse
Well, I actually didn't know this was possible in earlier versions. However it should work now --> see the changelog
You have to connect usb cable before rebooting to bootloader, otherwise it won't work and just reboot the system.
Micha_Btz said:
backup and restore of boot is not possible
Click to expand...
Click to collapse
I can't confirm that. What exactly was the problem for you? Backing up or restoring? Did you got any errors?
Have had a look yesterday, Backup and restore of boot is possible (don't now what happends)
@115ek,
I have a mysterious problem with 3.3.1-0.0.and 3.3.1-0.1:
I used all twrp versions before without problems and now your twrp did not show the correct date (1970-xx-xx) and time (7-8 hours back).
I tried the following several times:
1. reflash your twrp, clear recovery and flash again,
2. flash older versions: date and time was wrong even after reboot
The only way to get the correct date/time back in twrp was (at least for me) flash stock ROM with EMMA and after flashing twrp 3.2.3 my backup.
I do not want to repeat this as this is a lot of work incl. copying back the internal storage.
tramp20 said:
@115ek,
I have a mysterious problem with 3.3.1-0.0.and 3.3.1-0.1:
I used all twrp versions before without problems and now your twrp did not show the correct date (1970-xx-xx) and time (7-8 hours back).
I tried the following several times:
1. reflash your twrp, clear recovery and flash again,
2. flash older versions: date and time was wrong even after reboot
The only way to get the correct date/time back in twrp was (at least for me) flash stock ROM with EMMA and after flashing twrp 3.2.3 my backup.
I do not want to repeat this as this is a lot of work incl. copying back the internal storage.
Click to expand...
Click to collapse
Can you try the latest version?
At first you have to set the right timezone in TWRP settings.
The time is stored in a real time clock (RTC) which runs even if the device is powered off. Setting and reading it's value is done by a kernel driver. If you set the right time in android system it gets stored in the RTC. Then, if you boot into TWRP, the time is read again. And for me this works fine. However it takes some seconds (there's a wrong time at the beginning).
115ek said:
Can you try the latest version?
At first you have to set the right timezone in TWRP settings.
The time is stored in a real time clock (RTC) which runs even if the device is powered off. Setting and reading it's value is done by a kernel driver. If you set the right time in android system it gets stored in the RTC. Then, if you boot into TWRP, the time is read again.
Click to expand...
Click to collapse
Thank you. I know this all, I tried reset to default in TWRP and set TZ etc. but these two mentioned TWRP versions do not read the RTC time (AICP ROM).
All TWRP versions before were ok. I tried this several times.
I noticed this "bug" on my Z1c after a backup with your TWRP (Date from 1970 and a complete false time even after setting the TZ).
Even after flashing one of the older TWRP date/time are wrong (only in TWRP), after booting to Android date/time is correct until I boot to TWRP again.
As I wrote the way back to a correct date/time in TWRP was for me flashing stock ROM with EMMA.
Where is this "kernel driver"? In your TWRP version or in a hidden partition? Sorry I do not know much of these internals.
I assume you did not change in the newest version something regarding this problem.
I have not the time to try the last version for now
Generic question re: encrypting this device
Installed this twrp version and (unlike others) I don't see anything strange. Only thing I haven't tried so far is restoring a nandroid backup I created with this twrp release.
A few days back after I had installed this the first time Itried to encrypt my phone; after a while I received the message that encryption was completed.
Then upon reboot of the device I had to unlock it even before boot sequence had started. Aftter unlocking booting resumed and from then on everything appeared to be as before.
This surprised me a bit because on my other phone (OnePlus6 running stock OOS Pie) I have to unlock after boot sequence has completed. But OK, this may be the LOS 16 way.
Then I devided to unencrypt the phone (this is my secondary device and I only use it for playing around a bit, until I decide to sell it, maybe). Again, from my OP6 I'm used to the fact that if I remove any device locking pattern encryption is gone. But obviously not on my Z1c: after I had removed the security pattern (= set security to nothing) everything appeared to be normal. But after the next reboot all data were gone.
Question: is there a supported way to unencrypt this phone without losing any data?
If there isn't such a way: what happens to my Nandroid backups I took while the phone was encrypted? Are they still usable e.g. after I install a ROM update?
tramp20 said:
Thank you. I know this all, I tried reset to default in TWRP and set TZ etc. but these two mentioned TWRP versions do not read the RTC time (AICP ROM).
All TWRP versions before were ok. I tried this several times.
I noticed this "bug" on my Z1c after a backup with your TWRP (Date from 1970 and a complete false time even after setting the TZ).
Even after flashing one of the older TWRP date/time are wrong (only in TWRP), after booting to Android date/time is correct until I boot to TWRP again.
As I wrote the way back to a correct date/time in TWRP was for me flashing stock ROM with EMMA.
Where is this "kernel driver"? In your TWRP version or in a hidden partition? Sorry I do not know much of these internals.
I assume you did not change in the newest version something regarding this problem.
I have not the time to try the last version for now
Click to expand...
Click to collapse
Flashing stock ROM isn't necessary - I'm 99% sure. Maybe you can get a log with
Code:
adb pull /tmp/recovery.log
while your in TWRP and connected to a PC...
The kernel driver is - as the name says - located in the kernel, which is part of the recovery.img
So everyone flashing this image should have the same functionality (in theory). As it works for me (and some others) I'm just wondering.
lm089 said:
Installed this twrp version and (unlike others) I don't see anything strange. Only thing I haven't tried so far is restoring a nandroid backup I created with this twrp release.
A few days back after I had installed this the first time Itried to encrypt my phone; after a while I received the message that encryption was completed.
Then upon reboot of the device I had to unlock it even before boot sequence had started. Aftter unlocking booting resumed and from then on everything appeared to be as before.
This surprised me a bit because on my other phone (OnePlus6 running stock OOS Pie) I have to unlock after boot sequence has completed. But OK, this may be the LOS 16 way.
Then I devided to unencrypt the phone (this is my secondary device and I only use it for playing around a bit, until I decide to sell it, maybe). Again, from my OP6 I'm used to the fact that if I remove any device locking pattern encryption is gone. But obviously not on my Z1c: after I had removed the security pattern (= set security to nothing) everything appeared to be normal. But after the next reboot all data were gone.
Question: is there a supported way to unencrypt this phone without losing any data?
If there isn't such a way: what happens to my Nandroid backups I took while the phone was encrypted? Are they still usable e.g. after I install a ROM update?
Click to expand...
Click to collapse
The behaviour is totally expected as amami uses the deprecated full disk encryption (FDE). Most likely your oneplus 6 is using file based encryption (FBE). That's the reason it can boot to your lockscreen because some files necessary for booting aren't encrypted (or not encrypted using your password...). To boot a device with fully encrypted /data you have to decrypt it first. If you're interested in details have a look here.
The other thing sounds a bit strange. However I don't know if it's possible to remove the FDE completely. Maybe the device just sets a default password then?
Concerning your question:
What definitely should work is taking a backup in TWRP (of course need to decrypt /data before), then format /data and restore the backup. Anyhow - I didn't test such a case so far.
115ek said:
Flashing stock ROM isn't necessary - I'm 99% sure. Maybe you can get a log with
Code:
adb pull /tmp/recovery.log
while your in TWRP and connected to a PC...
The kernel driver is - as the name says - located in the kernel, which is part of the recovery.img
Click to expand...
Click to collapse
Flashing stock ROM was the only way that all older TWRP could read the correct date again after trying your twrp version.
I will try to get a log if I have enough time.
So the recovery.img = twrp.img or at least a part of it?
Thank you.
New update:
As I had problems with installing OTA updates (especially with /data encrypted, but not limited to) on LineageOS 16.0 I came up with a fix.
Download Currently only on sourceforge - android filehost is buggy at the moment...
19.09.2019 3.3.1-0.3
fix non working OTA update (rebooting to recovery and stucking there unable to install update automatically)
Edit:
As reminder for me / interested guys: This commit breaks the OTA updating in some cases (when mmap isn't sufficient). The buildflag
Code:
-D_FILE_OFFSET_BITS=64
doesn't work as intended on my setup. Maybe I missed something.
tramp20 said:
@115ek,
I used all twrp versions before without problems and now your twrp did not show the correct date (1970-xx-xx) and time (7-8 hours back).
Click to expand...
Click to collapse
Have the same time/date problem with twrp-3.3.1-0.3-amami.img
recovery.log >> https://pastebin.com/rBdHAmz2
Also does not reboot into the recovery from system (AICP 14), just shutdown and then power+volume down works.
Related
JB sediKERNEL for the LG F3Q (codenames: FX3Q, D520)
This is the JB stock Kernel build from the LG source code.
It is modified to be able to boot on a unlocked bootloader (loki) and may contain other features in the near future.
Current features (always for the latest version):
Same as stock but build from the sources
Compatible with the locked bootloader (means loki'ed)
XATTR enabled
SELinux enabled
dmesg will provide human readable timestamps (too)
KEXEC patches available (but not applied(anymore))
Will ignore crappy LG bootloader args
Will not do a AUTOMATIC HIDDEN factory reset when kernel panics occur
Will not enforce LG signed image anymore
AROMA flashing ZIP file available! This will flash the sediKERNEL into the right place (boot partition of course ) and wipe dalvik cache for you.
With this no "adb shell + dd" etc are needed anymore. Just flash the ZIP in twrp (read the instructions at the bottom of this post).
Take a preview look at the attached images (see bottom of this post!) of the installer process - as you can see this is really easy and straight forward, isn't it?
magic key feature for booting into recovery instead of normal boot! This superseedes all the problems regarding how to reach the recovery mode when the system is damaged!!
Usage instructions:
Power on the device
when you see the LG logo the first time do NOTHING!!
When the screen goes black THEN press Volume UP + Volume DOWN. Both the same time and hold them pressed.
Release the buttons when the screen goes black again
Wait. You will see the LG logo a third time and then you will see the recovery screen!
If you see a kernel crash then you have pressed the magic keys too early! Read and follow the above steps carefully and you should be fine.
No hacks anymore, no special installation instructions to workaround things, not breaking or damaging data or anything. Just using those keys and be happy!
Known issues (always for the latest version):
High (always for the latest version):
None (known)
Medium (always for the latest version):
None (known)
Minor (always for the latest version):
When booting up while the USB cable is connected you will see the charger image instead of boot directly - even when there is enough battery capacity. Simply press power button or boot without the cable connected.
Version >= 2.0: in rare situation when you use the magic key press (vol up+down) to boot into recovery a kernel crash can occur when you have not followed the instructions step by step. This is not a problem of the kernel! It is because of a timing issue of the hook used to get into recovery when you press the magic keys too early. Simply follow the instructions and you should be fine. If you still see a crash let me know and try it again it should really work the described way.
Development progress
sediKERNEL v3.0
Current progress:
Building a custom kernel without stock initrd (that means building an own initrd which works. atm I use the custom compiled Kernel + stock initrd)
Latest stable version: sediKERNEL v2.0
Download:
USE THAT ON YOUR OWN RISK!
ZIP flashable file (see instructions at the OP thread): sediKERNEL
DD Image file (see instructions at the OP thread): really? ok if you don't like AROMA open the ZIP and use the /kernel/sediKERNEL...lok file
Changelog:
For changelog see Changelog post
Previous versions:
see Changelog post
Installation Instructions (all versions)
Pre-Requirements (both methods)
Bravery & the will to change things for a better world
You should have rooted the device
You need either CWM (not my preferred choice) or TWRP installed (TWRP is highly recommended)
Method1: Based on ZIP (AROMA installer)
DO A BACKUP! For example execute: dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/STOCK_boot.img <- This will backup your current boot partition to your external SD card.
If you have adb installed (install it here if you like: @lifehacker) the command would be:
adb shell "su -c dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/STOCK_boot.img"
Download the sediKERNEL ZIP file
Extract that ZIP on your PC.
Copy or push BOTH files to your F3Q (the ZIP you extracted + the MD5 file).
You can do this by mount the F3Q normally and use MTP or adb if you like:
e.g when in booted stock ROM: "adb push ZIPfile /storage/external_SD/" & once again for the md5 file: "adb push MD5file /storage/external_SD/"
Reboot into recovery (e.g. execute: "adb reboot recovery")
Flash the ZIP & enjoy the magic
Done
Method2: Based on DD
DO A BACKUP! For example execute: dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/STOCK_boot.img <- This will backup your current boot partition to your external SD card.
If you have adb installed (install it here if you like: @lifehacker) the command would be:
adb shell "su -c dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/external_SD/STOCK_boot.img"
Download the sediKERNEL Image file
Put that image file to your F3Q (e.g when in booted stock ROM: "adb push imagefile /storage/external_SD/")
Reboot into recovery (e.g. execute: "adb reboot recovery")
execute: dd if=/storage/external_SD/your-uploaded-imagefile of=/dev/block/platform/msm_sdcc.1/by-name/boot
wipe dalvik cache (IMPORTANT!). Example: "adb shell mount /data and then: adb shell 'rm -R /data/dalvik-cache' " when recovery has booted up.
Done
Sources:
My current kernel setup of the fx3q sediKERNEL build can be found here: kernel_lge_fx3q_aosp
.
XDA:DevDB Information
[KERNEL][STOCK/AOSP][JB] sediKERNEL for LG Optimus F3Q, Kernel for the General Discussion
Contributors
xdajog, joel.maxuel
Source Code: https://github.com/xdajog/kernel_fx3q_aosp
Kernel Special Features:
Version Information
Status: Stable
Current Stable Version: v2.0_build28
Stable Release Date: 2015-05-13
Created 2015-05-19
Last Updated 2015-05-19
Changelog
sediKERNEL v2.0 (build28)
Enhancements:
Busybox (busybox_nonselinux_1.23.1) added to initial ramdisk (to get all the commands needed for the magic recovery boot keys)
Toolbox added (to get a working reboot command for the magic recovery boot keys)
added magic key press detection for booting into recovery! This superseedes all the problems regarding how to reach the recovery mode when the system is damaged!!
Usage instructions:
Power on the device
when you see the LG logo the first time do NOTHING!!
When the screen goes black THEN press Volume UP + Volume DOWN. Both the same time and hold them pressed.
Release the buttons when the screen goes black again
Wait. You will see the LG logo a third time and then you will see the recovery screen!
If you see a kernel crash then you have pressed the magic keys too early! Read and follow the above steps carefully and you should be fine.
ing those keys and be happy!
AROMA flashing ZIP file available! This will flash the sediKERNEL into the right place (boot partition of course ) and wipe dalvik cache for you. Enjoy
Fixes:
sediKERNEL version string was not optimal
Version was "Unavailable" at "About Phone" --> "Software Version" --> "Kernel Version". This was because the regex awaits "()" to filter out the correct version string. So the fix was to add build details into brakes and double escape CONFIG_LOCALVERSION string. Using EXTRAVERSION within the Makefile brakes Kernel module build when used.
Download:
USE THAT ON YOUR OWN RISK!
ZIP flashable file (see instructions at the OP thread): sediKERNEL v2.0
DD Image file (see instructions at the OP thread): open the ZIP and use the /kernel/sediKERNEL...lok file
sediKERNEL v1.5
Enhancements:
removed all kexec patches and kexec support because we do not need it atm (I want to avoid issues)
added version string to kernel (uname -a)
Fixes:
may fixes kernel crash in rare situations (kexec related)
Download:
USE THAT ON YOUR OWN RISK!
DD Image file (see instructions at the OP thread): sediKERNEL_JB-v1.5_build6.img
ZIP flashable file (see instructions at the OP thread): N / A
sediKERNEL v1.2
Enhancements:
Will ignore crappy LG bootloader args
Will not do a factory reset when kernel panics occur
Will not enforce LG signed image
Fixes:
This may fixes LG security errors (need feedback..)
May fixes a problem booting custom ROMs
Download:
USE THAT ON YOUR OWN RISK!
DD Image file (see instructions at the OP thread): sediKERNEL_JB-v1.2_26.img
ZIP flashable file (see instructions at the OP thread): N / A
sediKERNEL v1.0
Enhancements:
Same as stock but build from the sources
Compatible with the locked bootloader (means loki'ed)
XATTR enabled
KEXEC patches applied !
SELinux capable
Booting successful (tested on stock ROM)
Wi-Fi (tested on stock ROM)
Fixes:
TWRP is not unhappy anymore because of missing xattr and selinux
Download:
USE THAT ON YOUR OWN RISK!
DD Image file (see instructions at the OP thread): sediKERNEL_JB-v1.0.1.img
Reserved 2
IN THE MEANTIME YOU COULD USE THIS POST FOR ANOTHER THANKS CLICK
I appreciate all the work being done.
Would this be a solution to "Security Error" bootloops I am getting with my de-bloated ROM?
joel.maxuel said:
I appreciate all the work being done.
Would this be a solution to "Security Error" bootloops I am getting with my de-bloated ROM?
Click to expand...
Click to collapse
Possible but if you still getting security error bootloops when using this kernel then it may has something to do with a removed LG app.
It depends at which stage that security error occurs. If it appears directly when booting up it should not occur with sediKERNEL but if it booting up and you see the error then first it should be app related.
-----
Sent from my SGH-I927 using XDA Android mobile app
xdajog said:
Possible but if you still getting security error bootloops when using this kernel then it may has something to do with a removed LG app.
It depends at which stage that security error occurs. If it appears directly when booting up it should not occur with sediKERNEL but if it booting up and you see the error then first it should be app related.
Click to expand...
Click to collapse
Yeah, the error I received using the stock kernel threw before the boot animation occurred, but after the LG logo.
I read somewhere that the Security Error comes up when you even remove Videos.apk. Hopefully that is kernel related and will go away with sediKERNEL.
joel.maxuel said:
Yeah, the error I received using the stock kernel threw before the boot animation occurred, but after the LG logo.
I read somewhere that the Security Error comes up when you even remove Videos.apk. Hopefully that is kernel related and will go away with sediKERNEL.
Click to expand...
Click to collapse
Well there are 2 stages where the LG logo will be displayed:
1) When powering on the device -> that is a static LG Logo and is shown shortly after powering on
2) When booting the Kernel -> that is the same looking LG Logo but there is a little little animation on it
I think that you will receive that Security Error after stage 1 and before stage 2 so when booting the kernel and that should be fixed using sediKERNEL.
xdajog said:
Well there are 2 stages where the LG logo will be displayed:
1) When powering on the device -> that is a static LG Logo and is shown shortly after powering on
2) When booting the Kernel -> that is the same looking LG Logo but there is a little little animation on it
I think that you will receive that Security Error after stage 1 and before stage 2 so when booting the kernel and that should be fixed using sediKERNEL.
Click to expand...
Click to collapse
Oh okay. It must be ROM based then. Because I think I did get to stage 2 before the security error threw.
joel.maxuel said:
Oh okay. It must be ROM based then. Because I think I did get to stage 2 before the security error threw.
Click to expand...
Click to collapse
nevertheless it would worth to try the sediKERNEL
xdajog said:
nevertheless it would worth to try the sediKERNEL
Click to expand...
Click to collapse
Agreed. I will hold off until v1.5 is released since that one looks more promising.
joel.maxuel said:
Agreed. I will hold off until v1.5 is released since that one looks more promising.
Click to expand...
Click to collapse
Code:
Latest available version
sediKERNEL v1.2
Enhancements:
Will ignore crappy LG bootloader args
Will not do a factory reset when kernel panics occur
Will not enforce LG signed image
Fixes:
This may fixes LG security errors (need feedback..)
May fixes a problem booting custom ROMs
Ok no appologies anymore try it
So I noticed a couple things over the past few days with the kernel.
The first is minor. When doing a reboot from recovery you need to make sure the USB cable is disconnected. The impact is that the phone goes to charge mode if the cable is still connected.
The other, well, gives a real good reason to have the really bulletproof method with TWRP. The hotkeys to the bootloader no longer work. I was testing an AOSP keyboard with my ROM (think I know what to do now) when the setup wizard crashed continually, leaving me soft bricked. Luckily download mode still works.
So tonight I am using the spare, until I get the F3Q rooted, recoveried, and restored (again).
Not to complain, I really appreciate all the work done, thought you would want to know any drawbacks with the current version.
Sent from my MyTouch 4G Slide
joel.maxuel said:
The other, well, gives a real good reason to have the really bulletproof method with TWRP. The hotkeys to the bootloader no longer work.
Click to expand...
Click to collapse
Many thx for your feedback!
Hm interesting. I use method 2 and the hotkeys are still working. AFAIK those hotkeys are integrated in the bootloader and that one will never be touched by any method. Strange..
-----
Sent from my SGH-I927 using XDA Android mobile app
xdajog said:
Hm interesting. I use method 2 and the hotkeys are still working. AFAIK those hotkeys are integrated in the bootloader and that one will never be touched by any method. Strange..
Click to expand...
Click to collapse
There are so many hotkey variations across brands I lose track of the combo (keys pressed, how long). But I did try pwr +vol-dn, pwr + vol-up, even the three finger salute. Sometimes holding until the first LG logo shows, other times until the boot animation comes up (that's when I know I am screwed). I could still be doing it wrong...
Where is the bootloader stored anyway? Could it be that the opportunity for loading the bootloaders factory reset is during the kernel loading stage? TWRP kernel could still have those functions/flags. With a flipped boot and recovery image noted in method 2, that would make sense why your setup works.
Sent from my MyTouch 4G Slide
joel.maxuel said:
There are so many hotkey variations across brands I lose track of the combo (keys pressed, how long). But I did try pwr +vol-dn, pwr + vol-up, even the three finger salute. Sometimes holding until the first LG logo shows, other times until the boot animation comes up (that's when I know I am screwed). I could still be doing it wrong...
Where is the bootloader stored anyway? Could it be that the opportunity for loading the bootloaders factory reset is during the kernel loading stage? TWRP kernel could still have those functions/flags. With a flipped boot and recovery image noted in method 2, that would make sense why your setup works.
Sent from my MyTouch 4G Slide
Click to expand...
Click to collapse
The trick is to take out the battery , pressing vol+down and power while putting back the battery again. This will work 100%.
Any tries without putting out the battery may not work.
The bootloader is in "aboot" partition and i do not think it will have to do with the kernel. The reason why I can say that for near sure is that:
I tried to grab the key pressed while booting up which will be done in the init process. You can define things within an init script also key presses but they do not work while _booting_! They will work when booted up only so I tried to find out any other methods. The most meaningful would be to do that manually by writing a program to grab the key events. But at least I can say that I found no ressources about doing that other then described.
Because of that and because the bootloader steps into factory reset before kernel loads I do not think that there is anything kernel related. I think that the battery pull out will work in any case...
-----
Sent from my SGH-I927 using XDA Android mobile app
xdajog said:
The trick is to take out the battery , pressing vol+down and power while putting back the battery again. This will work 100%.
Any tries without putting out the battery may not work.
The bootloader is in "aboot" partition and i do not think it will have to do with the kernel. The reason why I can say that for near sure is that:
I tried to grab the key pressed while booting up which will be done in the init process. You can define things within an init script also key presses but they do not work while _booting_! They will work when booted up only so I tried to find out any other methods. The most meaningful would be to do that manually by writing a program to grab the key events. But at least I can say that I found no ressources about doing that other then described.
Because of that and because the bootloader steps into factory reset before kernel loads I do not think that there is anything kernel related. I think that the battery pull out will work in any case...
Click to expand...
Click to collapse
Okay, just to make things weird, I had an opportunity to do the trick. It did not work, and I had to use the LG tool again.
It seems to bypass those keys pressed. Luckily download mode still works, or else I'd be screwed royally.
So going off-topic, why did I kill my phone again? Well, it all has to do with the LG Keyboard (onscreen) failing. With the ROM I have posted, it's "Unfortunately, LG Keyboard has stopped" over and over again. Yesterday, I made a version of the ROM with the AOSP Keyboard APK replacing the Lucky Goldstar version. Same problem, except this time it's "Unfortunately, AOSP Keyboard has stopped" over and over again. Okay, so I finished the setup wizard, turned on developer mode, fired up ADB, deleted the AOSP Keyboard from the /system/app folder and installed it as a userapp. No problem. So I thought, hmmm, would this APK work if I fire it in the /system/apps/bootup folder and let it install as a userapp when the ROM first boots?
I was going to test that theory, but when I rebooted into recovery (with the debloated ROM without any keyboard apps), wiped userdata and cache, I mispelled recovery when I issued the adb shell command "reboot recovery". That made it reboot into system, and things went downhill once I could not get past the LG Setup Wizard that was continually crashing.
So, LG tool'ed back to stock, rooted, recoveried and I thought, before I restore my precious backup I should try the ROM I created, answer that question once and for all. I wiped userdata and cache, rebooted back into recovery (spelling correct this time), flashed it, rebooted, and....
AOSP Keyboard crashed once (or more), in between all the LG Setup Wizard force closes. So I backed out and restored everything (again). I now have two pieces of homework:
Find a way to have developer mode on by default, so I can make (potentially) changes to the ROM if I am in this situation again.
Investigate if LG Setup Wizard is even needed, as it is really annoying me right now. If it's not, consider it gone!
Solve these two, and I should have something a lot closer to beta.
joel.maxuel said:
Okay, just to make things weird, I had an opportunity to do the trick. It did not work, and I had to use the LG tool again.
It seems to bypass those keys pressed. Luckily download mode still works, or else I'd be screwed royally.
Click to expand...
Click to collapse
hm... yea download mode should work always as this is totally independent from that. But the main difference in the latest sediKERNEL is that it completely ignores the bootloader arguments.
I thought always that the "Factory Hard Reset" screen was/is hardcoded within the bootloader but your tests showing that this can not be (fully) true. You should at least SEE the screen where you need to confirm the factory reset then. Well that could mean it either checks for the existence of kernel or this screen IS from the kernel itself! At least the last one could be tracked I will investigate that theory because if that is the case then there would be a hook where we could load TWRP instead e.g...
...
Update: Ok search is over. There is no trace found withing the kernel sources or the end result which contains the factory hard reset strings.
That said I think the LG factory reset needs a working kernel available...
That is my theory but could be "easy" verified/declined by following those steps. Maybe if you get into that situation again you could try?
deleting partition "boot" (dd /dev/zero..). If factory reset is still showing fine (it could be enough to still have a kernel in recovery). If not well then we need a working kernel/boot image to reach factory reset and you can ABORT HERE..
Then flash sediKERNEL to the boot partition and verify that it is booting.
from there delete the recovery partition (dd /dev/zero..).
Try to get into the factory reset again. If the screen "Factory Hard Reset" is displayed fine (it could be enough to either have a kernel in recovery or in boot). If not then we need a working kernel/recovery image to reach factory reset and you can ABORT HERE..
boot into system again
Now the wicked part: delete recovery partition and boot partition (dd ..) --> THIS MEANS: SOFT-BRICKING! but it is the only way to say it for absolutely sure (if the above both tries still showing the factory reset)..
turn out the battery. try to open the factory reset.
If the screen "Factory Hard Reset" is displayed that would be a clear decline of my theory!
If you do not see the screen "Factory Hard Reset" then it means we need a working kernel / boot / recovery partition in order to reach the factory reset screen!
well and now you need to use the download mode again to unbrick the device of course..
So going off-topic, why did I kill my phone again? Well, it all has to do with the LG Keyboard (onscreen) failing. With the ROM I have posted, it's "Unfortunately, LG Keyboard has stopped" over and over again. Yesterday, I made a version of the ROM with the AOSP Keyboard APK replacing the Lucky Goldstar version. Same problem, except this time it's "Unfortunately, AOSP Keyboard has stopped" over and over again. Okay, so I finished the setup wizard, turned on developer mode, fired up ADB, deleted the AOSP Keyboard from the /system/app folder and installed it as a userapp. No problem. So I thought, hmmm, would this APK work if I fire it in the /system/apps/bootup folder and let it install as a userapp when the ROM first boots?
I was going to test that theory, but when I rebooted into recovery (with the debloated ROM without any keyboard apps), wiped userdata and cache, I mispelled recovery when I issued the adb shell command "reboot recovery". That made it reboot into system, and things went downhill once I could not get past the LG Setup Wizard that was continually crashing.
So, LG tool'ed back to stock, rooted, recoveried and I thought, before I restore my precious backup I should try the ROM I created, answer that question once and for all. I wiped userdata and cache, rebooted back into recovery (spelling correct this time), flashed it, rebooted, and....
AOSP Keyboard crashed once (or more), in between all the LG Setup Wizard force closes. So I backed out and restored everything (again). I now have two pieces of homework:
Find a way to have developer mode on by default, so I can make (potentially) changes to the ROM if I am in this situation again.
Investigate if LG Setup Wizard is even needed, as it is really annoying me right now. If it's not, consider it gone!
Solve these two, and I should have something a lot closer to beta.
Click to expand...
Click to collapse
In order to turn on the usb debugger mode: within your ROM zip file modify this file "/system/build.prop"
Code:
persist.service.adb.enable=1
Optionally:
if you want to do root commands over adb I/you could modify in the "default.prop" file which is within the kernel's initrd:
Code:
ADD: ro.secure=0
REMOVE (if exist): ro.debuggable=0
Regarding your keyboard FCs:
I remember that I had the same issues within my Captivate ROM I build. There I tried to add the Kii Keyboard to the stock ROM image and that resulting in the same FC's you describing. My solution was to use another keyboard (in my case it was a samsung one) so I would suggest that you could try around with another keyboard instead of the AOSP one...
Good luck
xdajog said:
hm... yea download mode should work always as this is totally independent from that. But the main difference in the latest sediKERNEL is that it completely ignores the bootloader arguments.
I thought always that the "Factory Hard Reset" screen was/is hardcoded within the bootloader but your tests showing that this can not be (fully) true. You should at least SEE the screen where you need to confirm the factory reset then. Well that could mean it either checks for the existence of kernel or this screen IS from the kernel itself! At least the last one could be tracked I will investigate that theory because if that is the case then there would be a hook where we could load TWRP instead e.g...
...
Update: Ok search is over. There is no trace found withing the kernel sources or the end result which contains the factory hard reset strings.
That said I think the LG factory reset needs a working kernel available...
That is my theory but could be "easy" verified/declined by following those steps. Maybe if you get into that situation again you could try?
deleting partition "boot" (dd /dev/zero..). If factory reset is still showing fine (it could be enough to still have a kernel in recovery). If not well then we need a working kernel/boot image to reach factory reset and you can ABORT HERE..
Then flash sediKERNEL to the boot partition and verify that it is booting.
from there delete the recovery partition (dd /dev/zero..).
Try to get into the factory reset again. If the screen "Factory Hard Reset" is displayed fine (it could be enough to either have a kernel in recovery or in boot). If not then we need a working kernel/recovery image to reach factory reset and you can ABORT HERE..
boot into system again
Now the wicked part: delete recovery partition and boot partition (dd ..) --> THIS MEANS: SOFT-BRICKING! but it is the only way to say it for absolutely sure (if the above both tries still showing the factory reset)..
turn out the battery. try to open the factory reset.
If the screen "Factory Hard Reset" is displayed that would be a clear decline of my theory!
If you do not see the screen "Factory Hard Reset" then it means we need a working kernel / boot / recovery partition in order to reach the factory reset screen!
well and now you need to use the download mode again to unbrick the device of course..
Click to expand...
Click to collapse
Hopefully I don't end up in that situation again. However if I do, I still wouldn't be able to complete the test anyway because I would have no way of issuing (root) console commands. If I did, I could just execute my backup (I dd my partitions for this reason) restore plan (and get out of the mess easily).
Then I re-familiarized myself with this:
Code:
Enhancements:
Will ignore crappy LG bootloader args
Will not do a factory reset when kernel panics occur
Click to expand...
Click to collapse
What if the strings are in aboot, but the kernel flags merely throw the kernel into aboot if triggered by the hot-keys?
xdajog said:
In order to turn on the usb debugger mode: within your ROM zip file modify this file "/system/build.prop"
Code:
persist.service.adb.enable=1
Optionally:
if you want to do root commands over adb I/you could modify in the "default.prop" file which is within the kernel's initrd:
Code:
ADD: ro.secure=0
REMOVE (if exist): ro.debuggable=0
Regarding your keyboard FCs:
I remember that I had the same issues within my Captivate ROM I build. There I tried to add the Kii Keyboard to the stock ROM image and that resulting in the same FC's you describing. My solution was to use another keyboard (in my case it was a samsung one) so I would suggest that you could try around with another keyboard instead of the AOSP one...
Good luck
Click to expand...
Click to collapse
I will try the build.prop suggestion. It won't give me superuser (maybe you could do the default.prop modification?), but I could still install apks, which would have gotten me out of at least one mess. Although su would be nice. Could you integrate the modified default.prop into your kernel? :fingers-crossed:
As for the keyboards, I wonder if it's a permission thing. I will have to look at that when I get home. To be honest, I didn't look at what the permissions are set to (should be rw-r--r--), and I could/should rename the file to LatinIME.apk. There may also be a old library that is getting in the way. I also have a line on a different keyboard. Looks nice, just in the process of asking permission to use it first (based off of Google Keyboard).
sediKERNEL v1.5 released
Maybe the last version I release because no testing device anymore from now on:
sediKERNEL v1.5
Enhancements:
removed all kexec patches and kexec support because we do not need it atm (I want to avoid issues)
added version string to kernel (uname -a)
Fixes:
may fixes kernel crash in rare situations (kexec related)
Download:
see OP !
cheers
xdajog
i have LG Optimus L5 last year for 3 month. and some developed on him.
Not good phone the L3-L5-L7 phones LCD Quality is very low
Hi!
!!! First things first: big phat huge !!!THANKS!!! to the full TeamWin Team, SGCMarkus (initial twrp tree), Phoenix591 (for inspiration), Dees Troy (for his trees), z31s1g for his brilliant theme and Captain Throwback (inspiration, too) !!!
For Pie ROMs you should use 3.3.1 recovery, either OrangeFox (based on TWRP with many very useful additions, with Magisk module manager being only one of it :good: ), or good old TWRP itself. 3.3.1 needed for decryption of pie ROMs!
Feature list:
- capable of installing treble and/or vendorized ROMs
- Possibility to leave out lockscreen settings when restoring a backup (sometimes you have to delete them manually, otherwise no login into your restored ROM possible -.- You can bypass this with this. Note: lockscreensettings are independent from your encryption settings)
- Time and date is showed correctly, independent of /data
- some extra partitions (see below)
- Oreo 3.2.3-7: compiled with (modified) 8.1 TWRP branch
- Oreo recovery: Decryption of AOSP up to 8.1 and stock ROMs userdata is working (cherrypicked stuff for bringing that up), so, with this recovery, the urgent need for flashing no-verity-opt-encrypt zip isn't there anymore
Pie is not decryptable for the moment, neither with old Oreo recovery nor with newer PIe recovery: this is being worked on. Encryption changed in Pie, this needs some extra "love"
- everything working: backup, restore, decryption, time, mtp, adb, installing of treble or vendorized builds, themeable, .........
- modem image support: backup, restore, flashing of modem images either taken directly from kdz or via diskdump (this already was available but then broken at some point of time, sry for that! ).
- Same for OP image
Don't forget your timezone settings after flashing. Also there are some extra partitions you can mount/backup/flash/explore, like LAF, persist-LG and OP configs. There's the thought of some people to flash TWRP as a second copy to LAF partition to be on the sure side when it comes to ROM switching or sth like that. You can do this, anyway it's not really recommended (by me and some others) because you'll lose download mode, but you now have the option.
Also, if you want to restore an older backup, don't restore 'firmware' from it!!! This will break your WLAN, at least, and you have to flash a modem.img to get it back working.
For extra partitions: Some of them are needed for decryption (modem / persist-lg (drm)), some are for VoLTE (OP), time is stored on /persist/time (and /data/vendor/time), modem should be known and the LAF partition should be known already (described above).
For decryption: it works as it should. Therefore it is a little bit tricky to restore a ROM which has encrypted userdata, when you'd installed any other ROM in between. or formatted data There are some points to remember when restoring, a little guide is available in 3rd post, and some tipps too.
Some instructions:
How to flash?
If starting fresh with an unmodified phone, this thread should help you installing it
When you already have TWRP installed, you can flash this recovery from within TWRP:
- Tap "Install"
- Tap "Install image" button, located down right
- Locate your downloaded image and select it
- Select "recovery" from the list which shows up then
- Install; and reboot to recovery after installing immediately, don't use it for any other tasks until rebooted pls, as it may not function. Things can go bollox when phone wasn't rebooted to recovery after installing.
And of course you can flash it via fastbootmode. Reboot to bootloader (adb reboot bootloader; when magisk is installed, you can use magisk manager => module => menu on the top right => reboot to bootloader. You can reboot to recovery from there too) and then:
fastboot flash recovery <twrp-image-name.img>
When you experience errors or sth isn't working as it should in your opinion:
When an error occurs, pls supply me a log from TWRP, taken immediately after the error showed up. You can use the "Copy to SDCard" option (advanced options) in TWRP for this. Grab this file then and upload its content to pastebin.org.
I can't help without as much detailed info as you can supply. This should include at least following information: phone model, used TWRP image (exact name of image), task you wanted to do (which ROM e.g.).
There's now an optional version of TWRP available, which contains the inclusion of internal storage in data backups (IntSD version). Exclusions (folders which won't be backed up): TWRP, Movies, Music and Download folders. These won't be included in backups, as they can be really big.
With the recovery including internal storage you can backup to internal and external storage, no matter. The data_image recovery can backup its data image to external sd only, of course.
If you want to use data_image, system_image or internal storage included in data backup, first check your filesystem on your external sdcard. It needs to be capable of writing big files, which isn't the case with fat/fat16/fat32. You need exFAT (for stock) or ext4/ntfs (only available with custom kernel and/or AOSP based builds).
DOWNLOADS:
Oreo and Pie capable 3.2.3-7 TWRP:
Download links (always the latest and newest only; one version for all):
File name: TWRP-3.2.3-7-DataIMG.img (default)
MD5sum: aac1525f9bd85d6efbc0fb65bda4a904
MAIN Download: AndroidFileHost - TWRP-3.2.3-7-DataIMG latest
File name: TWRP-3.2.3-7-IntSD.img (non-default, includes main part of internal storage in data backup)
MD5sum: 23113ad33772a5f783dcabd09fa97ebb
MAIN Download: AndroidFileHost - TWRP-3.2.3-7-IntSD latest
Some additional words to different versions;
I personally use internal w/ sdcard backup, all my pics and almost everything possible app related on my phone is on external SDcard. Some data always remains on intSD (e.g. whatsapp, the Android folder which contains settings and app data too, k-9 mail folder and others), this needs to be in a backup for me. This is, what the intSD version does: but it leaves out the big folders (download, music, movie and TWRP).
As always: Use it at your own risk! You are the one who changes stuff on your phone, I'm not responsible for anything which happens to your phone. TWRP is powerful, be careful at what you do with it :good: And it just works.
All you need to compile this yourself:
[url]https://github.com/seader/android_device_lge_joan-twrp[/url]
[url]https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni[/url]
[url]https://github.com/seader/android_kernel_lge_msm8998[/url] (not really needed as a prebuilt kernel is used)
[url]https://github.com/seader/bootable_recovery-twrp[/url] (copy of twrp recovery with encryption cherrypicks and the stuff added. encrypt-8.1 branch = intSD version, master branch = DataIMG version)
Features:
- Treblelized / vendorized: one recovery for all
- Time and date working, getting this from persist partition
- decryption working for both stock and AOSP up to 8.1; Pie is being worked on [break atm ]
- additional partitions available
- "data_image" (default) and "internalSD included" (non-default) available
- Checkbox for leaving out lockscreensettings when restoring data partition (available in main settings and restore settings; in supported themes in main settings only!)
- TWRP app removed
Changelog:
21. April 2019, TWRP 3.3.0-00, new Pie recovery:
- Newest sources used, pie branches everywhere
- tiny menu structure overhaul
- almost all the stuff from Oreo recovery back in, except:
-- decryption
-- data image function
-- inclusion of internal sdcard in backups
-- everything else is working and included (special partitions, time and date working, all the default functions working, exclusion of lockscreen settings when restoring, TWRP su and app removed)
08. Dec. 2018, TWRP 3.2.3-7, old Oreo recovery:
- OP image flashing function added
- Sources update
Older:
09. Nov. 2018:
- treble ROMs are now installable
- brought back modem partition, fully working (remember to NOT restore the "firmware" partition!)
02. Nov. 2018:
- switched from prebuilt kernel to inline kernel building for easier future updates in terms of pie / treble
- removed modem/firmware partition from backup list
- included some QCOM optimizations for buildtime
- excluded TWRP app, install prompt for this app shouldn't pop up anymore (not tested by me)
- disabled logcat
26. Oct. 2018:
- increased compatibility for some scripts / flashable zips
25. Oct. 2018:
- added optional recovery with internal sd content added to data backups (the "data_image" version is the one you already may have installed, like 3.2.3-4-f, just renamed and containing the fstab edits)
- little fstab changes regarding modem / firmware: pls update
18. Oct. 2018:
- removed decrypt files from RAMdisk and added a link to firmware instead
- added possibility to leave out lockscreen-db* files while restoring
- added data_image option; read post #3 pls
15. Oct. 2018
- added decryption of stock and AOSP based ROMs
12. Oct. 2018, pt. 2 (succesful)
- finally fixed the OP mysery... A typo from my side, sry!!
12. Oct. 2018, pt. 1 (failed)
- Added versioning, TWRP now is 3.2.3-1
- re-sorted partitions list
- OP partition won't cause an error anymore on phones where it doesn't exist; sry, didn't know, that US998 doesn't have a OP partition! In addition, it doesn't look for me like there is an equivalent partition on these phones...?
11. Oct. 2018:
- fixed some warnings
- added some additional partitions
- made OP flashable and backupable
- made vendor 'removable', so no warnings anymore for non-vendor devices
- included logcat
- added local_manifest, patch for timefix and a little description in readme
How to (re)boot to TWRP?:
If your phone is rooted:
- Magisk has options to reboot to different targets like bootloader or recovery, but this menu is a little bit hidden: you can access it by starting Magisk.Manager, going to the "Module" menu, tapping on the three dot menu on the top right. Then select your target
- If a terminal emulator is installed, open it, type "su" followed by enter and type "reboot recovery"
- You can do the same with an adb shell, open a shell and type the commands from above, they're the same
- There also are apps for rebooting to recovery or other targets. Just search around in PlayStore
- The good old "button dance" When phone is powered off, press the volume down key and power button at the same time. When a first sign of life is seen on display, immediately release the power button, but just to instantly press it again. A menu will show, which wants you to do a factory reset: do it You have to confirm this two times, and afterwards TWRP will boot without performing a factory reset. TWRP is compiled with a flag which recognizes this procedure and hinders the bootloader to pass the command for factory resetting.
Some additional infos:
- vendor partition: it's there for everyone (no more present in TWRP 3.3!). It is flagged as removable, so it can be leaved in fstab without producing errors. Ppl w/o a vendor partition (which you need to create via script when you want to flash treblelized AOSP builds) shouldn't let themselves get confused about that, it's an additional entry like external sdcard or USB OTG.
- kdzwriter: still untested (and no more present in 3.2, in 3.3 it never was), respectively tested with 21h kdz, which told me "not applicable for this device". I for know mark this as non-working. I'll leave it in this recovery, for future updates and other testers with other kdz file (no more inside).
- data image backup: chose SDCARD for backup location, and enable compression otherwise it's an ~55gb image lol. (<= it IS an 55gb image, no matter of compression. Compression doesn't work for images! So prepare for a huuuge file, and think about your filesystem on sdcard (can it handle big files? For AOSP you can chose ext4 or exfat, for stock exfat only)). This option includes internal sdcard, which is in /data/media. This can be used to do a real full backup with absolutely everything needed (incl. /sdcard/Android folder, your music, vids or anything else e.g.).
- time: when it goes wrong again, just delete the /persist/time folder from within recovery, boot up android and reboot to recovery. Should be "fixed" now. This folder isn't present in 3.3: here you can try to delete "/persist/.twrps" file (you need to re-setup TWRPs settings then) and the folder "/data/vendor/time", followed by a reboot to ROM and then to recovery again. May ned one or two reboots more to ROM or TWRP to get TWRP recognize the time correctly.
Encryption:
There's something you need to remember when restoring encrypted backups, after you have flashed another ROM (which differs from the one to restore): your secure startup settings. Write them down or have them in mind, you need it. Steps for restoring an stock or AOSP data partition encrypted backup:
- format data
- first restore your ROM only partially, means only boot and system (and only that)
- boot into your ROM you've restored
- go through the setup manager and afterwards hop into security and encryption settings
- encrypt your phone exactly the same way it was in your backup you want to restore encrypted userdata from; for 3.3 recovery it's only needed to set up any encryption config, you can put in what you want for yourpin / pattern / passwd
- if it is encrypted already, you only have to redo security settings. Use the same settings as in the backup, means pin/pattern/pw need to be the same *and* secure startup too, if you've chosen it before (see above for pie and 3.3 recovery: you can use anything. Youcan try this with oreo too, maybe it works too)
- reboot to recovery again and restore your encrypted data partition (from the backup you've already restored system and boot from)
- now you're good to go You should tick "Don't restore lockscreen settings" for leaving out the lockscreen.db* files. Otherwise you have to delete them manually to be able to get into your ROM, because lockscreen settings will prevent it. Lockscreen settings btw. are independent of encryption settings. It's the same pattern/pin/pw used, but another building site.
If you want to encrypt your AOSP ROMs userdata (only possible if you are on android up to 8.1), you can use the attached fstab file (it's for LOS 15.1 non treble), either as an example or to overwrite the existing one. Have a look at the line which contains "userdata". The fstab file is located in /system/vendor/etc/. Unzip the attachment (it is no flashable zip), put it in the correct location and overwrite the original file. Reboot your phone, then go into security settings, you should now be able to encrypt it.
This TWRP can't handle decryption of AOSP 9.0 encrypted data atm, you need 3.3 TWRP for that. There changed something from 8.1 to 9.0 which means the new stuff needed new recovery, which is included with 3.3 recovery.
Additional stuff:
- Recommended theme (original thread): [THEME][TWRP] TWRP Materialised - Black / Dark / Light / Play [27/01/18]
Edited versions of this theme, with menu entries added:
Black and Dark theme versions available here. There are two version of each: one showing "incl. internal" and one without, both have the lockscreen settings exclusion checkbox included. You'll now find this menu entry in main settings page only, it was there before too, but there was an additional entry when restoring a backup. This is gone in this theme as it didn't fit the way I wanted it to fit Pick the one you need.
Included storage: version for recovery "IntSD"
Without storage: version for recovery "DataIMG"
can i just update it by flashing it in the twrp 3.2.1-02 treble as img?
seadersn said:
reserved #2
Click to expand...
Click to collapse
What's the difference between the AFH file and Mega file?
Sent from my LG-H932 using XDA Labs
black metallic said:
can i just update it by flashing it in the twrp 3.2.1-02 treble as img?
Click to expand...
Click to collapse
yes, and then reboot to recovery again
TWRP can simply be updated that way.
BROKEN1981 said:
What's the difference between the AFH file and Mega file?
Sent from my LG-H932 using XDA Labs
Click to expand...
Click to collapse
Im 99.9% sure thats a mirror, incase AFH is slow again.
SGCMarkus said:
yes, and then reboot to recovery again
TWRP can simply be updated that way.
Im 99.9% sure thats a mirror, incase AFH is slow again.
Click to expand...
Click to collapse
I figured as much. I had a night that AFH wanted 3 hours to download TWRP. A Google speed test gave me 78mbps.
So yeah, seems Mega is the way to go
Sent from my LG-H932 using XDA Labs
First, thanks for this. Second, what's the difference b/w the earlier "tfp" img and this "tfp-kdz" img?
joarce said:
First, thanks for this. Second, what's the difference b/w the earlier "tfp" img and this "tfp-kdz" img?
Click to expand...
Click to collapse
Stated in op. This image allows for writing of some stuff from kdz files.
Sent from my LG-US998 using Tapatalk
jip, thx
SGCMarkus said:
yes, and then reboot to recovery again
TWRP can simply be updated that way.
Im 99.9% sure thats a mirror, incase AFH is slow again.
Click to expand...
Click to collapse
cool, can i still use treble and wipe tge vendor?
I don't know if I understand it correctly. Pls correct me If I'm wrong.
The benefit of KDZ Writer is that we can update system from KDZ in TWRP.
Thanks will try this
Running it now (H932). Thank you.
seadersn said:
So, here it is: a new (the third for v30...?) thread for an already existing recovery.
Click to expand...
Click to collapse
Actually the 4th, but thank you!
First one was "H930" (which confused US998 users when they got bootloader unlock and root), 2nd one was for "US998" to counteract the H930 confusion -- but really should have been "V30" or "JOAN". @SGCMarkus then made one which not only was Oreo compatible but was "unified". Now this is 4th.
The unification thing is important. I saw over in Moto Quark threads (Droid Turbo, Moto Maxx, Moto Turbo -- all the same phone) where one initial forum was split into two because Droid Turbo at first didn't have bootloader unlock and root, the OTHER Quarks (Moto Maxx, Moto Turbo) jumped ahead in development. Then a year later when Droid Turbo got bootloader unlock and root, thanks to Sunshine, the CM dev at the time generously modified his kernel to include Droid Turbo (which was in a different "dead" forum by then). Thus all the Quarks were unified in development and could all run the same ROMs, same TWRP.
Whereas with one LG flagship phone (which I can't find right now), starting having split development. TWRP and dedicated ROMs for European (which again got bootloader unlock first, thanks to LG's mysterious ways) but then separate older TWRP and a few ROMs for the North America open market. Maybe that's improved now, which is why I can't find it, but I remember thinking "that's not right" and I didn't want that to happen to the V30.
Is the vendor partition mountable ?
Are trebleized ROMs flashable ?
Thanks for providing the new, current version of TWRP. V30 really needed an update for this. No more incorrect times/dates and Magisk giving an error due to false time/date.
Can you give a quick "dummies " tutorial on how to replace the old twrp with this new version using twrp?
Thx.
gimpy1 said:
Can you give a quick "dummies " tutorial on how to replace the old twrp with this new version using twrp?
Thx.
Click to expand...
Click to collapse
I put the new image on sd card. Booted to current TWRP. Flashed new image to recovery partition. Rebooted to system.
Mine took a few reboots to settle in. Couldn't get to it using reboot manager app. Was getting ready to do button dance, but tried reboot app one more time and it booted me to new TWRP. Everything's great now. I don't know if you're supposed to boot back to recovery after flashing the new image. That's what I didn't do.
Sent from my LG-US998 using Tapatalk
Krekos/CZ/ said:
I don't know if I understand it correctly. Pls correct me If I'm wrong.
The benefit of KDZ Writer is that we can update system from KDZ in TWRP.
Click to expand...
Click to collapse
jep, that's the intention of this tool. have a look at the pic in first post there's more to flash via kdzwriter.
FcBayernMinga said:
Is the vendor partition mountable ?
Are trebleized ROMs flashable ?
Click to expand...
Click to collapse
comes this evening, i need a bit of time for relaxing now, but i don't get it because of kids xD
Ballroomblitz said:
... I don't know if you're supposed to boot back to recovery after flashing the new image. That's what I didn't do.
Sent from my LG-US998 using Tapatalk
Click to expand...
Click to collapse
jep, this is needed! after flashing of new recovery reboot to recovery. :good:
Disclaimer :
YOU are choosing to make these modifications
and YOU are the only one responsible for any damages done to your device
==== Notes/Prerequisets/Links ====
* you should have already unlocked your bootloader (if not then start the process as soon as possible because it's going to take a while).
* backup your stuff, make sure you have sufficient charge just in case anything went wrong.
* download the unoffical TWRP port from Here (get the latest version)
* get the latest magisk from Here
* install device usb drivers
* set up fastboot properly Method A, Method B (using chocolaty)
- - - - - - - - - - - -
instructions :
1- shutdown your device completely.
2- enter fastboot mode by pressing and holding the Vol Down + Power Button button until you see xiaomi's mi bunny with a blue "fastboot" text underneath it.
3- connect your device to your pc via usb cable.
4- on your pc check if you have fastboot configured properly and your device recognized by typing:
Code:
fastboot devices
if it's detected then you're good to proceed to the next step.
5- flash the twrp recovery image by using the usual fastboot commands.
Code:
fastboot flash recovery recovery.img
in our case it should look something like:
Code:
fastboot flash recovery recovery-TWRP-3.3.0-0517-XIAOMI8LITE-CN-wzsx150.img
6- unplug usb cable and hold the Vol up + Power Button (don't let go of the buttons untill the devices vibrates) and let it boot to the twrp recovery you just installed.
7- if you rebooted successfully, you should be at TWRP splash screen, if greeted with a slider slide it and continue.
8- in the main menu of TWRP, go to "Install" choose the magisk zip file you downloaded and flash it, when done reboot the device.
9- congratulations friend, you're now rooted and have TWRP as your recovery Happy Flashing :highfive:
- - - - - - - - - - - -
Optional : install Orange Fox Recovery from Here (Supports Encryption and MIUI OTA updates).
- - - - - - - - - - - -
2020-02-25 Last upated and working on MIUI Global Stable 11.0.8 Pie
just in case
Is it possible to just accesss the TWRP to edit build.prop enabling camera2 Api?
If I remember is something about:
fastboot boot twrp.img
and then:
setprop persist.camera.HAL3.enabled 1
Without the need of root the device.
Thanks for the guide!
antonioli84 said:
Is it possible to just accesss the TWRP to edit build.prop enabling camera2 Api?
If I remember is something about:
fastboot boot twrp.img
and then:
setprop persist.camera.HAL3.enabled 1
Without the need of root the device.
Thanks for the guide!
Click to expand...
Click to collapse
Sorry for the late reply
No problem
+
I'm not really sure if you could do it with TWRP's built in file manager without root
You could try
I've seen people do it with adb but haven't had the chance to try it yet
take a look here : https://www.google.iq/amp/s/amp.red...gswg/camera2_api_without_root/#ampf=undefined
And here (this has some very useful info)
https://www.google.iq/amp/s/forum.x...o/guide-enable-camera2-api-root-t3690366/amp/
malek_anas_97 said:
Sorry for the late reply
No problem
+
I'm not really sure if you could do it with TWRP's built in file manager without root
You could try
I've seen people do it with adb but haven't had the chance to try it yet
take a look here : https://www.google.iq/amp/s/amp.red...gswg/camera2_api_without_root/#ampf=undefined
And here (this has some very useful info)
https://www.google.iq/amp/s/forum.x...o/guide-enable-camera2-api-root-t3690366/amp/
Click to expand...
Click to collapse
Thank you for the reply. I've done it in Mi A1 but I don't know if it's the same procedure because of the MIUI. One of the links says that we have to change something in kernel to do it.
It would be good expert people try it to see what method works. It's sad that the Mi 8 Lite doesn't have a proper forum until now.
antonioli84 said:
Thank you for the reply. I've done it in Mi A1 but I don't know if it's the same procedure because of the MIUI. One of the links says that we have to change something in kernel to do it.
It would be good expert people try it to see what method works. It's sad that the Mi 8 Lite doesn't have a proper forum until now.
Click to expand...
Click to collapse
i enabled it in stock miui by adding "persist.camera.HAL3.enabled=1" to my build prop and then rebooting
malek_anas_97 said:
i enabled it in stock miui by adding "persist.camera.HAL3.enabled=1" to my build prop and then rebooting
Click to expand...
Click to collapse
Thanks for the reply.
What method did you use to change build.prop?
Can't find a similar guide for the Mi 8, is it the same process as for the lite ?
antonioli84 said:
Thanks for the reply.
What method did you use to change build.prop?
Click to expand...
Click to collapse
i'm rooted with magisk
with a file manager, i use this one https://play.google.com/store/apps/details?id=nextapp.fx&hl=en
+
this addon https://play.google.com/store/apps/details?id=nextapp.fx.rr
the file is in /system/build.prop
webvan said:
Can't find a similar guide for the Mi 8, is it the same process as for the lite ?
Click to expand...
Click to collapse
https://www.youtube.com/watch?v=YI2CtIIPVaI
malek_anas_97 said:
i'm rooted with magisk
with a file manager, i use this one https://play.google.com/store/apps/details?id=nextapp.fx&hl=en
+
this addon https://play.google.com/store/apps/details?id=nextapp.fx.rr
the file is in /system/build.prop
Click to expand...
Click to collapse
Thank you man. I would like to know if anyone can do the trick without root. I've bought a Mi 8 Lite for my wife and it would be nice to her receive the updates from Xiaomi and use the GCam the same way she receives in Mi A1.
malek_anas_97 said:
7- if you rebooted successfully, you should be at TWRP splash screen
you will be greeted with a slider slide it and continue
Click to expand...
Click to collapse
Hi Malek,
When you first boot to TWRP, were you asked for the decryption password? If yes, did you just format data to skip this? I was asked for the password and my screen PIN did not work. Just wondering if there is no other choice that to format data.
Official Xiaomi Mi 8 Lite (Platina) telegram group 24/7 support and latest ROM news posted here first!
Rules :
1 - English only.
2 - Be polite.
3 - Don't spam.
Gp Link : https://t.me/joinchat/DXcdlA0r5XYI-ooJlO8IlQ
Please Join
chan200606 said:
Hi Malek,
When you first boot to TWRP, were you asked for the decryption password? If yes, did you just format data to skip this? I was asked for the password and my screen PIN did not work. Just wondering if there is no other choice that to format data.
Click to expand...
Click to collapse
to this point i don't really understand how encryption works on this device
it's on by default i guess
so what i finally did the other day to be kinda sure of what's happening
i flashed stock rom in Mi Flash with the clean all option checked
i set up the phone for the first time without setting any fingerprint or security or anything
after that i flashed twrp
from twrp i flashed dm verity and encryption disable
get it from here https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389
(make aure to read the first post)
then formatted data
after that the booted up and i set it up normally
and then booted to twrp again to flash latest magisk
now when i check if my device is encrypted using this adb command "adb shell getprop ro.crypto.state"
i get "unencrypted"
so i guess it works? i don't know lol
malek_anas_97 said:
i flashed stock rom in Mi Flash with the clean all option checked
i set up the phone for the first time without setting any fingerprint or security or anything
after that i flashed twrp
from twrp i flashed dm verity and encryption disable
Click to expand...
Click to collapse
It looks like your phone was not encrypted (or was encrypted with MIUI's default password) when you flashed TWRP, as you had clean flashed stock then set up without setting security. That you could start TWRP to flash "dm versity and encryption disable", without being asked to input a password first, shows that TWRP was able to handle the default encryption (or no encryption) of the clean MIUI install.
In my case I already have a screen PIN set up on my phone before trying to install TWRP, and this version of TWRP can't handle it. Another difference is that I have not actually flashed TWRP onto the phone but have merely booted to TWRP via fastboot. I wouldn't have thought that this would affect TWRP's ability to decrypt the DATA partition though.
In hindsight I should have just done the minimum setup after the phone was wiped by the bootloader unlocking process before installing TWRP. I guess that unless there is another version of TWRP out that can handle the screen PIN encryption, my only option is to wipe clean the phone so that I can repeat what you did. However, now that I have reinstalled everything on the phone, I am a bit reluctant to do this just to get root. I think I will wait until there is an AOSP ROM available and do the wipe/format at the time of switching. Hopefully I don't have to wait too long!
chan200606 said:
In my case I already have a screen PIN set up on my phone before trying to install TWRP, and this version of TWRP can't handle it. Another difference is that I have not actually flashed TWRP onto the phone but have merely booted to TWRP via fastboot. I wouldn't have thought that this would affect TWRP's ability to decrypt the DATA partition though.
Click to expand...
Click to collapse
An update: I've now got over this encryption thing. It is indeed the screen PIN that was causing me problems. While I had tried removing the PIN and all fingerprints last time, I had powered down the phone immediately after removing the PIN and booted into fastboot mode. Today I thought I better try it one more time: after removing the PIN, reboot the phone to system first before powering it down and restarting in fastboot mode. This cycles the phone system at least once without the PIN so hopefully any traces of the PIN would really be wiped. And indeed it works - the booted TWRP (i.e. not flashed to phone) has no problems reading my phone and I could install Magisk.
So I now have stock recovery + Magisk on my Mi8 Lite, which is the minimum I wished to do to it. Maybe at a later date I would flash TWRP onto the phone as well.
i cant unlock my mi 8 lite, say user portrait scores too low or black, i activate all need, oem, usb, sync device. no work, any help?
Everything is ok for global rom.
For the language twrp asked directly at first launch for it and you don't need anymore magisk, you can install it directly from twrp. ( advance/install root ) it'll install the version 17.1 and you can update it from the app on the phone.
No problem for reboot into twrp ( volume up + power) even with fingerprint.
kax001 said:
i cant unlock my mi 8 lite, say user portrait scores too low or black, i activate all need, oem, usb, sync device. no work, any help?
Click to expand...
Click to collapse
i really have no idea why this is happening to you
i searched online and it seems like you're not the only one having this
vonclutch said:
Everything is ok for global rom.
For the language twrp asked directly at first launch for it and you don't need anymore magisk, you can install it directly from twrp. ( advance/install root ) it'll install the version 17.1 and you can update it from the app on the phone.
No problem for reboot into twrp ( volume up + power) even with fingerprint.
Click to expand...
Click to collapse
yeah i know there's no problem in turning the phone off then rebooting manually with the buttons
but i was talking about using "fastboot reboot recovery" command to reboot to recovery from fastboot directly
anyways glad everything worked for you friend : )
OrangeFox Recovery For XZ Premium
Adapt By SJll
禁止任何内置推广APP以及收费ROM使用或参考本项目
Code:
/*
* Your warranty is now void.
*
* We're not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this recovery
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
OrangeFox is FREE SOFTWARE
Download:
Link
INSTALLATION:
1. Download th zip file to your device
2. Reboot to your custom TWRP-based Recovery
3. Install the OrangeFox zip file as a normal zip
4. Enjoy!
ChangeLog
Pie-V3.3.1-V1:
Update blob to android Pie.
V3.3.1-V2:
Fix mountpoint of persist partition.
Credits
* TeamWin - for TWRP
* The OrangeFox Team - for your hard work
* Cryptomilk for init tweaking.
FEATURES:
* Increased compatibility with TWRP
* Updated with latest TWRP commits
* Built-in support for installing init.d functionality
* Built-in support for installing Magisk
* AromaFM [only for some devices]
* Password
* Better language support
* Optimized versions of community scripts
* Fox theme engine:
- choice of theme (black, dark, etc)
- choice of color scheme
- choice of splash screen
* Alternative lockscreen
* And many more!
Contributor
@Sjll
Source code
Github
Update date
2019.08.01
Screenshots
- see below
Nice
我用twrp3.2.1刷入这个zip后重启还是twrp,解出img来用trwp app刷进recovery分区也一样。系统用的是马大官改,没有刷你的pt。
I flashed this zip file via twrp 3.2.1 , but reboot to recovery still gets twrp 3.2.1 working on it. the same thing happened using twrp app to flash unpacked img file. I haven't flashed your project treble yet.
leiersai said:
我用twrp3.2.1刷入这个zip后重启还是twrp,解出img来用trwp app刷进recovery分区也一样。系统用的是马大官改,没有刷你的pt。
I flashed this zip file via twrp 3.2.1 , but reboot to recovery still gets twrp 3.2.1 working on it. the same thing happened using twrp app to flash unpacked img file. I haven't flashed your project treble yet.
Click to expand...
Click to collapse
检查你的刷入分区,如果还是不行,获取root后用工具箱类的app试试。
Check the partition you flashing in, if still error, try to flash via some app tool after getting root permission.
I finally made it work by flashing via computer through fastboot. but now I'm facing another problem, it shows my data patition is encrypted, but I don't know the password. I'm using gesture lockscreen and fingerprint in Android. my device has been rooted via magisk.
----------------------------------------
now i knew what is going wrong... temporarily give up.
leiersai said:
I finally made it work by flashing via computer through fastboot. but now I'm facing another problem, it shows my data patition is encrypted, but I don't know the password. I'm using gesture lockscreen and fingerprint in Android. my device has been rooted via magisk.
----------------------------------------
now i knew what is going wrong... temporarily give up.
Click to expand...
Click to collapse
If you forget your password, you need to format userdata partition.
I'm install through newest twrp as img and working great. Awesome job on original twrp some kernels won't let me get into twrp. On Orangefox is OK.
Sjll said:
If you forget your password, you need to format userdata partition.
Click to expand...
Click to collapse
I know my passwords, but not that secret key I even have no idea about when my phone encrypted /data by itself...
Benio9436 said:
I'm install through newest twrp as img and working great. Awesome job on original twrp some kernels won't let me get into twrp. On Orangefox is OK.
Click to expand...
Click to collapse
Enjoy it!
leiersai said:
I know my passwords, but not that secret key I even have no idea about when my phone encrypted /data by itself...
Click to expand...
Click to collapse
I didn't support dm-verify in OrangeFox, so you could only format it.
On the Pie-V3.3.1-V1 variant of OrangeFox I'm noticing some strange issues.
Some scripts cannot properly mount or unmount /system, with all kinds of excuses such as "device or resource busy", or just outright "no such file or directory"... It can also happen after a nandroid backup. While mostly harmless, sometimes it can cause addon.d to break (such as OpenGApps and Magisk) and I need to manually flash back things that addon.d should have guaranteed their survival at that time.
For now it can be worked around by flashing only one zip at a time and reboot to recovery to flash my next one.
By the way, it seems backing up/restoring the entire system image is safer than only the contents of the system partition, as back then with stock ROM (eXistenZ) I noticed that if I back up only the contents of system partition with TWRP then restoring it later, the system would bootloop at Sony logo, whereas restoring a backup of entire system image would boot fine.
LSS4181 said:
On the Pie-V3.3.1-V1 variant of OrangeFox I'm noticing some strange issues.
Some scripts cannot properly mount or unmount /system, with all kinds of excuses such as "device or resource busy", or just outright "no such file or directory"... It can also happen after a nandroid backup. While mostly harmless, sometimes it can cause addon.d to break (such as OpenGApps and Magisk) and I need to manually flash back things that addon.d should have guaranteed their survival at that time.
For now it can be worked around by flashing only one zip at a time and reboot to recovery to flash my next one.
By the way, it seems backing up/restoring the entire system image is safer than only the contents of the system partition, as back then with stock ROM (eXistenZ) I noticed that if I back up only the contents of system partition with TWRP then restoring it later, the system would bootloop at Sony logo, whereas restoring a backup of entire system image would boot fine.
Click to expand...
Click to collapse
Have you disabled the MIUI OTA?
Sjll said:
Have you disabled the MIUI OTA?
Click to expand...
Click to collapse
What is MIUI OTA? I did see it mentioned something about XiaoMi or MIUI but I remember it said "DISABLED".
After all, I'm not flashing anything XiaoMi or MIUI related (I'm flashing just LOS, OpenGApps, Magisk and modules).
LSS4181 said:
What is MIUI OTA? I did see it mentioned something about XiaoMi or MIUI but I remember it said "DISABLED".
After all, I'm not flashing anything XiaoMi or MIUI related (I'm flashing just LOS, OpenGApps, Magisk and modules).
Click to expand...
Click to collapse
It's in settings and "MIUI OTA" is enabled by default.
I confirmed this issue, but I had no idea to solve it now. And the core function of OrangeFox is fine. You can compare my device tree with OrangeFox official devices'. We may lack of some blob or have some wrong settings
Sjll said:
It's in settings and "MIUI OTA" is enabled by default.
I confirmed this issue, but I had no idea to solve it now. And the core function of OrangeFox is fine. You can compare my device tree with OrangeFox official devices'. We may lack of some blob or have some wrong settings
Click to expand...
Click to collapse
I can confirm the MIUI OTA was enabled. However, disabling it has no effect regarding the failures in handling the /system partition. Also, it seems the recovery can determine whether the package is a MIUI OTA, as I recall it says MIUI OTA support DISABLED when flashing ROM zips such as LOS.
When mount/unmount operations on /system fails, the error usually reads "device or resource busy". Guess something is locking the system partition for too long.
While the issue doesn't impact much when flashing zips, it can potentially prevent addon.d scripts from succeeding causing loss of certain OTA survival capable components such as OpenGApps and Magisk.
EDIT: Also, when the "device or resource busy" error occurs, I also can't mount/unmount system partition from the Mount screen.
EDIT 2: It seems the Orangefox tree uses a prebuilt kernel... is that kernel image also overclocked? It appears the phone would overheat while in recovery, and the overheated state would carry over and cause freezes/reboots due to the SoC hit certain power/thermal thresholds, as the logcat is simply cut off without anything implying kernel panics or fatal errors.
可以汉化不
Amazing post
Any stable version
any chance of updating this for andriod 11?
i am trying to build it myself but i am a total beginner.
there is an aosp a11 rom for maple now and i really need the magisk manager recovery that orangefox provides!
ok i cant get this to work,
ive used your device tree to build with three different kernels and it compiles every time. i can flash it and it boots ok, but touchscreen doesnt work so i cant get into recovery.
is there something i need to do to get touchscreen working before i build?
This is the new thread for Pie & 10 TWRP Recovery 3.3.1-x
Feature list:
- Pie stock ROMs are fully decryptable with this TWRP, either protected with secure startup or without :good: OREO encrypted userdata is not decryptable with 3.3 . However, if you're on encrypted oreo and update to pie stock, either via zip or kdz, crypto gets migrated and you're good to go in terms of access to your encrypted data with 3.3. So, with this recovery, the urgent need for flashing no-verity-opt-encrypt zip isn't really there anymore
- everything working: backup & restore even with encrypted userdata, no matter if it's from oreo or pie. If you restore a backup containing an encrypted userdata, you'll need to format userdata before, for crypto removal. But only when coming from another encrypted ROM, otherwise you can just restore, boot up (it will use the encryption settings you"ve set up) ; decryption; time & dat; mtp; adb; installing of ROMs and zips in general; themeable; .........
- Possibility to leave out lockscreen settings when restoring a backup (sometimes you were forced to delete them manually, otherwise no login into your restored ROM possible -.- You can bypass this with this. Note: lockscreensettings ≠ encryption pin/pw/pattern.)
- Time and date is shown correctly, independent of /data. This should work after a few boots of ROM and TWRP, TWRP needs to get the data once and later on it will then be calculated from persist's settings file.
- modem image support: backup, restore, flashing of modem images either taken directly from kdz or diskdump. Same for OP partition (not present on USA and some others possibly)
- For removing encryption completely you can now do it as already known, via format userdata. Crypto is removed with it now again.
- busybox instead of toolbox/toybox, for better zip compatibility as it looks for now
- Pie 3.3.1-x: compiled with full 9.0 TWRP sources
- capable of installing every ROM and zip files
- some extra partitions (see below)
Don't forget your timezone settings after flashing. Also there are some extra partitions you can mount/backup/flash/explore, like LAF, persist-LG and OP configs. There's the thought of some people to flash TWRP as a second copy to LAF partition to be on the sure side when it comes to ROM switching or sth like that. You can do this, anyway it's not really recommended (by me and some others) because you'll lose download mode, but you now have the option.
For extra partitions: Some of them are needed for decryption (modem / persist-lg (drm)), some are for VoLTE (OP), time is stored on /persist/time (and /data/vendor/time), modem should be known and the LAF partition should be known already too (described above).
For decryption: it works as it should. Therefore it is a little bit tricky to restore a backup of a ROM which had encrypted userdata, when you'd installed any other ROM in between. There are some points to remember when restoring, a little guide is available in old thread's third post (https://forum.xda-developers.com/showpost.php?p=77839649&postcount=3), and some tipps too.
Some instructions:
How to flash?
If starting fresh with an unmodified phone, this thread should help you installing it
When you already have TWRP installed, you can flash this recovery from within TWRP:
- Copy the new image file to one of your phone storages
- Tap "Install"
- Tap "Install image" button, located down right
- Locate your downloaded image and select it
- Select "recovery" from the list which shows up then
- Install; and reboot to recovery after installing immediately, don't use it for any other tasks until rebooted pls, as it may not function. Things can go bollox when phone wasn't rebooted to recovery after installing.
And of course you can flash it via fastbootmode. Reboot to bootloader (adb reboot bootloader; when magisk is installed, you can use magisk manager => module => menu on the top right => reboot to bootloader. You can reboot to recovery from there too) and then:
fastboot flash recovery <twrp-image-name.img>
How to (re)boot to TWRP?:
If your phone is rooted:
- Magisk has options to reboot to different targets like bootloader or recovery, but this menu is a little bit hidden: you can access it by starting Magisk.Manager, going to the "Module" menu, tapping on the three dot menu on the top right. Then select your target
- If a terminal emulator is installed, open it, type "su" followed by enter and type "reboot recovery"
- You can do the same with an adb shell, open a shell and type the commands from above, they're the same
- There also are apps for rebooting to recovery or other targets. Just search around in PlayStore
- The good old "button dance" When phone is powered off, press the volume down key and power button at the same time. When a first sign of life is seen on display, immediately release the power button, but just to instantly press it again. A menu will show, which wants you to do a factory reset: do it You have to confirm this two times, and afterwards TWRP will boot without performing a factory reset. TWRP is compiled with a flag which recognizes this procedure and hinders the bootloader to pass the command for factory resetting.
This time no optional version of TWRP is available, it's "one for all". This TWRP works for every V30 model, and only for them. I removed vendor partition too btw, there isn't any active development about that, so it's useless and only confuses ppl. DataImage function is available.
If you want to use data_image, system_image or internal storage included in data backup, first check your filesystem on your external sdcard. It needs to be capable of writing big files, which isn't the case with fat/fat16/fat32. You need exFAT (for stock) or ext4/ntfs (only available with custom kernel and/or AOSP based builds).
CHANGELOG:
February 23rd, 2020, TWRP 3.3.1-2:
- corrected blocksize for formatting crypto related partitions
- included timezone data, maybe helps some ppl with time still not showing correct; should speed up time calc
- used pre-compiled full mke2fs and e2fsdroid binaries
- enabled ntfs experimental support (rw in kernel, NTFS_3G flag in twrp / ofox)
- minimal tweaks
- enabled F2FS and NTFS support
January 1st, 2020, TWRP 3.3.1-1:
- Formatting problem solved, TWRP now removes crypto as it should when user initiates a data format
- small fixings like checkbox layout in restore menu
- Moved a LOGERR to LOGINFO: "E: Unable to decrypt FBE device". Couldn't get rid of it with our needed config...
Dec. 30th, 2019, TWRP 3.3.1-0:
- initial first version
- almost everything working like in 3.2 oreo TWRP
- Formatting your device doesn't remove crypto from disk, so a "fresh" (formatted) userdata gets disturbed by old security lock
DOWNLOADS:
Nougat, Oreo and Pie capable 3.3.1-0 TWRP, but decrypting support only for PIE (AOSP untested, stock confirmed):
Download links below (always the latest and newest only; one version for all):
File name: TWRP-JOAN-3312_2020-02-23.img
MD5sum: 2fd78a606b65274977f1cd63080d5f23
MAIN Download: MEGA, TWRP-JOAN-3312_2020-02-23.img
As always: Use it at your own risk! You are the one who changes stuff on your phone, I'm not responsible for anything which happens to your phone. TWRP is powerful, be careful at what you do with it :good: And it just works.
All you need to compile this yourself:
[url]https://github.com/seader/android_device_lge_joan-twrp[/url]
[url]https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni[/url]
[url]https://github.com/seader/android_kernel_lge_msm8998[/url] (not really needed as a prebuilt kernel is used)
[url]https://github.com/seader/bootable_recovery-twrp[/url] (copy of twrp recovery with the stuff added. Pie is "encrypt-9.0" branch. omni's android-9.0 branch almost fully compatible, beside not being able to remove crypto (dirty hack, sry )
Much appreciated for your hard work. Twrp after all is the base for all customization
Thanks!
sure, enjoy it
btw, is there someone with oreo encrypted...? would be nice to know if it's decryptable with this new twrp too, and we therefore only need this one (and the other one can be archived...?)?
which is spoken very early, there's a lot left to do for 3.3 running really flawlessly. but, of course, this will be continued and being further worked on :good: starting right now xD
@ChazzMatt: it will take a while until wtf can be updated with this new one here. this is in an late beta stage, it works but has some quirks left. nothing that can destroy a phone but this twrp isn't fully working at this point of time and therefore not possible to use "in productive threads".
Everything works as well as the previous stable recovery.
I have tried:
1. backing up and restoring ROMs
2. Flashing, ROMs(stock pie and aosp Q), kernels and other mods.
Big thanks ??
In my case time is still not correct, I have to choose a different timezone compared to actual.... When booted up normally, it is correct.
kanehun said:
In my case time is still not correct, I have to choose a different timezone compared to actual.... When booted up normally, it is correct.
Click to expand...
Click to collapse
it needs some boots and reboots to recovery. after setting up everything it showed in twrp as it should :good: i'll add the tzdata back, a registry of all timezones, used for calculation of time, maybe it helps.
Time zone is beyond screwed up, 3 hours off without DST. Also, I'm on Oreo and it's asking for the decrypt password to access internal SD.Going back to 3.2.3-7.
ldeveraux said:
, I'm on Oreo and it's asking for the decrypt password to access internal SD.Going back to 3.2.3-7.
Click to expand...
Click to collapse
Try using the Pie compatible Decryption Disabler and then Reformatting data...
Have you tried flashing the @Zackptg5 Disable_Dm-Verity_ForceEncrypt_08.18.2019 (encryption disabler) before reformatting?
Flash Magisk,
Flash Pie-compatible encryption disabler,
Flash JohnFawkes Root Checker disabler,
Reformat data (where you type yes),
Reboot to recovery from within TWRP,
Flash Magisk AGAIN,
Reboot phone.
See this post: https://forum.xda-developers.com/showpost.php?p=79972563&postcount=107
_____________
7. MORE TWRP ACTIONS - Now turn off data encryption and install essential items… all in TWRP:
(This is not a "menu" in TWRP, it's merely a list of what you NEED to do before booting to the OS)
a. Wipe Data – Factory Reset
b. Install – set storage to the External SD (if you have a microSD card) OR drag necessary files over from PC once in TWRP.
c. Install the Magisk zip. (This is to give the encryption disabler root privileges)
d. Install @Zackptg5 Disable_Dm-Verity_ForceEncrypt_08.18.2019 (encryption disabler).
e. Install @JohnFawkes AnyKernel 3 RCTD Remover (root checker disabler); this disables LG's firmware root checks, which may impede performance.
f. FORMAT DATA (Select WIPE, then FORMAT DATA, then select yes.)
Do NOT delete your OS, but you do need to FORMAT your data , not just "wipe" it this time. Otherwise you may get an encryption error when you boot up the first time. If you get any red mount errors, go back to the TWRP reboot menu and select reboot to recovery and try to FORMAT DATA again. Then, after successfully formatting...
g. Reboot – "Reboot Recovery" from TWRP reboot menu (choose to reboot back to Recovery). Now that the data partition has been formatted, TWRP needs to reload the recovery partition for usage. If you skip this step, when Magisk is installed again below, it may think that /data is still encrypted and set "preserve force encryption". This is also a good sanity check that LG encryption has been removed from /data.
h. Re-flash the Magisk zip again. (This is to make sure, due to Pie changes.)
i. Reboot – to System (NOW you are finally rebooting your phone! Until now this whole section has been done within TWRP.)
ChazzMatt said:
Try using the Pie compatible Decryption Disabler and then Reformatting data...
Have you tried flashing the @Zackptg5 Disable_Dm-Verity_ForceEncrypt_08.18.2019 (encryption disabler) before reformatting?
Flash Magisk,
Flash Pie-compatible encryption disabler,
Flash Root Checker disabler,
reformat data (where you type yes),
reboot to recovery from within TWRP,
flash Magisk AGAIN,
reboot phone.
See this post: https://forum.xda-developers.com/showpost.php?p=79972563&postcount=107
_____________
7. MORE TWRP ACTIONS - Now turn off data encryption and install essential items… all in TWRP:
(This is not a "menu" in TWRP, it's merely a list of what you NEED to do before booting to the OS)
a. Wipe Data – Factory Reset
b. Install – set storage to the External SD (if you have a microSD card) OR drag necessary files over from PC once in TWRP.
c. Install the Magisk zip. (This is to give the encryption disabler root privileges)
d. Install @Zackptg5 Disable_Dm-Verity_ForceEncrypt_08.18.2019 (encryption disabler).
e. Install @JohnFawkes AnyKernel 3 RCTD Remover (root checker disabler); this disables LG's firmware root checks, which may impede performance.
f. FORMAT DATA (Select WIPE, then FORMAT DATA, then select yes.)
Do NOT delete your OS, but you do need to FORMAT your data , not just "wipe" it this time. Otherwise you may get an encryption error when you boot up the first time. If you get any red mount errors, go back to the TWRP reboot menu and select reboot to recovery and try to FORMAT DATA again. Then, after successfully formatting...
g. Reboot – "Reboot Recovery" from TWRP reboot menu (choose to reboot back to Recovery). Now that the data partition has been formatted, TWRP needs to reload the recovery partition for usage. If you skip this step, when Magisk is installed again below, it may think that /data is still encrypted and set "preserve force encryption". This is also a good sanity check that LG encryption has been removed from /data.
h. Re-flash the Magisk zip again. (This is to make sure, due to Pie changes.)
i. Reboot – to System (NOW you are finally rebooting your phone! Until now this whole section has been done within TWRP.)
Click to expand...
Click to collapse
No, that's an insane amount of hassle for no apparent gain! I'm just sticking with the older TWRP [emoji6]
ldeveraux said:
No, that's an insane amount of hassle for no apparent gain! I'm just sticking with the older TWRP [emoji6]
Click to expand...
Click to collapse
Were you already on a decrypted ROM using the older version of TWRP? Trying to figure out if the same encrypted internal storage situation will happen to me if I bother to try this Pie version of TWRP. Just would stick with Oreo TWRP if it's going to be this whole hassle to upgrade.
Thanks!
:victory: thank you seadersn!
ldeveraux said:
No, that's an insane amount of hassle for no apparent gain! I'm just sticking with the older TWRP [emoji6]
Click to expand...
Click to collapse
It's the exact steps people have to do when installing TWRP to work with bootloader unlocked Pie KDZ.
We needed new Encryption Disabler and we needed new Root Checker Disabler and we needed to flash Magisk twice.
The order of steps had to be rewritten besides new files.
Those have been in effect ever since EU H930 got Pie. Works on Oreo AND Pie bootloader unlocked KDZ.
drewcu said:
Were you already on a decrypted ROM using the older version of TWRP? Trying to figure out if the same encrypted internal storage situation will happen to me if I bother to try this Pie version of TWRP. Just would stick with Oreo TWRP if it's going to be this whole hassle to upgrade.
Thanks!
Click to expand...
Click to collapse
I'm on the TWRP flashable US99820H, so no clue
ChazzMatt said:
It's the exact steps people have to do when installing TWRP to work with bootloader unlocked Pie KDZ.
Those have been in effect ever since EU H930 got Pie.
Click to expand...
Click to collapse
I guess. I don't have Pie and don't plan on updating soon. I don't even know what the decryption password was all about. My TWRP was working fine, I've learned one thing with Android: if it ain't broke...
ldeveraux said:
I'm on the TWRP flashable US99820H, so no clue
I guess. I don't have Pie and don't plan on updating soon. I don't even know what the decryption password was all about. My TWRP was working fine, I've learned one thing with Android: if it ain't broke...
Click to expand...
Click to collapse
Any TWRP flashable ROM was likely decrypted and is similar to my situation (except I'm on Pie VS99630c). Sounds like upgrading to TWRP 3.3.1 Pie is more hassle than it's worth and I'll stay put.
Thanks.
ldeveraux said:
I'm on the TWRP flashable US99820H, so no clue
I guess. I don't have Pie and don't plan on updating soon. I don't even know what the decryption password was all about. My TWRP was working fine, I've learned one thing with Android: if it ain't broke...
Click to expand...
Click to collapse
Sure. I'm still on stock rooted Oreo firmware, also.
But those two new files, different order of steps work with both Oreo AND Pie Bootloader Unlocked KDZ with 3 2.3.7 -- whereas the older method and (with original decryption and root check disabler files) were in place before Pie.
WTF has always had decryption and root check disabler files and reformat of data to install TWRP.
What's different now is newer files to be effective on Pie KDZ as well as different order of steps -- as well as flashing Magisk at the beginning and again at the end.
I am hoping those files and steps also work with this new TWRP 3.3.1.
---------- Post added at 05:54 PM ---------- Previous post was at 05:51 PM ----------
drewcu said:
Any TWRP flashable ROM was likely decrypted and is similar to my situation (except I'm on Pie VS99630c). Sounds like upgrading to TWRP 3.3.1 Pie is more hassle than it's worth and I'll stay put.
Thanks.
Click to expand...
Click to collapse
Those files and steps I posted work with all Pie KDZ on 3.2.3.7. If they don't work on this 3.3.1 that's strange.
ChazzMatt said:
Sure. I'm still on stock rooted Oreo firmware, also.
But those two new files, different order of steps work with both Oreo AND Pie Bootloader Unlocked KDZ with 3 2.3.7 -- whereas the older method and (with original decryption and root check disabler files) were in place before Pie.
WTF has always had decryption and root check disabler files and reformat of data to install TWRP.
What's different now is newer files to be effective on Pie KDZ as well as different order of steps -- as well as flashing Magisk at the beginning and again at the end.
I am hoping those files and steps also work with this new TWRP 3.3.1.
---------- Post added at 05:54 PM ---------- Previous post was at 05:51 PM ----------
Those files and steps I posted work with all Pie KDZ on 3.2.3.7. If they don't work on this 3.3.1 that's strange.
Click to expand...
Click to collapse
I am on John Fawkes' Pie VS99630c TWRP flashable ZIP using TWRP 3.2.3.7. The concern is whether upgrading TWRP to 3.3.1 is as simple is flashing the IMG file within TWRP 3.2.3.7, or whether we'll have to reflash multiple things in a whole list of steps. If it's the latter, then why not just stay on TWRP 3.2.3.7 which seems to do everything we need in terms of flashing Pie ROMs?
ChazzMatt said:
Those files and steps I posted work with all Pie KDZ on 3.2.3.7. If they don't work on this 3.3.1 that's strange.
Click to expand...
Click to collapse
it's only formatting data switched to "fastboot -w" (reformats cache and data) or "fastboot erase userdata" (reformats data). both remove eventually present encryptions. everything else works like in the default wtf recovery :good: and that's really an enerving point... i want to simply format my userdata in twrp and not have to switch to fastboot...
formatting now works :good:
drewcu said:
I am on John Fawkes' Pie VS99630c TWRP flashable ZIP using TWRP 3.2.3.7. The concern is whether upgrading TWRP to 3.3.1 is as simple is flashing the IMG file within TWRP 3.2.3.7, or whether we'll have to reflash multiple things in a whole list of steps. If it's the latter, then why not just stay on TWRP 3.2.3.7 which seems to do everything we need in terms of flashing Pie ROMs?
Click to expand...
Click to collapse
it's the first: flashing image easily. only thing is, as described above, removing encryption requires fastboot. atm not possible to do this in recovery as usual. therefore nod suitable for wtf thread, but for anybody else, especially the ones who have pie installed and want to acces their data in twrp when encrypted. i'll test oreo decryption compatibility soon, zip needs downloading time lol
oreo decryption compatibility not given with 3.3 but: you can easily migrate from encrypted oreo via fw zip to pie, it adopts the storage encryption then and 3.3 is able to unlock :good: i've got a solution for 3.3 not being able to remove encryption: i keep a copyof 3.2.3-7 image on external sd and install it when formatting needed xD then back to 3.3 and good to go.
workaround no more needed, working now