fastbootd is a userspace daemon that runs in the recovery
ramdisk. It allows writing single partitions to the super
partition via fastboot CLI. When TWRP sees the fastboot option
in the misc partition during startup, it will start with
the fastbootd page and fastbootd running. Otherwise it will
run recovery normally.
Change-Id: Id7b12d29ef21dbd5950dc884dd1cd788f25357f0
for android-10
This will support updating the ramdisk to a different
compression format and co-exist with magisk.
We are also cleaning up and removing non android-10
api makefile actions.
We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.
Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
partitions.
Too many problems have been reported for TWRP attempting to store
logs in the persist partition. Selinux denials have caused issues
booting Android, and filling up persist has caused IMEI issues.
This patchset will remove persist from the list of available log
directories by default in order to avoid these and other possible
issues.
Change-Id: I29889d69f76270a8fbb764a79be3523821d8579c
This patchset is now exlcuding /data/cache from backup, and removing it
from the wipe exclusion list to prevent errors on restore and wiping
/data.
This patchset changes the directory from /data/cache to /data/recovery for TWRP
to store logs and other file information. This will help with AB
devices that don't want recovery to mess with /data/cache.
This patchset will make ORS use /data/cache for AB devices.
Remove policy code because we don't need to set a policy for the
recovery directory.
Change-Id: I1d140276314fd34804a72297d6e25a52e58210a0
fscrypt aosp doc: https://source.android.com/security/encryption/file-based
kernel fscrypt doc: https://www.kernel.org/doc/html/v4.18/filesystems/fscrypt.html
This commit implements the ability for TWRP to use fscrypt to decrypt
files on the fscrypt implementation. It has been implemented mostly
in a new successor library to e4crypt called libtwrpfscrypt. Most of the
code was ported from AOSP vold.
Notable updates include:
- updated policy storage by libtar
- lookup of fbe policies by libtwrpfscrypt
- threaded keystore operations
Big thanks to Dees_Troy for the initial trailblazing
of encryption in TWRP.
Change-Id: I69cd2eba3693a9914e00213d4943229635d0cdae
* since commit: a2bd7b7758
after factory reset /data/recovery doesn't recreates in A-only devices.
* so fixes issue flashing newer roms need access to /data/recovery
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I02cb67f7161571b1aa02784049231d42872a3587
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit bcbe94e2b5ef83fe65a5c9767287802365b5ee4e)
We are now requiring fstab v2 for android-10+ trees. You can
specify twrp flags using /etc/twrp.flags to label and
annotate partitions.
This patchset uses fs_mgr to load the super partition and build
device mapper blocks off vendor and system depending on the slot
in use. These are mapped to partitions in TWRP and allowed to
be mounted read-only. The super partition is also mapped into a
TWRP partition in order to backup the entire partition. You cannot
backup individual device mapper blocks due to the device can only
be read-only. Therefore you cannot write back to the device mapper.
Change-Id: Icc1d895dcf96ad5ba03989c9bf759419d83673a3
Rework progressbar according to AOSP, this should fix various
issues with progressbar.
From AOSP:
progress <frac> <secs>
fill up the next <frac> part of of the progress bar over <secs> seconds. If <secs> is
zero, use `set_progress` commands to manually control the progress of this segment of the
bar.
set_progress <frac>
<frac> should be between 0.0 and 1.0; sets the progress bar within the segment defined by
the most recent progress command.
Change-Id: I7f92359046288f3529cb2e98e6d54d410a248f1d
(cherry picked from commit ab16437de14fd9f1203b7e0ce82ea18eb56cae78)
This adds the option to automatically unmount the system partition
before installing a ZIP-file.
This option is enabled by default, This is usefull on SAR-devices
where system is mounted as system_root and ZIPs (i.e. Magisk)
try to unmount system instead of system_root and fail to install.
Change-Id: Id94ae658964679e23aa7fa137e07edf74ee073df
Set TW_INCLUDE_REPACKTOOLS := true
Must also have:
AB_OTA_UPDATER := true
Use magiskboot and provide GUI options to allow users to repack
their existing boot image to install TWRP (or kernels) so we can
stop having to provide installation zips for AB devices. There is
also an option to try to fix a recovery bootloop if the kernel
has been patched to always boot the ramdisk for root, etc.
You will need to pull the below repo into external/magisk-prebuilt
https://github.com/TeamWin/external_magisk-prebuilt
Change-Id: I74196cc6f095a7576d61886dc96cbc18deba9b04
Edl mode is available only on qualcomm devices and it used to fully
restore the bricked devices. I made the button available only if
TW_HAS_EDL_MODE := true like the download button. I set the edl
button to the right of the download button, so devices can support
edl button and download button. I also added the translation for
all languages.
Change-Id: I69d1058b8c050b722395c7b3da6dce1ccfbe7a91
This patchset updates all the places we touch cache on AB devices
and non AB devices so that we can write to the appropriate
location. AB devices removed the cache partition and moved it to
/data/cache.
Change-Id: I485ec205a604f1f07ceb7700ae9c4e720fd55c3e
On some devices (e.g. ASUS Zenfone) the serial number of the device
is stored in a file in the /factory partition. Consequently, the only
way to load it is using a user space application during the init
process, and to update the ro.serialno system property.
In most places, TWRP already uses the system property to get the
serial number of the device. However, when generating the device ID
used for the backup folder name it checks the boot command line
directly. On these devices, the serialno is not included on the
command line.
Add a TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID option that enables
usage of ro.serialno for generating the device id. It is disabled
by default to avoid changing the device id on existing ports.
Change-Id: I4a2eeca883f38fdaeb1209507fd8ebe44b1b04a0
* /persist can be mounted early while TWRP is parsing the fstab so
as soon as the partition is parsed, mount and adjust the time
accordingly.
* Store a backup settings file on /persist. Having a 2nd copy of
the settings file in the /persist partition allows for early
reading of the file and adjust timezone and brightness to user
preference while still on TWRP splash.
* Add the qcom ats time offset in TWRP settings file and use it
if no better ats file is found. This will also allow devices
with a persist partition, but no ats files in it, to adjust
the time offset during early boot.
* Use /persist/time/ as Qualcomm time fix source, based on
Xuefer <xuefer@gmail.com> patch:
https://gerrit.omnirom.org/c/27265/https://gerrit.omnirom.org/c/24384/
Change-Id: I6c21538eec58d87edfb639d9ce3871f33b886c1d
* 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
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
Note: I will have to add a build flag for excluding the app later for
watches and maybe Android TV. I will also have to add support in the
tablet and watch layouts later. I will merge this for the initial roll out
to select devices and finish up later.
Change-Id: Ia4ce5522fae542afa1539b10c0691315392a19ab
Rename twrpDU.* to exclude.*
Remove global variable for du and replace with partition specific
variables.
Use separate exclusion lists for backups and wiping.
Clean up some includes
Fix some parenthesis in twrp.cpp that I messed up.
Note: twrpTarMain command line utility compiles but probably does
not work correctly yet due to not properly setting part_settings
Change-Id: Idec9c3e6a8782ba53f3420fa79ba33394f4f85fb
* 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
Provide a countdown from 5 sec for the automated reboot after install.
Include a cancel button to interrupt the process.
Change-Id: Ib5e1447918adfde45eba361c088800812b690890
* 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
Removing these lines allows UMS to be enabled for devices with storage lun.
The checks don't seem to make sense as they are referencing always defined strings.
Change-Id: I75df9b7db5a790807fc2b5c946b271b103326b39
Note: events.cpp is still old code renamed to cpp to make it
easier to call functions like gr_fb_width().
I had to modify AOSP fbdev code to provide a separate memory
surface for drawing to as drawing directly to the framebuffer
resulted in rendering taking about 5 times longer.
I also modified AOSP adf code to provide a separate memory surface
for drawing for the same performance reasons. The Nexus 9 supports
adf graphics.
Overlay graphics work on at least one device. Overlay provides a
separate memory buffer already so performance is good.
I do not have a drm device yet that I know of. I made some attempt
to update the drm code to determine the correct pixel format based
on the drm graphics format, but what is available in pixel flinger
and what is available in drm do not line up all that well. Reports
are that the Pixel C is using drm graphics, but performance is
slow, likely due to the use of a mmap instead of a memory buffyer.
Change-Id: Ibd45bccca6ac2cb826037aa9b2aa5065cf683eed
-Detects, decrypts, and mounts an adopted SD card if a
secondary block device is defined (usually mmcblk1)
-Handles unified storage
-Displays the adopted storage in MTP along with internal
-Factory Reset - wiped just like a data media device, we
retain the keys folder and the storage.xml during a
factory reset
-Backup / Restore
-Disable mass storage when adopted storage is present
-Read storage nickname from storage.xml and apply it to
display names in the GUI
-Read storage.xml and determine what storage location is in
use for /sdcard and remap accordingly
libgpt_twrp is source code mostly kanged from an efimanager
project. It is GPL v2 or higher, so we will opt for GPL v3.
Change-Id: Ieda0030bec5155ba8d2b9167dc0016cebbf39d55