Commit Graph

7642 Commits

Author SHA1 Message Date
bigbiff d331705daa android-5.1: use char constructor for default on c++ streams
Change-Id: I4be681c2720f62182e57237b1cfefc384235f0e1
2019-12-22 16:05:12 -05:00
Ian Macdonald 2923defaea /sbin should come first in the linker search path.
/sbin must come before any other search path when TWRP is built for a
different version of Android than the one on which it will run.

Otherwise, as soon as any of the other paths becomes available via
direct action (i.e. the user mounts a file-system) or indirect action
(e.g. the user flashes a zip that mounts a file-system), incompatible
libraries will be prioritised and loaded instead of the correct ones
from /sbin in TWRP's ramdisk.

This will cause severe disruption of the TWRP environment. Toybox and
other dynamically linked binaries will immediately cease to work; and
since Toybox provides umount, it typically won't be possible to recover
from this state without a reboot.

For example, the following occurs when a Toybox applet is run on a
Samsung Galaxy S10 running Android 10, but using a version of TWRP built
for Android 9:

android:/ # getprop ro.boot.bootloader
CANNOT LINK EXECUTABLE "getprop": cannot locate symbol "_system_properties_init" referenced by "/system_root/system/lib64/libselinux.so"...
linker: CANNOT LINK EXECUTABLE "getprop": cannot locate symbol "_system_properties_init" referenced by "/system_root/system/lib64/libselinux.so"...

Change-Id: I31fe612ebb1c7d9ad71d67be2c615caa3fbb5d6f
2019-12-05 01:54:57 +01:00
big biff 72d75b0b40 Merge "ldconfig: add /sbin to search.paths" into android-9.0 2019-12-01 01:22:18 +01:00
mauronofrio 9bf73351e5 Encryption: try wrapped key also for device without metadata support
Change-Id: I8b58e45ec0d42470226083e8003dcd8152a91af1
2019-11-23 22:29:15 +01:00
Captain Throwback 8d70eb617e ldconfig: add /sbin to search.paths
- Move commands from prebuilt to root Android.mk
- Hotfix for linker errors after https://git.io/JerWD merge
  on some Samsung device(s)

Change-Id: If628ab486689878885b696c2f5a107987092aeba
2019-11-14 11:14:06 -05:00
big biff 8c0bcc8ba0 Merge "Add ld.config.txt for Android 8.x+ trees" into android-9.0 2019-11-08 00:47:20 +01:00
SyberHexen a895118a1f cache: Fix typo in twrp-functions.cpp for A/B devices
* without this A/B devices are writing 8MB+ uncompressed logs under persist/cache/recovery which increase in size over time. This can eventually leave persist partition OOM causing other cascading issues like crashing the modem during boot and bootloops.

Change-Id: I0f3aab0eb96804d1be8de965eb2c2e9bb83d5b56
Co-authored-by: Erfan Abdi <erfangplus@gmail.com>
Signed-off-by: Andrew Hexen <SyberHexen@gmail.com>
2019-10-29 18:28:48 -07:00
Captain Throwback 170964d5bb Add ld.config.txt for Android 8.x+ trees
- Fixes the ld.config.txt errors in recovery log which may prevent
  decryption and shell commands from working properly

Change-Id: I0e057525cdda39e8ac10115d37e2cb882b9c4844
2019-10-21 19:46:30 -04:00
big biff e078e9cf7b Merge "Update Portuguese (Portugal) translation" into android-9.0 2019-10-19 00:21:45 +02:00
VDavid003 2034a41934 Fix typo in comment
Change-Id: I9b24d324fd61f2f0d2e85a9d123778557e14d63c
Signed-off-by: VDavid003 <virag.david003@gmail.com>
2019-10-18 22:43:20 +02:00
Vasco Machado bdb20a9d2d Update Portuguese (Portugal) translation
Change-Id: I2adff8a76f210048edc29264652d072139d594f9
2019-10-17 16:45:59 +01:00
big biff c1d7c35049 Merge "Persistent logs: Compress target log on storage." into android-9.0 2019-10-06 19:32:37 +02:00
bigbiff bigbiff e3ad5346da Persistent logs: Compress target log on storage.
This update will use pigz to compress the log that TWRP stores
on persistent storage in order to help with storing logs on the
persist partition.

Change-Id: I16971b8b138b74a164b1b0835847177cfc6104e2
2019-09-18 19:17:20 -04:00
bigbiff bigbiff 0be03b3217 Encryption: try wrapped key if the first time decryption fails
Change-Id: I108b7aeea41c6b85c851f40c1c4a7e25012e2463
2019-09-01 13:38:44 -04:00
Peter Cai 05cd3f8616 ext4crypt: change to upgrade key if export fails
Add support to upgrade key when export fails with KEY_REQUIRES_UPGRADE.

Ported from
https://source.codeaurora.org/quic/la/platform/system/vold/commit/?h=LA.UM.7.9.r1-06100-sm6150.0&id=85c46eaacc60290db5e71380d89eb4d99ed67995

