End-of-Life: No updates are planned after version 3.1.N0-0.
Pull request Compare This branch is 380 commits ahead, 5087 commits behind omnirom:android-9.0.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
applypatch Fix updater binary for 7.0 Dec 24, 2016
attr Add a listxattr tool for listing xattrs Feb 22, 2017
bmlutils twrp: fix incompatible pointer to integer conversions Nov 12, 2015
bootloader_message Fix bldr msg file open mode when offset specified Feb 12, 2017
crypto vold_decrypt: Add back missing xml and get rid of compiler warning Mar 9, 2017
digest Merge up to AOSP marshmallow-release Oct 9, 2015
dosfstools Prevent out of bound array read in date_dos2unix() Nov 12, 2015
edify Update to 7.0 Dec 21, 2016
etc crypto: Use system's vold for decryption Mar 9, 2017
fb2png fb2png: Add some missing includes Jan 15, 2016
flashutils flashutils: additional emmc check Jan 19, 2017
fonts Optimize and reduce size of PNG files Aug 19, 2016
gpt Unix file endings and remove execute permission Feb 29, 2016
gui Create general sleep_and_reboot page Mar 10, 2017
injecttwrp Whitespace and minor code cleanup Jun 4, 2014
libblkid Update to 7.0 Dec 21, 2016
libcrecovery Make TWRP compile for arm64 Nov 12, 2014
libpixelflinger Remove support for non-CM and pre-Android-6.0 Nov 12, 2015
libtar libtar: support backing up and restoring new Android user.* xattr Feb 22, 2017
minadbd Minor cleanup Dec 31, 2016
minui Fix "ordered comparison between pointer and zero". Feb 22, 2017
minuitwrp Use LOGI/LOGE for non-EVENT_LOGGING events Feb 22, 2017
minzip minzip: Add libselinux includes Dec 31, 2016
mksh Add custom mksh build-routine Dec 24, 2016
mmcutils twrp: fix incompatible pointer to integer conversions Nov 12, 2015
mtdutils Fix updater binary for 7.0 Dec 24, 2016
mtp Update MTP debugging tags Feb 18, 2017
openaes Merge up to AOSP marshmallow-release Oct 9, 2015
orscmd More upstream source alignment Jan 27, 2017
otafault Update to 7.0 Dec 21, 2016
prebuilt Remove stray prebuilts Mar 10, 2017
res-hdpi/images Remove new images from AOSP Dec 9, 2014
res-mdpi/images Remove new images from AOSP Dec 9, 2014
res-xhdpi/images Remove new images from AOSP Dec 9, 2014
res-xxhdpi/images Remove new images from AOSP Dec 9, 2014
res-xxxhdpi/images Remove new images from AOSP Dec 9, 2014
res Remove unneeded images Sep 17, 2013
scripts Run language_helper.py from inside languages dir Feb 24, 2017
sepolicy Fixup union sepolicy Nov 5, 2015
simg2img allow flashing sparse images Feb 5, 2016
tests Update to 7.0 Dec 21, 2016
toolboxes Rely on external busybox repo Dec 24, 2016
tools Update to 7.0 Dec 21, 2016
twrpTarMain Cleanup HAVE_SELINUX leftovers Jan 19, 2017
uncrypt Update to android-7.1 Dec 24, 2016
update_verifier Update to android-7.1 Dec 24, 2016
updater Allow custom bootloader msg offset in block misc Jan 24, 2017
.gitignore gitignore: ignore tags file Nov 4, 2014
Android.mk Revert "Default to disabling encrypted backups" Mar 10, 2017
CleanSpec.mk recovery: minui: add adf backend Apr 25, 2014
NOTICE Finally update NOTICE file to contain GPL v3 Mar 17, 2016
README.md Update Readme to reflect state of repository May 5, 2017
adb_install.cpp Update to 7.0 Dec 21, 2016
adb_install.h fix adb sideload Jan 4, 2015
asn1_decoder.cpp Add missing includes. Jan 28, 2015
asn1_decoder.h Add support for ECDSA signatures Oct 10, 2013
bootloader.h Update to android-7.1 Dec 24, 2016
common.h Merge up to AOSP marshmallow-release Oct 9, 2015
data.cpp Create general sleep_and_reboot page Mar 10, 2017
data.hpp DataManager Updates Apr 4, 2016
default_device.cpp Auto-detect whether to use the long-press UI. Apr 10, 2015
device.cpp Update to android-7.1 Dec 24, 2016
device.h Update to 7.0 Dec 21, 2016
error_code.h Update to android-7.1 Dec 24, 2016
exclude.cpp Include symlink size (path length) in Get_Folder_Size() Jan 19, 2017
exclude.hpp Improve backup & wipe exclusion handling Dec 24, 2016
find_file.cpp C headers before C++ headers Aug 4, 2016
find_file.hpp Cleanup headers and includes Jan 1, 2016
fixContexts.cpp Cleanup HAVE_SELINUX leftovers Jan 19, 2017
fixContexts.hpp Replace fix permissions with fix contexts for emulated storage Feb 2, 2016
fuse.h Make the android-5.0 branch compile in 4.4 to 4.1 Dec 2, 2014
fuse_sdcard_provider.cpp Update to 7.0 Dec 21, 2016
fuse_sdcard_provider.h Update to 7.0 Dec 21, 2016
fuse_sideload.cpp Update to 7.0 Dec 21, 2016
fuse_sideload.h Update to 7.0 Dec 21, 2016
infomanager.cpp C headers before C++ headers Aug 4, 2016
infomanager.hpp DataManager Updates Apr 4, 2016
install.cpp Update to android-7.1 Dec 24, 2016
install.h Update to android-7.1 Dec 24, 2016
installcommand.cpp Support new AB OTA zips Dec 24, 2016
installcommand.h Support new AB OTA zips Dec 24, 2016
interlace-frames.py Update to 7.0 Dec 21, 2016
legacy_properties.h Add basic error checking to legacy property init Mar 27, 2014
legacy_property_service.cpp Compatibility updates Dec 24, 2016
legacy_property_service.h Compatibility updates Dec 24, 2016
mounts.c TWRP-ify AOSP code Sep 5, 2012
mounts.h TWRP-ify AOSP code Sep 5, 2012
openrecoveryscript.cpp Cleanup reboot functions and usage Mar 10, 2017
openrecoveryscript.hpp Support ORS commands on the system partition Dec 31, 2016
partition.cpp Do not unconditionally remove MTP storage on unmount Feb 18, 2017
partitionmanager.cpp crypto: Use system's vold for decryption Mar 9, 2017
partitions.hpp Improve backup display names with emulated storage Feb 8, 2017
print_sha1.h Update to 7.0 Dec 21, 2016
progresstracking.cpp progress: Initialize display percentage variable Apr 4, 2016
progresstracking.hpp Improve progress bar handling for backup / restore / image flash Apr 4, 2016
recovery-persist.cpp Update to 7.0 Dec 21, 2016
recovery-persist.rc Update to 7.0 Dec 21, 2016
recovery-refresh.cpp Update to 7.0 Dec 21, 2016
recovery-refresh.rc Update to 7.0 Dec 21, 2016
recovery.cpp Update to android-7.1 Dec 24, 2016
recovery_ui.h TWRP-ify AOSP code Sep 5, 2012
res-560dpi Update to 7.0 Dec 21, 2016
roots.cpp Update to 7.0 Dec 21, 2016
roots.h Update to 7.0 Dec 21, 2016
screen_ui.cpp Update to android-7.1 Dec 24, 2016
screen_ui.h Update to android-7.1 Dec 24, 2016
set_metadata.cpp Compatibility updates Dec 24, 2016
set_metadata.h Compatibility updates Dec 24, 2016
tarWrite.c Improve progress bar handling for backup / restore / image flash Apr 4, 2016
tarWrite.h Improve progress bar handling for backup / restore / image flash Apr 4, 2016
tw_atomic.cpp Cleanup headers and includes Jan 1, 2016
tw_atomic.hpp Add cancel backup capability. Jan 27, 2015
twcommon.h More upstream source alignment Jan 27, 2017
twinstall.cpp More upstream source alignment Jan 27, 2017
twinstall.h Move all AOSP code out of recovery binary Apr 4, 2013
twrp-functions.cpp Cleanup reboot functions and usage Mar 10, 2017
twrp-functions.hpp Cleanup reboot functions and usage Mar 10, 2017
twrp.cpp Cleanup reboot functions and usage Mar 10, 2017
twrpDigest.cpp twrpDigest: don't crash when zip.md5 file is empty Mar 9, 2017
twrpDigest.hpp MD5 verification sanity Dec 31, 2016
twrpTar.cpp libtar: support backing up and restoring new Android user.* xattr Feb 22, 2017
twrpTar.h Improve progress bar handling for backup / restore / image flash Apr 4, 2016
twrpTar.hpp Improve backup display names with emulated storage Feb 8, 2017
ui.cpp Update to 7.0 Dec 21, 2016
ui.h Update to 7.0 Dec 21, 2016
unique_fd.h Update to 7.0 Dec 21, 2016
variables.h Version 3.1.N0-0 Mar 10, 2017
verifier.cpp Update to 7.0 Dec 21, 2016
verifier.h Update to 7.0 Dec 21, 2016
wear_touch.cpp Update to 7.0 Dec 21, 2016
wear_touch.h Update to 7.0 Dec 21, 2016
wear_ui.cpp Update to 7.0 Dec 21, 2016
wear_ui.h Update to 7.0 Dec 21, 2016

