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>
* 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
* 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
* 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
/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
- 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
* 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>
- Fixes the ld.config.txt errors in recovery log which may prevent
decryption and shell commands from working properly
Change-Id: I0e057525cdda39e8ac10115d37e2cb882b9c4844
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
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
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
* 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
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