Commit Graph

9658 Commits

Author SHA1 Message Date
Mohd Faraz 9a4ef26299 Unmount vendor after apex
BUG: prebuilt vendor blobs are being overriden by vendor partition, which causes failed to decrypt the device
TEST: after this patch vendor is no more overriding and decryption working as expected.

 * Devices using the stock or the rom based libs then it needed to add the TW_USES_VENDOR_LIBS := true in the BoardConfig

Change-Id: I3cbc7fe6df2289081e9198941cfb65a1a7e0e6a3
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-10-23 22:17:01 +00:00
Captain Throwback 3b33954568 gui: bump theme version to 4
updates for fastbootd

Change-Id: I02331693ca9a407e0bd30c633f2b799ece7b3636
2020-10-23 21:56:24 +00:00
Captain Throwback 49df5475db init: include more services in TWRP by default
vndservicemanager should be included with crypto support

boot and health services are needed for bootctrl and fastbootd

hwservicemanager and servicemanager should be included
regardless of crypto status

Change-Id: Ie76dac11b733c4549c2d55301cf614fe82905884
2020-10-23 21:55:18 +00:00
Captain Throwback 8bd1ac5f7c mke2fs: add conf file to recovery build if flag is set
Also clean up paths for some other files in Android.mk

Change-Id: I31220642e8396c6360c11078959796c045f53b9e
2020-10-23 01:01:44 +00:00
Noah Jacobson 81d638d235 Add support for multi-user decryption
* Add CLI support using the command "twrp decrypt <PASSWORD> [USER ID]"
* Add GUI support using the menu Advanced --> Decrypt User

multiuser: Parse users only when Decrypt_DE runs successfully

multiuser: Warn when not all users are decrypted

Change-Id: Ia5e943b13c2d5ec5c34ae97661133c19ff471e6d
2020-10-23 00:52:04 +00:00
Ian Macdonald 160e8d3955 Improve 'super' partition description in back-up menu.
For the back-up menu, we can detail what the super partition includes by
aggregating one of BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST or
BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST.

We comma-separate the list and capitalise the first letter of each
dynamic partition.

Change-Id: I663eaf4f28b4591293aae21c2dd11f615f625746
2020-10-22 22:45:36 +00:00
Mohd Faraz 2a1e375076 Write correct mount Opts in fstab
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I4049be4a693bde3f1bc3a088ce864eca5515ae5f
2020-10-22 22:32:57 +00:00
Mohd Faraz a791d12005 Fix compilation
* since bu binary was not in required modules, as per the change https://github.com/TeamWin/android_bootable_recovery/commit/3a299dcc322a21802e555da9a4ab51d00ced6ee0
   it was including the required modules and giving the following error

    FAILED: out/soong/.intermediates/frameworks/base/ext/android_common/turbine-combined/ext.jar
    echo "module ext missing dependencies: libphonenumber-platform, nist-sip, tagsoup, libtextclassifier-java" && false
    module ext missing dependencies: libphonenumber-platform, nist-sip, tagsoup, libtextclassifier-java

    FAILED: ninja: 'out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/javalib.jar',
    needed by '/home/androiabledroid/twrp/out/target/product/rolex/obj/JAVA_LIBRARIES/bu_intermediates/dexpreopt.zip',
    missing and no known rule to make it

Change-Id: I1b93235b61f18f201968e4550b0e9195968bcaf2
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-10-22 22:31:11 +00:00
Captain Throwback 47bf7204f8 partition: support tntfs module
Change-Id: I0532b10f6748d00c80454a051ef63cc74a77780c
2020-10-22 22:26:02 +00:00
Captain Throwback b60a2732d5 Unmount vendor partition prior to switching slots
On some devices, having the vendor partition mounted
causes slot switching to fail ("Error getting bootctrl module")
Automatically unmount vendor partition prior to switching
slots to ensure the process completes successfully.

Use lazy unmount if Unmount_by_Path function fails.

TEST: Mount vendor partition, then switch slots.
      Vendor partition should be unmounted when
      switching completes
      
Change-Id: If6198d4693141be464749c4d423a9088753d939e
2020-10-21 18:03:24 -04:00
bigbiff df8436b51a fastboot: implement fastbootd in twrp
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
2020-10-21 17:47:27 -04:00
Captain Throwback 12673e2a4c prebuilt: make paths consistent and remove some redundacies
Change-Id: I46d1a66622245ad61026e402bacc36924ff0e642
2020-10-20 12:15:29 -04:00
Aaron Kling 4eccd9a1c6 Choose hwrotation at runtime
If the prop persist.twrp.rotation is set to 0, 90, 180, or 270,
that will be used. If the prop is not set, the existing rotation
board config flags will be honored.

Note: This flag will only rotate graphics. If a set of devices
needs differing touch rotation, that support will need added
separately.