README.md

Fork of TWRP

This fork differs from the original in the following ways:

  • Designed to be built with LineageOS 14.1 only
  • Encrypted backups are disabled by default due to poor implementation, see TWRP Issue #817
  • Customize the mksh prompt and environment by editing mksh/mkshrc
  • Require fstab v2 syntax (see examples and supported flags below)
  • Use external repositories for pigz, exfat, fuse
  • SuperSU and HTC Dumlock have been removed
  • adb backup is not implemented due to concerns about code quality
  • Other minor customizations (see change history)

BusyBox vs. Toybox

This fork is ready to rock with toybox... if only toybox were a truly suitable replacement for busybox. Specify TW_USE_TOYBOX := true to replace busybox with toybox, but be aware that many recovery installable packages depend on tools in busybox like awk that are not present in toybox, as well as arguments to available tools like --ignore-fail-on-non-empty for rmdir and -empty for find that are also missing. So, venture at your own risk.

The BusyBox repository at LineageOS can be synced by adding the following to your local manifest:

<project name="LineageOS/android_external_busybox" path="external/busybox" remote="github" />

At last check (May 4, 2017), LineageOS' busybox repository still needs this patch.

To Do

  • Fix hard-coding of alternate block device search (code link)
  • Support vold-formatted entries in fstab (e.g. /devices/platform/msm_hsusb_host/usb* instead of /dev/block/sda1)

