Commit Graph

3577 Commits

Author SHA1 Message Date
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
Matt Mower
908dd25139 GUI: Use standard routine for auto-reboot
If 'reboot after install' is enabled, follow the standard reboot
routine to process 'No OS' and 'Install SuperSU' checks.

Since the system reboot routine is repeated several times, it has been
separated into its own routine.

Change-Id: I4c1882ecb8dc2d153ec2378b2e0973ab1a2a8278
2016-08-19 11:28:27 -05:00
Matt Mower
8dc25b7984 Fixup reboot after install variables
* Create correctly named data manager variable 'tw_install_reboot'
* Make configurable through Settings
* Remove closing tag space in theme files (not personal preference,
  but should match surrounding code style)
* Fix the "two presses needed to enable" issue for the checkbox on the
  install screen

Change-Id: I0ceb60b4888a672e2f0ecb5672b03cc86615621a
2016-08-19 11:09:01 -05:00
Matt Mower
9a2a20503c GUI: Add countdown & cancel to install auto-reboot
Provide a countdown from 5 sec for the automated reboot after install.
Include a cancel button to interrupt the process.

Change-Id: Ib5e1447918adfde45eba361c088800812b690890
2016-08-19 11:06:34 -05:00
Matt Mower
bfccfb8822 Finish creating disable_free_space_check variable
* Create data manager variable for 'tw_disable_free_space'
* Make configurable through Settings
* Fix the "two presses needed to enable" issue for the checkbox on the
  backup screen
* No need to capitalize every word, but do specify precedes backup

Change-Id: Id436cef13e4ca9349618420aac03862ec4e3c35e
2016-08-19 10:35:10 -05:00
Ethan Yonker
9fa76ba147 Allow running of a custom script after factory reset
Change-Id: I33e6d72bf93103052551f33da51ba4af9a5f88c9
2016-08-19 17:19:57 +02:00
Ethan Yonker
4a71d4f6c7 Add build flag for forcing single buffer mode
RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER := true

Change-Id: Id5144ea772c3b7ae382b064c41c23acdd0decb84
2016-08-19 17:19:38 +02:00
Tianjie Xu
62ab2a0fbc "view recovery logs" will show /tmp/recovery.log
For A/B devices, "view recovery logs" doesn't work due to the lack
of cache partition. To help debugging, we'll show /tmp/recovery.log
instead if /cache is not found.

Change-Id: Idb77c3a4c30388148a210b38d732a7b27e757bba
Test: Tested on an A/B device and /tmp/recovery.log showed up.
Bug: 30905700
(cherry picked from commit a54f75ede8)
2016-08-17 15:07:50 -07:00
Alex Deymo
53c107f068 Add inttypes.h for PRIu64.
This missing header is needed to use PRIu64 macros.

Bug: 27178350
TEST=`mma bootable/recovery` on the failing branch.

Change-Id: I165701e8019256426d3f6a4168db52c6a0197c4d
2016-08-12 13:46:17 -07:00
Alex Deymo
4344d636d4 Call update_engine_sideload from recovery.
This patch enables sideloading an OTA on A/B devices while running from
recovery. Recovery accepts the same OTA package format as recent
versions of GMS, which consists of .zip file with the payload in it.

Bug: 27178350
TEST=`adb sideload` successfully a full OTA (*)
TEST=Failed to take several invalid payloads (wrong product,
fingerprint, update type, serial, etc).

<small>(*) with no postinstall script.</small>

Change-Id: I951869340100feb5a37e41fac0ee59c10095659e
2016-08-11 18:55:11 -07:00
Ethan Yonker
64dbd0df84 Make input whitelist and blacklist work for mouse devices too
Includes some minor code clean up. Also we are now outputting the
name of the first mouse device that we encounter to make it easier
to identify which device(s) may need to be blacklisted.

Change-Id: I515baf92967390edd224728f3a7092239138e6b8
2016-08-11 02:34:15 +02:00
maxwen
ad05c6dce4 recovery: allow usage of TARGET_CRYPTFS_HW_PATH
only if not defined fallback to the default
more flexible device config where the cryptfs_hw is located