Change-Id: I6996c07bc0ae7bb8555b3d480b2917a17a365eb3
2020-10-19 22:08:25 +00:00
Captain Throwback bff7617e2f init.rc: move "start logd" to logd rc file
Change-Id: I1ff512206a60056eb96f25e83db417382c9a44e5
2020-10-14 23:24:50 +00:00
Captain Throwback ca2ba939c9 init: add services to build
hwservicemanager and servicemanager are needed for decryption
and fastbootd in TWRP. Include these services by default since
they are standard Android services and independent of device
tree or SoC.

Change-Id: Id0ec73d9a6ca0289c7b4f67e9dcf541b2157c04e
2020-10-14 12:55:58 -04:00
Captain Throwback 82c6693ec8 init.rc: clean up redundant "on fs" section
Change-Id: Ie5340ce0d31383117602df907ee3cc0b8ec7100c
2020-10-13 15:10:59 -04:00
bigbiff c3793658b3 libtar: turn off debugging for block headers
Change-Id: I09e4dd2ec33457156faf99b0139d116b50cb7dc3
2020-10-11 09:56:44 -04:00
Mohd Faraz 815e24079b Fixes Decryption prompt asking when not needed
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: Ic366a50f02f283864cf44d7b36f40ff6432d4970
2020-09-24 16:08:07 -04:00
Mauronofrio Matarrese c1bb76ea74 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
2020-09-24 19:24:58 +00:00
Ian Macdonald 57c289fd32 Fix path to fscrypt_policy.h include file.
Change-Id: I4d380196e3283748aa82628a4e4176120a10c46a
2020-09-17 22:17:22 +00:00
Ian Macdonald 1e0474acb0 Unconditionally call DataManager::ReadSettingsFile().
Change-Id: I86e14e65765b266efe1f8e96154c03b66b099771
2020-09-17 22:03:33 +00:00
bigbiff 6411e0832d apex: handle flattened apex directories
Change-Id: I4eb9934721ded959690d8da84a4305d15e448edf
2020-09-14 20:13:12 -04:00
bigbiff c2cb385d5d wiping: this will fix wipe with devices that don't use the
/dev/block/mapper/userdata symlink to the setup device mapper.

Change-Id: I1d5a1ed59f7c445ce86ccd52dae1e2e729e06815
2020-09-13 18:05:41 +00:00
bigbiff fdca6b8a5a truetype: fix truetype font key map
Change-Id: I09dc6798c219ae9d3f1a3745947b28e19fd0f527
2020-09-12 14:25:32 -04:00
bigbiff 8da46fa939 Revert "Implement autodetection for SAR, based on the installed system"
Change-Id: I9e6c549013c1d5564d0a2e369510535e3869dff6
2020-09-09 20:13:12 -04:00
Captain Throwback dc0823c96e TW_OVERRIDE_SYSTEM_PROPS: move up to just after fstab processing
Change-Id: I9428222fd885c2afea0a5598cc4c3a52cd729ff8
2020-09-09 19:03:30 -04:00
Mohd Faraz e3948ece83 Fix up issue during decryption
* Since some devices are unable to decrypt after processing of the fstab,
   because of the partition details updation, and after intro of dynamic partitioning
   here decryption process was going on after complete processing of the dynamic volumes.

 * This patch fix these issue, it process the logical volumes at their time not after all processing fstabs.
   This fixes the decryption issue.
   Translate more partitions i.e., ODM, Product.
   Added more partitions in unmount partitions.

Change-Id: I977c0cf0c40e5311f54a78c98f1fd89f71c6ac57
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-09-09 22:49:37 +00:00
Captain Throwback 57db2cc8ac f2fs: add back fsck.f2fs to recovery build
- Fixes issue of rebooting device when data filesystem
  is set to f2fs

Change-Id: I9de815e12be57773712d4acfa0b634ce909ea820
2020-09-09 15:40:13 -04:00
bigbiff 20edca8f34 minui: fix bad merge from aosp10.
Tested charger on flame and graphics show properly when device is
powered off.

Change-Id: Ic1a46497a6bce88992b2d1a9052cba2a1a6af8b7
2020-09-08 15:08:53 +00:00
bigbiff ad58e1bfae repack: move sbin to /system ramdisk and update repacking
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
2020-09-08 10:08:33 -04:00
bigbiff 3db1ffc89f Merge "persist logs: remove persist from available log directories in partitions." into android-10.0 2020-09-05 23:41:22 +00:00
Captain Throwback b7cefd105e TW_OVERRIDE_SYSTEM_PROPS: move to after super partition is set up
Change-Id: I288ef00752be0cf59977e80007a9d2e0a059b41d
2020-09-05 17:12:47 -04:00
4ndyZ af1e585f3a lang: Updated German language strings
* Added all missing strings
* Translated some English strings in the German language file
* Changed ZIP notation to "ZIP" to be consistent in the translation

