Commit Graph

41 Commits

Author SHA1 Message Date
Ethan Yonker
58f2132bc3 Merge AOSP android-9.0.0_r3
Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
2018-08-24 11:17:39 -05:00
steadfasterX
10d747567e enable md5sum digest verification
all (well I just checked LOS, aoscp and aicp) ROM scripts use
"md5sum" as extension but TWRP checks only for the extension
"md5".
This change will also expects md5sum as the default digest extension
and only if not found falling back to md5.

Change-Id: Ia1dd072d77d53ed6c6ff13c6db730abdcdb56bb3
2018-07-27 19:03:50 +02:00
Ethan Yonker
ecbd3e8ba9 Merge up to android-8.1.0_r1 and fix conflicts
Change-Id: I2dc060134d15ec9f015a606cb24ef8276f6af1fc
2017-12-15 12:48:49 -06:00
bigbiff bigbiff
19fb79c722 ADB Backup: add ability for TWRP GUI to restore
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-11-27 09:32:30 -06:00
nkk71
b4c3591306 Auto detect possible use of legacy props
* Revert: Make legacy props an option disabled by default
  (reverted from commit 75aa615767)

* Instead check for ANDROID_PROPERTY_WORKSPACE in the updater-
  binary to determine whether legacy property service can be
  used

Change-Id: If68d5cca9a2b56edcb1c73db0474668cf46d8c91
2017-11-17 23:49:11 +01:00
Ethan Yonker
75aa615767 Make legacy props an option disabled by default
Change-Id: Id0bb17ebd11e120b4676c41d6553e6a830ac7ee9
2017-09-08 12:17:53 -05:00
Ethan Yonker
8373cfe28c Update to AOSP 8.0 base
Change-Id: I29fe722b4eb9718765327902779046840a01433e
2017-09-08 07:14:59 -05:00
bigbiff bigbiff
56cf564658 twrpDigest refactor
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-06-17 07:05:45 -05:00
Ethan Yonker
941a899695 Support new AB OTA zips
Change-Id: I1ff883375a0a769bf27a834c9bf04c6cdbb42117
2016-12-05 14:54:32 -06: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
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
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
Ethan Yonker
20eb0bc2d1 Detect and install custom themes as part of zip installs
Change-Id: I7ec7133e53fca92ebe49a9a41161754a9138141e
2016-03-29 19:41:48 +01:00
Ethan Yonker
74db157b94 Multiple Language Support
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-12-19 08:31:01 -06:00
Matt Mower
13a8f0b294 Free some memory allocations
Change-Id: Ifb6c186e43e1eb068e8075def16924ced04bb23d
2015-11-11 19:42:27 -06:00
that
5064048ec3 Improve error handling for zip install
- minzip: don't crash with corrupted zips (e.g. 4096 null bytes)
- twinstall: output error when zip doesn't contain update-binary
- twinstall: add strerror(errno) to system-level errors
- twinstall: correct message if /file_contexts could not be extracted
- twinstall: use TWFunc::Wait_For_Child for better waitpid errors
- twinstall: minor code cleanup

Change-Id: I53b156b0ec08755af2742bb71d1523ae38f4a82e
2015-10-15 16:10:53 +02:00
Ethan Yonker
c798c9cd24 Merge up to AOSP marshmallow-release
In order to maintain compatibility with older trees, we now have
minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to
handle ifdef issues in minui/minui.d because healthd includes
minui/minui.h and there was no other alternative to make minui.h
compatible with older trees without having to modify healthd rules
which is outside of TWRP.

Note that the new minui does not currently have support for qcom
overlay graphics. Support for this graphics mode will likely be
added in a later patch set. If you are building in a 6.0 tree and
have a device that needs qcom overlay graphics, be warned, as off
mode charging may not work properly. A dead battery in this case
could potentially brick your device if it is unable to charge as
healthd handles charging duties.

Update rules for building toolbox and add rules for making toybox

Use permissive.sh in init.rc which will follow symlinks so we do
not have to worry about what binary is supplying the setenforce
functionality (toolbox, toybox, or busybox).

Fix a few warnings in the main recovery binary source code.

Fix a few includes that were missing that prevented compiling in
6.0

Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
2015-10-09 11:15:29 -05:00
Ethan Yonker
738be7a3ff Use one mizip for all
The new minzip did not compile in older trees due to needing
mmap64. For older trees we will just use mmap instead. Remove all
files and code pertaining to minzipold. Updater should now build
properly in older trees as well.

Eliminate use of PLATFORM_VERSION in favor of PLATFORM_SDK_VERSION
which should be more consistent and reliable.

Change-Id: I38d2b604a73d1b17a2072c7d60e990b81ece0c10
2014-12-10 11:54:02 -06:00
Ethan Yonker
75bf041a8a Make the android-5.0 branch compile in 4.4 to 4.1
Migrate previous minzip to minzipold replacing the existing
minzipold. This will break compatibility with trees that do not
support selinux (ICS and older). Migrate former verifier files to
verifierold.

