1. 27 Nov, 2017 1 commit
  2. 17 Jun, 2017 2 commits
    • nkk71's avatar
      Fix incorrect 'unlink' return value check · 9efbe769
      nkk71 authored
      Change-Id: I430f6bb21a5fd87e0422420463e8bb96c4a612e1
      9efbe769
    • 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
  3. 01 May, 2017 1 commit
  4. 23 Apr, 2017 1 commit
    • bigbiff bigbiff's avatar
      ADB Backup: fix adb restore issues · b5ecaad2
      bigbiff bigbiff authored
      Set Backup_FileName on adb backup to fix restore.
      Set read_from_adb after EOF to return properly
      from newer adb client prompt.
      Create setter and getter for Backup_FileName
      for openrecoveryscript.cpp which is not a
      friend class.
      Fix condition for twrpTar::Get_Size() and adb backup.
      Change-Id: I7eb8168fa3416366b996e220cecbc0e1bcec5e8e
      b5ecaad2
  5. 23 Feb, 2017 1 commit
    • Matt Mower's avatar
      Do not unconditionally remove MTP storage on unmount · a8e6d831
      Matt Mower authored
      * It is not necessary to Remove_MTP_Storage() for a partition if an
        MTP_Storage_ID has not been assigned.
      * The hack to force-set tw_mtp_enabled=1 should no longer be necessary
        now that we're checking whether MTP really needs to be disabled for
        a volume before running Disable_MTP().
      
      Change-Id: I1b7233eedd9da7c6be0c67fc60243f3837105173
      a8e6d831
  6. 08 Feb, 2017 1 commit
  7. 18 Jan, 2017 7 commits
  8. 13 Dec, 2016 3 commits
  9. 30 Nov, 2016 4 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
      Check if mount point is dir during startup · 93ac7a0b
      Ethan Yonker authored
      7.0 trees tend to create a /vendor symlink in the root of the
      ramdisk. TWRP needs to delete the symlink and mkdir to be able to
      mount the partition properly.
      
      Change-Id: Ia338739e07ca16ccd2492ea1fec2f5e99cfc08eb
      93ac7a0b
    • James Christopher Adduono's avatar
      MD5 verification sanity · 79ae093c
      James Christopher Adduono authored
      We can use switches and enums to make things more understandable
      and work with results in a more sensible manner.
      
      PS2: Move file MD5 verification and error handling into
           a separate function to reduce code.
      
      PS3: Default to false in Check_Restore_File_MD5 function
      
      Change-Id: Id3ee0bb444cf13be67bb5dec2c43f7c26a86b954
      (cherry picked from commit 5c3950716e5c7c6279efd5f3f338d6d22e5215e2)
      79ae093c
    • Ethan Yonker's avatar
      Fix image flashing · e080c1f8
      Ethan Yonker authored
      PS2: full_filename is not a dir
      
      PS3: use a consistent format of always assuming directory
           is missing the trailing / + fix whitespace alignment
      
      Change-Id: Ib963473ae10571b3d069b326d024ca04c7224dda
      (cherry picked from commit fa4ff144374474c541351d153549ad11d4396614)
      e080c1f8
  10. 13 Sep, 2016 1 commit
    • Ethan Yonker's avatar
      Clean up PartitionSettings · dcf2b674
      Ethan Yonker authored
      The PartitionSettings struct contains some data elements that are duplicates
      of data elements in the TWPartition class that is contained within the
      PartitionsSettings.Part element. We will eliminate this duplication to help
      reduce the chances for programming bugs.
      
      Specifically, this fixes problems where the current file system does not
      match the backed up file system.
      
      Change-Id: I02f236e72093362050556a2e53a09d1dbb9a269d
      dcf2b674
  11. 31 Aug, 2016 1 commit
  12. 22 Aug, 2016 1 commit
    • Kjell Braden's avatar
      wait for cryptfs device node to come up · 3126a113
      Kjell Braden authored
      this is to prevent a race condition to occur when mounting an adopted
      storage volume just after it was decrypted. After setting up the
      decrypted volume using cryptfs_setup_ext_volume(), Decrypt_Adopted()
      immediately calls Mount(), which will call Check_FS_Type(), which will
      fail in blkid_new_probe_from_filename, as the device node was not
      created yet.
      
      Change-Id: Ic5a274c2066ab278c9b7f1c8b83b820e552ca344
      3126a113
  13. 01 Aug, 2016 1 commit
    • bigbiff's avatar
      ADB: Add adb backup for TWRP. · ce8f83c4
      bigbiff authored
      Functionality for client side to backup
      tar and image streams over adbd to the client under backup.ab.
      
      Using adb backup on the client side you can backup the partitions
      TWRP knows about.
      
      On the client side you can do the following:
      adb backup -f <filename> --twrp <options> where options are
      --compress: compress data
      system: backup system
      cache: backup cache
      data: backup data
      boot: backup boot
      etc for each partition.
      
      You can string multiple options,
      i.e. adb backup -f <filename> --twrp --compress cache system data
      
      adb backup in TWRP will take any option corresponding
      to TWRP fstab partitions, e.g. efs boot as well.
      
      If you do not specify the filename with the -f option,
      adb will backup your data to a filename backup.ab on the client.
      You can then rename the file and encrypt it with desktop tools.
      
      If you don't want to use command line arguments:
      adb backup --twrp
      
      will bring up the gui and allow you to choose partitions
      from the backup page.
      
      To restore the backup use the following convention:
      adb restore <filename>
      
      Structures are used to store metadata in binary inside
      of the file itself. If the metadata structure is modified,
      update the adb version so that it will invalidate older
      backups and not cause issues on restore. When restoring,
      we currently do not support picking specific partitions.
      It's all or nothing.
      
      Change-Id: Idb92c37fc9801dc8d89ed2a4570e9d12e76facf8
      ce8f83c4
  14. 03 May, 2016 4 commits
    • Matt Mower's avatar
      Wait to mount until after fstab processed · 72c87ce3
      Matt Mower authored
      The necessity to process fstab twice stems from mounting partitions
      while still processing. Instead, wait to finish setup of /data, /cache
      and storage parameters until after fstab has been processed (once).
      
      Change-Id: Id77e1edbab5eb68a7cd4a1f34953d819a043d47a
      72c87ce3
    • Matt Mower's avatar
      Remove char/string conversions in fstab processing · 2b2dd15c
      Matt Mower authored
      There a few char->string conversions between functions which handle
      different parts of fstab line processing, but there are no uses of
      string functions. Pass char arrays/pointers around instead.
      
      Change-Id: I976a9a54ee8dcfb6194cadcac6a34e467602003b
      2b2dd15c
    • Matt Mower's avatar
      Rewrite FS fstab flag processing · 4ab42b18
      Matt Mower authored
      * If 'ro' fsflag detected, set Mount_Read_Only = true
      * Only output human readable Mount_Options to log
      * Match fsflags identically (not just first n chars) since there are
        no fs_flags which take arguments
      * Match new processing method introduced in TW fstab flag processing
      
      Change-Id: Iefdb76016be90a131b0d627d0cd3f18d2eb1a008
      4ab42b18
    • Matt Mower's avatar
      Rewrite TWRP fstab flag processing · 2416a50b
      Matt Mower authored
      * Do not flip/flop between std::string and char* when no std::string
        specific functions are applied.
      * Remove the need to manually count flag string lengths
      * Move checks for Display_Name, Storage_Name, and Backup_Display_Name
        out of flag processing
      
      Change-Id: I24d432c222124012b2a98d27598e42d0944f7da2
      2416a50b
  15. 28 Apr, 2016 1 commit
    • Gordon Freeman's avatar
      Partition: Fix parsing of several twrp fstab flags · 5da13028
      Gordon Freeman authored
      fix parsing when using storagename=, backupname= and userdataencryptbackup= in twrp.fstab
      also split encryptable= and forceencrypt= into seperate blocks
      and make storage=Y working
      
      Change-Id: I674f7ffe7f9e4ff121c4dccf79096360e044535c
      5da13028
  16. 31 Mar, 2016 2 commits
    • 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
    • Ethan Yonker's avatar
      DataManager Updates · fe91611c
      Ethan Yonker authored
      The goal of this change is to make DataManager use InfoManager to reduce
      code duplication.
      
      Change-Id: Ia4f4c4324453a192995e0f442db0a03628c13e46
      fe91611c
  17. 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
  18. 17 Mar, 2016 1 commit
    • Ethan Yonker's avatar
      Change to dd for wiping crypto partitions · c2dafbbb
      Ethan Yonker authored
      flash_image was spitting an error. We are also specifying a size
      so that we do not risk writing beyond the partition.
      
      Change-Id: Ie3a0d77db96e54357238595934c3df0e3b680823
      c2dafbbb
  19. 18 Feb, 2016 1 commit
  20. 05 Feb, 2016 1 commit
    • Matt Mower's avatar
      partitions: Mount storage for MTP after wipe · 209c9635
      Matt Mower authored
      Conditionally run Add_MTP_Storage() after wipe if:
      1) is wiped successfully
      2) is storage (already implemented)
      3) mount succeeds
      
      Previous to this commit, Add_MTP_Storage() was called before mounting
      storage, which fails. Mounting storage right after wipe should not be
      a problem since Update_System_Details() does it anyways (and doesn't
      complain if already mounted).
      
      Change-Id: I8a5a78d5ac9181f3a9464dfe6b77284458f9868b
      209c9635
  21. 03 Feb, 2016 1 commit
    • HashBang's avatar
      allow flashing sparse images · ed974bb8
      HashBang authored
      if the image has the right magic bytes to be a sparse image,
      use simg2img to flash the image
      
      create a rule to make a fully dynamic simg2img which results in a
      much smaller increase in gzip ramdisk size (2KB vs 40KB)
      
      Change-Id: I1b0f6bc127da46103888b1154a9bddd8ac02c01d
      ed974bb8
  22. 29 Jan, 2016 3 commits