summaryrefslogtreecommitdiffstats
path: root/openrecoveryscript.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-04-03Use magiskboot to repack the boot partitionEthan Yonker1-1/+1
Set TW_INCLUDE_REPACKTOOLS := true Must also have: AB_OTA_UPDATER := true Use magiskboot and provide GUI options to allow users to repack their existing boot image to install TWRP (or kernels) so we can stop having to provide installation zips for AB devices. There is also an option to try to fix a recovery bootloop if the kernel has been patched to always boot the ramdisk for root, etc. You will need to pull the below repo into external/magisk-prebuilt https://github.com/TeamWin/external_magisk-prebuilt Change-Id: I74196cc6f095a7576d61886dc96cbc18deba9b04
2019-03-20Adding Edl button in reboot menumauronofrio1-0/+2
Edl mode is available only on qualcomm devices and it used to fully restore the bricked devices. I made the button available only if TW_HAS_EDL_MODE := true like the download button. I set the edl button to the right of the download button, so devices can support edl button and download button. I also added the translation for all languages. Change-Id: I69d1058b8c050b722395c7b3da6dce1ccfbe7a91
2019-03-18AB/Non AB Devices: updates for moving cachebigbiff bigbiff1-8/+13
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
2018-08-24twrp: use ANDROID_ROOT environment variableCaptain Throwback1-5/+5
instead of hard-coded /system path I updated most of the references I found, but there might be more For devices that have to mount system at /system_root, this allows system to be bind mounted to /system and detected properly by TWRP Change-Id: I9f142fd8cec392f5b88e95476258dab9c21a9aac
2018-05-25Skip decryption when installing mapped zipsGabriele M1-1/+0
Decrypting userdata is not needed when installing zips if we have a map of blocks to read, so skip the decryption. This allows to install zips with no user interaction and, more importantly, it allows to install zips on devices where TWRP can't properly decrypt userdata. Remove also the unneeded Mount_All_Storage() call, Install_Command() already mounts the needed partition. Change-Id: I91c69f84ecc2fe41c9567c40649e501af1cfb64a
2017-11-27ADB Backup: add ability for TWRP GUI to restorebigbiff bigbiff1-262/+1
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
2017-06-17twrpDigest refactorbigbiff bigbiff1-8/+8
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
2017-04-23ADB Backup: fix adb restore issuesbigbiff bigbiff1-0/+1
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
2017-01-18Add missing file descriptor closesMatt Mower1-1/+20
Change-Id: I7154a022833a5e092facd7c5df776719b9fcc929
2017-01-18Unused variable cleanupMatt Mower1-4/+1
Change-Id: I2397d0bd221dcf5c9d0f971ba157519bcf014a70
2017-01-18Whitespace cleanupMatt Mower1-5/+5
Change-Id: I93c65973679894bb8587da4b38b410d38036b8bd
2016-09-13Clean up PartitionSettingsEthan Yonker1-4/+1
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
2016-08-01ADB: Add adb backup for TWRP.bigbiff1-2/+287
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
2016-03-31DataManager UpdatesEthan Yonker1-6/+0
The goal of this change is to make DataManager use InfoManager to reduce code duplication. Change-Id: Ia4f4c4324453a192995e0f442db0a03628c13e46
2016-01-29Replace fix permissions with fix contexts for emulated storageEthan Yonker1-2/+2
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
2016-01-22Fix a bunch of messagesMatt Mower1-2/+2
* Find and rename/remove duplicate string variable names * Add missing string variables to en language file * Fix display of some strings missing @ in front of variable name * Fix several %s --> {1} * Be consistent in usage of cancelled vs. canceled (both spellings acceptable) Tip for finding strings missing from language files: 1) Find all messages: egrep -hr "gui_msg.+=" > /tmp/msgs.txt 2) Regex replace to trim them down WHAT: ^\s+gui_msg(?:[^"]+)"([a-zA-Z0-9_]+)=([^"]+).+ WITH: $1 Note that $2 can be used to retain the message 3) Find missing strings: for i in $(cat /tmp/msgs.txt); do if ! grep -q $i gui/theme/common/languages/en.xml; then echo $i; fi done Change-Id: Ic193162e4b5468bf027472928a370be39840ea1d
2016-01-04Fix Recursive_Mkdir if path doesn't end with "/"that1-2/+2
Somewhat surprisingly, Recursive_Mkdir(TWRES "customlanguages") did not create the "customlanguages" directory because it expected a trailing slash. Fixed by rewriting the loop to be more like Create_Dir_Recursive. Also fixed error handling for the final directory, and fixed incorrect return value handling for "mkdir" ORS command. Change-Id: I1ab418ddda695cbb595a9db2817f00fc7b171f51
2015-12-29get rid of console thread for OpenRecoveryScriptthat1-0/+68
- CLI commands run in a threaded action "twcmd" - Console is displayed via "singleaction_page" - move ORS execution code from GUI action to OpenRecoveryScript class - remove unused function gui_changePackage - don't change PageManager package in home action - fix that /tmp/openrecoveryscript was not deleted after execution Change-Id: Ic688c0b04647ce09e9db979b0bc5123f47cf4f70
2015-12-22openrecoveryscript: really append ORS command to ORS script file.xiaolu1-2/+2
for example, in "/cache/recovery/command" : --wipe_data --update-package=/sdcard/1.zip Change-Id: I70c92a868372dca48024e303a0778f9409ab0dc9
2015-12-19Multiple Language SupportEthan Yonker1-62/+61
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
2015-08-26Fix up some TW_OEM_BUILD thingsEthan Yonker1-1/+6
Fix factory reset now properly formats data as expected Change text for ORS processing Disable system read only check, SuperSU, and patch system Stop copying fstab and version to cache Change-Id: I20f5cae390afbb8d2d88e01b8d9b9bf4ff0fdea1
2015-06-17Allow ORS set command to work with spaces in the valueEthan Yonker1-4/+9
Change-Id: I1a61ba7ad5479f8aa31a0c9c18bf228cf32104e9
2015-06-17Make sure that adbd restarts after sideloadDees Troy1-0/+1
Change-Id: I7d82b95cd8749c6f8569739162708705faa6f1f7
2015-02-11Fix handling of mapped zip files for OTA updatesEthan Yonker1-24/+33
AOSP started using the @ special character to pass to sysMapFile to indicate that the zip file is actually mapped to unused blocks on the data partition. Allow TWRP to do the same. Change-Id: I5bf1355a5462588086401b02de1b17ab88ed3bcd
2015-01-22Move ORS command line into main threadEthan Yonker1-1/+1
Also eliminate the mostly similar runPage function in favor of using a single runPages function to avoid code duplication. Change-Id: I46ef414beb4009fee16d4de13d8a5ab2b9678409
2015-01-05Fix adb sideload during ORSEthan Yonker1-22/+28
Change-Id: I13735c7bba72f3887c4a7618843478be5ada3370 p
2015-01-04fix adb sideloadthat1-1/+2
- "Cancel" button handling requires another thread - simplify handling of child pid - merge duplicated code for reinjecting TWRP after installation - fix error that showed on host PC after sideload finished - fix problem where adbd sometimes does not stop correctly Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
2014-10-07Remove extra slashes from zip path in openrecoveryMatt Mower1-3/+3
TWFunc::Get_Path() returns a path with a trailing slash and the substr method is returning a string with a leading slash, so we don't need to specify additional slashes for wholePath in Locate_Zip_File(). Also, put 'value' readout to log on its own line if it exists. Change-Id: I2a4db6dbde5552f5a803eabb0599fd983d683fca
2014-08-09Add command line capabilitiesEthan Yonker1-1/+33
Allows sending openrecoveryscript commands to TWRP via shell. This may be handy for visually impaired users, for various one click utilities to drive TWRP commands from a computer, for using TWRP when a catastrophic hardware failure like a shattered screen prevents you from being able to use touch, or even on devices like a TV stick where touch and USB mouse input is unavailable. This patch also includes a few minor changes to openrecoveryscript including proper support for rebooting via the script and for decrypting the device via the command line. Change-Id: I796ad168efdd2da9c25334ac93d1079daaa7b0bc
2014-02-15Improve ORS scanning of storage locationsEthan Yonker1-46/+29
Grab a vector of storage locations and iterate through them for searching for zips and restore folders. Change-Id: Ia045b1e15ac3701132d61fe9f5847da5785a9b4e
2014-02-12Add fix permissions to OpenRecoveryScriptEthan Yonker1-0/+4
Change-Id: I2419cba26fcf046833b5a02fd1b95d6d6e542b8a
2013-10-24Update licenses to all matchDees Troy1-21/+17
Change-Id: I3be70a897e563658736b2dec3a9ea2697b69b225
2013-10-22Update licenses to all matchDees Troy1-21/+17
2013-09-18check for space after = toobigbiff bigbiff1-0/+2
2013-09-12Add TWFunc::Exec_Cmd() with no 'result' agrumentVojtech Bocek1-5/+3
Signed-off-by: Vojtech Bocek <vbocek@gmail.com> Change-Id: Id8acff1ac9b3c7e4b562c80562a8ff42a1d132b9
2013-09-10another fix to ignore space then = signbigbiff bigbiff1-0/+2
2013-08-30ignore extra = on install cmdbigbiff bigbiff1-0/+2
Change-Id: If9a0e6d4c00f6dd79f76c68ed0370a3101211801
2013-06-22Support encrypted backup filesDees_Troy1-1/+6
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
2013-04-04Move all AOSP code out of recovery binaryDees_Troy1-78/+81
Improves license compatibility between GPL and Apache Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-03-30Add partition list GUI elementDees_Troy1-77/+39
Add partition list GUI element and update backup, restore, mount, storage selection, and wipe sections of GUI and partition manager code to reflect the new GUI element. Update ORS engine to handle new backup and restore setup. Fix a bug with decrypt. Add 1080x1920 layout. Change-Id: Iaa2f44cb707167e66f935452f076ba00e68a2aa4
2013-01-28Reset progress bar in ORSDees_Troy1-1/+2
Change-Id: Ia7df2fa80712dc9ff7fda97261fefa33ce823ae0
2013-01-25Use GUI for ORS instead of console onlyDees_Troy1-98/+129
2013-01-24Convert AOSP commands to ORS for encrypted devicesDees_Troy1-6/+20
Change-Id: I6a76a51cd9efd7db67d7abeeb26f9bdd0eebf5a9
2013-01-18Improve ORS sideload to display GUI with cancel buttonDees_Troy1-28/+24
2013-01-17Add sideload command for ORSDees_Troy1-0/+31
2013-01-17ORS engine fixesDees_Troy1-11/+8
Fix backup to not error when a non-existant partition is given. Fix restore to run when no partition parameters are given. Ensure that ORS runs after decryption and that zips install. Fix a problem with the fake internal sdcard not mounting to /sdcard on data media devices.
2013-01-09Add libtar to TWRP instead of using busybox tarbigbiff bigbiff1-13/+7
Add proper mkdosfs tool Add fuse to TWRP Add experimental exfat-fuse to TWRP Convert all system() functions to use new Exec_Cmd function
2012-10-16Update injecttwrp for Epic 4G TouchDees_Troy1-1/+13
2012-10-02Ensure that actions are not simulated in ORSDees_Troy1-0/+1
2012-10-01Update ORS and recovery commandsDees_Troy1-114/+133
2012-09-27Port backup name checking to Partition ManagerDees_Troy1-0/+4
2012-09-20Add and improve OpenRecoveryScript supportDees_Troy1-0/+476
Improve zip finding in ORS engine Add support for restoring with just a backup name