Change-Id: Ic64be8ade00c0b0d014370ecc9341b1ecc9b0d7a
2019-09-01 19:34:09 +02:00
Peter Cai 90edd2e867 ext4crypt: support wrappedkey for FBE
Qualcomm devices use a special `wrappedkey` mode for FBE. This is ported
from CAF
https://source.codeaurora.org/quic/la/platform/system/vold/commit/?h=LA.UM.7.8.r4-01000-SDM710.0&id=9229262d893a8592f7bc1b4e8a8dab7aad8df68c,
originally by folks at Mokee for vold
https://mokeedev.review/c/MoKee/android_system_vold/+/34102.

This patch ports the above changes to `ext4crypt`, which we can use in
recovery. Note that since we do not have `fs_mgr` in the recovery, we
cannot read the `wrappedkey` flag from fstab. Instead, similar to
`fbe.contents`, we use a special property `fbe.data.wrappedkey` to
indicate support for wrappedkey mode. Devices that need to use this
should set this property to `true` to activate corresponding code.

Change-Id: I79c2855d577156670b45c10c7c7b1fcd9fece8d9
2019-09-01 19:33:30 +02:00
big biff 69ab4a6000 Merge "fix build error in 9.0 with TW_NO_EXFAT_FUSE:=true" into android-9.0 2019-08-04 00:49:41 +02:00
Andreas Schneider b0a0dbbab0 prebuilt: Add android.hardware.confirmationui@1.0 for /sbin/keystore
Change-Id: I62e68c137e9790392dd2fc44c2add990c2f408d6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2019-07-04 00:39:02 +02:00
big biff 0bd7c59026 Merge "ext4crypt: support synthetic keys v3 on May update" into android-9.0 2019-06-25 02:01:42 +02:00
Ian Macdonald a3b25a3ebe Backup_Tar(): Properly localise string instead of using English.
Change-Id: Id13885a30e3a412e5b7b42de0e63cd7fc885dfc1
2019-06-24 00:28:38 +02:00
bigbiff bigbiff 3c897aec16 fb2png: Fix compilation in android-9.0 repos.
Remove unused reference.
Change temp variables to size_t.
Update function calls for unused arguments.
Update static functions to ignore being defined
for each file that includes it.
Change-Id: If11d4e26daee54197f369974a09ec71f27abb59b
2019-06-05 20:00:54 -04:00
Ethan Yonker ae7ff3b2fa Fix symlink creation
Change-Id: I0d0bcdde2957974eb357a6f3d820bd5ab0fa47ee
2019-05-24 16:31:09 -05:00
Ethan Yonker abf1fb0086 Switch between dependencies and modules
Use LOCAL_REQUIRED_MODULES for Pie and up and
LOCAL_ADDITIONAL_DEPENDENCIES for Oreo and down.

Change-Id: I5365e782f98f3bbf4bf246be22c8f573824b65ee
2019-05-24 22:39:12 +02:00
Peter Cai ea1764c9fa ext4crypt: support synthetic keys v3 on May update
Re-implemented SP800Derive in C++, which is added as the new key
derivation function in Android 9.0 May update. From file
services/core/java/com/android/server/locksettings/SP800Derive.java in
frameworks/base.

This is required to get TWRP working on any Android device that has a
screen lock set up after the May update.

Change-Id: I5c1a51b110033f2b0b75d5e36fd8098c05e95179
2019-05-24 20:41:12 +08:00
bigbiff bigbiff f5955b1cb4 Digest: Create digest for each subpartition and not just the first.
Change-Id: I408382e83aa0ac1106ff7198adf9787c0a0877cd
2019-05-18 17:30:12 -04:00
Ethan Yonker 5a1ae04674 3.3.1
Change-Id: I9c1114d133cd195ce536dc66b6bdc1f0236ddd55
2019-05-16 12:11:32 -05:00
Ethan Yonker 76bbd3a11a Add option to uninstall TWRP app from /system
Change-Id: Ibe372a372333c357810be2afcb3796723ca370cb
2019-05-16 19:07:06 +02:00
Ethan Yonker 9f5dd3139e Flash both A/B partitions when flashing recovery ramdisk
Change-Id: Ib4017943be91f6b2030094d73daa826a4a1555d4
2019-05-16 19:06:49 +02:00
dianlujitao 3cf05a569e Resolve e2fsdroid failure in certain cases
* Set proper SELinux context for system-as-root system, AOSP uses "/"
   in fstab while TWRP uses "/system_root" so an exception is necessary.
 * Skip initializing context if the target partition doesn't exist in
   /file_contexts e.g. /usb-otg.

