Commits on Oct 23, 2017
  1. Version 3.1.N1-0

    mdmower committed Oct 23, 2017
    Change-Id: If9ba4fd81c12ea1b08145ffc5ef67c91e8074051
  2. ors: Update doc

    nailyk-fr authored and mdmower committed Apr 17, 2017
    Change-Id: Ia026a8578262d4bb231e1727313ed1f5e323b880
Commits on Sep 5, 2017
  1. Fix minui issues for some build trees

    Dees-Troy authored and mdmower committed May 23, 2017
    In trees where TWRP is the primary recovery, minui.h was not setting rules
    properly for healthd because healthd uses clang. Must use
    CLANG_TARGET_GLOBAL_CFLAGS to set global flags.
    Change-Id: I4cd9c88f8fcaec345fe012d09abcb9f24be06ef4
  2. Fix for LineageOS build

    dianlujitao authored and mdmower committed Feb 24, 2017
     * Match LineageOS cryptfs_hw location
    Change-Id: I5bc1399602f59f4d22827ff7e47acb901b1e33c6
  3. twrpTar: Fix uninitialized current_archive_type

    nkk71 authored and mdmower committed Jun 29, 2017
    * current_archive_type is not properly initialized
      leading to a potential random close(fd) in closeTar()
    Change-Id: I1598ba4d524b723b8175ee847e2b1c5aeedbd938
  4. libtar: Fix restore of e4crypt policies

    Dees-Troy authored and mdmower committed Jul 6, 2017
    Change-Id: I457356069330c38299fd326181c1c88b12a08dbd
  5. Complete support for project pathmap

    mikeNG authored and mdmower committed Apr 28, 2017
    * Use project pathmap when available for LOCAL_C_INCLUDES
    Change-Id: Iddc7cc8509d966307c4a490c9d6c15d761dbb3b4
  6. Fix incorrect 'unlink' return value check

    nkk71 authored and mdmower committed Jun 13, 2017
    Change-Id: I430f6bb21a5fd87e0422420463e8bb96c4a612e1
  7. Improve decrypted partition logging

    nkk71 authored and mdmower committed Jun 4, 2017
    * Partition information should be updated after successful
      decryption (both userdata and adopted) and then logged
    * Fix adopted storage nickname being ""
    Change-Id: Idcdab84f339e932e62880089bad36e206920dd70
  8. cryptfs: Remove dm-crypt device on failed table load

    nkk71 authored and mdmower committed Apr 5, 2017
     * The dm-crypt device needs to be removed from
       the device-mapper driver list otherwise it will
       remain busy and cannot be used later on by
       other processes (eg vold_decrypt) or for further
       testing/debugging in recovery.
    Change-Id: I35e43a79ecc3de234ddb9f87f7d75c6439ea7454
  9. etc: remove "." from LD_LIBRARY_PATH

    that1 authored and mdmower committed Mar 14, 2017
    We shouldn't load libraries from some random working directory.
    For example it breaks busybox when you're in /system/lib.
    Change-Id: Ia1f8f4fda9e6182c0cd8c5ac727c2b1eb09c84a2
  10. gui: fix line wrapping in terminal, issue #876

    that1 authored and mdmower committed Mar 14, 2017
    Apparently we are supposed to delay going to the next line until the next
    character is printed.
    Change-Id: I5cd0cc128cc00dcdd0dd2dd9508281f1249db257
  11. Adopted Storage: backup keys but do not wipe them

    Dees-Troy authored and mdmower committed May 1, 2017
    Change-Id: I545a32848ee686ecfacd13604ae3f18f5d206dfc
  12. Update TWRP to AOSP 7.1.2

    Dees-Troy authored and mdmower committed May 10, 2017
    Change-Id: I19c1546efb4182aac62c690e3cc05b04e3a9a32e
