Commit Graph

3606 Commits

Author SHA1 Message Date
Matt Mower
a8a89d1961 Whitespace cleanup
Change-Id: I93c65973679894bb8587da4b38b410d38036b8bd
2017-01-18 17:41:17 +01:00
that
55f2bdac06 gui: remove old unmaintained 2.x theme
Change-Id: I1181307989c7478ac6b84bf77732ee5dcff52ed1
2017-01-18 17:23:17 +01:00
Ethan Yonker
7118774ec9 libtar: backup and restore posix capabilities
This patch also allows libtar to combine data from multiple extended
tar headers into a single header.

Change-Id: I82d13e89a3622ea665b60062b1904ddbedfa41b3
2017-01-18 17:11:33 +01:00
nailyk
a083dc68c6 ADBbackups: Fix wrong owner on binary backups.
- Set the correct owner on binary backup files to flash storage.

Solve https://github.com/TeamWin/Team-Win-Recovery-Project/issues/749

Change-Id: I5526494c77232f524cf02a482de070b44248c4a0
2017-01-18 17:02:56 +01:00
James Christopher Adduono
1efebdc0bd Include symlink size (path length) in Get_Folder_Size()
All we have to do is check for the case of a symlink as well.
st.st_size contains the length of the path the symlink points to.

Change-Id: I9a7b06ba11b5866e04599b8904fd42acf241abe2
2017-01-18 16:51:06 +01:00
niks255
d73903c8eb gui: Detect device resolution with TARGET_SCREEN_HEIGHT/WIDTH
* Ease the compilation with Lineage/CM configurations
    when TW_THEME or DEVICE_RESOLUTION are not defined

Change-Id: I35a8ce651ba5333c8426baa3d70fcbc42a2e5e59
2017-01-18 16:49:11 +01:00
bigbiff bigbiff
584b977489 TWRP device version string
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
2017-01-18 09:44:17 -06:00
Hashcode
5733215112 build: AOSP/CM14 fixes (API 24/25, mainly BusyBox-less environment)
These changes are needed by any ROM where devices are configured to
use TOOLBOX/TOYBOX instead of BUSYBOX (i.e., TW_USE_TOOLBOX := true).

Change-Id: I68b88cc9fb857f32864556c4b6c9c8e6ee744051
2017-01-12 12:50:18 -05:00
sndnvaps
7dde36df11 updater: link libcrypto_utils_static if it exist
Change-Id: I9bf238a3e29d88850a6cc69f07954949722c35d7
Signed-off-by: sndnvaps <sndnvaps@gmail.com>
2017-01-12 11:39:42 -06:00
D. Andrei Măceș
1c28904749 libtar: Use relative path for crypto/ext4crypt include
Don't assume path to be bootable/recovery (i.e., support CM's
RECOVERY_VARIANT).

Change-Id: Ib53cc919c5a9beb3beee71d7227a7c957a24b601
2017-01-12 18:35:29 +01:00
nailyk-fr
1021edf17e bootloader_message: Allow TWRP to ignore wipe-data command into misc
* Rebase of https://gerrit.omnirom.org/#/c/20750/ patch-set 3
 * Original commit message:

