summaryrefslogtreecommitdiffstats
path: root/twrp-functions.hpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* AB/Non AB Devices: updates for moving cachebigbiff bigbiff2019-03-181-0/+5
| | | | | | | | | This patchset updates all the places we touch cache on AB devices and non AB devices so that we can write to the appropriate location. AB devices removed the cache partition and moved it to /data/cache. Change-Id: I485ec205a604f1f07ceb7700ae9c4e720fd55c3e
* Remove SuperSUEthan Yonker2018-07-201-1/+0
| | | | Change-Id: I2ca7580bbde5a8903b9ba5c1513ddba887e8d49e
* Use /persist as Qualcomm time fix source during early bootnkk712018-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * /persist can be mounted early while TWRP is parsing the fstab so as soon as the partition is parsed, mount and adjust the time accordingly. * Store a backup settings file on /persist. Having a 2nd copy of the settings file in the /persist partition allows for early reading of the file and adjust timezone and brightness to user preference while still on TWRP splash. * Add the qcom ats time offset in TWRP settings file and use it if no better ats file is found. This will also allow devices with a persist partition, but no ats files in it, to adjust the time offset during early boot. * Use /persist/time/ as Qualcomm time fix source, based on Xuefer <xuefer@gmail.com> patch: https://gerrit.omnirom.org/c/27265/ https://gerrit.omnirom.org/c/24384/ Change-Id: I6c21538eec58d87edfb639d9ce3871f33b886c1d
* Support v2 fstab formatEthan Yonker2017-11-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | Auto detect and support both the v1 and v2 fstab formats Support putting TWRP style flags in a separate /etc/twrp.flags file twrp.flags format is the same as twrp.fstab (v1 with TWRP flags) Support using a wildcard in a block device and find all partitions: /usb-otg vfat /dev/block/sda* Support using sysfs entries (voldmanaged) and read uevents and scan for wildcard partitions from uevent data. (twvold?) May not be complete for some of the newer flags found in fstabs in newer build trees and there is a slim chance of a crash if the user removes a removable device while TWRP is performing actions. May need to add some kind of mutex to prevent the 2 threads from causing this crash. We need to start somewhere though and this change is pretty innocuous when not using a v2 fstab. Change-Id: I617d97c7db332cbe671a9d2b8ad98b3d9c4f03cc
* ADB Backup: add ability for TWRP GUI to restorebigbiff bigbiff2017-11-271-0/+2
| | | | | | | | | Restore adb backup files that TWRP made to your PC. Put files in your backup directory to see them. e.g. /sdcard/TWRP/BACKUPS/<sn> Change-Id: I2c57970d77b64c39a302159041456e761c185259
* twrpDigest refactorbigbiff bigbiff2017-06-171-0/+2
| | | | | | | | | | | | | | | | | | | 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
* Timeout for decryptEthan Yonker2017-03-011-0/+1
| | | | | | | | | | | | | | | | 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
* Copy Kernel Logsbigbiff bigbiff2016-12-021-0/+1
| | | | | | Give user option to copy kernel logs to current storage Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd
* ADB: Add adb backup for TWRP.bigbiff2016-08-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rewrite TWRP fstab flag processingMatt Mower2016-05-031-0/+1
| | | | | | | | | | * 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
* Improve progress bar handling for backup / restore / image flashEthan Yonker2016-03-311-3/+3
| | | | | | | | | | | | | | | | | 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
* Improve sdcard partitioning processEthan Yonker2016-01-141-0/+1
| | | | | | | | | | | | | | | | | -Improve code for partitioning sdcards -Allow user to select a device for partitioning (must be removable) -Use sgdisk to partition sdcards -Set default sizes for ext and swap to 0 -Change increments for ext to 256MB and swap to 64MB Note: sgdisk is included in 6.0. I have included a static prebuilt sgdisk for trees that do not have sgdisk, however the prebuilt sgdisk is a decent bit larger than the old parted binary. The old parted binary is quite old at this point and we only have it for armv7a. sgdisk should be maintained by AOSP and can be built from source so it should work across architectures. Change-Id: Ib80882d9b5776e5e9358b11340fba392e6f1ae09
* Disable stock recovery replacing TWRP during ORSEthan Yonker2015-02-021-1/+1
| | | | | | | | -Create a separate function to disable stock recovery flashing -Add a call to that function to the reboot section of the ORS action so that an OTA update will not inadvertantly replace TWRP Change-Id: I43eae81e0e76971b6e8d34c38785dc73772242d2
* twrp-functions: remove unused functionsthat2014-12-291-2/+0
| | | | Change-Id: I3d072be9ef28f21ade466bc4c42caca8848f7c2a
* Update SuperSU to 2.40Ethan Yonker2014-12-181-2/+0
| | | | | | | | | The SuperSU install process is getting rather complicated, so we will modify the install script slightly and use it to install all the things and stop trying to check to see if root permissions have been lost like we used to do. Change-Id: Ibdb64c909d2bd16e12bb35b4f31f572cc29add47
* display cpu temperature in twrpJenkins2014-10-141-0/+1
| | | | | | | use TW_NO_CPU_TEMP := true to disable display use TW_CPU_CUSTOM_PATH := path to set custom path Change-Id: Id260ecbb4ec36a78442387329944f67003d0f6a0
* performance profile supportTom Hite2014-10-081-0/+2
| | | | | | | | | | | Many device trees support the recovery.perf.mode property to set various core frequencies and online/offline mode. TWRP is highly threaded, and support for multiple cores on many operations dramatically recudes the time, e.g., backups, zip flashes, etc. p2: removed user notifications Change-Id: I957b8ca40b241c0af0471327eeb329cce1816017
* add mtp responder to TWRP.bigbiff bigbiff2014-09-031-0/+1
| | | | | | Big thanks to Dees_Troy for helping with the implementation. Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
* Support reading since_epoch and secondary brightness filesxNUTx2014-08-101-0/+2
| | | | | | | | | | | | | | | TWFunc::Fixup_Time_On_Boot: Will now try to read /sys/class/rtc/rtc0/since_epoch to correct time, if that fails it will try to use the ats files to correct time. TWFunc::Set_Brightness: One single function to set brightness from both the automated functions and the gui actions. It is able to set a second brightness path if present, it will set them both the same value. Many Sony devices have 2 brightness files in the sysfs that must be set to properly set the brightness. Change-Id: I7ca582109085dfbcb46b8de73ad031e4b7903fca
* Implement "take a screenshot" featureVojtech Bocek2014-07-091-0/+1
| | | | | | | | * Like in android - press power+volume down, screenshots are saved in /sdcard/Pictures/Screenshots (if /sdcard is mounted) or /tmp Change-Id: Iaefa15b11a1d5fdfac57d77388db1621f378a8d4 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Track backup and restore progressEthan Yonker2014-07-091-0/+1
| | | | | | | | 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
* Add support for actions triggered by key combinationVojtech Bocek2014-04-161-0/+1
| | | | | Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6 Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Fix skipping of relative paths and lost+found in twrpDUVojtech Bocek2014-03-131-0/+1
| | | | | Change-Id: Ib79029fd6237502338b041a6bc2f9e539536d6ad Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Remove unused functionsEthan Yonker2014-02-121-1/+0
| | | | Change-Id: I3230412e6aad7aab0f2fd034cc7b289cd4cd6a97
* ifdef some functions that depend on other TWRP partsEthan Yonker2014-02-121-8/+13
| | | | | | | End goal is to create a twrpTar binary that can run from the command line. Change-Id: I14f07a425b7755bd09dbce95a5918da1430964fc
* Separate out function for reading /system/build.prop valuesEthan Yonker2014-02-081-0/+1
| | | | Change-Id: I9e398aa3f4f5be0728435ffdab333d4090cdab22
* Add option to print render time of each frame to log fileVojtech Bocek2014-02-061-0/+1
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Id158a6375fbadf4cdf0a8c7d143759e602419e7f
* Load RTC offset on Qualcomm Krait chips, fixes the broken time & dateVojtech Bocek2014-02-041-0/+1
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I04ad07f3e6be961003e063be8c648e191e2f9431
* Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.bigbiff bigbiff2013-12-191-1/+0
| | | | | | Moved Get_Folder_Size to this new class. Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
* Update licenses to all matchDees Troy2013-10-221-0/+18
|
* Add TWFunc::Exec_Cmd() with no 'result' agrumentVojtech Bocek2013-09-121-1/+2
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Id8acff1ac9b3c7e4b562c80562a8ff42a1d132b9
* Pull ROM info from build.prop for backup namesDees Troy2013-09-121-0/+2
| | | | Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
* Really fix TWFunc::tw_chmod() for 3-character mode stringVojtech Bocek2013-08-301-1/+1
| | | | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: I8f03d46235e1c71e8ee510309c9418cde802f50b
* Unify indentation and little clean-up in TWRP filesVojtech Bocek2013-08-241-6/+6
| | | | Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
* Support encrypted backup filesDees_Troy2013-06-221-0/+5
| | | | | | | | | | | | | | | Also includes features merged from: Update twrpTar by kokotas Revised function entryExists(). Added function to get archive's uncompressed size. Added option to exclude item(s) from the archive. Revised forks() http://review.teamw.in/#/c/590/ Change-Id: I01fa2c81643161984eff2625247af75990684bd9
* Move all AOSP code out of recovery binaryDees_Troy2013-04-041-3/+6
| | | | | | Improves license compatibility between GPL and Apache Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
* use md5.c for computation of md5sumsbigbiff bigbiff2013-03-071-1/+1
| | | | | | create a framework for computing digests and reading digests in TWRP add space for backwards compatibility with bb md5sum Change-Id: Ia18e3f430eed5eba22e5052d39b9b8d88ecd4536
* Check for root and root perms and offer to install/fixDees_Troy2013-02-211-54/+58
| | | | | | Also fix sort order for file selector by date and file sizes Change-Id: Idff9fe4232c19d4ed1082e78fabe6f921aa0a114
* This adds a 60 second screen timeout for TWRP. Might consider making this configurable in the future.bigbiff bigbiff2013-02-131-50/+54
| | | | | | | | | | | | | | | Will also set overlay to lockscreen so we don't have inadvetent screen selections. Touching the screen will bring the display back up. add back check script for poweroff move diff time function to twrp-functions.cpp make sure we chmod after copy_file add read_file and write_file functions to twrp-functions.cpp make single thread try to force update screen add forceRender drop caches after tar processing Change-Id: I3c5c509dd39dbb05451bbfe5d8b56d53c90d8d1b
* Use only std::string in TWFunc::Get_Folder_SizeVojtech Bocek2013-02-021-1/+1
| | | | | * Fixes crash which could occur with too deep path because of too much memory allocated on stack
* file manager updates for exFATDees_Troy2013-01-281-0/+1
| | | | Change-Id: I06fa6120a975cbc3d4eef9bc2ca034ec716740ee
* Add libtar to TWRP instead of using busybox tarbigbiff bigbiff2013-01-091-0/+3
| | | | | | | Add proper mkdosfs tool Add fuse to TWRP Add experimental exfat-fuse to TWRP Convert all system() functions to use new Exec_Cmd function
* Fix output of version numberDees_Troy2012-10-011-1/+0
|
* Save version number to storageDees_Troy2012-09-271-3/+4
|
* Port reboot functions to C++Dees_Troy2012-09-271-0/+17
|
* Add backup size checkingDees_Troy2012-09-261-0/+1
| | | | | Converted bootloader.cpp to TWRP and removed AOSP fstab parsing from startup
* Unify portrait layouts againDees_Troy2012-09-261-0/+2
|
* Update backup and restore code, adb sideloadDees_Troy2012-09-171-6/+9
| | | | | | | Fixed a problem with using make_ext4fs by making its lib a dynamic lib. Added ADB sideload zip install feature - no way to cancel it yet. Improve backup and restore code.
* Add wipe functions, compiles in CM7, text shows in UI, zips installDees_Troy2012-09-141-0/+23
Zip install works, had to move mincrypt code into TWRP to prevent a crash when checking the zip signature. Added wipe functions Made it compile in CM7 Made text show up in console and logging