Commits on May 5, 2017
Commits on Mar 10, 2017
  1. Version 3.1.N0-0

    mdmower committed Mar 9, 2017
    Change-Id: If5cc2bb9e5e97c6eb0023d02801036eebe3d510f
  2. Cleanup reboot functions and usage

    mdmower committed Feb 25, 2017
    * Split-out the actual android reboot functions into their own
      Reboot() function and use TW_Reboot()  (renamed from tw_reboot to be
      a bit more consistent in coding style) for all of the TWRP specific
    * Create Get_RebootCommand() to fetch tw_reboot_arg and translate it
      to a RebootCommand.
    * Make sure the same procedure is followed by each different method of
      rebooting the device.
    Change-Id: I5126b47f5fee8578b9c90031a02108f9cf9dc8f4
  3. Create general sleep_and_reboot page

    mdmower committed Feb 21, 2017
    * Repurpose the flash_sleep_and_reboot page for more general usage.
      Any operation (e.g. ORS) that would otherwise directly reboot the
      device without warning can optionally use this page to give users a
      notice and the option to cancel before the reboot occurs.
    * Optionally set tw_complete_text1 before entering sleep_and_reboot to
      change the header text (the sub-header contains the countdown).
    * Do not reset user-configurable option tw_install_reboot if cancel is
      pressed on the sleep_and_reboot page.
    * Go to main if cancel is pressed.
    * End sleepcounter operation more quickly when cancel is pressed by
      breaking the timer loop.
    * Do not call another sleep operation just to ensure the UI updates
      when the timer expires. Handle it in sleepcounter.
    * tw_sleep_total is a constant (perhaps configurable someday).
    Change-Id: I7d2dddad329a84791210f7952db4f64f4de7f87f
  4. Support sideload-auto-reboot

    mdmower committed Feb 25, 2017
    * Recent versions of adb support sideload-auto-reboot with the
      description: "reboots into the sideload mode, then reboots
      automatically after the sideload regardless of the result."
    Change-Id: I3b1869f5779276b89b2799c943e9a1a34da8616e
  5. Lang: Degree symbol is fine in XML

    mdmower committed Feb 18, 2017
    Change-Id: If8f1263cc8df05a77874f2ae0d0c9703949f4e25
  6. Disable encrypted backups

    mdmower committed Feb 26, 2017
    Encrypted backups are poorly implemented (both by TWRP for padding a
    password with zeros to achieve an AES key and openaes for using
    non-standard CBC) and not to be trusted. Do not give users a false
    sense of security by offering this option. Remove the ability to use
    openaes to encrypt backups, but still allow already openaes-encrypted
    backups to be restored.
    Ref: TeamWin/Team-Win-Recovery-Project#817
    Change-Id: Ibc1802372d8caa8c475039e66fb08ce163df27e9
  7. Revert "Default to disabling encrypted backups"

    mdmower committed Feb 27, 2017
    This reverts commit 9cc66d7.
    Change-Id: I5178caf02cd6c2d3cf038856dca5fed33c59ce18
  8. Remove stray prebuilts

    mdmower committed Feb 25, 2017
    * Leftovers from removal of SuperSU, HTC Dumlock, parted,
    Change-Id: Ib674693820130a3edda57b0fe66ee8550e793c01
Commits on Mar 9, 2017
  1. vold_decrypt: Add back missing xml and get rid of compiler warning

    nkk71 authored and mdmower committed Mar 6, 2017
    Change-Id: I883112e2618f560e96002e2076e2735cc20cfac3
  2. crypto: Use system's vold for decryption

    nkk71 authored and mdmower committed Jan 5, 2017
      If TWRP crypto fails to decrypt partition, mount the system
      partition and use system's own vold to attempt decryption.
      This provides a fallback for proprietary OEM encryption as well as
      encryption methods which TWRP hasn't been updated for.
      Requirements in device tree:
      * fstab.{ro.hardware} in device/recovery/root
        The fstab does not need to be complete, but it does need the
        data partition and the encryption entries.
      * 'TW_CRYPTO_USE_SYSTEM_VOLD := true' in BoardConfig
      * 'TW_CRYPTO_USE_SYSTEM_VOLD := <list of services>'
      * Setting the flag to 'true' will just use system's vdc+vold
      * Setting the flag with additional services, will also start them
        prior to attempting vdc+vold decryption, eg: for qualcomm based
        devices you usually need 'TW_CRYPTO_USE_SYSTEM_VOLD := qseecomd'
      * For each service listed an additional import will be automatically
        added to the vold_decrypt.rc file in the form of
        You will need to add any not already existing .rc files in
        your device/recovery/root folder.
      * The service names specified in the vold_decrypt.{service}.rc files
        have to be named 'sys_{service}'
        eg: 'service sys_qseecomd /system/bin/qseecomd'
      * Any service already existing in TWRP as {service} or sbin{service} will
        be stopped and restarted as needed.
      * You can override the default init.recovery.vold_decrypt.rc file(s)
        by placing same named ones in your device/recovery/root folder.
        If you do, you'll need to manually add the needed imports.
      * If /vendor and /firmware folders are temporarily moved and symlinked
        to the folders and files in the system partition, the properties
        'vold_decrypt.symlinked_vendor' and 'vold_decrypt.symlinked_firmware'
        will be set to 1.
        This allows for additional control in the .rc files for any extra
        actions (symlinks, cp files, etc) that may be needed for decryption
        by using: on property:vold_decrypt.symlinked_vendor=1 and/or
        on property:vold_decrypt.symlinked_firmware=1 triggers.
      Debug mode: 'TW_CRYPTO_SYSTEM_VOLD_DEBUG := true' in BoardConfig
      * Specifying this flag, will enable strace on init and vdc, which will
        create separate log files in /tmp for every process created, allowing
        for detailed analysis of which services and files are being accessed.
      * Note that enabling strace will expose the password in the logs!!
      * You need to manually add strace to your build.
    Thanks to @Captain_Throwback for co-authoring and testing.
    Tested successfully on HTC devices:
    M8 (KK through MM), M9 (MM and N), A9 (N), 10 (N), Bolt (N),
    Desire 626s (MM), U Ultra (N)
    HTC One X9 (MTK device)
    And by Nikolay Jeliazkov on: Xiaomi Mi Max
    Change-Id: I4d22ab55baf6a2a50adde2e4c1c510c142714227
  3. file_contexts: remove symlink to binary file and use text version ins…

    CaptainThrowback authored and mdmower committed Mar 7, 2017
    Some older update binaries can't read the binary file_contexts, so include
    the text version of the file to prevent errors. This removes the symlink
    to the binary version of the file and uses the concatenated file_contexts
    from the OUT build folder.
    Change-Id: Ia57c9b47c95945721d3dfa1ec8e18c4bb199adff
  4. Timeout for decrypt

    Dees-Troy authored and mdmower committed Jan 19, 2017
    Sometimes, usually because of proprietary binaries related to keymaster,
    decrypt will hang waiting for the keymaster to initialize forever. This patch
    enables a timeout so that we don't get stuck trying to decrypt forever.
    A timeout is especially important when dealing with the default password
    because the user has no option to cancel when TWRP tries to decrypt.
    NOTE: This patch only adds a timeout for FDE. FBE will require some special
    handling because we need access to some static data and that data is not
    available across a fork.
    Special thanks to nkk71 for cleaning up some issues in my patch set.
    Change-Id: Iccf2fe769ac27a7dcd6bfebfe7d2e9eddd034308
  5. gui: preserve order of gui_print vs gui_msg

    that1 authored and mdmower committed Feb 23, 2017
    - rename __gui_print to internal_gui_print (__* is reserved for compiler)
    - translate outstanding messages in internal_gui_print
    - add locking because background thread could print while we render
    - minor cleanup
    Change-Id: Ib687d2cfb4763ad08ad4d4b76daf5b129d61d2e2
  6. twrpDigest: don't crash when zip.md5 file is empty

    that1 authored and mdmower committed Feb 23, 2017
    Change-Id: I14145b32c7993bb0cd236b2982ed00bc2c791282