fix: recently a change in AOSP causes a bootloop to TWRP
(and therefore all ROM's based on it)
Reason: AOSP enables use of /misc partition and normally the fstab in
TWRP will not have /misc added. The problem is now when Android writes
a wipe command to /misc it will force TWRP to boot but TWRP will do
nothing - leaving the cmd in /misc. This results in a bootloop to TWRP.
Solution: I added a new var TW_IGNORE_MISC_WIPE_DATA which can be
set to "true" in Boardconfig.mk of a device requiring this which then
ignores /misc commands like it would be when /misc would be just not in
fstab BUT with this change TWRP clears the bit in /misc so a normal boot
can happen.
Besides that if the device do not have an own recovery key combo and
/misc is enabled we want to open TWRP after walking through the factory
reset screen - without actually doing a factory reset.
kudos to nailyk (and DevUt) for the help with the C++ code!

Change-Id: If6fed5872015f1a66304e3edbdb787c507236f69
2017-01-11 18:09:59 +01:00
James Christopher Adduono
dcd1e440e0 Support theme width and height offsets
Current use condition is LG V20, where the secondary screen is
actually just a corner chunk of the main screen.
In this case, we need to shift the UI down some pixels in order
to see it all, but just using Y offsets resulted in losing
the rest of the GUI below.

Example in BoardConfig.mk:
  # Shift TWRP off the secondary screen
  TW_Y_OFFSET := 160
  TW_H_OFFSET := -160

Change-Id: I5a06638ba0d05e5b9fd8a6245c630d6ea3394f78
2017-01-11 18:04:29 +01:00
D. Andrei Măceș
b29a5e27c3 build: Consolidate the crypto_utils presence tests
No point checking filesystem repeatedly/check may change in future

Change-Id: I0413b07b850f785eb5150c6ed18836cc56e94d6f
2017-01-11 10:56:21 -06:00
Ethan Yonker
4767caf1f4 Fix compile error on 4.4 tree
Change-Id: Id85fdf0f4dee02f8ee3ae50ec42423c6a154a3eb
2017-01-11 10:45:04 -06:00
Ethan Yonker
f2e3f0c51c Change version to 3.0.3 to support the app release
Change-Id: I2e1afc76edd77208e9e94162a7045453109c74d2
2016-12-16 10:10:31 -06:00
Ethan Yonker
abd08746c7 Update Ukraine language translation (via jemmini)
Change-Id: Ice2bb6c66d47ca2da968f223dd47207159cc0b66
2016-12-16 10:09:11 -06:00
Ethan Yonker
b4bff5e9d1 Add TWRP app install via TWRP recovery
Note: I will have to add a build flag for excluding the app later for
watches and maybe Android TV. I will also have to add support in the
tablet and watch layouts later. I will merge this for the initial roll out
to select devices and finish up later.

Change-Id: Ia4ce5522fae542afa1539b10c0691315392a19ab
2016-12-16 17:02:16 +01:00
Miroslav Brzychcy
9b1b818eb8 TWRP Language Update
Update slovak language on behalf of translator.

Change-Id: I90f289dd082aef1780d63b4880092f57c48ad9ac
2016-12-14 19:41:18 -05:00
Ethan Yonker
ff2b7881c9 Change handling of /cache due to AB devices not having cache
Change-Id: Ia9b97ed19eb3d400d9d399255108cac79361bca4
2016-12-13 21:26:57 +01:00
Ethan Yonker
79f88bdf8d Support backup/restore of FBE policies
Change-Id: Iba8ef20f57b0fb57bb9406c53148a806441d0b59
2016-12-13 14:25:04 -06:00
Ethan Yonker
bd7492de28 Support File Based Encryption
Change-Id: Ib688ddd0c32d3999590cacd86b6d9b18eac336e9
2016-12-13 21:16:42 +01:00
Ethan Yonker
1b190166eb Add boot slot support
Change-Id: I7eaf80e327985f53791f90fbdebad022a9650d31
2016-12-13 14:04:48 -06:00
Ethan Yonker
941a899695 Support new AB OTA zips
Change-Id: I1ff883375a0a769bf27a834c9bf04c6cdbb42117
2016-12-05 14:54:32 -06:00
bigbiff bigbiff
bad332a3d1 Copy Kernel Logs
Give user option to copy kernel logs to current storage

Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd
2016-12-01 19:00:02 -05:00
Ethan Yonker
3fdcda4662 Improve backup & wipe exclusion handling
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
2016-11-30 13:19:08 -06:00
Ethan Yonker
0a8a7cebf1 Fix adb shell in 7.0 tree
busybox sh does not seem to work properly in 7.0 trees so use
mksh for sh instead.

Change-Id: Ia33bc3894f929b1348c8714d4ddd00a2671c7e94
2016-11-30 16:47:20 +01:00
Ethan Yonker
93ac7a0bb1 Check if mount point is dir during startup
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
2016-11-30 16:46:01 +01:00
James Christopher Adduono
79ae093c82 MD5 verification sanity
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)
2016-11-30 16:30:22 +01:00
James Christopher Adduono
9059499ccd Fix image flashing: attempt 2
We missed a spot!

