Commit Graph

10911 Commits

Author SHA1 Message Date
bigbiff
aed1bdfe59 get_args: process /data/cache/command
Change-Id: I744cdc5a72f53fd1224de242e30ff261e6104900
2021-09-25 20:52:58 +00:00
bigbiff
b2cce1055e screen blank: maintainer should specify in Board whether to disable
Change-Id: Id7dfea1ed9391d5a5f617b72a25fdb74dc235537
2021-09-25 15:33:19 +00:00
Captain Throwback
bc2cfa36ec Add exclusion criteria for "Fix Recovery Bootloop"
Should only be included on devices that use initramfs,
i.e. legacy SAR, recovery-in-boot

Change-Id: I2408fcd993e1e381f49b3d5ae860694b2fade4d2
2021-09-16 10:42:06 -04:00
Captain Throwback
529789380b copy log: add option to include logcat
Change-Id: I9689df4560d5209f385fbbc3e233859754b3ebbd
2021-09-07 03:03:16 +00:00
bigbiff
2485980a9a cleanup: remove unneeded headers
Change-Id: I0849406c635ebf85f90efd09f5452b6570d25487
2021-09-05 21:59:18 +00:00
Captain Throwback
b326961682 etc: include hwservicemanager for TW_INCLUDE_CRYPTO
A recent change removed the inclusion of hwservicemanager
and vndservicemanager with only this flag

Change-Id: I9b8cb05a6bd053b794599167bcc8bf0591b2e184
2021-09-04 15:06:54 +00:00
nebrassy
afb12eec15 repacker: adjust unpack command to fix compression issues
Change-Id: I027fd3bd86be858234daa82ef012254762949372
2021-09-02 10:18:49 -04:00
bigbiff
9dbd1fdf3c twres: change how build directory is determined
Change-Id: I1af103bc276828e9ec07e20becf9df59c9535478
2021-09-01 19:38:54 -04:00
bigbiff
e57d350820 bootctrl: TWRP shouldn't mark slots unbootable
Change-Id: I776916d42927ca5e12c4e6a416cc02d2c84d5cec
2021-08-29 19:46:08 +00:00
Mohd Faraz
29cab7f160 etc: vndservice and hwservice managers are required by other hals
* Export vendor paths for boot-hal as some libs are present in vendor
 * hwservicemanager and vndservicemanager are also required by health hal amd boot hal

Change-Id: I9017e0692cdb917db86629588726ba11eafd1e81
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2021-08-28 23:54:49 +00:00
soulr344
f831bff1e1 events: fix haptics on newer Samsung devices
Newer Samsung devices have a single file that enables/disables/sets the timeout for vibration in /sys/class/timed_output/vibrator/enable
The content of the file determines the state of the vibrator, 0 being vibrator being off and any other value being the time in ms that the vibrator is going to run before resetting to 0 again.

Change-Id: I1144e139285494e43b8656229ad6df10d5b48f39
Signed-off-by: soulr344 <soul@totsuka.gq>
2021-08-28 22:36:27 +00:00
Captain Throwback
2bf400c47c etc: don't start both health-hal services automatically
should be started in device tree init.recovery.rc

Change-Id: Ie2711a8053d0ad9dacd6d337f7a1902c9320334f
2021-08-28 21:43:18 +00:00
bigbiff
e3742ef616 openaes data encryption: turn off by default
Until the code can be removed, we will turn off openaes encryption
of data files by default. There are many restore issues that are
caused with openaes enabled. For maintainers who want to enable it
set TW_EXCLUDE_ENCRYPTED_BACKUPS := false on BoardConfig.

Change-Id: Ie284b03c7cc4c77a0a9dbcc460817fe3fe08b839
2021-08-28 21:04:16 +00:00
bigbiff
998f839e82 super processing: use logical flag to denote super status
To support all partitions that are on the super partition
we now parse for the logical flag in fstab to denote super
status.

- Remove guards for the first character being '/'.
- Skip commented lines in fstab
- Build Backup_Display_Name from partitions in super.
The first four lines that are in fstab will be
displayed.
Change-Id: I3f8980187bd4a136257dd6eeaeddd7ea71706cd3

