1. 27 Nov, 2017 1 commit
  2. 18 Nov, 2017 1 commit
  3. 15 Sep, 2017 1 commit
  4. 17 Jun, 2017 1 commit
    • bigbiff bigbiff's avatar
      twrpDigest refactor · 56cf5646
      bigbiff bigbiff authored
      This patch is to refactor twrpDigest using polymorphism
      and inheritance to use the same call patterns for creating and
      reading a digest. Now a library.
      Use SHA2 from libcrypto. SHA2 is default if device has libcrypto.
      
      Change string MD5 everywhere to use digest or Digest instead. Updated
      string tags to digest. Translation will be required.
      
      Switch out digest code into a driver class from partitionmanager.
      
      SHA2 is better for digest creation due to decreased collision space
      compared to MD5 and SHA1.
      
      See https://en.wikipedia.org/wiki/SHA-2
      
      Change-Id: I74b5546789990b12aa4ce2e389d25f80a3fe213f
      56cf5646
  5. 19 Apr, 2017 1 commit
    • Tao Bao's avatar
      Call libvintf to verify package compatibility. · da320ac6
      Tao Bao authored
      The libvintf API has landed. Hook up to do the actual verification.
      
      Bug: 36597505
      Test: recovery_component_test
      Test: m recoveryimage; adb sideload on angler and sailfish, with
            packages that contain dummy compatibility entries.
      Test: m recoveryimage; adb sideload on angler and sailfish, with
            packages that don't contain any compatibility entries.
      Change-Id: Idbd6f5aaef605ca51b20e667505d686de5ac781f
      da320ac6
  6. 13 Apr, 2017 2 commits
    • Tao Bao's avatar
      Add the missing LOCAL_CFLAGS for librecovery. · 235cc8c7
      Tao Bao authored
      The -DAB_OTA_UDPATER part was missing when separating the librecovery
      module (commit 62e0bc75).
      
      Bug: 37300957
      Test: Build sailfish recovery image and sideload full OTA.
      Change-Id: Idd25662f6bc812c1aca95b096802f59b051f8d63
      (cherry picked from commit 25dbe171)
      235cc8c7
    • Tao Bao's avatar
      Add the missing LOCAL_CFLAGS for librecovery. · 25dbe171
      Tao Bao authored
      The -DAB_OTA_UDPATER part was missing when separating the librecovery
      module (commit 62e0bc75).
      
      Bug: 37300957
      Test: Build sailfish recovery image and sideload full OTA.
      Change-Id: Idd25662f6bc812c1aca95b096802f59b051f8d63
      25dbe171
  7. 12 Apr, 2017 1 commit
    • Tao Bao's avatar
      Verify the package compatibility with libvintf. · 62e0bc75
      Tao Bao authored
      verify_package_compatibility() is added to parse the compatibility entry
      (compatibility.zip) in a given OTA package. If entry is present, the
      information is sent to libvintf to check the compatibility.
      
      This CL doesn't actually call libvintf, since the API there is not
      available yet.
      
      Bug: 36597505
      Test: Doesn't break the install with existing packages (i.e. w/o the
            compatibility entry).
      Test: recovery_component_test
      Change-Id: I3903ffa5f6ba33a5c0d761602ade6290c6752596
      62e0bc75
  8. 18 Mar, 2017 1 commit
    • Tao Bao's avatar
      Remove the dead #include's in verifier.cpp. · d7bf82eb
      Tao Bao authored
      A follow-up to commit 5e535014.
      Also clean up Android.mk, since libverifier no longer needs anything
      from libminui.
      
      Test: mmma bootable/recovery
      Test: recovery_component_test passes.
      Change-Id: I1c11e4bbeef67ca34a2054debf1f5b280d509217
      d7bf82eb
  9. 07 Mar, 2017 2 commits
  10. 06 Mar, 2017 1 commit
    • nkk71's avatar
      crypto: Use system's vold for decryption · 71c6c50d
      nkk71 authored
        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
        or
        * 'TW_CRYPTO_USE_SYSTEM_VOLD := <list of services>'
      
        Notes:
        * Setting the flag to 'true' will just use system's vdc+vold
          or
        * 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
          init.recovery.vold_decrypt.{service}.rc
          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
      71c6c50d
  11. 17 Feb, 2017 1 commit
  12. 16 Feb, 2017 1 commit
    • Matt Mower's avatar
      Symlink file_contexts --> file_contexts.bin · d821c96c
      Matt Mower authored
      The presence of /file_contexts is still important to TWRP:
      - files written while in adb shell only pick up contexts if
        /file_contexts is present
      - fixContexts looks for /file_contexts
      - if !USE_EXT4 (is this possible), then make_ext4fs looks for
        /file_contexts when wiping
      
      In the event than file_contexts.bin also becomes more important in the
      future, leave it in place and create a symlink to it.
      
      Change-Id: Ic87852248d42d5ea6bf936df160efa41294b6520
      d821c96c
  13. 02 Feb, 2017 1 commit
    • Matt Mower's avatar
      Allow custom bootloader msg offset in block misc · 8df3191b
      Matt Mower authored
      Globally define BOARD_RECOVERY_BLDRMSG_OFFSET with a decimal integer
      to offset the read/write location in misc where the bootloader message
      should appear. Example:
      
        BOARD_GLOBAL_CFLAGS := -DBOARD_RECOVERY_BLDRMSG_OFFSET=2048
      
      Edify commands get_stage and set_stage need to be aware of the
      custom bootloader msg offset because they write the stage directly
      to the BCB.
      
      Change-Id: Ifdb5ffe3e893a651be59ae63e3a0ebadd828c9f2
      8df3191b
  14. 18 Jan, 2017 4 commits
    • Matt Mower's avatar
      Move sh selection out of GUI makefile · 84057615
      Matt Mower authored
      * The TWRP_SH_TARGET variable is only used if TW_USE_TOOLBOX == false,
        so it doesn't really need to be defined.
      * Move the busybox sh symlink creation nearer to the toolbox/busybox
        build rules and take advantage of LOCAL_POST_INSTALL_CMD which has
        been around since Android 4.3.
      
      Change-Id: I7850f9c3e113d43ad519dd5c9a7d25e36ec1c426
      84057615
    • Matt Mower's avatar
      Move pigz symlinks out of GUI makefile · c55b9a78
      Matt Mower authored
      * Unify the building of pigz and its symlinks under the same module.
        LOCAL_POST_INSTALL_CMD has been around since Android 4.3, use it.
      
      Change-Id: I6a1f74216b6f5a5283fc17839b9b6f19571f3be5
      c55b9a78
    • Matt Mower's avatar
      SELinux can be assumed for Android 4.4+ · 87413643
      Matt Mower authored
      Change-Id: I7410a0c8e439eec90a955ee9201efd9a92bb9635
      87413643
    • bigbiff bigbiff's avatar
      TWRP device version string · 584b9774
      bigbiff bigbiff authored
      For building through jenkins. Export a variable to the shell
      so that we don't monkey patch variables.h and keep the git tag
      clean in the version string.
      Jenkins will export the variable TW_DEVICE_VERSION=n where n > 0.
      The makefile will use this variable to show the device string
      in twrp startup. For mass production builds, omit the
      environment variable to default to 0.
      
      Change-Id: I0d6eb764255d7069c0fb4a378522a009cfe4054f
      584b9774
  15. 17 Jan, 2017 1 commit
    • Tao Bao's avatar
      minui: Export minui/minui.h. · 0ecbd76b
      Tao Bao authored
      For libminui static and shared libraries.
      
      Test: build
      Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
      0ecbd76b
  16. 12 Jan, 2017 1 commit
  17. 11 Jan, 2017 3 commits
  18. 13 Dec, 2016 2 commits
  19. 05 Dec, 2016 1 commit
  20. 30 Nov, 2016 2 commits
    • Ethan Yonker's avatar
      Improve backup & wipe exclusion handling · 3fdcda46
      Ethan Yonker authored
      Rename twrpDU.* to exclude.*
      Remove global variable for du and replace with partition specific
      variables.
      Use separate exclusion lists for backups and wiping.
      Clean up some includes
      Fix some parenthesis in twrp.cpp that I messed up.
      
      Note: twrpTarMain command line utility compiles but probably does
      not work correctly yet due to not properly setting part_settings
      
      Change-Id: Idec9c3e6a8782ba53f3420fa79ba33394f4f85fb
      3fdcda46
    • Ethan Yonker's avatar
      Fix adb shell in 7.0 tree · 0a8a7ceb
      Ethan Yonker authored
      busybox sh does not seem to work properly in 7.0 trees so use
      mksh for sh instead.
      
      Change-Id: Ia33bc3894f929b1348c8714d4ddd00a2671c7e94
      0a8a7ceb
  21. 04 Nov, 2016 1 commit
  22. 18 Oct, 2016 2 commits
    • Yabin Cui's avatar
      Create bootloader_message static library. · 8b309f69
      Yabin Cui authored
      bootloader_messages merges bootloader_message_writer
      and bootloader.cpp, so we can use the same library to
      manage bootloader_message in normal boot and recovery mode.
      
      Bug: 29582118
      
      Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618
      (cherry picked from commit 2f272c05)
      8b309f69
    • Tianjie Xu's avatar
      Replace minzip with libziparchive · 8cf5c8f6
      Tianjie Xu authored
      Clean up the duplicated codes that handle the zip files in
      bootable/recovery; and rename the library of the remaining
      utility functions to libotautil.
      
      Test: Update package installed successfully on angler.
      Bug: 19472796
      
      Change-Id: Iea8962fcf3004473cb0322b6bb3a9ea3ca7f679e
      8cf5c8f6
  23. 09 Oct, 2016 2 commits
  24. 07 Oct, 2016 1 commit
    • Tao Bao's avatar
      Update the header path for ext4_utils. · df0d2a2a
      Tao Bao authored
      Test: `mmma bootable/recovery`
      Change-Id: I70ccddb3ddf46bb012fdc5f632afc46ebdd5473e
      (cherry picked from commit 3cbe1d20978dc488272e2b1ba10890a006fdfab9)
      df0d2a2a
  25. 30 Sep, 2016 2 commits
    • Tianjie Xu's avatar
      Turn on -Werror for recovery · 17e316cc
      Tianjie Xu authored
      Also remove the 0xff comparison when validating the bootloader
      message fields. As the fields won't be erased to 0xff after we
      remove the MTD support.
      
      Bug: 28202046
      Test: The recovery folder compiles for aosp_x86-eng
      Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
      (cherry picked from commit 7aa88748)
      17e316cc
    • Tianjie Xu's avatar
      Turn on -Werror for recovery · 7aa88748
      Tianjie Xu authored
      Also remove the 0xff comparison when validating the bootloader
      message fields. As the fields won't be erased to 0xff after we
      remove the MTD support.
      
      Bug: 28202046
      Test: The recovery folder compiles for aosp_x86-eng
      Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
      7aa88748
  26. 15 Sep, 2016 1 commit
  27. 01 Sep, 2016 2 commits
    • Tianjie Xu's avatar
      Switch recovery to libbase logging · c21edd46
      Tianjie Xu authored
      Clean up the recovery image and switch to libbase logging.
      
      Bug: 28191554
      Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      (cherry picked from commit 74778143)
      c21edd46
    • Tianjie Xu's avatar
      Switch recovery to libbase logging · 7b0ad9c6
      Tianjie Xu authored
      Clean up the recovery image and switch to libbase logging.
      
      Bug: 28191554
      Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
      7b0ad9c6