Change-Id: Ic838f4a23107b4d52d3fb1d7a875e265726c4516
(cherry picked from commit e9a3ee2693df3b9ebe7f501bc93411065559b5f1)
2016-11-30 16:29:32 +01:00
Ethan Yonker
e080c1f8fb Fix image flashing
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)
2016-11-30 16:27:07 +01:00
Ethan Yonker
b523650c8e Update to android-7.1 2016-11-29 21:27:39 -06:00
Ethan Yonker
99af766668 Fix libcrypto dependency in 6.0 trees
Change-Id: Ie230ed5f3db38a62305e03e4f9819e4aca816e16
2016-09-15 14:57:39 -05:00
Ethan Yonker
dcf2b674c4 Clean up PartitionSettings
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-09-13 14:53:37 -05:00
Ethan Yonker
ea2fcf0179 Fix compressed backups with split archives
Change-Id: I8b9197a18cd83c304e5d4ed29ef55ba67e4e42f7
2016-09-12 16:07:19 -05:00
Ethan Yonker
724c5148a5 Fix restore of subpartitions
Change-Id: If76cd08cdac7e2af4e0f5f00d420eed1f30897d3
2016-09-01 18:40:26 -05:00
Ethan Yonker
b8e985c6a2 Fix updater binary for 7.0
Note: updater is currently not backwards compatible with older trees. Maybe
later...

Change-Id: I3c2a5ef69cfa9005502408f7054e3096a64ba34b
2016-08-31 13:42:13 -05:00
Humberto Borba
443af214ff twrp: Use the correct lib name
Now ART uses LZ4 and the lib name should be liblz4.
https://github.com/omnirom/android_external_lz4/blob/android-7.0/lib/Android.mk

Signed-off-by: Humberto Borba <humberos@gmail.com>
Change-Id: Ifce783ecb6af10d43bbeabd614d12e8e6b3b4270
2016-08-31 20:10:45 +02:00
bigbiff bigbiff
8fd4b096c4 MD5 checking: fix issues introduced with adb backup patchset
This patchset will fix issues with creating and checking
md5 checksums with single partitions and subpartitions.

Change-Id: Iddfaf46412e95635af958094726cf9e3eb5a4cc8
2016-08-30 20:52:02 -04:00
Ethan Yonker
4bf259fab7 Make naming scheme more meaningful
Change-Id: Ifcaf00c760ff452b0e85a88b54e91ca0f2f4644a
2016-08-29 11:50:34 -05:00
Ethan Yonker
072c8d82dd Support update binary log command
Also track and log install time similar to AOSP recovery.

Change-Id: I68b41a75cf0d1fa57b693c726cccd382a16f91b1
2016-08-26 22:22:26 -05:00
Ethan Yonker
534d4e0612 Fix compatibility across the board
Change-Id: I6376920775ddabb4d4af505fffd86e404403a64a
2016-08-26 10:05:03 -05:00
Ethan Yonker
df681841e3 Fix compatibility with 5.1
Change-Id: I83704ce3a669239e0acb936e50e6eae080b28173
2016-08-25 15:49:40 -05:00
Ethan Yonker
f117962eb2 Make it backwards compatible with 4.4
Change-Id: I668604cddc8e8afbf78709f3f872bea4e9f4aa06
2016-08-25 15:36:13 -05:00
Ethan Yonker
34ae483e02 Update to 7.0
Change-Id: I621cc47352f7ac552d9602485825ae3a6f9ae516
2016-08-24 15:32:18 -05:00
nailyk
c45b2d59b3 minui: Fix gr_set_font() build issue on cm-13.0 tree.
- Add a fake function which fill the vendor/cm/charger/healthd_board_cm.cpp requirements.

Solve omnirom/android_bootable_recovery#84 issue.

Change-Id: Ia9bf898006da7e4f4ee6a942584fe2dd3c88f8ba
2016-08-23 22:25:31 +02:00
Jason Riordan
6c28ee8355 NTFS-3g: migrate to PLATFORM_SDK check instead
android-6.0 branch of ntfs-3g matches the cm-13.0 version now,
check platform version instead of CM_SDK version.

Change-Id: Ic4aed613084d530c814611678f70d75260b9adc4
2016-08-22 21:09:34 +02:00
nailyk
61c7c5c67e Gui: replace pow() function
The old pow function doesn't work for other power than 2
- replace pow function by a squared one

Solve the TeamWin/Team-Win-Recovery-Project#646 issue.

Change-Id: Id177300d45a7b49ff983795288434d910eb35c2a
2016-08-22 17:46:04 +02:00
Kjell Braden
3126a113e7 wait for cryptfs device node to come up
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
2016-08-22 16:51:30 +02:00
that
0e2140e931 Add git revision to startup message in recovery.log
This should make it easier to find the exact source for
a specific version of the binary.

Change-Id: I7e04dd9a3205cc643150a588b69b4bd691212ecb
2016-08-22 16:46:09 +02:00
gitbuildkicker
436e05b540 merge in nyc-dr1-release history after reset to nyc-dr1-dev 2016-08-21 17:01:01 -07:00