Commits on Feb 24, 2017
  1. Run from inside languages dir

    mdmower committed Feb 18, 2017 and make different assumptions about
    the directory from which they are called. Assume the script is run from
    within the languages directory for both.
    Change-Id: I4207919360d82dcd3cfbdebcff38f0e872554744
  2. Tweak MTP startup routine

    mdmower committed Feb 16, 2017
    * As a precaution, (non-permanently) disable MTP if TWRP crashes.
    * Remove a duplicate logging of 'Starting MTP'.
    * Combine and improve readability of conditions before MTP starts.
    * Remove unnecessary Disable_MTP() call if conditions unsatisfied.
    Change-Id: I61ac772fc123da5b84c3061fbcf2116531bc4e2f
  3. Improve handling of USB config during MTP switching

    mdmower committed Feb 23, 2017
    It is possible that devices could run into issues with MTP startup due
    to sys.usb.config not yet being set. This is actually due to a poor
    design decision in Enable_MTP(), where sys.usb.config would not be
    configured for mtp if sys.usb.config had never been set. It is not
    necessary to check for a previous value, just set it.
    Fix the USB PID for adb-only mode in Disable_MTP().
    Change-Id: I21b5e64c9bdcd3104372a8b4eb8ea50cf4561892
Commits on Feb 22, 2017
  1. Fix "ordered comparison between pointer and zero".

    MinSeong Kim authored and mdmower committed Nov 11, 2016
    From Clang 4.x releases, DR583 and DR1512 will be addressed.
    This patch, in advance, fixes the error(s).
    Test: `mmma bootable/recovery`
    Change-Id: I29dc85ae681307c322ab3a698c3f3bbad1c784ee
    Signed-off-by: MinSeong Kim <>
  2. cryptfs: Fix encryption issue due to stack corruption.

    nijel8 authored and mdmower committed Feb 19, 2017
    Ioctl BLKGETSIZE expects pointer to unsigned long as argument.
    On 64bit target using pointer to unsigned int can cause stack
    corruption due to type mismatch.
    props to aopp/android_system_vold@f8b8787
    Change-Id: I1d76c65e29479c8f0cd44b6892069b21b8249b95
  3. Use LOGI/LOGE for non-EVENT_LOGGING events

    mdmower committed Feb 13, 2017
    Change-Id: Iaebc613a25a727a91205d2f361e9d7719036d88d