Change-Id: I1ee7c02f91aafb646beaf401a43bcb22fa8c8c7a
2021-08-28 17:48:23 +00:00
Captain Throwback
878abc76c2 Run Update_System_Details during fstab processing
Fixes issue where devices where encryption failed wouldn't
have partition information until after an action was run

Change-Id: I1c50ceaa56d67bfbc330bfa77300512a6e3034c0
2021-08-27 19:21:36 -04:00
bigbiff
01dc4585f8 mtp: import fix for cpu utilization
commit f2388b3c23754f33f9bba1f73c0b2ca57f00e546
Author: James Wei <jameswei@google.com>
Date:   Tue Dec 18 17:39:58 2018 +0800

    MTP: CPU usage high while under MTP mode.

    poll timeout not setting well in MTP ffs handler.
    This will cause MTP ffs handler not going into sleep mode.

    Bug: 121171744
    Test: MTP 500 Mbyte file copy throughput from / to Host (no drop)
    Change-Id: I9b8a7257670b8e536bf2ea81118d297211254984

Change-Id: Ic79f6b04334074c73b62325b53112719ba29255d
2021-08-27 18:24:59 -04:00
Ethan Yonker
5f3b8f0103 Fix permissions on last_log.gz
Change-Id: I4c56bd01551d3f7301f471e4d342a0620c7b4971
2021-08-22 22:47:39 +00:00
Ethan Yonker
deeefbdec4 Stop using boot HAL when decrypting fscrypt
Change-Id: Ia7aaf6b86c5ca456fd6651e776f4d6423b09f02e
2021-08-22 22:47:02 +00:00
Mohd Faraz
7fc7050b6d partitionmanager: Symlink dynamic partitions to /dev/block/boot/device/by-name/
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: Iebebe9234723bcda863098cdff6ed41e7b410e78
(cherry picked from commit a7c22b56ba9b6e2f3fb90edbde7ec206b7eca8d5)
2021-08-15 23:01:09 +00:00
nebrassy
ac29e691d8 Add an option to one click flash current booted TWRP ramdisk
Change-Id: I12303696698a5feaa43401bcac9e30d5b3b99a0c
2021-08-09 23:05:14 +00:00
bigbiff
cfa875c4d4 vab support: merges and unmapping super devices
- check for merges before formatting data
- add advanced option for unmapping super devices

Change-Id: I38d4d3bbdfa071969016c3e000c86a4d03c71e45
2021-08-09 23:04:33 +00:00
bigbiff
d1e556a9a2 repack: fix bad rebase
Change-Id: Ic266b48e0a94c18dfc942e1214b38e6a0f2e8100
2021-08-07 14:34:06 -04:00
nebrassy
7378254120 repack: correctly recompress ramdisk to the format of boot image
Change-Id: I90df3d2f63eb82a185d9af0d68e61c955cee9403
2021-08-07 17:56:57 +00:00
bigbiff
74a46278c3 repacker: override slot for flashing images instead of using bootctrl
Bootctrl is being unreliable during repacking. This overrides the slot
while repacking recovery in boot.

Change-Id: I0a04357af4e5f24591792bcfb27ccbd10b0a813b
2021-08-07 17:56:19 +00:00
nebrassy
76224bde3d Support AIDL Vibrator
co-authored by: SebaUbuntu <barezzisebastiano@gmail.com>

