Commit Graph

10808 Commits

Author SHA1 Message Date
Captain Throwback a0a75f2f98 variables: add branch to TWRP version number
Since the 9.0 and 10.0 TWRP branches have diverged due to adding
dynamic partition support, this will make it easier to understand
which branch of TWRP is being used for the build.

Change-Id: I2712c9498c9230e9a6d2eac718bda9e82a6d14f7
2021-02-15 12:24:48 -05:00
DarthJabba9 91cd2ea291 Fix long-standing typo in the logs
Change-Id: I794ecab99d60c3b23f229b620ce811b2d00cce14
2021-02-15 12:24:39 -05:00
nebrassy cd79c90d27 mount binderfs
Change-Id: Ic32176d1c0150031982ec3d50e9ff0e8ac4fe517
2021-01-19 09:55:04 +01: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
Captain Throwback a9fc4f9eba Revert "dumpkey: add back to build for zip verification support"
This reverts commit 2fdec0f587.

Change-Id: I879f499034d06eb4bbb16b07d21dd9b5003d127d
2020-12-03 20:12:21 +00:00
bigbiff 7ed5106932 adb backup: fix building and relink
Change-Id: Ic65284ac2b3f4f410b3ad79288e8b39f51bcc5ee
2020-12-02 18:47:28 +00: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
Beta Soft dff12eb230 extra-languages: update Chinese translation
To other Chinese translators:
Do not replace "…" to "...", it is incorrect in zh-CN, should be use Half-width ellipsis.
Use "槽位" instand of "分区" to translate "slot".

Change-Id: I753d9bfe9d172a64373c8809a78b667b9d75d0e3
2020-12-02 23:03:19 +08:00
whyle f06b1658cf Enable f2fs in change filesystem
In android 10 to make f2fs, we use make_f2fs insteaf of mkfs.f2fs

Change-Id: If80ce7c122141f7e69431a8f9ca37cba27b915ed
2020-11-22 00:25:18 +01:00
whyle 33978c137b Update Chinese languages
Change-Id: I8a570f6400abcd3448a64c00b2aeaea321d2a405
2020-11-11 23:14:28 +00:00
whyle 0234cab3a1 Add missing Chinese tanslate
Change-Id: Ifca9c7a8b5a62d913002a3b1d1bb77f432d0a303
2020-11-11 19:55:44 +00:00
Ian Macdonald d485182c87 Clear_Bootloader_Message(): Log non-fatal errors at level INFO.
This fixes a cosmetic issue on Samsung devices, namely that
Clear_Bootloader_Message() returns an error reading the fstab, which
actually doesn't matter, because the fstab has already been read and
parsed by the time Clear_Bootloader_Message() is called.

Change-Id: I35e508f24d81f66bdaa56006cece9082178c0ba9
2020-11-11 19:12:21 +00:00
Ian Macdonald eb4d8b8818 Remove superfluous messages from the log.
These are already sent to the log when the functions return.

Change-Id: I839b64f6b2e63f62e11f6a40eaf7fedd48c293d8
2020-11-11 19:08:18 +00:00
Mohd Faraz d9e6671e96 Added apex resync script
BUG: Some devices having issues with mounted apex while flashing some packages.
 TEST: Added a device specific script in the device tree, which deloaded the apex, which are not needed and its fine.

 Example script: https://gist.github.com/AndroiableDroid/cf5a04f80b6326c759a59be5d828434e

Change-Id: I5c89dcd92871fec63c6a875c1a47eb8145ba71fa
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-11-11 19:06:54 +00:00
Captain Throwback ddb0a40afd TWRP_REQUIRED_MODULES: add more criteria to exclude packages
Only include hwservicemanager if CRYPTO flag is set and
only include servicemanager if FBE is included.

Only include health-hal if device uses dynamic partitions

Change-Id: I056d0246e406dc9f00bda65247455741ef986a37
2020-11-11 19:00:36 +00:00
Captain Throwback 2fdec0f587 dumpkey: add back to build for zip verification support
Change-Id: I2cdf10e94b45a27ef58f9d915efc1f42305ccd9f
2020-11-11 02:05:44 +00:00
nebrassy f74255ea1e set crypto state/type when detected
Change-Id: I4506d3ef11052dbebf974b5c387a3c7d5055f2ea
2020-11-11 01:59:11 +00:00
Captain Throwback 18aea279ca fde: move crypto state & type setting to function
In order to make sure the crypto state and type is set
properly if the device is encrypted, move this check to
a function and call it in cases where the default password
is being used and in cases where it isn't. This will ensure that
an unencrypted device isn't set as encrypted by mistake.

Change-Id: I736f9cbee0e95d7390a09c8235b9914feddaceaf
2020-11-11 00:58:52 +00:00
Ian Macdonald a991022e7c Fix TWRP starting in English no matter what.
Change-Id: Iec6ce0b9959899b604874423a6848f3cd75cf9fa
2020-11-11 00:41:26 +00:00
Captain Throwback 228223bbb1 fde: set ro.crypto.type to block
Since we set ro.crypto.type to "file" for FBE, we should also set
this prop for FDE.

Change-Id: Id3a581da5d4b58c41c2c361593ad7266898a6f54
2020-10-28 12:22:56 +00:00
DarthJabba9 58d1e7a13a Try to handle Android Rescue Party triggers.
The Rescue Party trigger manifests itself when a user is trying to boot
a ROM but keeps getting dumped back to recovery.

Normally, TWRP doesn't capture this, and the user is often wondering
what is happening. This patch captures the trigger and presents a clear
message to the user about what is going on (with options of how to
resolve the situation).

Change-Id: Ia4414ce6270a7ee9e54d14381990ca4766e757bd
2020-10-25 16:46:48 +00:00
Mohammad Afaneh 2d9953ab3e Add BOARD_SAMSUNG_DYNAMIC_PARTITIONS_PARTITION_LIST group list to 'super' partition description in back-up menu
Change-Id: I08d78583e8672b38f49cef93cc26f5e7663deb80
2020-10-25 14:28:03 +00:00
bigbiff 7138a0f1e0 fastboot page: fix theme layout for landscape
Change-Id: I65b495f217726bee6af9e5c433bda6263594f855
2020-10-24 19:52:25 -04:00
DarthJabba9 33d8fd3434 Make this work for block-based OTA updates
As it was previously, the OTA updater was failing because the comparison was exact, instead of the string being scanned for UPDATE_PACKAGE.

The patch can be tested by going through a block-based OTA update process (ie, either MIUI OTA, or an AOSP ROM with block-based OTA updates).

Change-Id: I5e6e585327d4653381b1fcdf802656193427ab2f
2020-10-23 22:53:23 +00:00
DarthJabba9 247c68bb2d Provide the option to enable debug information during tar backups
Change-Id: Ibdb060d334c8f799a283f1bcef4a369d5555c975
2020-10-23 22:51:33 +00:00
Mohammad Afaneh 3150f1eeff selinux: Build required contexts modules for devices
that do not use encryption.

Change-Id: Ifda13f29b8a2569a4af7f4d8159d4460101865f7
2020-10-23 18:49:45 -04:00
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