[RECOVERY][OFFICIAL] TWRP 3.5.2 [CEBU] - Moto G9 Power ROMs, Kernels, Recoveries, & Other D

This build is now official.
Check out https://twrp.me/motorola/motorolamotog9power.html
Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.​
Code:
#include <std_disclaimer.h>
/*
*
* 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 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.
*
*/
XDA:DevDB Information
TWRP, Tool/Utility for the Motorola G9 Power
Contributors
mistersmee
Source Code:
Device tree: https://github.com/teamwin/android_device_motorola_cebu
Kernel sources: Prebuilt (for now) [Note: Thanks @fddm, for your patched kernel!]
https://github.com/mistersmee/kernel_motorola_sm6115
TWRP sources: https://github.com/TeamWin/android_bootable_recovery
Telegram group: https://t.me/g9power (English language)
Version Information
Status: Stable
Created 20-05-2021

This is the list of things that need to work, as per TWRP's FAQs.
I will update as I find stuff that works, and as you guys tell me what works.
Code:
Blocking checks
- [X] Correct screen/recovery size
- [-] Working Touch, screen
- [X] Focaltech touchscreen panel (confirmed working)
- [X] Novatek touchscreen panel (confirmed working)
- [X] Chipone touchscreen panel (confirmed working)
- [X] Backup to internal/microSD
- [X] Restore from internal/microSD
- [X] reboot to system
- [X] ADB
Medium checks
- [X] update.zip sideload
- [X] UI colors (red/blue inversions)
- [X] Screen goes off and on
- [X] F2FS/EXT4 Support, exFAT/NTFS where supported
- [X] all important partitions listed in mount/backup lists
- [X] backup/restore to/from external (USB-OTG) storage (not supported by the device)
- [X] backup/restore to/from adb (https://gerrit.omnirom.org/#/c/15943/)
- [X] decrypt /data
- [X] Correct date
Minor checks
- [X] MTP export
- [X] reboot to bootloader
- [X] reboot to recovery
- [X] poweroff
- [X] battery level
- [X] temperature
- [X] encrypted backups
- [X] input devices via USB (USB-OTG) - keyboard, mouse and disks (not supported by the device)
- [X] USB mass storage export
- [X] set brightness
- [X] vibrate
- [X] screenshot
- [X] partition SD card
If it isn't filled, it means it hasn't been checked yet. 'X' denotes that it is working. '!' denotes that it is not working.

Note: As I mentioned in the initial post, I'm using the prebuilt kernel for now, although the kernel sources have been released. For the long-term, using the prebuilt kernel is not ideal. I have been working on the kernel sources, but as of this writing, I have been unable to get them to boot. If any of you have experience working with Android kernels, please let me know, PM me, etc.
The kernel repo I'm working on is here: https://github.com/mistersmee/kernel_motorola_sm4250
PRs are always welcome.
Edit: Nevermind, I got them to boot.

A few notes on the image:
1. Yes, VBMeta shows 0MB in TWRP. It is intentional, nothing is wrong with the build, or your phone.
VBMeta as a partition, is only a few bytes in size, 65536 bytes, which is 65 KB, which is 0.06 MB, to be exact. TWRP displays sizes in MB, and probably rounds those decimals up, hence a size this small registers as 0. However, it is still an important partition, and it is in the stock fstab, so it cannot be left out.
2. The above point applies for "Prodpersist" as well. Although it is not as small as VBMeta, it is still just a few KBs in size, Again, it is in the stock fstab, so it cannot be left out.
Another probable explanation as to why Prodpersist shows up as 0MB, is that it is actually related to the /product partition. Due to the way Android 10, and dynamic partitions work, basically, the /system, /product, and /vendor have been subsumed under one big "super", which is incidentally read-only. Those individual partitions can only be mounted if the super partition as a whole is mounted, and TWRP does not mount that partition while booting, hence why it probably shows up as 0MB.
In any case, Prodpersist is actually not *that* important, so it doesn't *really* matter anyways.
3. As I said in the last paragraph above, Android 10 changed the way the /system partition works. Because of this, most modifications that in earlier Android versions we could do in TWRP, think flashable zips that change your boot animation, or anything that modified the system partition, will not work.
The only way to do those kinds of mods is through Magisk.
4. Yes, the image is 64MB in size. But, the stock recovery image is also 64MB.
The reason as to why it is 64MB, is because AVB support is enabled. AVB is, of course, Android Verified Boot, which allows GSI support, which should theoretically mean support for flashing GSI images in this TWRP build.
Without AVB support, the image is around 20MB, which is the more "normal" size of TWRP images of the past.

I'm a little late but. Thank you very much

Unfocusedobsessiv said:
I'm a little late but. Thank you very much
Click to expand...
Click to collapse
You're welcome!
Also as a general note to everybody:
If you updated to Android 11 and find that TWRP is not working for you i.e. it doesn't boot, nothing is wrong with your phone/you didn't mess anything up.
The build isn't working due to the Android 11 update, but I'm currently working on it.

still waiting for twrp for android 11

bhavesh.kale.73 said:
still waiting for twrp for android 11
Click to expand...
Click to collapse
No ETA except to say I'm working on it. It depends on external factors, i.e Motorola releasing the updated kernel sources which they haven't done as of this writing.

Hello everyone. I've never had any luck restoring twrp backups of stock on encrypted A/B phones. Does anyone know if that's possible nowadays? I'm still on 10 too because of a Real Racing 3 bug that prevents it from loading in 11.
And a big thank you to you, @mistersmee . Your twrp is the reason I chose this phone.

arkansawdave74 said:
Hello everyone. I've never had any luck restoring twrp backups of stock on encrypted A/B phones. Does anyone know if that's possible nowadays? I'm still on 10 too because of a Real Racing 3 bug that prevents it from loading in 11.
And a big thank you to you, @mistersmee . Your twrp is the reason I chose this phone.
Click to expand...
Click to collapse
You're welcome! And yeah, I had no problem backing up and restoring /data on cebu, so not sure what's going wrong for you.

mistersmee said:
You're welcome! And yeah, I had no problem backing up and restoring /data on cebu, so not sure what's going wrong for you.
Click to expand...
Click to collapse
Actually, I haven't tried in a couple years...Not since the G7 Power (Ocean). We had a terrible time trying to restore stock backups on that phone. I haven't even looked at the partition list in the backup section of your TWRP, but I'm about to. What partitions besides /data did you backup and restore successfully, if you don't mind my asking.

arkansawdave74 said:
Actually, I haven't tried in a couple years...Not since the G7 Power (Ocean). We had a terrible time trying to restore stock backups on that phone. I haven't even looked at the partition list in the backup section of your TWRP, but I'm about to. What partitions besides /data did you backup and restore successfully, if you don't mind my asking.
Click to expand...
Click to collapse
Just about every partition that is available to backup/restore. Though frankly, backing up any partition other than /data is a waste of time and space, we don't actively modify them, and they are available in the stock firmware file if you manage to mess them up anyway.

Oh my gosh why didn't I think of that before.
The Moto G7 Power was the first a / B phone any of any of us had had back then. We tried and tried and tried many different ways to restore a backup but we never thought of that, which is surprising, but we were trying to make a complete backup that you could restore all from TWRP like in the old days. System, Boot, and data.
Anyway, I went to flash Resurrection Remix Q GSI and made it back up of stock first just /data. Restored just fine after the GSI failed to boot. You really made my Android experience so much better.
Thank You.

Hey guys. Just wanted to mention that I'm trying Android 11 Official GSI Customs coming off a stock 10 and TWRP still boots fine while running the 11s.

arkansawdave74 said:
Hey guys. Just wanted to mention that I'm trying Android 11 Official GSI Customs coming off a stock 10 and TWRP still boots fine while running the 11s.
Click to expand...
Click to collapse
That's great to hear.

New release
TWRP 3.6.0_11
This build supports the Android 11 stock ROM. Unknown if it is backwards compatible with stock Android 10. Until confirmed that it is backwards compatible, people running 10 for whatever reason should stick to the 3.5.2 image, or update to 11 and run 3.6.0.
Everything is confirmed working. Download links are on the TWRP website, as always.

mistersmee said:
Is your new build official as well?
New release
TWRP 3.6.0_11
This build supports the Android 11 stock ROM. Unknown if it is backwards compatible with stock Android 10. Until confirmed that it is backwards compatible, people running 10 for whatever reason should stick to the 3.5.2 image, or update to 11 and run 3.6.0.
Everything is confirmed working. Download links are on the TWRP website, as always.
Click to expand...
Click to collapse
Is your new build official as well?
EDIT. Nevermind. I missed the last line.

arkansawdave74 said:
Is your new build official as well?
Click to expand...
Click to collapse
Yes, it is official.

Booting twrp-3.6.0_11-0-cebu.img boots ok TWRP but touch freezed, any idea?

sirjuncos said:
Booting twrp-3.6.0_11-0-cebu.img boots ok TWRP but touch freezed, any idea?
Click to expand...
Click to collapse
Try this image: https://build.twrp.me/twrp-3.6.0_11-0-cebu.img

Related

[RECOVERY][ariel] TWRP 2.8.6.0 touch recovery [2015-06-07]

Team Win Recovery Project 2.x, or twrp2 for short, is a custom recovery built with ease of use and customization in mind. It’s a fully touch driven user interface – no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
Phone look:
Tablet look:
CHANGELOG for 2.8.6.0:
Fix daylight savings time rules for USA and Europe (_that)
Allow mulitple overlays for popup boxes (Dees_Troy)
Add pattern style password entry for decrypt (Tassadar)
Keyboard improvements (_that)
Update AOSP base to 5.1 (Dees_Troy)
Reduce theme count to 5 and rely on scaling (Dees_Troy)
Various scaling improvements (Dees_Troy)
Improved handling of resources in the GUI (_that)
Make scroll bar size proportional to list size (_that)
Allow scoll lists to render without a header (_that)
Make console scroll per pixel with kinetic scrolling (_that)
Support styles in XML to reduce XML size and improve consistentcy (Dees_Troy)
Various other fixes and improvements (mdmower, bigbiff, codelover, etc)
CHANGELOG for 2.8.5.0:
Scale the GUI - TWRP can read the theme's resolution and scale it up or down to fit the theme to your screen's resolution
Backups can now be cancelled while the backup is in progress (does not include restore because we don't want to leave your device in a bad state)
Improve thread handling and move input handling into the main rendering thread to improve stability
Make MTP work even if unplugged and plugged back in
Unify scrollable list code and make kinetic scrolling feel more natural
Fix handling of mapped zip files for OTA updates (CM12 updater)
USB keyboards should now work on all devices that support USB host mode via a USB OTG cable
Other small fixes and improvements
CHANGELOG for 2.8.4.0:
Add flashing of boot and recovery images via the TWRP GUI (Find the Images button on the Install page)
Fix some MTP related crashes and bugs
Eliminate TWRP toggling USB IDs during boot if MTP is enabled
Fix various adb sideload issues
Improve threading of actions
Eliminate separate thread for screen timeout
Update libblkid to 2.25.0
Use power button as back button on watch themes for easier navigation
Add mutex locking to data manager
Improve custom theme handling on encrypted devices
Allow the stock theme to be offset by build flags so we can center a lower res theme on a higher res screen especially for watches with round screens
CHANGELOG for 2.8.3.0:
MTP will now tell the host PC that storage is removed instead of disabling MTP completely
MTP will now report the correct max file size based on the file system in use to the host PC (may fix transfer of large files)
Update and improve fix permissions and make fixing contexts optional
Update SuperSU in TWRP to 2.40 and update install process
Make TWRP work properly on AArch64 (Nexus 9 is now built in true 64-bit binaries and libraries)
Attempt to set correct permissions and contexts on all files placed in storage so backups will show in Android
Fix kernel panic during MTP start on some devices
Support unicode fonts on devices with True Type Font support
Fix slider value not showing sometimes (vibration settings page)
Toggle MTP off during adb sideload to set correct USB IDs
Reduce library requirements for 5.0 L decrypt
Other minor fixes and improvements
Note: Starting with TWRP 2.8.2.0 and higher, adb sideload uses a new sideload method originally implemented in AOSP recovery. You will need the latest adb binaries to use sideload in these newer versions of TWRP. The version required is 1.0.32. You can find the version by running "adb version" on your computer. The new sideload feature no longer stores the zip on your device. Instead, a fuse file system is created in RAM and the zip is streamed from your computer. This puts less wear and tear on storage and ensures that large zips will not fill up all of your RAM. The sideload may spit an error on your PC side, but the zip should install just fine on your device.
Everything seems to be working. No known issues. USB-OTG works also
Downloadhttps://www.androidfilehost.com/?fid=24052804347756852
or use our TWRP Manager software to install it automatically for you
Install either by DD or maybe flashify will work for you.
Code:
dd if=recovery.img of=/dev/block/mmcblk0p7
Thanks goes to @Dees_Troy as this was my first MediaTek based device to build recovery for
This will also be taken official this week.
Pulled download temporarily
Thanks for your work dude but we do not have recovery image for our Fire 6 HD sadly ...
alucard_xs said:
Thanks for your work dude but we do not have recovery image for ou Fire 6 HD sadly ...
Click to expand...
Click to collapse
The HD 7 and HD 6 are EXACTLY the same device. The OTAs for both are EXACTLY the same. The only difference is the screen size. There essentially is no difference betweent the 2 devices
Sure but what about factory / recovery image, is there anyone floating around ?
alucard_xs said:
Sure but what about factory / recovery image, is there anyone floating around ?
Click to expand...
Click to collapse
just dump your current recovery.img.
dd if=/dev/block/mmcblk0p7 of=/sdcard/stockrecovery.img
Then as soon as you boot into recovery make a backup.
Root
Will flashing the SuperSU package in recovery root, or cause a bootloop?
ryanyz10 said:
Will flashing the SuperSU package in recovery root, or cause a bootloop?
Click to expand...
Click to collapse
Dont need to flash anything with TWRP. If you boot twrp then choose reboot to system option it will ask if you want to install SuperSU.
Reuploaded fixed version. Found a couple bugs that i didn't notice before. All good now
So for us the slow ones, can you explain this in detail?
You've replaced the stock recovery with TWRP, so we can flash images from USB drives ? But you need root to do the first flash to recovery, correct?
Will Amazon update re-write the recovery partition so you are back to stock ?
bibikalka said:
So for us the slow ones, can you explain this in detail?
You've replaced the stock recovery with TWRP, so we can flash images from USB drives ? But you need root to do the first flash to recovery, correct?
Will Amazon update re-write the recovery partition so you are back to stock ?
Click to expand...
Click to collapse
yes. and future custom roms if they come. You should be disabling OTAs anyways. OTAs im pretty sure will fail anyways with a custom recovery
jmz said:
yes. and future custom roms if they come. You should be disabling OTAs anyways. OTAs im pretty sure will fail anyways with a custom recovery
Click to expand...
Click to collapse
Man, that's pretty awesome! It sounds like one just needs one good TWRP flash, and then it's not that hard to recover after a screw up via OTG.
And it seems like with this TWRP we should be able to flash Amazon updates onto the device (such as 4.5.4), and install root on top after that ? Root 4ever ? How hard is it to make TWRP flash stock Amazon updates ? I want 4.5.4 , with root !!!
You could also change the size of /cache, and add it to /data, or move dalvik cache from /data to /cache, see these allocations (there is 1 Gb of space in /cache !!!):
http://forum.xda-developers.com/fire-hd/help/internal-memory-structure-hidden-t3122246
So even without a custom ROM there are tons of easy tweaks that one could do.
I actually got to like the Fire OS, it is super stable for me. With custom recoveries things are often quite rocky for a while. I'd like to get some sort of Android Setup app, in order to change things above and beyond what Amazon allows (such as that Cyrillic AOSP keyboard!).
Once you figure out how to put stock Amazon update files onto the device plus root, you can pretty much play with Xposed and get into risky stuff (not being afraid of bootloop.) Just make sure to keep the trusty TWRP handy!!!
bibikalka said:
Man, that's pretty awesome! It sounds like one just needs one good TWRP flash, and then it's not that hard to recover after a screw up via OTG.
And it seems like with this TWRP we should be able to flash Amazon updates onto the device (such as 4.5.4), and install root on top after that ? Root 4ever ? How hard is it to make TWRP flash stock Amazon updates ? I want 4.5.4 , with root !!!
You could also change the size of /cache, and add it to /data, or move dalvik cache from /data to /cache, see these allocations (there is 1 Gb of space in /cache !!!):
http://forum.xda-developers.com/fire-hd/help/internal-memory-structure-hidden-t3122246
So even without a custom ROM there are tons of easy tweaks that one could do.
I actually got to like the Fire OS, it is super stable for me. With custom recoveries things are often quite rocky for a while. I'd like to get some sort of Android Setup app, in order to change things above and beyond what Amazon allows (such as that Cyrillic AOSP keyboard!).
Once you figure out how to put stock Amazon update files onto the device plus root, you can pretty much play with Xposed and get into risky stuff (not being afraid of bootloop.) Just make sure to keep the trusty TWRP handy!!!
Click to expand...
Click to collapse
Yeah, I am going to be working on the update this week. Starting a new job tomorrow.
Also, I added a link to our software TWRP Manager so it is even easier to install TWRP.
jmz said:
Yeah, I am going to be working on the update this week. Starting a new job tomorrow.
Also, I added a link to our software TWRP Manager so it is even easier to install TWRP.
Click to expand...
Click to collapse
I just saw your boot unlocker thread, you should better manage your cross-references Congrats for getting us this far!
But I wonder if one could just flash 4.5.4 first, and then unlock the bootloader, and install TWRP, then root. Which bootloader versions can be unlocked? All so far? So people who were force updated to 4.5.4 are not SOL ?
Of course, it's easier to just have TWRP flash Amazon updates, then root is always available. That would be an enabling step, with the ability to flash Amazon stock ROMs, one can mess things up totally, and still recover back.
Exciting times, man !!!!
bibikalka said:
I just saw your boot unlocker thread, you should better manage your cross-references Congrats for getting us this far!
But I wonder if one could just flash 4.5.4 first, and then unlock the bootloader, and install TWRP, then root. Which bootloader versions can be unlocked? All so far? So people who were force updated to 4.5.4 are not SOL ?
Of course, it's easier to just have TWRP flash Amazon updates, then root is always available. That would be an enabling step, with the ability to flash Amazon stock ROMs, one can mess things up totally, and still recover back.
Exciting times, man !!!!
Click to expand...
Click to collapse
Messing with things more and more I don't think that is a fully working bootloader unlock. For example, I can't boot an unsigned boot.img after flashing. But I can boot it if I flash to recovery partition then issue adb reboot recovery.
Or that may just be a MTK/Amazon/LK thing. Not too sure at this point. But it seems right now, custom kernels are out of the question.
jmz said:
Messing with things more and more I don't think that is a fully working bootloader unlock. For example, I can't boot an unsigned boot.img after flashing. But I can boot it if I flash to recovery partition then issue adb reboot recovery.
Or that may just be a MTK/Amazon/LK thing. Not too sure at this point. But it seems right now, custom kernels are out of the question.
Click to expand...
Click to collapse
I see what you mean ... Even a partial unlock is huge step forward in terms of customization options, and the biggest deal is that now it's not too scary to screw up! Btw, in Amazon update files there is recovery-from-boot.p, is that the image we need for recovery? Or should we make a proper one via dd?
In Amazon update they seem to update recovery, but I wonder who checks for signed boot.img ? Is this part of the chipset ?
(from /recovery/etc ):
#!/system/bin/sh
if ! applypatch -c EMMC:/dev/block/platform/mtk-msdc.0/by-name/recovery:5888256:6d9d1bbc4172c107db3228ed8d9f97111219c617; then
log -t recovery "Installing new recovery image"
applypatch -b /system/etc/recovery-resource.dat EMMC:/dev/block/platform/mtk-msdc.0/by-name/boot:5370112:c2c686ada1b194050a3c8f05e2102345df48e9ce EMMC:/dev/block/platform/mtk-msdc.0/by-name/recovery 6d9d1bbc4172c107db3228ed8d9f97111219c617 5888256 c2c686ada1b194050a3c8f05e2102345df48e9ce:/system/recovery-from-boot.p
else
log -t recovery "Recovery image already installed"
fi
bibikalka said:
I see what you mean ... Even a partial unlock is huge step forward in terms of customization options, and the biggest deal is that now it's not too scary to screw up! Btw, in Amazon update files there is recovery-from-boot.p, is that the image we need for recovery? Or should we make a proper one via dd?
In Amazon update they seem to update recovery, but I wonder who checks for signed boot.img ? Is this part of the chipset ?
(from /recovery/etc ):
#!/system/bin/sh
if ! applypatch -c EMMC:/dev/block/platform/mtk-msdc.0/by-name/recovery:5888256:6d9d1bbc4172c107db3228ed8d9f97111219c617; then
log -t recovery "Installing new recovery image"
applypatch -b /system/etc/recovery-resource.dat EMMC:/dev/block/platform/mtk-msdc.0/by-name/boot:5370112:c2c686ada1b194050a3c8f05e2102345df48e9ce EMMC:/dev/block/platform/mtk-msdc.0/by-name/recovery 6d9d1bbc4172c107db3228ed8d9f97111219c617 5888256 c2c686ada1b194050a3c8f05e2102345df48e9ce:/system/recovery-from-boot.p
else
log -t recovery "Recovery image already installed"
fi
Click to expand...
Click to collapse
all devices have that in some form or another.
I would make a dd backup of the stock one before flashing.
jmz said:
just dump your current recovery.img.
dd if=/dev/block/mmcblk0p7 of=/sdcard/stockrecovery.img
Then as soon as you boot into recovery make a backup.
Click to expand...
Click to collapse
Is there an option in TWRP Manager to save stock recovery without any reboots? This sounds like an easy feature to add. Or is this part of "live backup" ?
bibikalka said:
Is there an option in TWRP Manager to save stock recovery without any reboots? This sounds like an easy feature to add. Or is this part of "live backup" ?
Click to expand...
Click to collapse
No there isn't.
Well, I guess I am out of the game for awhile. Just bricked my Fire.

[RECOVERY][bullhead] TWRP 3.1.1-0 touch recovery [2017-05-19]

Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
CHANGELOG for 3.0.2-0:
-Backups will now include adopted storage keys (Dees_Troy)
-Fixed an adb restore issue (bigbiff)
-Fixed rebooting when no OS is present (Dees_Troy)
-Fixed line wrapping in the GUI terminal (_that)
-Updated TWRP source code to AOSP 7.1.2 (Dees_Troy)
CHANGELOG for 3.1.0-0:
-vold decrypt on a few select HTC devices, TWRP will now attempt to use the system partition's vold and vdc binaries and libraries to decrypt the data partition (nkk71 and CaptainThrowback)
-adb backup to stream a backup directly to or from your PC, see documentation here: https://github.com/omnirom/android_bootable_recovery/commit/ce8f83c48d200106ff61ad530c863b15c16949d9 (bigbiff)
-tweak MTP startup routines (mdmower)
-support new Android 7.x xattrs for backup and restore to fix loss of data after a restore (Dees_Troy)
-support POSIX file capabilities backup and restore to fix VoLTE on HTC devices and possibly other issues (Dees_Troy)
-better indicate to users that internal storage is not backed up (Dees_Troy)
-improve automatic determination of TW_THEME (mdmower)
-minimal getcap and setcap support (_that)
-try mounting both ext4 and f2fs during decrypt (jcadduono and Dees_Troy)
-shut off backlight with power key (mdmower)
-timeout during FDE decrypt (Dees_Troy and nkk71)
-support for FBE decrypt and backing up and restoring FBE policies (Dees_Troy)
-boot slot support (Dees_Troy)
-TWRP app install prompt during reboot (Dees_Troy)
-support for AB OTA zips (Dees_Troy)
-support new Android 7.x log command (Dees_Troy)
-update recovery sources to AOSP 7.1 (Dees_Troy)
-numerous bugfixes and improvements by too many people to mention
CHANGELOG for 3.0.2-0:
-Fix a bug with the input box that affected masked inputs (passwords). This fixes decrypt of full device encryption on devices that support decrypt. This bug also impacts encrypted backups. Users are highly encouraged to stop using 3.0.1 if you use encrypted backups or if you need decrypt of data in TWRP.
-Add Greek translation to some builds.
CHANGELOG for 3.0.1-0:
-support new CM 13.0 pattern encryption (sultanqasim)
-fix slow flashing issue due to modprobe (present on only some devices) (#twrp)
-libtar updated to latest upstream and fixes (jcadduono)
-fixes for loading custom themes (_that)
-TWRP will now detect and install TWRP themes automatically through the normal zip install process (Dees_Troy)
-translation updates - added Italian, Czech and Polish and significant updates to Dutch
-progress bar improvements - progress bar updates during image flashing and better tracks progress during file system backups (tar) (Dees_Troy)
-fix input box text display (Dees_Troy)
-reboot option after zip install complete (bigbiff)
-other mostly invisible bug fixes and improvements
CHANGELOG for 3.0.0-0:
-Completely new theme - Much more modern and much nicer looking (by z31s1g)
-True Terminal Emulator - Includes arrow keys, tab and tab completion, etc. (by _that)
-Language translation - It won’t be perfect and especially some languages that require large font files like Chinese & Japanese won’t be availble on most devices. Also some languages may only be partially translated at this time. Feel free to submit more translations to OmniROM’s Gerrit. (mostly by Dees_Troy)
-Flashing of sparse images - On select devices you will be able to flash some parts of factory images via the TWRP GUI (by HashBang173)
-Adopted storage support for select devices - TWRP can now decrypt adopted storage partitions from Marshmallow
-Reworked graphics to bring us more up to date with AOSP - includes support for adf and drm graphics (by Dees_Troy)
-SuperSU prompt will no longer display if a Marshmallow ROM is installed
-Update exfat, exfat fuse, dosfstools (by mdmower)
-Update AOSP base to 6.0
-A huge laundry list of other minor fixes and tweaks
WARNING: This is our first release in a long time. We have a lot of new and somewhat aggressive changes in this new release. The changes to the graphics back-end may cause some devices to not boot up properly or have other display-related issues. If you are not in a position to reflash an older build of TWRP, then wait until you are or at least wait until others have tried the new version for your specific device. You don’t want to end up with a non-working recovery and have to wait several hours or days to get to a computer to be able to fix it.
Notes for themers: In addition to the udpated theme, we have introduced a theme version variable to the TWRP theme system. If the theme version does not match the version that TWRP expects, TWRP will reject the custom theme and load its stock theme. This change will ensure that people who update TWRP without updating their theme will still have a workable recovery. We have removed libjpeg support. The stock theme was only using a jpeg image for the splash / curtain. This change means that any custom themes will no longer be able to use jpeg images. It also means that tools used to repack recovery images with a different curtain / splash will need to be updated to use the new method.
Version number notes: For a while we’ve been using a 4 digit version number and reserved the 4th digit for device-specific updates. For instance, we find and fix a device-specific issue like decryption of data on Nexus 5, we would release that as a 2.8.7.1. After a while, some people would start asking where 2.8.7.1 was for other devices. So, going forward we have decided to change the numbering scheme to 3.0.0-2, etc. Our hope is that this version numbering scheme will more clearly identify that the 4th digit does not indicate a version change for the code base.
We need your help! The bulk of TWRP work is done by 3 people on a volunteer basis. We have pushed most of our device files to our github and we have a gerrit instance. If you have the ability, please help us maintain our official devices and/or add your device to our official device list. Thanks in advance!
DOWNLOAD:
1) Install the TWRP app from the Play Store or grab the apk from our website
2) Open the app, agree to the terms, and enable root access
3) Select TWRP Flash
4) Search for your device and select the version you wish to download
5) Once the download is complete, select the file (it's usually in your downloads folder) and then Flash Recovery
OR:
Most devices can be updated quickly and easily within TWRP if you already have version 2.8.4.0 or higher installed
1) Download the latest version from our website on your device
2) Reboot to TWRP
3) Hit Install and tap the "Images..." button in the lower right
4) Browse to the location of the TWRP image on your device and select it
5) Select recovery from the partition list and swipe to flash
OR:
You can find more information and download links on our website.
BUGS:
If you have found a bug, please consider posting it to our github issues log. It's pretty much impossible for us to keep up with the more than 40 threads that we have for the devices that we "directly" support. If you have a significant problem that cannot be answered in this thread, your best bet is to PM me directly, contact us via our website, or find us in our IRC channel below. If you see someone that's struggling, feel free to point it out to us. We need your help to help us keep track of all of our devices! Thanks!
SUPPORT:
Live support is available via #twrp on Freenode with your IRC client or just click this link.
PSA: DO NOT restore EFS backups made with TWRP 3.0.2-1 as there is a bug in that version that affects how the backup is made. Backups of EFS made with TWRP 3.0.2-1 are invalid and should be discarded. Also, seriously people, do not restore EFS unless you absolutely know that you need to.
Device specific page including instructions for a manual install
Download links for current and past versions of TWRP
Dees_Troy said:
NOTE: Decrypting data is not supported yet. The Nexus 5X will normally attempt to encrypt the device automatically on first boot. To use TWRP as you normally would, you will have to format data and install a slightly modified boot image with forceencrypt disabled.
Click to expand...
Click to collapse
Coming from an N5 I'm completely new to device encryption. Could someone explain what the implications of this are? Does installing TWRP require an unencrypted device? Will flashing it require a data format? When you say "use TWRP as you normally would," what would be different with this as it is?
Sorry for these probably really basic questions. I just have no idea what the implications of this are.
From what I put together TWRP requires unencrypted kernel/boot. Not to fear though. Looks like chainfire had released an unencrypted kernel/boot - http://forum.xda-developers.com/showthread.php?t=3219344
The N6 came with a forced encrypted kernel/boot. If you want to use a custom kernel you will be flashing an unencrypted kernel. When flashing a unencrypted kernel it will wipe your sdcard. You can encrypt your device later but this will wipe the sdcard.
It's best to flash an unencrypted kernel/boot first if you plan on using custom kernels/ROMs down the road.
Can a kernel with encryption be flashed even though the device is encrypted? The reason I ask is for compiling stock kernel with a lower vibration intensity value and not touching anything else
0.0 said:
Can a kernel with encryption be flashed even though the device is encrypted? The reason I ask is for compiling stock kernel with a lower vibration intensity value and not touching anything else
Click to expand...
Click to collapse
If your device is encrypted you can still flash any image to your system (as long as the bootloader has been unlocked). Flashing a no-encrypt kernel will not change anything in the system until the device is wiped.
Mark.
Awesome ! Was waiting for this ! Will flash in an hour And report back !
EDIT: Works Great !
So would I be good to go to install twrp after unlocking bootloader on the 5x?
briant1234 said:
So would I be good to go to install twrp after unlocking bootloader on the 5x?
Click to expand...
Click to collapse
No, this will screw up your device. http://www.xda-developers.com/a-look-at-marshmallow-root-verity-complications/
aes512 said:
No, this will screw up your device. http://www.xda-developers.com/a-look-at-marshmallow-root-verity-complications/
Click to expand...
Click to collapse
How would that screw up his device? At worst, he would have a half broken recovery that can't read or write to his /data partition since he isn't also flashing a modified boot image or kernel, no?
I tried flashing Chainfire's modified boot.img for this phone yesterday and it didn't seem to work. I initially had problems mounting my data partition, and when that failed I had issues with flashing the system.img to restore it - I fixed this by using a program called mfastboot to flash the system.img in 512mb chunks. I eventually managed to get the phone to boot after flashing it and formatting userdata but then I incurred more problems. I had multiple force closes of gapps when trying to go through Google setup. Once I got past these I couldn't check whether the phone had successfully been decrypted as Settings force closed if you tried to enter security. I'm not sure if anyone could shed any light on what I might have done wrong or whether they face the same issues and there's a problem with Chainfire's modified boot.img for the 5x.
EDIT: I think it might've been due to the fact there's 3 different builds - I'm on MDA89E so I'll wait for a modified boot.img for that before trying again.
Hayth said:
I tried flashing Chainfire's modified boot.img for this phone yesterday and it didn't seem to work. I initially had problems mounting my data partition, and when that failed I had issues with flashing the system.img to restore it - I fixed this by using a program called mfastboot to flash the system.img in 512mb chunks. I eventually managed to get the phone to boot after flashing it and formatting userdata but then I incurred more problems. I had multiple force closes of gapps when trying to go through Google setup. Once I got past these I couldn't check whether the phone had successfully been decrypted as Settings force closed if you tried to enter security. I'm not sure if anyone could shed any light on what I might have done wrong or whether they face the same issues and there's a problem with Chainfire's modified boot.img for the 5x.
EDIT: I think it might've been due to the fact there's 3 different builds - I'm on MDA89E so I'll wait for a modified boot.img for that before trying again.
Click to expand...
Click to collapse
I noticed that @mskip has this mda89e modified image mentioned in this post: http://forum.xda-developers.com/showpost.php?p=63422766&postcount=17
PS: I've not ordered any new phone (yet) but am following things here anyway.
Hayth said:
I tried flashing Chainfire's modified boot.img for this phone yesterday and it didn't seem to work. I initially had problems mounting my data partition, and when that failed I had issues with flashing the system.img to restore it - I fixed this by using a program called mfastboot to flash the system.img in 512mb chunks. I eventually managed to get the phone to boot after flashing it and formatting userdata but then I incurred more problems. I had multiple force closes of gapps when trying to go through Google setup. Once I got past these I couldn't check whether the phone had successfully been decrypted as Settings force closed if you tried to enter security. I'm not sure if anyone could shed any light on what I might have done wrong or whether they face the same issues and there's a problem with Chainfire's modified boot.img for the 5x.
EDIT: I think it might've been due to the fact there's 3 different builds - I'm on MDA89E so I'll wait for a modified boot.img for that before trying again.
Click to expand...
Click to collapse
SOMEONE TRIED FLASHING THE IMAGE AND IT DIDN'T BOOT SO I GUESS THE 5X IS A BIT DIFFERENT WITH REPACKING KERNELS. I WOULDN'T ADVISE TRYING TO FLASH IT BUT I WILL FIND OUT WHATS DIFFERENT AND REPACK THE IMAGE PROPERLY.
Mark.
Pbrah said:
How would that screw up his device? At worst, he would have a half broken recovery that can't read or write to his /data partition since he isn't also flashing a modified boot image or kernel, no?
Click to expand...
Click to collapse
It will put the phone in boot loop is why.
In other news: http://forum.xda-developers.com/showpost.php?p=63426368&postcount=11
seems like .. I have I am first person who didn't read the complete thread before taking the plunge.
So I fastboot unlocked my bootloader and flashed TWRP straight after. I am now stuck in a bootloop between "your device software cant be checked for corruption" organge screen and TWRPfirst install Failing.
can someone help me please ? I cant even turn off the phone .. kept holding the power switch for a minute no go.
update: I managed to get into fastboot mode again. then installed chainfire's bullhead boot.img and re-flashed recovery.img still no go
suhail_kapoor said:
seems like .. I have I am first person who didn't read the complete thread before taking the plunge.
So I fastboot unlocked my bootloader and flashed TWRP straight after. I am now stuck in a bootloop between "your device software cant be checked for corruption" organge screen and TWRPfirst install Failing.
can someone help me please ? I cant even turn off the phone .. kept holding the power switch for a minute no go.
update: I managed to get into fastboot mode again. then installed chainfire's bullhead boot.img and re-flashed recovery.img still no go
Click to expand...
Click to collapse
Before you try anything, attach your cable from the phone to the PC and open up a command window in any folder that has "fastboot" in the path. Periodically try this command "fastboot devices" and if you get any output that shows a device number, you can do fastboot commands. It isn't so important what's on the screen as whether you can communicate with the device. (I don't have a 5x, but this usually works on just about everything with a similar button config). Be patient. It might take a few tries. So that ^ is something you try periodically but you need to do this next paragraph or two depending upon how far you get:
You can try holding down (all at once for ~10-30 seconds) up & down & power and when you let go (or perhaps before) you should see the fastboot screen. If you do, good because you can repair it one way or another from there. If you see it or even if you don't, try the "fastboot devices" cmd from the cmd window. Repeat until you see a device number come back.
If you ever get fastboot talking to the phone, then download, unpack, (I mean unpack everything down to a directory with a windows batch file and some .img files in it) this file:
Here are the specific links for each variant:
don't need this: MDA89E - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mda89e-factory-29247942.tgz
don't need this: MDA89F - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mda89f-factory-08c99420.tgz
Get this one: MDB08I - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mdb08i-factory-64536fcf.tgz
The one you probably need is the last one MDB081 since I think that is the modified boot image-version that Chainfire has made for bullhead.
Your phone and you probably need a break before trying this again, so just burn that entire file (the link after mdb08I) and if you use the batch file that basically resets everything, then you should be back to "stock" again but with this version (I think it's the latest OTA version).
Good luck.
hachamacha said:
Before you try anything, attach your cable from the phone to the PC and open up a command window in any folder that has "fastboot" in the path. Periodically try this command "fastboot devices" and if you get any output that shows a device number, you can do fastboot commands. It isn't so important what's on the screen as whether you can communicate with the device. (I don't have a 5x, but this usually works on just about everything with a similar button config). Be patient. It might take a few tries. So that ^ is something you try periodically but you need to do this next paragraph or two depending upon how far you get:
You can try holding down (all at once for ~10-30 seconds) up & down & power and when you let go (or perhaps before) you should see the fastboot screen. If you do, good because you can repair it one way or another from there. If you see it or even if you don't, try the "fastboot devices" cmd from the cmd window. Repeat until you see a device number come back.
If you ever get fastboot talking to the phone, then download, unpack, (I mean unpack everything down to a directory with a windows batch file and some .img files in it) this file:
Here are the specific links for each variant:
don't need this: MDA89E - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mda89e-factory-29247942.tgz
don't need this: MDA89F - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mda89f-factory-08c99420.tgz
Get this one: MDB08I - 6.0.0: https://dl.google.com/dl/android/aosp/bullhead-mdb08i-factory-64536fcf.tgz
The one you probably need is the last one MDB081 since I think that is the modified boot image-version that Chainfire has made for bullhead.
Your phone and you probably need a break before trying this again, so just burn that entire file (the link after mdb08I) and if you use the batch file that basically resets everything, then you should be back to "stock" again but with this version (I think it's the latest OTA version).
Good luck.
Click to expand...
Click to collapse
many thanks mate that worked flawlessly, managed to recover device and so far installed chainfire's boot.img and twrp. on to rooting now.
QUESTION: Can someone who STILL has their device encrypted, flashed TWRP Recovery, pushed the root zip and then entered twrp to flash it explain exactly what happens on the screen in TWRP. Does it block the install process completely, ask for a password to decrypt the device before continuing, or not allow you to unlock it?
I just need to know that part to give better instructions for the toolkit rooting operation. Once the device has been decrypted there should be no problems at all but im just not sure whether to encourage the user to run a decrypt procedure first, before the root prodecure starts.
Any feedback would be appreciated.
Mark.
EDIT: I added the option anyway.
anybody know where the sources are for the kernel?
m4r0v3r said:
anybody know where the sources are for the kernel?
Click to expand...
Click to collapse
They will be here https://android.googlesource.com/kernel/msm/ once Google updates a few things other repos for bulkhead such as device tree and more kernel files will be at https://android.googlesource.com under device/lge/bullhead and under device/lge/bullhead-kernel if that's needed. Let me know if you have more questions!

[HOW TO] ENCRYPTING NX505J (Z7 MAX) [UPDATED Dec. 2nd, 2016]

What is encryption?
Basically, if you lose your phone and someone wipes /data on Recovery mode, the phone boots with NO lock screen, your apps will be gone but YOUR FOLDERS becomes exposed, that means Whatsapp history and media, pictures, downloads, documents. Stuff you wouldn't want in the hands of thieves/strangers.
Does it affect performance?
It does increase memory readings on every phone. But z7 Max doesn't show any lag at all!
Tested ROMs able to ENCRYPT:
- CM13 beta7 by PaoloW8
Tested ROMs able to DECRYPT:
- Ressurection Remix M by pchatzop
(if you wanna try for yourself, please first MAKE FULL BACKUP of your storage folders, files and appdata)
Requirements:
1. External SD Card
2. Crypto footer
3. CM13 beta7
4. Secure screen lock (PIN, Pattern, Password)
5. Pchatzop's Ressurecution Remix 5.7.4 and GApps 6 (IN SD CARD)
Steps:
0. Boot to TWRecoveryP
1. Open Advanced > Terminal
2. Enter
Code:
umount /dev/block/mmcblk0p23
3. Enter
Code:
e2fsck -f /dev/block/mmcblk0p23
4. (this will resize storage LOSING DATA) Enter
Code:
resize2fs -f /dev/block/mmcblk0p23 6896600
5. (second data error check just for safety) Enter
Code:
e2fsck -f /dev/block/mmcblk0p23
6. Back to TWRP home menu > Install > flash CM13 beta7 and the same GApps you're going to use on RR ROM. (let's avoid future FCs). Wipe Dalvik/Cache then reboot to system.
7. Wait for system bootup
8. Head to Settings > Lock Screen
9. Set a secure screen lock
10. Head back to Settings > Security > Encrypt phone > Encrypt
11. Enter password > Encrypt
12. Wait for a while depending on the size of your used storage.
13. Screen lock input shows upon boot then decrypt successfully THIS TIME ONLY, so head back to TWRP.
14. Have your SD card inserted with your RR ROM and GApps. As of November 24, TWRP builds for the Z7 Max CAN'T decrypt storage so ignore screen lock input and head straight to TWRP main screen > Wipe > Advanced Wipe > Check CACHE and SYSTEM only!!!
15. TWRP main menu > Install > flash your ROM and GApps > Reboot and decryption input should show and decrypt on every restart, even if you change your password.
NOTE: To Decrypt Data you have to head to TWRP > Wipe > Format Data > Type "yes", meaning you will LOSE ALL DATA TO DECRYPT so BACKUP first.
3njoy!
bump
Can not get this to work, in order to try my modified twrp. I have tried beta 2 and Rel V9,still stuck at bootscreen. Done the resize2fs, and got past the overlap error, but still stuck at the bad magic error. Will try the beta7 and see if something changes. Do you have the /data original block size in order to revert the resizing? Didn't occur to me to save it Well, there is always nubia updater tool if i get too OCD .
pchatzop said:
Can not get this to work, in order to try my modified twrp. I have tried beta 2 and Rel V9,still stuck at bootscreen. Done the resize2fs, and got past the overlap error, but still stuck at the bad magic error. Will try the beta7 and see if something changes. Do you have the /data original block size in order to revert the resizing? Didn't occur to me to save it Well, there is always nubia updater tool if i get too OCD .
Click to expand...
Click to collapse
Sorry about the delay, final exams.
My original block size is 6896635. This thread is outdated, my new reports makes some info here invalid
Keep up the good work
Thank for the report, i made some STUPID mistake and mixed the fstab.qcom arguments with the twrp fstab argument, which resulted at data being mounted at failsafe mode, thefore not using any of the footer arguments i used,resulting at the recovery not finding the footer. I revert the twrp fstab to the twrptest2 level while keeping the decryption libs intact. New build is up, give it a spin .
pchatzop said:
Thank for the report, i made some STUPID mistake and mixed the fstab.qcom arguments with the twrp fstab argument, which resulted at data being mounted at failsafe mode, thefore not using any of the footer arguments i used,resulting at the recovery not finding the footer. I revert the twrp fstab to the twrptest2 level while keeping the decryption libs intact. New build is up, give it a spin .
Click to expand...
Click to collapse
OK Twrptest4 formats and resizes correctly but doesn't decrypt yet
Kerneltest1 was better than kerneltest2. Flashed both after CM13 beta7, both kernels enabled f2fs support for Paolo's CM13, kernel1 encryption works on first tries on both ext4 and f2fs (on cm13, not RR), kernel2 always give bad superblock. I guess it is not something just in kernel at all but on RR or CM recent builds :?
As a Senior Member, you have more chance of getting response from @luca020400, @luk133, @Vidhanth, @Vatsal (they all contributed for moto G 2014 encryption on ROMs and TWRP) or @golden-guy, @Android-Andi (for s3 mini's)!
Keep up the good work!!
That is a great report, thank you so much! I will check the diffs between kernel 1 and 2, and will get you a twrp with the configuration of kernel 1 with decryption libs. F2fs encryption working is a great step forward. You are right about the second part, kernel does work, but seems like cyanogen source broke the encryption on later builds. I want to get this to work, and even incorporate it in my nougat builds, but twrp needs to work first! Does twrp find the footer but fail to decrypt, or does not find it at all?
---------- Post added 3rd December 2016 at 12:06 AM ---------- Previous post was 2nd December 2016 at 11:17 PM ----------
Just made a new test kernel, together with a new recovery with the above changes. Hope something changes now(at least the kernel should encrypt fine). I also have the qseecomd blob from cm13 beta7 in the folder, i have a feeling that if we replace that blob in the latest RR with a kernel that can encrypt in beta 7, encryption should work there too. Hope you can test and report back. Feeling we are closer to cracking(pun intended) this!
pchatzop said:
That is a great report, thank you so much! I will check the diffs between kernel 1 and 2, and will get you a twrp with the configuration of kernel 1 with decryption libs. F2fs encryption working is a great step forward. You are right about the second part, kernel does work, but seems like cyanogen source broke the encryption on later builds. I want to get this to work, and even incorporate it in my nougat builds, but twrp needs to work first! Does twrp find the footer but fail to decrypt, or does not find it at all?
---------- Post added 3rd December 2016 at 12:06 AM ---------- Previous post was 2nd December 2016 at 11:17 PM ----------
Just made a new test kernel, together with a new recovery with the above changes. Hope something changes now(at least the kernel should encrypt fine). I also have the qseecomd blob from cm13 beta7 in the folder, i have a feeling that if we replace that blob in the latest RR with a kernel that can encrypt in beta 7, encryption should work there too. Hope you can test and report back. Feeling we are closer to cracking(pun intended) this!
Click to expand...
Click to collapse
twrp does find the footer but fail to decrypt, even the Default Android password dont decrypt, I have the TWRP log at home if you want.
When I get home I'll download your new tries.
Thanks again, regards
Good, that means that either the service does not start, or that the zuk decryption libs are incompatible with z7max encryption model. The logs would be great. Meanwhile, im getting a new recovery with all decryption libs replaced with nubia counterparts, so that you can test both variants and see what is really stopping it from decrypting. Its in the folder too.
pchatzop said:
Good, that means that either the service does not start, or that the zuk decryption libs are incompatible with z7max encryption model. The logs would be great. Meanwhile, im getting a new recovery with all decryption libs replaced with nubia counterparts, so that you can test both variants and see what is really stopping it from decrypting. Its in the folder too.
Click to expand...
Click to collapse
Oh, I tested your RR N, it shows decryption screen lock input but after decryption it bootloops, mostly because the /data has Marshmallow stuff, so we need to fix TWRP first to wipe /data without wiping /media along :highfive:
Got a new twrp in the folder, plenty more testing for you! Is beta7 the last build encryption works? Because i can check the github diffs between beta7 and beta8 and see what i can revert to try getting it working again in the latest builds. That is if it is positively the last build that encryption works.
pchatzop said:
Got a new twrp in the folder, plenty more testing for you! Is beta7 the last build encryption works? Because i can check the github diffs between beta7 and beta8 and see what i can revert to try getting it working again in the latest builds. That is if it is positively the last build that encryption works.
Click to expand...
Click to collapse
Yes it is beta7! I tried beta8, V1.... with your boot.img3, encryption starts but gives the same unsuccessful screen from RR. Only beta7 reboots to decryption input.
Also, I have suspicions: as your TWRP set data partition to 6896631 which was originally 6896635, the password MUST BE OF 4 characters (6896631 - 6896635 = -4) for encryption to work?
Unfortunately, no TWRPtest could decrypt yet, it finds the crypto footer but fails. Attaching twrp log and encryption success logcat:
So boot3 works with beta7? I will sift through the logs, think this is a selinux issue introduced in beta8, i will get a new build and try it on my phone, maybe it will work this time.
I got a new twrp in the folder. Spend 5 hours trying to get RR-M to encrypt, tried selinux changes, test builds, replacing blobs with some from beta7, still not there. I could get it to begin encrypting sometimes by rebooting in safe mode with root disabled, but got the encryption unsuccessful screen. There is something that does not allow /data to get unmounted properly during the soft reboot for the encryption, and even when it does, it gets stuck in another point. Hopefully the new twrp will decrypt an already encrypted system.
Got a new twrp in the folder, my attempts at encrypting have failed so far, most i could get was here: "Cryptfs : Error writing crypto_blkdev /dev/block/dm-0 for f2fs inplace encrypt" where "12-31 13:32:09.246 237 306 I Cryptfs : Encrypting from block 0" wuld be on your log. I will attach it , and hopefully you can try to help me, since you have more exprerience with encryption. Hopefully something changes at the recovery front.
pchatzop said:
I got a new twrp in the folder. Spend 5 hours trying to get RR-M to encrypt, tried selinux changes, test builds, replacing blobs with some from beta7, still not there. I could get it to begin encrypting sometimes by rebooting in safe mode with root disabled, but got the encryption unsuccessful screen. There is something that does not allow /data to get unmounted properly during the soft reboot for the encryption, and even when it does, it gets stuck in another point. Hopefully the new twrp will decrypt an already encrypted system.
Click to expand...
Click to collapse
pchatzop said:
Got a new twrp in the folder, my attempts at encrypting have failed so far, most i could get was here: "Cryptfs : Error writing crypto_blkdev /dev/block/dm-0 for f2fs inplace encrypt" where "12-31 13:32:09.246 237 306 I Cryptfs : Encrypting from block 0" wuld be on your log. I will attach it , and hopefully you can try to help me, since you have more exprerience with encryption. Hopefully something changes at the recovery front.
Click to expand...
Click to collapse
Hey, thanks and sorry for taking your time! Did you try a password/PIN/Pattern 4-character/digits/dots long?
TWRPtest8 doesn't decrypt yet
Could you please make your TWRP "Copy Log to SD" save the log in the external SD when available? It is always trying to save in /data/media, but as it is encrypted, the file goes nowhere. So I always have to format, save the log and re-encrypt :highfive:
Keep up the good work!:highfive:

[RECOVERY][UNOFFICIAL][TWRP 3.2.1][MOTO x4 PAYTON][7.1.1/8.0]

OFFICAL TWRP RELEASED, this thread is no longer active. 3-30-2018
https://twrp.me/motorola/motorolamotox4.html
---
UNOFFICIAL BUILDS -- USE AT YOUR OWN RISK AND KNOW HOW TO GET YOURSELF OUT OF TROUBLE IF IT ARISES. I ASSUME NO RESPONSIBILITY FOR YOUR BROKEN THINGS.
UPDATED 01-11-2018
There are now 7.1 based and 8.0 based builds. Obviously, be careful to select the proper download. While I don't think flashing/booting the wrong one would permanently brick the device, let's not find out
For now I will not be attempting to make data decryption work. It is REQUIRED that you unencrypt your device by formatting userdata, so back up your stuff first.
IMPORTANT NOTES: TWRP for OREO is a bit of a pain as it currently requires manually editing your fstab. I have tried to automate this process, but it breaks stuff. So just be aware before you begin that it is a rather time consuming process.
If you make any change to your boot partition after flashing SuperSU, you will need to reflash it or you will get a bootloop.
8.0 OREO TWRP INSTALLATION:
OREO SEEMS VERY FINICKY AND DOES NOT LIKE CHANGES TO ITS FILESYSTEM -- BE PREPARED TO REFLASH STOCK.
0. FLASH OREO FACTORY IMAGE (may work otherwise, but we should be starting from fresh stock here)
1. Download FASTBOOT BOOTABLE TWRP for 8.0/OREO below
2. Download SuperSU 2.82 SR5 below
3. Move SuperSU to external SD or USB OTG
4. From bootloader, fasboot BOOT TWRP
5. Flash SuperSU (note: do not format /data now... not necessary and will cause errors on boot)
6. Reboot system
7. With any root file editor/text editor (Amaze, Total Commander, etc) open /system/vendor/etc/fstab.qcom as a text file for editing.
8. At the end of the /data partition entry, delete "fileencryption=ice" and replace it with "encryptable=footer".
9. Save fstab.qcom (and make sure it is actually saved properly!)
10. Reboot to bootloader and fasboot BOOT TWRP
11. Go to Wipe, hit the FORMAT DATA button, and type "yes" to format /data. This will erase your data, obviously:silly:
12. Reboot system (should now be unencrypted, verify in Settings>Security or by booting TWRP and checking /data with File Manager.
If you later choose to flash TWRP (not the bootable we used here!), you may need to flash SuperSU again to avoid bootloops.
7.1.1 NOUGAT TWRP INSTALLATION:
1. Download current TWRP for 7.1.1 build below
2. Download SuperSU 2.85 SR5 (https://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
3. Move SuperSU to your external Micro SD card.
4. Fastboot flash the TWRP image.
5. Reboot to TWRP.
6. FORMAT data (not wipe...use the "FORMAT DATA" button and type "yes". OBVIOUSLY THIS WILL ERASE YOUR DATA)
7. Install SuperSU 2.85 SR5
8. Reboot to system (it WILL bootloop a couple times...don't panic!) and confirm that device is unencrypted by checking that SETTINGS>SECURITY>ENCRYPTION now prompts "encrypt" (don't do it).
DOWNLOADS:
TWRP FOR 7.1.1 (Nougat) DOWNLOAD: https://drive.google.com/open?id=1Et-AQgCNx7WDAwzihlI51euUa2ixKHEP
TWRP FOR 8.0 (Oreo) DOWNLOAD: https://drive.google.com/open?id=1WcVS_3rloF7jxPulj_jKxfsp3zy5pB5N
FASTBOOT BOOTABLE TWRP IMAGE (OREO BASED): https://drive.google.com/open?id=12ClviqtEjtflB63UQ1CZQNKEqkprBO0u **For temporary TWRP boot using "fastboot boot". Do not flash or you will be stuck in recovery!**
DEVICE TREE: https://github.com/mightysween/android_device_motorola_payton (NEEDS TO BE UPDATED WITH OREO BRANCH)
changelog:
BETA4
-reverted to 3.2.0 for current build (release candidate rebased to 3.2.1).
-fixed "format data" button
-finalized fstab for OTG/SD/INTERNAL mounting
-target is now UNENCRYPTED devices only (/data decrypt will not be fixed)
BETA3
-Rebased to TWRP 3.2.1
-USB OTG working
-all partitions mounting correctly
-considered working except for decrypt and MTP/ADB
BETA2
-fixed internal storage mount
BETA1
- updated source to TWRP 3.2.0
ALPHA3
- Fixed USB mounting (adb/mtp still nonfunctional) BROKEN IN BETA1
ALPHA2
- SD Card fixed
ALPHA1
- /system is now properly mounted.
- now plays nice with our working root method.
- ramdisk is patched to prevent first boot encryption once /data is decrypted (now requires flashable ZIP)
NOT WORKING:
adb/mtp/sideload
/data decryption (abandoned -- /data access requires unencryption)
CREDITS: @kraatus90 for kernel fix, @Chainfire for SuperSU, @jcadduono for no-verity-opt-encrypt scripts.
---
Thanks so much for all your work!
hi,
you said this is really unstable and could brick the device easily. however, you seem to be testing and experimenting with your device a lot, so i'd like to ask if you have any particual unbrick method that you use when something goes wrong.. like, a via fastboot flashable image or something simmilar...?
thanks for your work!
Thanks for you work. If you have any unbrick methods pls tell.appreciated your work ?
I am not going to provide step by step "unbrick" methods, because until the partitioning is properly set up, TWRP has potential access to things that can not be fixed.
Again, this is still highly experimental.
All that said, my entire process to protect any device remains the same: Have a backup for every partition you will be testing, make as few changes as possible at a time, test boot images before flashing (fastboot boot), and test restore methods frequently (flashing back to stock or backups), and don't do anything unless you are highly certain of the outcome.
By those standards, there is nothing to gain by installing TWRP right now, as its basic function (install/backup/restore) is not set up yet.
Found the BoardConfig flag to enable FBE (TW_INCLUDE_CRYPTO_FBE := true) but do not have the lib it is dependent on (libe4crypt) and I don't see it anywhere yet...
For reference (not sure this is most current, but it demonstrates the process)
https://github.com/nijel8/TWRP/commit/bd7492de28963b7e74e8e5d3f17ec9a5a287d9c3
I have confirmed that FBE support is present in the source, dependent on this missing module... so need to figure out where/how to enable it.
It is possible that this entire process is specific to only certain devices (i.e. Pixel, Nexus). If this is the case, we may be stuck at this point for awhile.
Obvious workaround is to not be encrypted to begin with -- but that isn't a "solution".
mightysween said:
It is possible that this entire process is specific to only certain devices (i.e. Pixel, Nexus). If this is the case, we may be stuck at this point for awhile.
Click to expand...
Click to collapse
This appears to be the case, unfortunately. Seems that the TWRP FBE support was built specifically for the Google implementation of FBE which was merged into kernel sources for Nexus and Pixel. Not even using the qseecomd I assumed it was... will remove on next build.
Info on FBE:
https://source.android.com/security/encryption/file-based
Will be testing options to disable forced encryption, and if necessary dm-verity...
Anyone who wants to dig through kernel for related flags and props, it would be greatly appreciated!
Hey, where did the big "format data" button go in TWRP? Is that optional on compile... can't find a flag for it...
Making good progress this morning.
Seem to have a build with properly decrypted /system, and working SD Card. I also have patched the boot.img to disable forced encryption on the first boot. But now, I can not find a safe way to fully format (not "wipe") the /data partition. As mentioned in the previous post, the "FORMAT DATA" button is missing. The fastboot command "fastboot format userdata" returns an error that it does not support RAW format.
Need to figure out why this is happening... and once I do, I believe I can reformat /data without encryption and then will have an almost fully working TWRP build. Obviously, the ideal solution would be to have TWRP work out of the gate with an encrypted /data, but until then this is going to be our best option.
Will post an updated test build in the OP soon.... needs further testing before I would recommend non-expert users to try it.
Getting very close now!
UPDATE: ADDED NEW BUILD TO OP
---
Also, just occurred to me that the ramdisk will need to be patched every time, so now that I have SD card support will be testing some of the existing flashable ZIPs out there that are designed specificially to prevent first-boot encryption and/or disable dm-verity.
---
mightysween said:
Hey, where did the big "format data" button go in TWRP? Is that optional on compile... can't find a flag for it...
Click to expand...
Click to collapse
This is really the only hold up... I changed the partition from 'Advanced Wipe", but as expected, it was still encrypted on boot as it doesn't actually format the footer where encryption is stored. I can't figure out where that darn "FORMAT DATA" button ran off to, and that is exactly what we need here.
mightysween said:
This is really the only hold up... I changed the partition from 'Advanced Wipe", but as expected, it was still encrypted on boot as it doesn't actually format the footer where encryption is stored. I can't figure out where that darn "FORMAT DATA" button ran off to, and that is exactly what we need here.
Click to expand...
Click to collapse
I don't know how to help except to say that using TWRP 3.1.0-MOD_1 with my XT1254 (DROID Turbo), when you go to wipe it has two buttons --- one on the left for Advanced Wipe and Format Data on the right.
johnjingle said:
I don't know how to help except to say that using TWRP 3.1.0-MOD_1 with my XT1254 (DROID Turbo), when you go to wipe it has two buttons --- one on the left for Advanced Wipe and Format Data on the right.
Click to expand...
Click to collapse
I have 3.1.1-0 (same version I am building here) on several other devices, and the button is there. It has to be triggered by something during compile, but I can't figure it out. Driving me nuts
Looking through TWRP source, and can find actions for every other button (wipe, backup, restore, install, etc) but not for format. Hmm.
I posted over on an old but semi-active TWRP flags thread, maybe someone will have some insight.
Wondering if I make a stock boot image without the encryption tag in fstab, and then wipe data and reboot... then flash my image. That may make it so the data partition is never encrypted in the first place and allow TWRP to work.
But that is an ugly, non-user friendly fix. Why can't we just format /data?
---
Final update for today... this seems to be a compile issue, which is a good thing. I tried to manually decrypt /data from the TWRP command line, and got this:
No crypto support was compiled into this build.
Click to expand...
Click to collapse
So, I must be missing something in boardconfig still... and maybe need to set up a small proprietary vendor folder with the necessary libs
mightysween said:
Final update for today... this seems to be a compile issue, which is a good thing. I tried to manually decrypt /data from the TWRP command line, and got this:
So, I must be missing something in boardconfig still... and maybe need to set up a small proprietary vendor folder with the necessary libs
Click to expand...
Click to collapse
Thanks for doing all of this! I wish I had the time and knowledge to help.
Had a few PM's checking on TWRP status, so an update.
The good news is that the X4 is using Qualcomm based decryption for /data... the bad news is that most if it seems to be closed source. This will take some time for me to figure out, but I have already made some progress by sifting through logs.
Right now, I am trying to find a device with similar decrypt scheme to have some more guidance on the process.
mightysween said:
Had a few PM's checking on TWRP status, so an update.
The good news is that the X4 is using Qualcomm based decryption for /data... the bad news is that most if it seems to be closed source. This will take some time for me to figure out, but I have already made some progress by sifting through logs.
Right now, I am trying to find a device with similar decrypt scheme to have some more guidance on the process.
Click to expand...
Click to collapse
dont know all about these things but maybe xiaomi mi a1 twrp can help as it is also using same a/b partition. and twrp is already there for it
vivek638 said:
dont know all about these things but maybe xiaomi mi a1 twrp can help as it is also using same a/b partition. and twrp is already there for it
Click to expand...
Click to collapse
Thanks, the Mi A1 is one of the devices I have been comparing to, and has been quite helpful.
mightysween said:
Thanks, the Mi A1 is one of the devices I have been comparing to, and has been quite helpful.
Click to expand...
Click to collapse
Keep searching. wish i could have helped but dont know anything about compiling n all..
I'm not much of a programmer, but I can look through the files. Is there anything in particular we're searching for?

[Recovery][VS995][Unofficial] TWRP 3.2.1-0

Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
Note 1/19/18: I fixed OTG in 3.2.1-0. Since the LineageOS kernel for the VS995 is known to have broken OTG, I went back to my good old reliable 10b source. I stripped down the options as much as I could to reduce the file size. It seems to be working well. Unfortunatly the only way to tell them apart is the file size or md5.
Old: 24,637,440 bytes / MD5 - ca8bb67c07a81fe17f463eeaacd7c096
New: 24,653,824 bytes / MD5 - d2b25849241b9524b838a11bb0a39093
Here's the build info from the old builds for those looking for breadcrumbs, etc.
OK, this is the first time I've built TWRP so I'm sure there are some issues. Please use this at your own risk. I've done some very basic testing and it seems to work OK for my purposes. I do not plan to build for anything other than the VS995. For other devices I'll lay out my basic workflow in hopes that those still working on other devices can do the same.
Basically I followed the guide here: https://forum.xda-developers.com/showthread.php?t=1943625
Since I already have the LineageOS repositories (with proprietary files from here) installed on my machine, I started with the code from here: https://github.com/omnirom/android_bootable_recovery
I found out LineageOS doesn't have busybox so I added that to my LineageOS system/external folder from here: https://github.com/omnirom/android_external_busybox
Since it failed to build with encryption, I cherry-picked this commit: https://gerrit.omnirom.org/#/c/22096/
I added the recover.fstab from here to the device folder for the vs995: https://github.com/jcadduono/android_device_lge_vs995/tree/android-6.0/recovery/root
Here are the extra lines and flags I added to my default LineageOS BoardConfig.mk
Code:
RECOVERY_VARIANT := twrp
PRODUCT_COPY_FILES += device/lge/vs995/twrp.fstab:recovery/root/etc/twrp.fstab
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TW_INCLUDE_CRYPTO := true
That's pretty much everything I've done.
Note to developers: This recovery is a true VS995 build. Please add vs995 to your zips asserts.
Know issues:
- ROMs, kernels, mods, etc. whose zips are built with 'elsa' and/or 'vs996' only asserts will not flash. This is not a bug. If your zip tells you it's for another device and not a vs995, please ask the developer to add this to their asserts.
Download: VS995 TWRP 3.2.1-0
Device tree/kernel source
Old Builds:
VS995 TWRP 3.2.0-0
TWRP 3.2.1-0 Changelog
Code:
What's new in 3.2.1-0:
* minui fixes (cryptomilk)
* Better android-8.0 compatibility in ROM trees (Dees_Troy)
* Fix missing library in android-8.0 (nkk71)
* Fix inconsistent SDCard naming (DevUt)
* Default to TWRP restore instead of adb backup restore to fix restore on fresh TWRP boot (jlask)
Thank you very much, even though I don't own a VS995 it's always good to see new development. Thanks again OP.
Link gives me "Access Denied"
wally86 said:
Link gives me "Access Denied"
Click to expand...
Click to collapse
I (think I) fixed it. Please try again.
BackCheck said:
I (think I) fixed it. Please try again.
Click to expand...
Click to collapse
Working now!
I just received my vs995. I'm gonna downgrade to 12A from 15A with uppercut, when use dirtysanta. Should I use twrp 3.0.2-1 like in the guide then then update to 3.2.0-0 or just use 3.2.0-0?
Thanks
wally86 said:
Working now!
I just received my vs995. I'm gonna downgrade to 12A from 15A with uppercut, when use dirtysanta. Should I use twrp 3.0.2-1 like in the guide then then update to 3.2.0-0 or just use 3.2.0-0?
Thanks
Click to expand...
Click to collapse
I would 100% use the 3.0.2-1 from the thread. It has been well tested. From there is you're looking to use a custom kernel or flash a custom rom, then you might test 3.2.0-0. Like I said in the OP, this is the first time I've ever messed with compiling TWRP.
BackCheck said:
I would 100% use the 3.0.2-1 from the thread. It has been well tested. From there is you're looking to use a custom kernel or flash a custom rom, then you might test 3.2.0-0. Like I said in the OP, this is the first time I've ever messed with compiling TWRP.
Click to expand...
Click to collapse
Alright sounds good. I'm gonna try resurrection remix & weta with this version and I'll report back in a few days with how it's working.
Awesome, thanks for keeping the development alive!
Awesome thanks so much. Downloading now. You're great!
Any idea if this is available on the H918 (T-mobile)?
jaysonic88 said:
Any idea if this is available on the H918 (T-mobile)?
Click to expand...
Click to collapse
To the best of my knowledge, there is no 3.2.0 TWRP for the H918, 3.1.1 is the most recent build for it.
This works perfectly with VS995. Thank you!
Any idea how to make this for H990DS ?
Zenns said:
Any idea how to make this for H990DS ?
Click to expand...
Click to collapse
Between the links I posted in the OP and this there are enough breadcrumbs for someone to start building it. That someone isn't me but I would gladly offer advice if needed.
BackCheck said:
Between the links I posted in the OP and this there are enough breadcrumbs for someone to start building it. That someone isn't me but I would gladly offer advice if needed.
Click to expand...
Click to collapse
So I followed your guide (thanks btw!) and successfully compiled twrp 3.2 for the h910 (att) variant. There are some issues for me though. First the terminal in twrp constantly says "child process exited" when I try to type anything in. Also when installing stuff there's a red warning saying "error mount -o bind data/media/0 error 2" or something similar. In the file manager I can access that partition and see files there. Backup and restore seems to work and I tested a couple of magisk zips and they all flashed successfully. Was wondering if you had seen anything like that.
toastyp said:
So I followed your guide (thanks btw!) and successfully compiled twrp 3.2 for the h910 (att) variant. There are some issues for me though. First the terminal in twrp constantly says "child process exited" when I try to type anything in. Also when installing stuff there's a red warning saying "error mount -o bind data/media/0 error 2" or something similar. In the file manager I can access that partition and see files there. Backup and restore seems to work and I tested a couple of magisk zips and they all flashed successfully. Was wondering if you had seen anything like that.
Click to expand...
Click to collapse
Good job. And no, my first build had completely different errors. If you want to PM me your fstab and board config I might be able to look over it sometime and see if I can see anything. Those 2 files look like good places to start.
So I've gone and gotten a sorta working us996 build. Definitely took a couple trys, and my first attempt wiped /data (thanks LG, but this is why I keep backups!) Since I didn't have TW_IGNORE_MISC_WIPE_DATA set. It doesn't have USB otg support like the old 3.0.2 build does (neither does Lineage, but the old build and stock does). I plan on looking at cleaning up my fstab or whatever so that the sdcard is labeled nicely (has internal storage and then storage0 - storage4 with the sdcard being one of those). Havnt tried backups/restoring yet, nor any sort of encryption, but flashing a new lineage build, gapps, and magisk worked. Slightly annoyed I can't build lineage and twrp at the same time (using brunch it pukes out an error about not being able to find some library twrp builds in it's applypatch directory, granted paraphrasing errors doesn't help much) but whatever I can toggle back and forth.
Phoenix591 said:
So I've gone and gotten a sorta working us996 build. Definitely took a couple trys, and my first attempt wiped /data (thanks LG, but this is why I keep backups!) Since I didn't have TW_IGNORE_MISC_WIPE_DATA set. It doesn't have USB otg support like the old 3.0.2 build does (neither does Lineage, but the old build and stock does). I plan on looking at cleaning up my fstab or whatever so that the sdcard is labeled nicely (has internal storage and then storage0 - storage4 with the sdcard being one of those). Havnt tried backups/restoring yet, nor any sort of encryption, but flashing a new lineage build, gapps, and magisk worked. Slightly annoyed I can't build lineage and twrp at the same time (using brunch it pukes out an error about not being able to find some library twrp builds in it's applypatch directory, granted paraphrasing errors doesn't help much) but whatever I can toggle back and forth.
Click to expand...
Click to collapse
I share your pain on the errors with brunch, I get that too. What are you using for fstab? If your using the fstab from jcadduono then OTG is in the file, then it's in there. I don't use OTG so I'm not sure it or encryption is working in mine either. I need testers.
BackCheck said:
I share your pain on the errors with brunch, I get that too. What are you using for fstab? If your using the fstab from jcadduono then OTG is in the file, then it's in there. I don't use OTG so I'm not sure it or encryption is working in mine either. I need testers.
Click to expand...
Click to collapse
No it isn't in jc's fstab, looks like USA-RedDragon has it in his, https://github.com/DesolationRom-Devices/device_lge_h910twrp?files=1 . Going to take a closer look in a day or so.
Well, I got USB otg working, just not the way I hoped. I grabbed the prebuilt kernel image from the repo in my last post and that did the trick when using his fstab as well. So it's probably a kernel problem, since it didn't work with his fstab alone. I tried enabling the more obviously named USB otg kernel config options without success.

Categories

Resources