Commit Graph

10822 Commits

Author SHA1 Message Date
epicX 271bb3a17c reduced the checkforapp function call to reduce unwanted log info
Change-Id: I79ef116989f68333292d3518dcb3ea08be98b8ef
2021-02-15 12:27:11 -05:00
Captain Throwback acc7f0f873 wrappedkey: only run check on FBE devices
Change-Id: I3713fc4619279d8ee2de924df2bc4fbde944d834
2021-02-15 12:27:03 -05:00
Captain Throwback b5af4f80d0 fbe: move key directory logging within key directory check
Change-Id: I9d1a50ab0fb8b9bbb2e0686c6ffe28b4b22634b4
2021-02-15 12:26:54 -05:00
Captain Throwback dbc37b7a4c wrappedkey: set prop for metadata partition if flag is present
Change-Id: I0da59e81993a119d198dbfc350b7fca0e1cb3c5c
2021-02-15 12:26:46 -05:00
bigbiff 15a6938f8b twrp release: 3.5.0 Android 10 release
Change-Id: Icb6a026533c4181a97c0de955a4393bd1377e549
2021-02-15 12:26:33 -05:00
Captain Throwback 6321bc35a2 gui: fix listbox on reboot page in landscape theme
Change-Id: I65b7b3476235d49ec0cfa289b23be9bc65f7dfb5
2021-02-15 12:26:25 -05:00
f2065 7b127b876b Updated Russian localization
Change-Id: I803c6b90f5e011ab2c3ebf906736b9914f488a55
(cherry picked from commit e931e74a9dd6e24c5c243d545d2fcf3731c6d6f5)
2021-02-15 12:26:17 -05:00
Captain Throwback 31c14929e0 twrpapp: restore system mount to previous state
The current function to check for the existence of the TWRP app
in system unconditionally unmounts system once the check is
complete. Since the TWRP app check now occurs more frequently since
change 70e0a397e00c605cf7b01a5f5ce027dea84f1a14, system is now
getting unmounted every time the Advanced menu is entered, which
is undesirable if it was mounted in order to perform tasks from that
menu.

This patch first checks the state of the system mount point, and
once the check is complete, either unmounts system or leaves it
mounted, based on the initial state.

Change-Id: I7ad1f3e4e6cf3579134f1a9c5468ad90a142feae
2021-02-15 12:26:09 -05:00
Ethan Yonker 8581ab3df8 Remove TWRP app prompt from reboot flow
Add option to install TWRP app as a list menu item on the
advanced page and as a button on the reboot page (except for
watch theme). Now when a user reboots the device, they no longer
will be prompted to install the TWRP app, which interrupts the
flow of rebooting the device.

Change-Id: I00559d0be6e7d0b00d469a5960e4b14e32a3fc5f
2021-02-15 12:25:56 -05:00
nebrassy 57f210d409 also set crypto state for non-metadata FBE
Change-Id: I586878cc6134d798b1d087415cb694d6738f279a
2021-02-15 12:25:47 -05:00
althafvly 003401cb6a relink: copy relink_libraries for every arch
Change-Id: I51a4318fb2a825d8e3c0fd82f4b2d26f3780ab38
2021-02-15 12:25:37 -05:00
Alexander Sulfrian 8dfcf2a186 Update lock pattern types for android 11
The stored id for the different types of the lock pattern was chnaged
with Android 11. You can find the updated list in the LockPatternUtils:

    https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-11.0.0_r25/core/java/com/android/internal/widget/LockPatternUtils.java#113

It was changed in 5e891bcc04556a3595ab349381acc2a2e36a69d1:

    https://android.googlesource.com/platform/frameworks/base/+/5e891bcc04556a3595ab349381acc2a2e36a69d1

The old CREDENTIAL_TYPE_PASSWORD_OR_PIN was essentialy split in
CREDENTIAL_TYPE_PASSWORD and CREDENTIAL_TYPE_PASSWORD_OR_PIN.

This code updates the matching in twrp, so that the correct unlocking
method for file base decryption can be found. Without these changes twrp
always try to use the default password and obviously fails. With these
changes the usual password dialog is shown and the decryption is
successfully.

Change-Id: Ia8d47223b30a5301d4b9d2230241039612055ebb
Signed-off-by: Alexander Sulfrian <asulfrian@zedat.fu-berlin.de>
Co-authored-by: althafvly <althafvly@gmail.com>
2021-02-15 12:25:16 -05:00
bigbiff af253cd0ef debug: remove unneeded debug message
Change-Id: I271e7fca0e3786fe90d324d2d1ccba9fa6394b9f
2021-02-15 12:25:08 -05:00
bigbiff 401f8214a6 debug: remove unneeded debug statement
Change-Id: Ic51bdcdfd61401c34c5a7bd18ddd64c33bc9926a
2021-02-15 12:24:58 -05:00
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