Change-Id: I7d1c18eeae877e48dceff06a7cfead28c89797b4
2016-08-10 20:38:26 +02:00
bigbiff bigbiff
a481d36402 Fix md5 creation from adb backup patch.
Change-Id: Id90da89c4eb50ed695a88f29859d1276ed8d032b
2016-08-08 21:02:39 -04:00
that
68d59737d5 adbbu: fix include path, now builds again in Omni 4.4
Change-Id: Idee80db34a0685abb4bec50383dcbc4911c1a341
2016-08-04 19:13:53 -04:00
James Christopher Adduono
c81de8c6c0 Optimize and reduce size of PNG files
Done using:
find -type f -name *.png -exec optipng -o7 -nc -fix {} +
(-nc is required as TWRP png lib can't handle color type changes)
find -type f -name *.png -exec advdef -4 -z {} +
(use Zopfli compressor on insane prefix to reduce size even more)

Total amount of bytes saved: 317,491

Change-Id: I545c678f71942e6ceb95acb631841ea7ef82a049
2016-08-04 17:40:42 +02:00
Captain Throwback
9643a80b02 Add typecode to sgdisk for proper detection in Android
- Fixes the "Unsupported SD Card" error when partitioning w/TWRP

PS2:
Use hex code instead of GUID to make code more succinct
Update typecode for Linux swap to be consistent

PS3: Revert PS2 changes

Change-Id: I5aec780aa4dfb7bd9025ae8cbceda13bfaaa0b03
2016-08-04 17:39:51 +02:00
Matt Mower
786d734a41 Remove curtainClose() remnants
Change-Id: I6ae96b60d34fa4e4b23cd1e5a4fffff3d00451c7
2016-08-01 20:41:37 +02:00
Matt Mower
25036b75ff Remove unused identifier from NotifyTouch
The 'state' parameter in GUIAction::NotifyTouch() is used in the
function.

Change-Id: I0744c7aa1542d771dbd2916638fbdd53e9681f86
2016-08-01 20:40:58 +02:00
Matt Mower
76b8afc4be Move cursor after appending date to backup name
* Send the cursor to the end of the input text

Change-Id: Id4f20717134cd38188cc1107f73dcd6bb995f377
2016-08-01 20:38:36 +02:00
that
8323ab53ee gui: fix Enter key in terminal
Translating CR to LF was an old hack that breaks Enter in nano.

Change-Id: If259e8b133f2f56f4126a1fb68856bf014a2daae
2016-08-01 20:36:23 +02:00
bigbiff
ce8f83c48d ADB: Add adb backup for TWRP.
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-07-31 22:20:18 -05:00
gitbuildkicker
d246a4aa75 merge in nyc-dr1-release history after reset to nyc-mr1-dev 2016-07-27 01:06:31 -07:00
Bill Yi
e49c0d6406 Import translations. DO NOT MERGE
Change-Id: If24c94c20f8e4c37c119dcaff765e9ee59e48ef4
Auto-generated-cl: translation import
2016-07-20 19:24:24 -07:00
gitbuildkicker
0783d16daa merge in nyc-dr1-release history after reset to nyc-mr1-dev 2016-07-15 16:34:45 -07:00
Tianjie Xu
da654af606 Skip update verification if care_map is not found
Recently flashed devices may not have care_map.txt in /data/ota_package.
This leads to a failure of update-verifier and prevents boot
success flag from being set. So, we need to skip verification
in case the file is not found.

Error message:
... I update_verifier: Started with arg 1: nonencrypted
... I update_verifier: Booting slot 1: isSlotMarkedSuccessful=0
... E update_verifier: Care map /data/ota_package/care_map.txt not found.
... E update_verifier: Failed to verify all blocks in care map file

Bug: 30156449
Change-Id: Ia15f5f3e7ca2ea6981d49678e799b9f70d134faa
2016-07-15 16:30:12 -07:00
gitbuildkicker
fb4e8c9967 merge in nyc-dr1-release history after reset to nyc-mr1-dev 2016-07-15 15:56:11 -07:00
Tianjie Xu
4bbe0c93c8 Fix a typo when comparing the verity mode
The veritymode string used by the bootloader should be lowercase 'eio'
instead of 'EIO'. Fix the typo and change to strcasecmp.

Bug: 27175949
Change-Id: I376dacc70eef7364e2b9931a7c940adedcdb1929
2016-07-14 23:57:43 +00:00
Tianjie Xu
13f44939b1 Merge "Touch blocks in care_map in update_verifier" into nyc-mr1-dev 2016-07-14 22:27:09 +00:00
Tianjie Xu
03ca853a1c Touch blocks in care_map in update_verifier
Read all blocks in system and vendor partition during boot time
so that dm-verity could verify this partition is properly flashed.

Bug: 27175949
Change-Id: I38ff7b18ee4f2733e639b89633d36f5ed551c989
2016-07-14 14:31:39 -07:00
Tianjie Xu
27b9fc8a36 Skip update-on-boot for bootreason in blacklist
Skip the OTA installation when bootreason is 'kernel_panic',
'Panic' etc.

Change-Id: Ic1202492bffefa1a9d8d0e691b5af979285e552c
Test: On angler, ota installation skips for one bootreason in the blacklist.
Bug: 29978689
2016-07-11 18:37:34 -07:00