Commit Graph

189 Commits

Author SHA1 Message Date
nebrassy
76224bde3d Support AIDL Vibrator
co-authored by: SebaUbuntu <barezzisebastiano@gmail.com>

Change-Id: Ifaa0af4cb0fe0dee7d2a9ad4c58a5ede5ce46d59
2021-07-31 18:52:01 +02:00
bigbiff
c5012c5c88 bc: include basic calculator in ramdisk
Change-Id: Ia16fc28a234396e996e84de8496294b26053869b
2021-07-04 13:57:47 -04:00
bigbiff
5c083cc3f0 super partition: include lpdump utility
Change-Id: Ifaac3b660ae3d46d9f1589470dcf6fd7c21b8ef8
2021-06-25 22:45:22 +00: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
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
DarthJabba9
fba0cee8ed bash: add to TWRP
Change-Id: Ie1826df01ad5fe2480e96d56b2c4fd1c91449cc2
2021-03-03 20:05:14 -05:00
nebrassy
5078965777 Include nano in TWRP by default
Use 'TW_EXCLUDE_NANO := true' to exclude from build

Will be excluded by default if 'TW_OEM_BUILD := true' is set

Change-Id: I812399ef9f3f5d3c7d4baf981924d49255c16e5a
2021-03-03 19:39:45 -05:00
Captain Throwback
6443cefc69 tzdata: add to TWRP build automatically
Fixes "__bionic_open_tzdata" errors in recovery log

Use "TW_EXCLUDE_TZDATA := true" flag to exclude from build
if needed for space reasons. Will automatically be excluded
is "TW_OEM_BUILD := true" flag is present

Change-Id: I2f4a0f3a354a32c2f4f9733b3e88beedc4773020
2021-02-15 12:29:00 -05:00
althafvly
003401cb6a relink: copy relink_libraries for every arch
Change-Id: I51a4318fb2a825d8e3c0fd82f4b2d26f3780ab38
2021-02-15 12:25:37 -05:00
bigbiff
91bd7a7ff1 adb: get adb working and cleanup pixelflinger
- update recovery init.rc
- add libdl bootstrap
- cleanup libpixelflinger import
- logd and adbd permissive for now
2021-01-03 17:36:52 -05:00
bigbiff
673c7ae01e Merge tag 'android-11.0.0_r16' into android-10.0
Android 11.0.0 release 16 - twrp bringup patch
2020-12-16 19:06:18 -05:00
bigbiff
1f9e4847ce twrpinstall: create library for twrpinstall
This library will need to mirror AOSP for any changes to installing
packages. The library has been separated out in order to make importing
updates from AOSP into the TWRP project.

twinstall.cpp has been removed from the recovery binary and added to
this library. It has been refactored for libziparchive.

Sideload has been reworked to use the newer methods from AOSP on
flashing packages through adb sideload.

We are also removing old libraries for adb and verifier.

Lastly before flashing a zip or image, we want to unlock block devices
for writing so that when an OTA is flashed to the inactive slot,
the flash will succeed.

Change-Id: I6d8702fc9031ffaf9f666b4ba375dc7d9362e473
2020-12-02 13:43:42 -05: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
Mohd Faraz
a791d12005 Fix compilation
* since bu binary was not in required modules, as per the change 3a299dcc32
   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
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
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
7124009f9d fastbootd: relink for startup
Change-Id: Ica7dfbfd46c06618240fb06fce9c4b31103ec506
2020-07-03 18:55:21 +00: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
mauronofrio
6d3bf891c4 Add ozip decryption for Oppo/Realme device
This function will automatically decrypt .ozip file in a .zip and it will
save the .zip in the same folder of the .ozip and with the same name.
After the decryption, the flash will start.

To enable this function you have to set a Boardconfig flag with the
decryption key like i did here:

a30625f80a

Original projects:
https://github.com/sabpprook/ozip2zip
https://github.com/bkerler/oppo_ozip_decrypt

Change-Id: Ic93243a565008c442bcf2992069b2801532ac7c1
(cherry picked from commit 0ff59845f2f8dddedb4cee9a9faf86a6294cce66)
2020-06-10 22:31:49 +00:00
bigbiff
32cbabe413 apex: mount up apex files into /sbin for library access
This patch uses the loop device to mount files under
/sbin/ from /system/apex in order for the device to
use libraries or other files store inside these files.

Each apex file is mounted over a loop device into a
directory correpsonding to the apex filename under
/sbin/.

Once apex mounting is completed, TWRP will set a
property twrp.apex.loaded to true so that init
can use them as a LD_LIBARY_PATH source.
Change-Id: I69f14a969123ac9cf1afc85b6cf76836cb092fb2

Change-Id: Ica6a7d8e479bcaec8bec4483b5e8d2b45ee105fb
2020-06-08 20:38:04 +00:00
bigbiff
3a299dcc32 relink: use relinked files as required modules
Change-Id: I18bffa454ad64d70c5efedbf174887571e95b734
2020-06-08 20:35:01 +00:00
Mohd Faraz
bc576cde4b TWRP: Enable qti input haptics vibrators support
* these type of vibrators are present in newer devices based on
   board sm8150 & above. Like Oneplus 7 series, Redmi K20 Pro, etc.
 * to enable it add TW_SUPPORT_INPUT_1_2_HAPTICS := true in Boardconfig.mk
 * you will need to add the vendor vibrator service to init and run it in your device tree
