Commit Graph

7654 Commits

Author SHA1 Message Date
Captain Throwback
f8d0e2156e openrecoveryscript: do not skip decryption even if using block.map
- Allows addon.d scripts to run that require access
  to decrypted /data (e.g. Magisk). Seems to also affect
  GApps addon.d script, resulting in non-booting system
- If decryption prompt is canceled, installation will
  still proceed (i.e. on devices where TWRP doesn't
  support encryption)
- Should resolve
  https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1478
  and possibly
  https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1459

Change-Id: Idcd397aa145577c409d5174ae3f9c48474e5734b
2020-03-08 00:31:54 +00:00
Captain Throwback
d54e1da83e partitionmanager: add /etc to Local_Path
- Prevents errors when using copy_file for
  paths starting with /etc

Change-Id: I7d52acdbc8e67a21e3d32f4793257dbdad5d82de
2020-03-04 16:55:48 -05:00
Mauronofrio Matarrese
6d5d08a1c0 Move decryption error from logerror to loginfo
Change-Id: Iffa01968dfb92d2cc91b0b6a33c87d7f270430db
2020-02-17 17:13:04 -05:00
bigbiff
2c2d559113 Merge "Removing fake error: E: recv error on uevent" into android-9.0 2020-02-16 19:46:11 +00:00
Hernán Castañón
990168bec0 bootable: read all asserts in case there are more than one.
In A/B, the device check isn´t done by the updater script, but using
metadata for it.

Let´s search if the device codename/assert is included in the string.

Change-Id: Ie856ac699aaa83de2b364bc85a510a037d36edf9
Signed-off-by: Hernán Castañón <herna@paranoidandroid.co>
2020-02-05 00:28:04 +00:00
Darth9
0864aa54ce Prevent errors caused by /data/per_boot/
Change-Id: I543723f3da4f57fb4d580661216acc1abaac883e
2020-02-01 21:27:53 +00:00
Captain Throwback
49cfb7e537 crypto: add some missing newlines
Change-Id: I6bc6b512fe6e841703229d45333421532ecebb83
2020-01-28 17:46:23 -05:00
bigbiff
15434cdeec Merge "android-5.1: use char constructor for default on c++ streams" into android-9.0 2019-12-23 23:06:23 +00:00
Mauronofrio Matarrese
9632f301c1 Removing fake error: E: recv error on uevent
This shouldn't be an error, so i hide the line about the error.

Change-Id: I3ef667435dfa843440cc594409c8d20add676576
2019-12-23 09:28:10 +00:00
Ian Macdonald
f9156eaaab Complete overhaul of Dutch translation:
* All missing strings added (ref: en.xml).
* Many strings clarified and ambiguity removed.
* Inconsistent use of language reconciled.
* XML validated by xmllint(1).
* String length validated on device (G975F).

Change-Id: I4a4c3dc5a1147a62b8c141286fc7ac432678a322
2019-12-23 00:50:53 +00:00
Alessandro Astone
5667feb0ac recovery: wipe bootloader message from index 0 when using custom offsets
* We may use a custom offset to:
   a) preserve data that oem wrote to the first bytes of misc
   b) skip recovery flags written by the bootloader (e.g. --wipe_data)

   For case a) one should set the offset 'x' to be at least greater than
   the size of bootloader_message struct (2048 bytes). If this is the case,
   then we zero out bytes x ~ x + 2047

   For case b) one should set the offset to be strictly smaller than
   the size of bootloader_message struct. If this is the case, then we
   zero out bytes 0 ~ 2047.
   This allows to clear any additional flag set by the bootloader,
   that would otherwise be forgotten in misc.
   This also guarantees that we do not involountarily wipe any data that
   the oem may have written starting at byte 2048 (coff coff LG)

Change-Id: I2d4e0702a2d8cbbef6274a87ce9499b0f69310dd
2019-12-22 21:20:48 +00:00
bigbiff
d331705daa android-5.1: use char constructor for default on c++ streams
Change-Id: I4be681c2720f62182e57237b1cfefc384235f0e1
2019-12-22 16:05:12 -05:00
Alessandro Astone
7ec5fd9e6d recovery: Move bldrmsg offset symbols to bootloader_message.cpp
* bootloader_message.cpp is the only file using
  BOOTLOADER_MESSAGE_OFFSET_IN_MISC and WIPE_PACKAGE_OFFSET_IN_MISC,
  so we can move their definitions to the cpp.
  This prevents the need to set BOARD_RECOVERY_BLDRMSG_OFFSET
  in every module that includes the header.

* Global cflags are no longer supported Oreo and up,
  so set the BOARD_RECOVERY_BLDRMSG_OFFSET via make variable

* Simplify logic, always set BOARD_RECOVERY_BLDRMSG_OFFSET.

Change-Id: I2b902bcce7f5ca13472e0ac30ac01b4991294dbe
2019-12-22 20:21:16 +00: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