Add fuse.h to recovery source because older trees do not have it.

Add LOCAL_MODULE_TAGS where needed for 4.1 tree.

Change-Id: Iade57cb2b0115af7fce9f56aa98636b1744a1ef4
2014-12-02 10:34:15 -06:00
Ethan Yonker
f9796a4a5f Release map after zip install
Change-Id: I4ae145669786ad0932297ae0ae095cbc6f3f696b
2014-11-08 07:28:03 -06:00
Ethan Yonker
24813426b9 Update adb sideload feature
Change-Id: Ib503d0e87434e1a28430779302d6565211c26592
2014-11-07 17:25:46 -06:00
Ethan Yonker
f96087e68f Fix up install functions
Change-Id: I62110806f60cd923fb761f5e5f2544da3d5b68b1
2014-11-07 10:38:51 -06:00
Matt Mower
d5c1a9220d More MD5 verification error handling
Distinguish between skipped md5 verification cases:
 - .md5/.md5sum file not found
 - .md5/.md5sum file unreadable

Move MD5 error messages to twrpDigest

Change-Id: I912e3d9ebe64e78bed76eab8aa468d619b45972f
2014-04-16 21:46:53 +02:00
Ethan Yonker
d5801c5fe2 Force zip verification in OEM builds
Change-Id: Ie894b5f5cda64f83b1bb58bb977024230b0337f2
2014-04-15 15:27:00 +02:00
Matt Mower
6883d73d0d Allow disabling legacy properties
Introduce TW_NO_LEGACY_PROPS flag for users that build TWRP in
non-kitkat trees and don't need the legacy prop environment.

Change-Id: Iacb2d9af7d7069acb3d0a96bb34f32ded6317a20
2014-03-27 16:14:59 -05:00
Matt Mower
cdd3b339fc Add basic error checking to legacy property init
Let init and rename funcitons return success or failure values.

Change-Id: Ieed86cac8a0dcfd770a89dacc57fd306e7a6ad8d
2014-03-27 16:12:40 -05:00
that
7e303cfeb8 Support pre-KitKat properties for update-binary
Google changed the in-memory format for storing properties in 4.4.
Zips containing an older update-binary expect the old format, otherwise
assertions on properties in the update script fail.

This is just enough of the old property service to copy the properties
to the legacy format before running the updater.

Change-Id: I404680384bdc5e952609e295029ab0a0faf743a5
2014-03-09 23:17:15 +01:00
Dees Troy
3be70a897e Update licenses to all match 2013-10-22 14:25:12 +00:00
Dees Troy
b7ae098e21 Kang in older minzip for building in CM9 & CM7
CM7 and CM9 do not have libselinux needed in the newer minzip.
2013-09-10 20:47:46 +00:00
Dees_Troy
512376ccc7 Extract file_contexts from zips if it exists
Update binary will now extract file_contexts if it exists in the
root of the zip to /tmp

Recovery will replace the existing /file_contexts in the ramdisk
if file_contexts exists in the root of the zip.

This ensure that the proper contexts are used during zip installs.

Change-Id: If22c41101868643b67e6dba6177677c078fcd877
2013-09-05 13:06:16 +00:00
Vojtech Bocek
fafb0c541b Unify indentation and little clean-up in TWRP files
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-08-24 07:56:48 -05:00
Dees_Troy
2673cec07a Move all AOSP code out of recovery binary
Improves license compatibility between GPL and Apache

Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-04-04 18:57:34 +00:00
bigbiff bigbiff
cdcfee48b9 use md5.c for computation of md5sums
create a framework for computing digests and reading digests in TWRP
add space for backwards compatibility with bb md5sum
Change-Id: Ia18e3f430eed5eba22e5052d39b9b8d88ecd4536
2013-03-07 08:07:34 -05:00
Dees_Troy
e2c8ba75eb Disable the forced MD5 check 2013-01-30 21:00:05 +00:00
Dees_Troy
9350b8d6ed Update sdcard partitioning to C++ 2012-09-27 12:40:09 -04:00
Dees_Troy
c51f1f994a Various fixes
Modify AOSP mount and wipe functions to use Partition Manager.
Update wipe code to reset the log file index when wiping cache.
Add ADB sideload to 540x960 theme.
2012-09-20 15:32:50 -04:00
Dees_Troy
b9d88acdc0 Move to shared libmincrypt
Remove mincrypt source from TWRP and add rule to make
libmincrypt as a shared library.
No more crashes during zip signature verification and
less code to maintain in TWRP.
2012-09-14 14:34:26 -04:00
Dees_Troy
38bd760b58 Add wipe functions, compiles in CM7, text shows in UI, zips install
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
2012-09-14 13:36:32 -04:00
Dees_Troy
32c8eb81af Make text appear in GUI console, Zip install works.
Move TW zip install code to C++ so that it can use the
ui->functions.
Bring in mincrypt code to fix a crash during signature
checking.
2012-09-12 15:14:38 -04:00