Change-Id: I27812c7f79c95258363772481f71253b8b505e28
(cherry picked from commit 6c70991a72820b390185b6de923a3694dce3cf44)
2020-09-05 20:26:33 +00:00
bigbiff aac58612ea persist logs: remove persist from available log directories in
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
2020-08-30 18:16:35 -04:00
DarthJabba9 43d70f4bc7 Exclude the dumpsys dumps from backups, to avoid error 255 when restoring data backups
Change-Id: I7a83b3789828c1400e31007e868263c54d8eb38c
(cherry picked from commit 13b07f8dbe27d85254e0a04f689a9ed6bde7673e)
2020-08-04 23:03:14 +00:00
bigbiff 5b911ca621 persist: contexts for lost+found not found when running e2fsdroid
When running e2fsdroid on persist, lost+found doesn't have any
entries in file_contexts. We are removing the lost+found directory
after a wipe now, and before the restore of the tar.
Change-Id: If5db0971884e296fae0211ff4806f3e16e394632

Change-Id: I9fa51dc9ef558cd82445df9a8fa377b1feda11aa
2020-07-19 09:32:13 -04:00
Mohd Faraz e1d72623b7 Fix up cache wipe issue in A-Only device
* missed in https://github.com/TeamWin/android_bootable_recovery/commit/3754fabbea2eefeb7c1a0c5bc804f1e14a686855

Change-Id: I8fc3719e7f98c3d9b5fd96a9820b84773d4f5d7d
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 25371a7e1f7f7d690755e3b12140b39567456a98)
2020-07-06 20:56:57 -04:00
bigbiff 25d25b9e67 log storage: change AB device log storage to /data/recovery
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
2020-07-07 00:55:42 +00:00
bigbiff 7124009f9d fastbootd: relink for startup
Change-Id: Ica7dfbfd46c06618240fb06fce9c4b31103ec506
2020-07-03 18:55:21 +00:00
bigbiff 1f780663cf minuitwrp ev_init: delay start if specified in board
This setting in the board will help if it takes longer
for the touchscreen driver to initialize.

Use TW_DELAY_TOUCH_INIT_MS := nnnn where nnnn is in MS.

Change-Id: I0a5c602edfe1214d64adadc980921a7bc0aa2bc5
(cherry picked from commit c6e2cfecce019d70ed5de74611761a2546e34828)
2020-06-29 15:50:54 +00:00
mauronofrio matarrese e50fde5c78 Set proper filesystem during decryption
Change-Id: I0bb9d4ceab83feff19571004f7dccd360ddceac0
2020-06-23 14:46:23 +00:00
mauronofrio 539597deed Rework is_metadata_wrappedkey_is_supported
Change-Id: Ia3c266bb32e31354375b633c4801e486f664539a
2020-06-23 14:45:20 +00:00
mauronofrio matarrese f1079ed67b fscrypt: : Use wrapped key for metadata encryption
Importing of this commit:
https://github.com/LineageOS/android_system_vold/commit/944c48d5a4c6df1eb751b04f52c06adac35ebab6

Change-Id: I048a6c2aeff2591135f47223a99af5ddd215703c
2020-06-23 14:44:34 +00:00
mauronofrio matarrese bd79db4d6d fscrypt: change to upgrade key if export fails
Importing this commit:
https://github.com/mauronofrio/android_bootable_recovery/commit/f999d65b23f0cd36ee85995ac1601d1b2ab690e5

Change-Id: If73dc534ddf6c8b96ce2789789f25ce432428aa5
2020-06-23 14:44:12 +00:00
mauronofrio matarrese 17fb1210a9 Rework is_wrapped_key_supported_common
Importing is_wrapped_key_supported_common from android-9.0 branch

Change-Id: I7a13b40e365a984a90a661e6c2c71cfa5b725a11
2020-06-23 14:43:47 +00:00
mauronofrio matarrese 7982032fcd fscrypt: Wrapped key support for FBE
Commit imported from:

https: //github.com/LineageOS/android_system_vold/commit/ce024f07c23d0649635a336fff389332b9806f48
Change-Id: I924a9fcbac7d790609fbafcf8c12654fdb267e32
2020-06-23 14:43:17 +00:00
bigbiff 86fabbe4d0 vendor partition: mount if found in super
Change-Id: I6348511087aca6fc722dc48677794e0d8b4a63fa
2020-06-22 17:07:27 -04:00
bigbiff 7ba7500953 decrypt: AOSP 10 requires the use of fscrypt
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
2020-06-22 12:17:22 +02:00
Simon Shi f4c1553789 super: emmc shouldn't be mount-only.
Bugs:
E:Cannot restore super -- mounted read only.

Change-Id: I07891b3f45a8601c1cafa45f9dd2a7a94482ac06
2020-06-18 02:38:24 +08:00
Simon Shi 407437ed39 super: Don't mount while prepare
Some of the partitions will not be unmount automatically. They shouldn't
be mounted by default.

Bugs:
DM_DEV_REMOVE failed for [product]: Device or resource busy
Cannot unmap product before removing group qti_dynamic_partitions.
script aborted: assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))
assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))error: 25
Updater process ended with ERROR: 7

Change-Id: I7cbd5c29456ca2731b94a69bbf9ad77058cef09c
2020-06-16 00:06:48 +08:00