| Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
* For EXT2/3:
* Align mke2fs options with Android 9.0 fs_mgr_format.cpp.
* For EXT4:
* Note that make_ext4fs is still in use on Android 8.1 to workaround
a FDE encryption bug even though mke2fs has become the default
choice. The bug is fixed in Android 9.0+.
* For F2FS:
* Drop the broken "-r" option, it's never ported to O, explicitly
pass number of sectors instead.
* Keep all options aligned with Pie fs_mgr.
* Check existence before start wiping, as Wipe_EXT4 does.
* For all:
* Calculate block size at runtime, and reserve the space specified
via negative "length" option from fstab. Note that positive length
will be ignored.
* If the partition has crypto footer, and "length" is not specified
in fstab, automatically reverse CRYPT_FOOTER_OFFSET (16384).
* Remove the default crypto key location: footer, this is a bad
assumption since most partitions don't use encryption! We need to
know the real situation to decide whether to reserve crypto footer
on format.
* If the current action is "wipe" or "change filesystem", wipe crypto
footer or block device after mkfs if the partition is
unencrypted or undecrypted (e.g., wrong password).
* If the current action is "format data", unconditionally wipe crypto
footer or block device.
Change-Id: I7304a8ee703131ea4a08ab7c60334af28cac28b3
|
|
Change-Id: Ie0292f4ffea5993a4ae74fa04fc5c8252ca2cfcf
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
-Change backup display name to say that we are excluding storage
-Add warning message during backup of any partition with data media
-Also eliminate unused variable from twrpTar class
Maybe this will make the people in issue 276 happy, but probably not because
they already lost their data, or because the warning text is yellow instead of
red.
https://github.com/TeamWin/Team-Win-Recovery-Project/issues/276
Change-Id: I98303fe7f6b7a25fea029637c90145258d41ee46
|
|
Change-Id: Ib688ddd0c32d3999590cacd86b6d9b18eac336e9
|
|
Change-Id: I7eaf80e327985f53791f90fbdebad022a9650d31
|
|
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
|
|
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)
|
|
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)
|
|
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
|
|
This patchset will fix issues with creating and checking
md5 checksums with single partitions and subpartitions.
Change-Id: Iddfaf46412e95635af958094726cf9e3eb5a4cc8
|
|
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
|
|
Change-Id: Id90da89c4eb50ed695a88f29859d1276ed8d032b
|
|
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
|
|
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
|
|
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
|
|
* 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
|
|
* 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
|
|
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
|
|
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
|
|
Change-Id: If903d838abc920f952f243482338188c15bb1dbf
|
|
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
|
|
-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
|
|
tabs > spaces for line-comments to be consistent
Change-Id: I4e859fab61c54a5ae86e719a656398a085cfd7fb
|
|
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
|
|
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
|
|
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
|
|
* 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
|
|
Add support for mounting ntfs via ntfs-3g and support for wiping
and repairing ntfs partitions.
Change-Id: I82dc4626f459bb93b86eb9ebba64ad3a6560781b
|
|
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
|
|
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
|
|
(for compressed backup users with low space).
Clean up backup folder and copy only recovery.log for debugging.
Conflicts:
gui/devices/watch/res/watch.xml
Change-Id: If8aa3580dbc082d0fe4882d4af8dc3cdb362a8b5
|
|
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
|
|
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
|
|
- 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
|
|
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
|
|
Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
|
|
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
|
|
Change-Id: Ia6eefd23f6671428221e35642f01534bc9fff6ad
|
|
- 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
|
|
Change-Id: Ia3007fbced9ce3bc94efdb3dacc582a5e68a49a4
|
|
Change-Id: I9fcd7e0169fbdd52405c0c86aafbef091f69411e
|
|
Change-Id: I95cf6f4def0c86f40c775738f0712323f0a0f146
|
|
Big thanks to Dees_Troy for helping with the implementation.
Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
|
|
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
|
|
Change-Id: I9043e98e1e1ed4722f05c13a60b43d2d0bf739f6
|
|
Change-Id: Ia5957efe616defa4272501cd8f31d26d394077bb
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
|
|
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
|
|
Change-Id: I5743d9b967a8227c4bb87da01a9c67c574bf9876
|
|
Change-Id: I8af92543c2f0c201e7220267c417d74e4561038d
|
|
Moved Get_Folder_Size to this new class.
Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
|
|
example userdata line (as needed by MotoX):
/data f2fs /dev/block/platform/msm_sdcc.1/by-name/userdata flags=fsflags="inline_xattr"
Code for parsing flags/options originally based on AOSP fs_mgr sources.
Change-Id: I5fb2b5d5cdd08137e6bf71f0085a3f8aebd889a8
|
|
Change-Id: I3be70a897e563658736b2dec3a9ea2697b69b225
|
|
|
|
Change-Id: I58f4a8cedf31e6b6efd88f96a43ed525603ae311
|
|
Need to add this to your source tree:
https://github.com/razrqcom-dev-team/android_external_f2fs-tools
Change-Id: I3ee9ebbb617259655518f8ea356ce7b8c246cd4d
|
|
* Remove useless 'virtual' keyword
* Set proper members visibility
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
|
|
Also copy recovery.fstab to cache and create a storage.fstab in
cache for app/apk use.
|
|
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
|
|
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
|
|
Needed on Sony mint (Xperia T) as the /data/media folder is a
separate partition and normal data media wiping is not appropriate
for this device but the layout version file needs to be retained
for Android 4.2 multi-user.
|
|
|
|
Add proper mkdosfs tool
Add fuse to TWRP
Add experimental exfat-fuse to TWRP
Convert all system() functions to use new Exec_Cmd function
|
|
Change-Id: I8f2b5b68a8c3ede74858d53002efab997174ee65
|
|
Change-Id: Ie44958a148d00cadd2ba3c51255f7fd9d8a651e7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also redirect stderr output on terminal commands for display in
GUI console
|
|
Also improve handling of MTD names
|
|
Converted bootloader.cpp to TWRP and removed AOSP fstab parsing
from startup
|
|
|
|
|
|
Improve zip finding in ORS engine
Add support for restoring with just a backup name
|
|
|
|
Add in archive splitting support
|
|
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.
|
|
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
|
|
|
|
Add flag parsing from recovery.fstab
|
|
|
|
Pull in most TWRP sources
Stub out partition management code
Make it compile -- probably will not boot
Kind of a mess but have to start somewhere
|
|
|