Commit Graph

166 Commits

Author SHA1 Message Date
epicX
9d80efa884 Allow all extension while checking for digest verification
Change-Id: Ie17582f144e0a5b5a68e2c6d88c26cb9f5a29ee6
(cherry picked from commit 57366118181ad8f78251dc034f55835e6947cc0a)
2021-03-12 23:47:05 +00:00
epicX
8f52c0a73d Added support for flash image in both slots
Change-Id: Iafda62a5f77f7c1f564f1a2ec0a59aefaf5e1266
2021-03-07 18:34:03 -05:00
epicX
11e90832d3 Fixes for Add support to change TWRP Folder
Change-Id: I66a66cc6b952c1aae45c50a8f40c00febce69462
2021-03-03 20:05:05 -05:00
epicX
a721f955f7 Add support to change TWRP Folder
Change-Id: Id3b3b46d492bf83d1d9d3f535c880ea9d15b4107
2021-03-03 20:04:57 -05:00
Captain Throwback
16dd81b500 nano: Add File Manager option to edit selected file
Change-Id: Ie7d940545569e6de976d2a51666b692f3fc23798
2021-03-03 20:00:51 -05:00
Mohd Faraz
77bbeb0080 Added Support for terminal from filemanager
* Now We can open terminal from current directory in filemanager

Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I6df9ee1222c1fa24105da1002abe3c180be2ded1
Signed-off-by: AndroiableDroid <mohd.faraz.abc@gmail.com>
2021-03-03 19:39:35 -05:00
epicX
271bb3a17c reduced the checkforapp function call to reduce unwanted log info
Change-Id: I79ef116989f68333292d3518dcb3ea08be98b8ef
2021-02-15 12:27:11 -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
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
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
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
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
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
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
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
b98b4f7b96 partitionmanager: magisk update sytnax as per new binaries
Change-Id: I51994b991472cf103de067b9856ff3df1bf35a90
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 5738e760646d67791e938954a8873da41209d58c)
2020-05-30 20:05:43 +00:00
bigbiff
adc599e005 Revert "Add support for multi-user decryption"
This reverts commit 0b25b1d79b.

Reason for revert: Changes need to be made to libtwrpfscrypt to include this patchset. Will cherry-pick this patch later and make necessary modifications.

Change-Id: I7601d7b820129709b05d9b4368573b6f1048de02
2020-05-28 19:36:30 +00:00
Noah Jacobson
0b25b1d79b 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

Change-Id: Id2681bc2b1012a0571417f7a6e0b980b1b25c61c
(cherry picked from commit 5a79f67a1b1bd1bcadeca0a4896a871646652534)
2020-05-20 19:11:15 -04:00
Chaosmaster
d5364a0b21 Rework progressbar logic, implement scoped/split progressbar
Rework progressbar according to AOSP, this should fix various
issues with progressbar.

From AOSP:

   progress <frac> <secs>
       fill up the next <frac> part of of the progress bar over <secs> seconds. If <secs> is
       zero, use `set_progress` commands to manually control the progress of this segment of the
       bar.

   set_progress <frac>
       <frac> should be between 0.0 and 1.0; sets the progress bar within the segment defined by
       the most recent progress command.

Change-Id: I7f92359046288f3529cb2e98e6d54d410a248f1d
(cherry picked from commit ab16437de14fd9f1203b7e0ce82ea18eb56cae78)
2020-05-19 14:45:22 +00: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
VDavid003
2034a41934 Fix typo in comment
Change-Id: I9b24d324fd61f2f0d2e85a9d123778557e14d63c
Signed-off-by: VDavid003 <virag.david003@gmail.com>
2019-10-18 22:43:20 +02:00
Ethan Yonker
76bbd3a11a Add option to uninstall TWRP app from /system
Change-Id: Ibe372a372333c357810be2afcb3796723ca370cb
2019-05-16 19:07:06 +02:00
Ethan Yonker
53796e7333 Use magiskboot to repack the boot partition
Set TW_INCLUDE_REPACKTOOLS := true

Must also have:
AB_OTA_UPDATER := true