Change-Id: Ifaa0af4cb0fe0dee7d2a9ad4c58a5ede5ce46d59
2021-07-31 18:52:01 +02:00
bigbiff
a15d02f885 vab: exclude gsi
Change-Id: I00d4b4f19aafcaf87ad951ba4f1cb7e3fe84ced8
2021-07-26 19:20:57 -04:00
nebrassy
45f66b2c58 Repacker: refresh sizes before backing up boot
Change-Id: I001295739cb71fdbfc3c3bfe5cc150dc5215867c
2021-07-26 23:13:51 +00:00
Ctapchuk
5c10257865 Update Russian language, sync with en.xml
Change-Id: I8af2239735a800a7c883931ac3531440cc7f7758
2021-07-17 14:51:32 +00:00
bigbiff
2d54867daa fbe formatting: add warning for fbe devices and remove unused string
Change-Id: Id7af18a4c39932d8685e3265bfa158494ffd10f0
2021-07-17 00:14:21 +00:00
bigbiff
70cf814036 gui makefile: this file is redundant and handled by Android.bp
Change-Id: Ia51a0300709b88636125b7131b769000254a40db
2021-07-07 20:20:14 +00:00
HemanthJabalpuri
c6512446af gui: Fix TW_SCREEN_BLANK_ON_BOOT var in 6e0ca7dbed
Change-Id: I51ba03e13cd805f8aba6978e05fb3404b5ac0d7d
2021-07-05 11:32:29 +00:00
bigbiff
c5012c5c88 bc: include basic calculator in ramdisk
Change-Id: Ia16fc28a234396e996e84de8496294b26053869b
2021-07-04 13:57:47 -04:00
bigbiff
f3d93e18ce zip signature: update code to aosp11
Change-Id: I13b46d8092a75517fc83baf6c2dc83b8a68fdd5c
2021-07-04 11:46:05 -04:00
bigbiff
ab036619a4 apex: unmount flattened apex directory before installing zips
Change-Id: Idd1cadedcab94e81e30a487bd09f9173e5fe577e
2021-06-26 19:00:30 +00:00
Captain Throwback
d8a0ef78b7 update twrp version to match current release
Change-Id: I444efb9f9b488c2cd5046bbe239d90abd3ef2ba5
2021-06-25 22:46:34 +00:00
bigbiff
5c083cc3f0 super partition: include lpdump utility
Change-Id: Ifaac3b660ae3d46d9f1589470dcf6fd7c21b8ef8
2021-06-25 22:45:22 +00:00
bigbiff
bbbfe171f1 fscrypt: updates for wrapped key
- During OTA upgrades if security state or ROT changes then Keymaster
keys requires upgrade. So for such usescases, if the FBE ephemeral
key export fails, check whether KM key requires upgrade and try for
exporting ephemeral key again.

CRs-Fixed: 2632902
Change-Id: I3ee2fcd97a56b628dc4304867c8f2b8da875f883
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>

- Commit 77df7f2 / http://aosp/1217657 ("Refactor to use
EncryptionPolicy everywhere we used to use raw_ref") unintentionally
made fscrypt_initialize_systemwide_keys() start specifying keepOld=true
(via default parameter value) when retrieving the system DE key, and
likewise for read_or_create_volkey() and volume keys.

As a result, if the associated Keymaster key needs to be upgraded, the
upgraded key blob gets written to "keymaster_key_blob_upgraded", but it
doesn't replace the original "keymaster_key_blob", nor is the original
key deleted from Keymaster.  This happens at every boot, eventually
resulting in the RPMB partition in Keymaster becoming full.

Only the metadata encryption key ever needs keepOld=true, since it's the
only key that isn't stored in /data, and the purpose of keepOld=true is
to allow a key that isn't stored in /data to be committed or rolled back
when a userdata checkpoint is committed or rolled back.

So, fix this bug by removing the default value of keepOld, and
specifying false everywhere except the metadata encryption key.

Note that when an affected device gets this fix, it will finally upgrade
its system DE key correctly.  However, this fix doesn't free up space in
Keymaster that was consumed by this bug.

Test: On bramble:
  - Flashed rvc-d1-dev build, with wiping userdata
  - Flashed a newer build, without wiping userdata
  - Log expectedly shows key upgrades:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key:
/metadata/vold/metadata_encryption/key
        D vold    : Upgrading key: /data/unencrypted/key
        D vold    : Upgrading key: /data/misc/vold/user_keys/de/0
        D vold    : Upgrading key:
/data/misc/vold/user_keys/ce/0/current
  - Rebooted
  - Log unexpectedly shows the system DE key being upgraded again:
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" unexpectedly still exists:
        $ adb shell find /data /metadata -name