Change-Id: I0fe6612def149e70808ca41829b6f7ba0b23cd62
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 909daa959c99cf3a6abbe224ec3fc45669df4440)
2020-06-08 01:43:05 +00:00
bigbiff
f654e8483b twrpapp: modules in 10 should be optional
Change-Id: I465eb02bfeb1feeb087458955241c1456b0ef496
2020-06-05 21:03:23 -04:00
Stefan Tauner
6ad1457332 Add and install permission file for Android 9+
Without this, installing the twrp app as system app leads to
reboot loops into recovery with log messages like:
java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions whitelist: {me.twrp.twrpapp: android.permission.READ_PRECISE_PHONE_STATE, me.twrp.twrpapp: android.permission.BATTERY_STATS, me.twrp.twrpapp: android.permission.PACKAGE_USAGE_STATS}

Change-Id: I6156323ea0d23512b0d7eefbd03aa627f3002ae8
(cherry picked from commit 86a4370e6fe4bb20033b0de3a261aec4bf3573db)
2020-06-05 18:39:36 +00:00
Mohd Faraz
784073e9fe relink: relink reboot
Signed-off-by: Mohd Faraz <mohd.faraz.abc@gmail.com>
Change-Id: Ie64dad38f1382df5f7bc64f4d21a0602f23b07b1
2020-05-20 00:09:55 +02:00
bigbiff
bb5d66889f relink: make dependent on libtar compilation
Change-Id: I51ef2918e6aacb3078a38cc9ec7fae2dfb9e73ee
2020-05-19 14:45:24 -04:00
bigbiff
437b93a087 Merge remote-tracking branch 'origin/android-9.0' into android-10.0
Change-Id: Ie850f431f0d2c39c86b9c10701676a24770ab447
2020-05-10 20:06:41 -04:00
Chaosmaster
461e39fe89 Add TWFunc::Property_Override(name, value) to override properties
using libresetprop

Change-Id: Ic49e187698c714f8a629d20ceddc40e823555477
2020-05-10 17:17:56 -04:00
mauronofrio
76ef9f3c04 Create a flag to include resetprop in the TWRP
The flag is:
TW_INCLUDE_RESETPROP := true

Change-Id: I4d4d25a6d5bbd2330efd7f184d0f878a8cf0346e
2020-04-30 16:42:03 +08:00
bigbiff
973167aff3 ramdisk: move uevent link that build creates
Add missing init.rc files for recovery.
Cleanup init symbolic links.
Comment out removing the source file in relink.sh because we need
to retain files in /system in the ramdisk.
Change-Id: Ie959024296738538f3b3161e38027a44525b0696

Change-Id: I5b1a744414b88a9a15c56bd81f37091664d5cdf1
2020-04-09 16:47:23 -04:00
bigbiff
4721a5a1a3 unzip: relink unzip binary from system/bin
Change-Id: I69a8c86c3c817f0a539be53a52f33b8bb6813fdf
2020-04-05 10:32:40 -04:00
bigbiff
36f088ac7c adbd: relink sh properly
Change-Id: Ifb4eba0cded949db66a9d3b77bb185828425d197
2020-04-04 19:58:19 -04:00
bigbiff
63d7add7cf logd: make logd run and relink logcat
Change-Id: I5a2984ea2649bebd923d42e6b984856b36b18fbd
2020-03-31 18:00:59 -04:00
mauronofrio
cb163e0b14 Relink update_engine_sideload
Change-Id: Ifb95d94a5804f0d490bc8c2c19cab7b03c8f1432
2020-03-30 16:46:35 +02:00
bigbiff
416fe3a18a toybox: deprecate busybox and toolbox utils
Starting with android-10.0 we should only use tools from toybox.
Toyxbox in android-10.0 is specified as a recovery target, so
we just move the symlinks in our relink target.

Change-Id: Ic0116a7d583519b39422ac4d82d30e00918eb29d
2020-03-28 14:13:43 -04:00
theimpulson
d95dcd207c bootable: Move to optional tags everywhere
FAILED:
bootable/recovery/etc/Android.mk: error: init.recovery.ldconfig.rc: LOCAL_MODULE_TAGS := eng is obsolete. See https://android.googlesource.com/platform/build/+/master/Changes.md#LOCAL_MODULE_TAGS
build/make/core/base_rules.mk:171: error: done.
18:29:38 ckati failed with: exit status 1

Change-Id: I056f019aa3249c185b808140bcef45a4777d21b3
Signed-off-by: theimpulson <aayushgupta219@gmail.com>
2020-03-23 15:09:31 -04:00
bigbiff
d58ba18272 AOSP10 TWRP Merge: fix conflicts and update libraries needed
This allows flame to boot TWRP. Still will need to work on
super partition for vendor and system access.

The plan will be to cherry-pick any updates to android-9.0
through gerrit.twrp.me to this branch as a WIP.
2020-03-23 11:18:29 -04: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
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
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
117c64785b Merge "NTFS-3G: use newer libfuse-light in pie." into android-9.0 2019-05-09 01:48:45 +02:00