Use magiskboot and provide GUI options to allow users to repack
their existing boot image to install TWRP (or kernels) so we can
stop having to provide installation zips for AB devices. There is
also an option to try to fix a recovery bootloop if the kernel
has been patched to always boot the ramdisk for root, etc.

You will need to pull the below repo into external/magisk-prebuilt
https://github.com/TeamWin/external_magisk-prebuilt

Change-Id: I74196cc6f095a7576d61886dc96cbc18deba9b04
2019-04-03 16:44:00 -05:00
bigbiff bigbiff
19874f1469 AB/Non AB Devices: updates for moving cache
This patchset updates all the places we touch cache on AB devices
and non AB devices so that we can write to the appropriate
location. AB devices removed the cache partition and moved it to
/data/cache.

Change-Id: I485ec205a604f1f07ceb7700ae9c4e720fd55c3e
2019-03-18 04:49:38 +01:00
bigbiff bigbiff
3ed778ad63 Vibration: allow BoardConfig to disable vibration for a device.
Change-Id: Ibd2f67391ce6d7774498839829e0de9391508781
2019-03-17 22:39:00 -05:00
Captain Throwback
9d6feb5311 twrp: use ANDROID_ROOT environment variable
instead of hard-coded /system path

I updated most of the references I found,
but there might be more

For devices that have to mount system at /system_root,
this allows system to be bind mounted to /system
and detected properly by TWRP

Change-Id: I9f142fd8cec392f5b88e95476258dab9c21a9aac
2018-08-24 12:47:45 -04:00
Ethan Yonker
fa67cbf18b Remove SuperSU
Change-Id: I2ca7580bbde5a8903b9ba5c1513ddba887e8d49e
2018-07-20 13:45:16 -05:00
Ethan Yonker
6e8c27a52b Support v2 fstab format
Auto detect and support both the v1 and v2 fstab formats
Support putting TWRP style flags in a separate /etc/twrp.flags file

twrp.flags format is the same as twrp.fstab (v1 with TWRP flags)

Support using a wildcard in a block device and find all partitions:
/usb-otg vfat /dev/block/sda*

Support using sysfs entries (voldmanaged) and read uevents and scan for
wildcard partitions from uevent data. (twvold?)

May not be complete for some of the newer flags found in fstabs in newer
build trees and there is a slim chance of a crash if the user removes a
removable device while TWRP is performing actions. May need to add some
kind of mutex to prevent the 2 threads from causing this crash. We need
to start somewhere though and this change is pretty innocuous when not
using a v2 fstab.

Change-Id: I617d97c7db332cbe671a9d2b8ad98b3d9c4f03cc
2017-11-28 00:20:51 +01:00
bigbiff bigbiff
19fb79c722 ADB Backup: add ability for TWRP GUI to restore
Restore adb backup files that TWRP made to your PC.
Put files in your backup directory to see them.

e.g. /sdcard/TWRP/BACKUPS/<sn>

Change-Id: I2c57970d77b64c39a302159041456e761c185259
2017-11-27 09:32:30 -06:00
Ethan Yonker
8373cfe28c Update to AOSP 8.0 base
Change-Id: I29fe722b4eb9718765327902779046840a01433e
2017-09-08 07:14:59 -05:00
Ethan Yonker
64c5c0a9ba Add TWRP app install to landscape and watch themes
Change-Id: Id48245218dc3ee3c6506521ce0134e6a579b6f4a
2017-03-06 12:42:54 -06:00
Ethan Yonker
5128d299a5 Fix crash during check for TWRP app
Make sure that opendir succeeds before continuing.

Change-Id: I3c96002ab830f4df2041044d411a7bac42a5b8f4
2017-02-05 23:27:54 -05:00
Matt Mower
0c88b84681 Fill uid/gid for screenshots at compile time
It's not necessary to rely on the success of a call to getpwnam() for
the uid/gid of a file stored to sdcard (or external storage). Use the
definitions in system/core/include/private/android_filesystem_config.h