Change-Id: I8f802c34e18fb9f65bf936d11967c83a451b0493
2019-05-15 16:27:17 +08:00
big biff c1ad6c1931 Merge "Pass file_contexts path to e2fsdroid" into android-9.0 2019-05-15 01:04:55 +02:00
big biff f816672f9c Merge "Update help manual in orscmd" into android-9.0 2019-05-14 01:41:33 +02:00
Nikolay 29969ec5dd Update help manual in orscmd
Change-Id: I4b2e385637cded40dbb08e0ee8ca7117dbdd67ca
2019-05-12 21:03:35 +01:00
lambdadroid ead0f49cbb toolbox: Avoid linking toolbox tools to dd
Having the twrp_dd module definition right within the build rules
for the toolbox symlinks causes the toolbox tools (getprop, ...)
to be linked to dd instead of toolbox.

This happens because the symlinks are created using variables
from the "toolbox_recovery" module (e.g. LOCAL_MODULE_STEM).
Those are changed by the twrp_dd module definition.

Move the twrp_dd module definition to the end of the make file
(after the build rules for the symlinks) to fix this.

Fixes https://github.com/omnirom/android_bootable_recovery/issues/257

Change-Id: I44973920898fe8a21bc32d621500fe38f9d1ebdd
2019-05-12 11:54:38 +02:00
big biff c2a5f7ef66 Merge "language: update Chinese translations" into android-9.0 2019-05-11 01:45:24 +02:00
betaxab c23f00b90d language: update Chinese translations
Change-Id: Id34055262b7c711a2ee71d97d27503a887d35b76
Signed-off-by: betaxab <betaxab@gmail.com>
2019-05-11 03:45:59 +08:00
big biff 117c64785b Merge "NTFS-3G: use newer libfuse-light in pie." into android-9.0 2019-05-09 01:48:45 +02:00
bigbiff bigbiff 52f868b5d9 NTFS-3G: use newer libfuse-light in pie.
Change-Id: I66dc38a19524f1eaac8cc5afc1110c5d11fc74eb
2019-05-05 16:13:08 -04:00
bigbiff bigbiff 3f20a85c03 English language: Remove duplicate value.
Change-Id: I849acef3e19519bfe6b8dc5fdd9a50eda3f03e2a
2019-05-05 13:53:25 -04:00
bigbiff bigbiff 6af36a4f37 bsd dd: include prebuilt bsd dd in twrp for Nougat and greater
- Cleaned up toolbox/Android.mk so that BSD dd builds
  with correct Android versions

Change-Id: Idb15811480ec03b05336d54b866233b5ac99dfaf
2019-05-04 19:55:16 -04:00
big biff 5f177ae4c7 Merge "awk: add awk for trees including one-true-awk" into android-9.0 2019-05-03 02:16:29 +02:00
big biff a525f3bc79 Merge "mkshrc: remove post-install cmd and use LOCAL_MODULE_STEM" into android-9.0 2019-05-03 02:09:53 +02:00
big biff 252651b483 Merge "Clean up logd init file" into android-9.0 2019-05-03 02:07:41 +02:00
big biff 84d2300cce Merge "Use BSD grep for builds with toybox" into android-9.0 2019-05-03 01:34:27 +02:00
Captain Throwback 695baa60cb toybox: fix build in 6.0 tree
When building with TW_USE_TOOLBOX, build currently fails.
This patch fixes those build errors.

Change-Id: I041523d93a3fa9624fee80679e521750b4f9edfa
2019-05-01 18:50:36 +01:00
Captain Throwback 93804dd50e awk: add awk for trees including one-true-awk
Change-Id: I5458a3ecc69b60cc249f598b0250428fc414f34b
2019-04-30 16:38:49 -04:00
Captain Throwback bb016729b1 mkshrc: remove post-install cmd and use LOCAL_MODULE_STEM
Change-Id: I2e0c7fda8cb39dd2a607f7ab2fdfe744e75fb3cd
2019-04-29 17:46:41 -04:00
Captain Throwback 986130473e Clean up logd init file
- Remove unnecessary services

Change-Id: I4c9227cd49eeef1176d321ae61ca3ca8c3f54596
2019-04-29 17:45:31 -04:00
Captain Throwback 3c565b568d Use BSD grep for builds with toybox
- Include symlinks for egrep and fgrep

Change-Id: I78e27f95efa143fa63def02c9e72af567833aefe
2019-04-29 17:44:24 -04:00
codeworkx 22e3aa9ed6 ext4crypt: add missing cflag
Avoid calling e4crypt_prepare_user_storage with wrong input parameters.

Change-Id: I5c8945370cb642e46f08c65090c0290c15fe0b57
libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 632 (recovery), pid 564 (recovery)
2019-04-23 12:07:43 +02:00
dianlujitao 19e8461ff7 Pass file_contexts path to e2fsdroid
* Otherwise no context will be initialized but existing context will be
   erased and lead to unexpected behavior, e.g., device no longer boots
   after restoring a system backup due to missing valid seclabel of the
   system partition.

Change-Id: I60c62fdc699714bb906a40ce5e1f40299681f72a
2019-04-22 17:55:13 +08:00