keymaster_key_blob_upgraded
        /data/unencrypted/key/keymaster_key_blob_upgraded
  - Applied this fix and flashed, without wiping userdata
  - Log shows system DE key being upgraded (expected because due to the
    bug, the upgraded key didn't replace the original one before)
        $ adb logcat | grep 'Upgrading key'
        D vold    : Upgrading key: /data/unencrypted/key
  - "keymaster_key_blob_upgraded" expectedly no longer exists
        $ adb shell find /data /metadata -name
keymaster_key_blob_upgraded
  - Rebooted
  - Log expectedly doesn't show any more key upgrades
        $ adb logcat | grep 'Upgrading key'
Bug: 171944521
Bug: 172019387
(cherry picked from commit c493903732d0c17b33091cf722cbcc3262292801)
Merged-In: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29
Change-Id: I42d3f5fbe32cb2ec229f4b614cfb271412a3ed29

Change-Id: I0449b812e91c13020a8b653f2149c33e46027b97
2021-06-25 18:42:20 -04:00
bigbiff
477006a4a0 fastboot: allow device to start required healthd and boot-hal services
Change-Id: Iac1d20ce26d49e7a99071c968d8c8e654e5ff1c6
2021-06-25 18:36:36 -04:00
Captain Throwback
0265b25b5b bash: fix copying of bash files to recovery ramdisk
Change-Id: I41d4b83802df3d8f9e8397130b807e348d054d1b
2021-06-17 22:53:29 +00:00
epicX
9597b840bc Normalized digest check before installing zip
Change-Id: I5a3e82f103e7a80800be7790f1c8dc33c76413da
(cherry picked from commit 646f4f0c66a918f12e12784b22e7dc9a89837c37)
2021-06-06 13:54:41 +00:00
bigbiff
2e344ab7fb fscrypt: integrate v1 processing into TWRP
Change-Id: I3bf9c14b818f9c3e0570c44c82bf0769fcec907f
2021-05-18 20:35:53 -04:00
bigbiff
799243055f apex: only mount required apex files
Since recent kernels seem to limit the number of loopback
devices to 7, we now just mount the required apex files in TWRP.

To mount additional apex files specify TW_ADDITIONAL_APEX_FILES
in your BoardConfig, for example:
TW_ADDITIONAL_APEX_FILES := "apex1 apex2"

To disable Apex in your builds use:
TW_EXLUCDE_APEX := true
Change-Id: Ib55529a4dc17ce2b737b01b86100dca3dc75e6c9

Change-Id: I3b4dfbb164838ffb126016b0d862f67d3f170bf3
2021-05-18 20:35:52 -04:00
bigbiff
be4f46cbc3 sdcard: bind mount in post decrypt
also uncomment wiping code that should not be commented

Change-Id: I445f688628dcedb67544c22c7b0775ee62e0b267
2021-05-18 20:35:51 -04:00
bigbiff
a957f078be FsCrypt update: support fscrypt policies v1 and v2
This patchset introduces support decryption for Android 11.

In this update we deprecate ext4crypt. To specify the
policy version to use, use TW_USE_FSCRYPT_POLICY := 1 or
TW_USE_FSCRYPT_POLICY := 2. By default policy version will
be set to 2 if this variable is omitted.

Change-Id: I62a29c1bef36c259ec4b11259f71be613d20a112
2021-05-18 20:35:51 -04:00
nebrassy
9c1709b963 Health hal 2.1
Change-Id: I58df03c469c213e58c7152430d6f15de80d00f77
2021-05-04 11:47:45 +02:00
Ctapchuk
fc35b151e3 Fix ozip_decrypt binary copying to ramdisk
Change-Id: Ic0ed7737e12974b9a901f47e6c60c6720005ecf3
(cherry picked from commit 01407c1d7dad675a9bfc007f3dda98a217bf8b1c)
2021-05-01 16:31:33 +00:00
Mohd Faraz
6e5c758634 prebuilt: libhardware lib is also required by boot-service
* On disabling Crypto causing not to boot

Change-Id: I3d2014d7b31d02dac7b706d1f722a58e089284be
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2021-04-25 00:04:27 +00:00
bigbiff
e2eae2fe74 boot-hal: add 1.1 HAL to TWRP
Change-Id: I51678c96f522e67c3681e404240dd98f6b07994e
2021-04-24 23:18:28 +00:00
bigbiff
6e0ca7dbed themes: convert theme copying to a golang module
Change-Id: I0a1e4b79109cf9db93acb0575200f4ec8f72d3a2
2021-04-24 19:16:53 -04:00
bigbiff
d81833a5e5 libtwrpgui: convert gui to use new ziparchive library
Change-Id: Iea94855257c6d02c2f663c25d390cb1cfb91a727
2021-04-24 18:56:46 -04:00