Change-Id: I979cfa0c74ecc927b88b0967cc56a66da237cc60
2017-02-03 05:32:00 +01:00
Ethan Yonker
5e1a7f932c Fix detection of TWRP app in /data
Change-Id: Icab9db0ceb63edba021cc190eea2ebbc87cf3442
2017-01-18 16:44:54 -06:00
Matt Mower
9472ba1d39 gui: Actions: Toggle backlight on power key
Create GUIAction to handle KEY_POWER with a screen backlight toggle.

Change-Id: Iad0a7923b4a776e0336722db74d6fc46cd0107a2
2017-01-18 19:55:33 +01:00
Matt Mower
23d8aaef29 Unused variable cleanup
Change-Id: I2397d0bd221dcf5c9d0f971ba157519bcf014a70
2017-01-18 17:50:05 +01:00
Matt Mower
029a82db6c Very minor code cleanup
Change-Id: Ie0b97da2cce7bb93307ed49b1138bc2f36df34d0
2017-01-18 17:49:23 +01:00
Matt Mower
a8a89d1961 Whitespace cleanup
Change-Id: I93c65973679894bb8587da4b38b410d38036b8bd
2017-01-18 17:41:17 +01:00
Ethan Yonker
4767caf1f4 Fix compile error on 4.4 tree
Change-Id: Id85fdf0f4dee02f8ee3ae50ec42423c6a154a3eb
2017-01-11 10:45:04 -06:00
Ethan Yonker
b4bff5e9d1 Add TWRP app install via TWRP recovery
Note: I will have to add a build flag for excluding the app later for
watches and maybe Android TV. I will also have to add support in the
tablet and watch layouts later. I will merge this for the initial roll out
to select devices and finish up later.

Change-Id: Ia4ce5522fae542afa1539b10c0691315392a19ab
2016-12-16 17:02:16 +01:00
Ethan Yonker
1b190166eb Add boot slot support
Change-Id: I7eaf80e327985f53791f90fbdebad022a9650d31
2016-12-13 14:04:48 -06:00
bigbiff bigbiff
bad332a3d1 Copy Kernel Logs
Give user option to copy kernel logs to current storage

Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd
2016-12-01 19:00:02 -05:00
Ethan Yonker
e080c1f8fb Fix image flashing
PS2: full_filename is not a dir

PS3: use a consistent format of always assuming directory
     is missing the trailing / + fix whitespace alignment

Change-Id: Ib963473ae10571b3d069b326d024ca04c7224dda
(cherry picked from commit fa4ff144374474c541351d153549ad11d4396614)
2016-11-30 16:27:07 +01:00
Ethan Yonker
dcf2b674c4 Clean up PartitionSettings
The PartitionSettings struct contains some data elements that are duplicates
of data elements in the TWPartition class that is contained within the
PartitionsSettings.Part element. We will eliminate this duplication to help
reduce the chances for programming bugs.

Specifically, this fixes problems where the current file system does not
match the backed up file system.

Change-Id: I02f236e72093362050556a2e53a09d1dbb9a269d
2016-09-13 14:53:37 -05:00
Ethan Yonker
f117962eb2 Make it backwards compatible with 4.4
Change-Id: I668604cddc8e8afbf78709f3f872bea4e9f4aa06
2016-08-25 15:36:13 -05:00
Matt Mower
9a2a20503c GUI: Add countdown & cancel to install auto-reboot
Provide a countdown from 5 sec for the automated reboot after install.
Include a cancel button to interrupt the process.

Change-Id: Ib5e1447918adfde45eba361c088800812b690890
2016-08-19 11:06:34 -05:00
Matt Mower
786d734a41 Remove curtainClose() remnants
Change-Id: I6ae96b60d34fa4e4b23cd1e5a4fffff3d00451c7
2016-08-01 20:41:37 +02:00
Matt Mower
25036b75ff Remove unused identifier from NotifyTouch
The 'state' parameter in GUIAction::NotifyTouch() is used in the
function.

Change-Id: I0744c7aa1542d771dbd2916638fbdd53e9681f86
2016-08-01 20:40:58 +02:00