1. 31 Mar, 2016 1 commit
    • Ethan Yonker's avatar
      Improve progress bar handling for backup / restore / image flash · 472f5068
      Ethan Yonker authored
      The progress bar will now be updated during image backups, restores
      and during image flashing (except for sparse images which will require
      significant changes to libsparse, and except for mtd nand using
      flash_utils).
      
      The progress bar will now be updated mid-file for file systems (tar) so
      the user will see changes even during large file backup / restore.
      
      Add a new progress tracking class to simplify handling of progress bar
      updates. The class will only update the progress bar 5 times a second to
      reduce the CPU load from updating the GUI frequently which does affect
      backup times.
      
      Change-Id: Iff382faef3df1f86604af336c1a8ce8993cd12c5
      472f5068
  2. 29 Mar, 2016 1 commit
    • James Christopher Adduono's avatar
      Allow restoring to read-only file system · d6f94acc
      James Christopher Adduono authored
      This allows the restoration of firmware or modems on read-only
      mounted file systems. If the user is able to make a backup of
      these partitions, it would only make sense they be allowed to
      restore that backup. The current handling is dangerous in that
      it happily wipes, but refuses to restore. :)
      
      Note that it would be preferable to use the backup=emmc flag
      instead in most cases, added by change:
      https://gerrit.omnirom.org/#/c/17183
      
      Change-Id: I32d47c8928dee61595c15a9db16d3c5b9a6d7183
      d6f94acc
  3. 06 Mar, 2016 1 commit
  4. 18 Feb, 2016 1 commit
  5. 06 Feb, 2016 1 commit
    • nkk71's avatar
      Add MultiROM support to standard TWRP tree · 09e43081
      nkk71 authored
      Squashed commit that allows MultiROM TWRP to be built from
      within the standard TWRP environment.
      
      MultiROM build flags and TARGET_RECOVERY_IS_MULTIROM
      must be defined in device tree.
      
      -------------------------------------
      
      MultiROM-support:
      - Move files to separate folder
        * Move primary multirom files to /recovery/multirom
        * Move multirom prebuilt files to /recovery/multirom/prebuilt
        * Move cp_xattrs folder used by multirom to /recovery/multirom/cp_xattrs
      - Add Android.mk for mrom-prebuilt files
      - Add Android.mk for mrom-cp_xattrs files
      - Fix include paths
        * fix includes in multirom.h/c/hpp/cpp files to go to parent (main recovery folder)
      - Add read_data function
        * Add read_data function used by multirom
        * Don't append to minzip, use a seperate file
      - Remove deprecated 'flags' variable
        * Remove deprecated 'flags' in function call to mzExtractRecursive
        * Ref: https://github.com/omnirom/android_bootable_recovery/commit/9c0f5d6b348e37533bdcccf1166d6cbf1ca5c50b
      - gui: Add multirom functions
        * objects.hpp - Add multirom action definitions
        * action.cpp - Add multirom actions and functions
          Note: TW_ORS_IS_SECONDARY_ROM code moved to openrecoveryscript.cpp
        * Add TARGET_RECOVERY_IS_MULTIROM flag to Android.mk
        * Reorder code changes for easier merging
      - twrp-functions
        * Add functions needed by multirom
        * Reorder code changes for easier merging
      - partition.cpp and partitionmanager.cpp
        * Add and embed multirom specific code
        * Reorder code changes for easier merging
      - twrp.cpp
        * Add and embed multirom specific code
      - variables.h
        * Add multirom specific defines
      - Android.mk
        * update Android.mk for compartmentalized multirom
      - gui: Update fileselector
        * Add <excludes> tag
        * Add support for multiple file extensions
      - gui: Update listbox
        * Add support for dynamic <items> tag
      
      Thanks @CaptainThrowback and @z31s1g for your help
      09e43081
  6. 29 Jan, 2016 1 commit
    • Ethan Yonker's avatar
      Replace fix permissions with fix contexts for emulated storage · b5fab76b
      Ethan Yonker authored
      Fix permissions rarely fixed anything on more recent versions of
      Android and usually made things worse. Instead we will replace it
      with a more dumbed down option that should fix contexts on
      /data/media with a few improvements to ensure that contexts get
      fixed for multiple users and on adopted storage.
      
      Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
      b5fab76b
  7. 25 Jan, 2016 1 commit
    • Ethan Yonker's avatar
      Adopted Storage support · 66a1949d
      Ethan Yonker authored
       -Detects, decrypts, and mounts an adopted SD card if a
        secondary block device is defined (usually mmcblk1)
       -Handles unified storage
       -Displays the adopted storage in MTP along with internal
       -Factory Reset - wiped just like a data media device, we
        retain the keys folder and the storage.xml during a
        factory reset
       -Backup / Restore
       -Disable mass storage when adopted storage is present
       -Read storage nickname from storage.xml and apply it to
        display names in the GUI
       -Read storage.xml and determine what storage location is in
        use for /sdcard and remap accordingly
      
      libgpt_twrp is source code mostly kanged from an efimanager
      project. It is GPL v2 or higher, so we will opt for GPL v3.
      
      Change-Id: Ieda0030bec5155ba8d2b9167dc0016cebbf39d55
      66a1949d
  8. 04 Jan, 2016 1 commit
  9. 19 Dec, 2015 2 commits
    • Ethan Yonker's avatar
      Use ioctl to get block device size · d18a821e
      Ethan Yonker authored
      AMLogic based device uses paths like /dev/block/recovery and the
      stock init binary either deletes or does not create mmcblk0p12
      which breaks TWRP because TWRP cannot match up the path / name.
      The ioctl method is probably more reliable anyway and certainly
      should be faster.
      
      Change-Id: I73f981dcec637cdf5b189bdefa00ea15b924b500
      d18a821e
    • Ethan Yonker's avatar
      Multiple Language Support · 74db157b
      Ethan Yonker authored
      This is similar to https://gerrit.omnirom.org/#/c/14014
      
      A lot of the features built in the older patch set have been split
      out into separate patches, most of which have already been merged.
      The remaining functionality here should all be directly related to
      language selection and loading. We always load English as a base
      before loading other languages over the top of the base. The idea
      is that if another language is missing a translation, then we will
      still display the English.
      
      Maybe still to do: read the /cache/recovery/last_locale file and
      load a language based on that. For me, this file contains just:
      en_US
      We probably won't bother with region specific translations so we
      would have to look at either trimming off the _US or using some
      other method like perhaps a symlink or a combination of the two.
      
      Thanks to _that for twmsg.cpp class
      
      Change-Id: I9647a22e47883a3ddd2de1da51f64aab7c328f74
      74db157b
  10. 25 Nov, 2015 2 commits
    • Ketut Putu Kumajaya's avatar
      Fix broken fsflags support · bfb72b06
      Ketut Putu Kumajaya authored
      Process_FS_Flags Flags parameter is just a copy not a reference,
      not get updated, Mount_Flags always 0 - fix it now.
      
      Thanks to SHM @ XDA-Developers
      
      Change-Id: Ib044db905febfedefee493cfc04fd1cad6f61f8e
      bfb72b06
    • Matt Mower's avatar
      Update dosfstools · 18794c82
      Matt Mower authored
      * Version 3.0.28
      * Update filenames in source
      * Remove unnecessary symlink to fsck
      * Commit "Recode short filenames from DOS codepage (default 437)." has
        been reverted since we do not have access to iconv
      * Commits cherry-picked on top of 3.0.28:
          - mkfs.fat: fix incorrect int type
          - Prevent out of bound array read in date_dos2unix()
      
      Change-Id: I50310235c62ec2e6bc90afcd10f2814d3afb5113
      18794c82
  11. 14 Jul, 2015 1 commit
    • Ethan Yonker's avatar
      Add ntfs-3g support · b81d9051
      Ethan Yonker authored
      Add support for mounting ntfs via ntfs-3g and support for wiping
      and repairing ntfs partitions.
      
      Change-Id: I82dc4626f459bb93b86eb9ebba64ad3a6560781b
      b81d9051
  12. 28 May, 2015 1 commit
    • Ethan Yonker's avatar
      Add resize2fs and ability to run resize2fs via GUI · a2719156
      Ethan Yonker authored
      Note: Only works on ext2/3/4 partitions. Only tested on ext4.
      
      We can use this in some cases to resize the data partition if an
      incorrect fstab caused recovery to not reserve the 16KB for a
      crypto footer.
      
      Sometimes the BoardConfig for a custom ROM does not have the
      correct size for the system partition and if the ROM flashes a
      raw system image, that image will not take up the full block
      device. Running resize2fs can fix the size and may allow more
      room in the system partition for customizations like busybox or
      a larger gapps package.
      
      Sometimes flashing a factory image may flash userdata with an
      image with a file system that does not take up the full size of
      the block device (e.g. factory images for the Nexus 6 will flash
      userdata with a ~24GB userdata image, wasting ~30GB of space).
      Using resize2fs we can easily fix this issue without having to do
      a full format data.
      
      Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
      a2719156
  13. 27 May, 2015 1 commit
    • Ethan Yonker's avatar
      Mount system as read-only by default · eb32b1ff
      Ethan Yonker authored
      Mounting system as rw can prevent future OTA updates. The purpose
      of this patch set is to prevent TWRP from mounting sytem as rw on
      the first boot. Device maintainers should update their twrp.fstab
      files on these devices to include an additional line:
      /system_image emmc /dev/block/../system
      
      This line will allow TWRP to create a raw system image backup to
      ensure that the user can return to an original state for future
      OTA updates.
      
      Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
      eb32b1ff
  14. 23 Feb, 2015 1 commit
  15. 02 Feb, 2015 1 commit
    • Ethan Yonker's avatar
      MTP: make MTP work even if unplugged and replugged · 1b03920c
      Ethan Yonker authored
      Set up a loop to keep trying to open / read the MTP device so that
      MTP will work even if the device is unplugged during boot or
      unplugged and replugged in.
      
      Change-Id: I0d3a3b7c91ce84a8cbed16caa4b15efee35b3641
      1b03920c
  16. 27 Jan, 2015 1 commit
    • bigbiff's avatar
      Add cancel backup capability. · 7abc5fe1
      bigbiff authored
      This will stop the iteration of the partition objects, kill the
      current twrpTar thread and remove the backup directory.
      
      Implement TWAtomicInt class to give us a wrapper that automatically
      uses mutexes before the read and write to help ensure that the
      reads and writes will be atomic based on documentation.
      
      Change-Id: I645b22bc980a292e9c7202acb24ffd22ebe68c63
      7abc5fe1
  17. 09 Jan, 2015 1 commit
    • Ethan Yonker's avatar
      Allow flashing of images via the GUI · 96af84a4
      Ethan Yonker authored
      - Use the Images... button in the lower right of the zip install
        page
      - Unify image flashing functions between restore and image flash
      - boot and recovery partitions are flashable by default
      - use fstab flag flashimg=1 or 0 to override defaults
      - file system partitions are currently not flashable
      
      Change-Id: I822dc446030543c55d2153e219d67a1292374ffc
      96af84a4
  18. 19 Dec, 2014 1 commit
    • Ethan Yonker's avatar
      MTP add/remove storage instead of disabling MTP · 726a0206
      Ethan Yonker authored
      Implement a pipe between TWRP and MTP to allow TWRP to tell MTP
      to remove storage partitions as they become unavailable (e.g.
      during a wipe, unmount, etc) instead of disabling MTP completely.
      This includes some fixes and improvements in destructors to
      properly remove / delete various items. This also means that we
      will not be toggling adb off and on quite as often.
      
      I do not like that we had to add another thread, but we were
      unable to use select() on the mtp_usb character device because
      this device does not support polling. Select always returned
      indicating that the mtp file descriptor was ready to be read and
      the resulting read would block. The read block prevented us from
      being able to include reading of the pipe between TWRP and MTP in
      the main MTP thread.
      
      We might want to add a return pipe letting TWRP know if the
      removal of the storage device was successful, but I am not sure
      how we want to implement this. It would invovle timeouts in both
      TWRP and MTP to ensure that we returned a failure indicator in a
      timely manner to TWRP and prevent deleting the storage device in
      the case of a failure. Right now we make no attempt to ensure that
      an MTP operation is underway like a large file transfer, but we
      were not doing anything like this in the past. In some respects we
      have limited control over what happens. If the user installs a
      zip that unmounts a storage partition, we will not know about the
      change in storage status anyway. Regular Android does not have
      these troubles because partitions rarely get unmounted like in
      recovery. At some point, we have to hold the user accountable for
      performing actions that may remove a storage partition while they
      are using MTP anyway.
      
      Ideally we do not want to toggle the USB IDs and thus toggle adb
      off and on during early boot, but I am not sure what the best way
      to handle that at this time.
      
      Change-Id: I9343e5396bf6023d3b994de1bf01ed91d129bc14
      726a0206
  19. 04 Dec, 2014 2 commits
    • bigbiff's avatar
      add function to partition.cpp to return max file size to mtp responder · 7cb4c332
      bigbiff authored
      Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
      7cb4c332
    • Ethan Yonker's avatar
      Reduce libs needed for decrypt and clean up old decypt files · 253368a0
      Ethan Yonker authored
      Trim cryptfs.c to remove functions that TWRP does not use for
      decrypt and remove the need for libfs_mgr from cryptfs.c by
      passing some items to cryptfs.c from the partition manager.
      
      Add support for new fstab flags:
      encryptable and forceencrypt=/path/to/cryptokey
      For example:
      flags=forceencrypt=/dev/block/platform/sdhci-tegra.3/by-name/MD1
      Note that "footer" is the default, so you do not need to set this
      flag on devices that use the footer for the crypto key.
      Also add mounttodecrypt if you need to mount a partition during
      the decrypt cycle for firmware of proprietary libs.
      
      Clean up decrypt and only support one version
      
      Android 5.0 lollipop decrypt should be backwards compatible with
      older versions so we will only support one version, 1.3 that came
      with 5.0 lollipop.
      
      Remove support for Samsung TouchWiz decrypt. It does not work with
      the latest versions of Samsung encryption anyway and it has not
      been updated to work with any AOSP decryption higher than 1.1
      
      Change-Id: I2d9c6e31df50268c91ee642c2fa090f901d9d5c9
      253368a0
  20. 04 Nov, 2014 1 commit
  21. 08 Oct, 2014 1 commit
    • that's avatar
      mtp: cleanup, fixes and performance improvements · 9e0593ea
      that authored
      - use std::map instead of linked list
      - read directories on demand
      - fix writing zip files to storage root
      - fix creating directories
      - lots of minor fixes
      - simplify generation of storage IDs and make them spec compliant
      
      Change-Id: I2137c27549ddbdc58466f2e3aeda464fac70a3c5
      9e0593ea
  22. 19 Sep, 2014 1 commit
  23. 15 Sep, 2014 1 commit
  24. 04 Sep, 2014 1 commit
  25. 02 Sep, 2014 1 commit
  26. 09 Jul, 2014 1 commit
    • Ethan Yonker's avatar
      Track backup and restore progress · 1b7a31bd
      Ethan Yonker authored
      Track backup and restore progress based on the sizes of the files
      as they are being added to the tar backup file. Update the
      progress bar based on the sizes of the files.
      
      Change-Id: Idf649efa1db3e91830b4b2add86203a3f30042ff
      1b7a31bd
  27. 04 Jun, 2014 1 commit
  28. 31 May, 2014 1 commit
  29. 16 Apr, 2014 1 commit
    • Matt Mower's avatar
      Support alternative .android_secure location · bf4efa39
      Matt Mower authored
      Some devices (jewel, m8) have .android_secure at a non-standard
      location. Allow a different partition to be specified as the home of
      .android_secure using the fstab flag 'andsec'.
      
      Using the /data/media variant of jewel as an example, recovery.fstab or
      twrp.fstab could be edited like follows:
      
      /external_sd  vfat  /dev/block/mmcblk1p1  flags=display="MicroSD";andsec
      
      Note, this is NOT a method to move .android_secure in your ROM. Your ROM
      must already write to this alternative location.
      
      Change-Id: I3a6e4e63aaddb35870b79e80938b0f9c2c902443
      bf4efa39
  30. 01 Apr, 2014 1 commit
  31. 13 Mar, 2014 1 commit
  32. 19 Dec, 2013 2 commits
  33. 24 Oct, 2013 1 commit
  34. 22 Oct, 2013 1 commit
  35. 30 Aug, 2013 1 commit
  36. 29 Aug, 2013 1 commit