Versioning

To help distinguish builds of recovery made from this fork, the minor version digit is replaced with M#. Minor version increments will be handled as needed, independent of TWRP. The major and semi-major version digits follow upstream to roughly indicate feature parity (as close as possible with a fork, anyways).

Convention:

  • 3.0.M0-0 incorporates all major features from TWRP 3.0.0-0
  • 3.0.M1-0 is the minor version increment after 3.0.M0-0 and is independent of any TWRP minor version increment(s)
  • 3.1.M0-0 is the semi-major version increment after 3.0.M4-2 and is tied to a TWRP semi-major version increment
  • 3.0.M0-1 is a device-specific fix to 3.0.M0-0; this device digit resets when any other version increments

Examples of fstab v2 for TWRP

Example fstab v2 for device mt2:

Worth noting in this example: encryptable= does not need to be specified if encryption keys are stored at the footer of /data. This is the default, assumed location.

# device                                          mount_point     fstype  mount_flags                             fs_mgr_flags   twrp_flags
/dev/block/platform/msm_sdcc.1/by-name/boot       /boot           emmc    defaults                                defaults
/dev/block/platform/msm_sdcc.1/by-name/cache      /cache          ext4    noatime,nosuid,nodev                    defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata   /data           ext4    noatime,nosuid,nodev,noauto_da_alloc    length=-16384
/dev/block/platform/msm_sdcc.1/by-name/modem      /firmware       vfat    ro                                      defaults       twrp=display="Firmware";mounttodecrypt
/dev/block/platform/msm_sdcc.1/by-name/log        /log            ext4    defaults                                defaults       twrp=display="Log"
/dev/block/platform/msm_sdcc.1/by-name/misc       /misc           emmc    defaults                                defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery   /recovery       emmc    defaults                                defaults
/dev/block/platform/msm_sdcc.1/by-name/system     /system         ext4    defaults                                defaults

/dev/block/mmcblk1p1                              /external_sd    vfat    defaults                                defaults       twrp=display="MicroSD";storage;wipeingui;removable
/dev/block/sda1                                   /usb-otg        vfat    defaults                                defaults       twrp=display="USB OTG";storage;wipeingui;removable

Example fstab v2 for device jewel:

# device                                           mount_point     fstype  mount_flags                           fs_mgr_flags                                              twrp_flags
/dev/block/platform/msm_sdcc.1/by-name/boot        /boot           emmc    defaults                              defaults
/dev/block/platform/msm_sdcc.1/by-name/cache       /cache          ext4    noatime,nosuid,nodev                  defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata    /data           ext4    noatime,nosuid,nodev,noauto_da_alloc  encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra
/dev/block/platform/msm_sdcc.1/by-name/devlog      /devlog         ext4    noatime,nosuid,nodev                  defaults                                                  twrp=display="Devlog"
/dev/block/platform/msm_sdcc.1/by-name/misc        /misc           emmc    defaults                              defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery    /recovery       emmc    defaults                              defaults
/dev/block/platform/msm_sdcc.1/by-name/system      /system         ext4    noatime                               defaults

/dev/block/mmcblk1p1                               /external_sd    vfat    defaults                              defaults                                                  twrp=display="MicroSD";storage;wipeingui;removable
/dev/block/sda1                                    /usb-otg        vfat    defaults                              defaults                                                  twrp=display="USB OTG";storage;wipeingui;removable

Supported fstab v2 flags in TWRP

Recognized mount flags (Column 4):
Syntax: comma separated

  • bind
  • defaults
  • noatime
  • nodev
  • nodiratime
  • noexec
  • nosuid
  • private
  • rec
  • remount
  • ro
  • rw
  • shared
  • slave
  • unbindable

Recognized fs_mgr flags (Column 5):
Syntax: comma separated

  • defaults
  • encryptable=
  • length=

Recognized twrp flags (Column 6):
Syntax: semicolon separated, begin with twrp=
Example: twrp=display="Firmware";mounttodecrypt

  • andsec
  • backup=
  • backupname=
  • blocksize=
  • canbewiped
  • canencryptbackup=
  • display=
  • encryptable=
  • flashimg
  • forceencrypt=
  • ignoreblkid
  • length=
  • mounttodecrypt
  • removable
  • retainlayoutversion
  • rw
  • settingsstorage
  • storage
  • storagename=
  • subpartitionof=
  • symlink=
  • userdataencryptbackup=
  • usermrf
  • wipeduringfactoryreset
  • wipeingui