Commit Graph

96 Commits

Author SHA1 Message Date
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
d81833a5e5 libtwrpgui: convert gui to use new ziparchive library
Change-Id: Iea94855257c6d02c2f663c25d390cb1cfb91a727
2021-04-24 18:56:46 -04: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
Ian Macdonald
e7c34e5715 Include common names for Magisk app in list of flashable zip files.
We introduce a new XML element prfxfilter for file name prefix
filtering, e.g. Magisk- .

The file is first matched against the list of extensions and, if there's
no match, then matched against the list of prefixes. An extension or
prefix may be equal to the whole filename.

Change-Id: I46a985c7298799793911948bc74296bebb306d9e
2021-02-15 12:29:38 -05: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
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
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
that
a9dd9f0374 gui: preserve order of gui_print vs gui_msg
- rename __gui_print to internal_gui_print (__* is reserved for compiler)
- translate outstanding messages in internal_gui_print
- add locking because background thread could print while we render
- minor cleanup

Change-Id: Ib687d2cfb4763ad08ad4d4b76daf5b129d61d2e2
2017-03-01 22:38:25 +01: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
a8a89d1961 Whitespace cleanup
Change-Id: I93c65973679894bb8587da4b38b410d38036b8bd
2017-01-18 17:41:17 +01:00
James Christopher Adduono
dcd1e440e0 Support theme width and height offsets
Current use condition is LG V20, where the secondary screen is
actually just a corner chunk of the main screen.
In this case, we need to shift the UI down some pixels in order
to see it all, but just using Y offsets resulted in losing
the rest of the GUI below.

Example in BoardConfig.mk:
  # Shift TWRP off the secondary screen
  TW_Y_OFFSET := 160
  TW_H_OFFSET := -160

Change-Id: I5a06638ba0d05e5b9fd8a6245c630d6ea3394f78
2017-01-11 18:04:29 +01: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
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
Sultan Qasim Khan
14138d9f74 gui: don't mix up display value with actual value
In the case of password entry, the two differ. Password entry was broken
by the earlier commit entitled "Improve input box text handling" because
it started using the displayValue as the actual value, even in cases where
they differ because of a mask value.

Change-Id: Iaf5a67e1d928f34595962a1f1b80eebb64e8b493
2016-04-04 08:26:33 -05:00
Ethan Yonker
a5db7121ab Improve input box text handling
Change-Id: I79cfaac1adf85d1ee5514bf5266930823c1a15ff
2016-03-29 20:05:35 +01:00
that
db79f22654 gui: remove unused struct translate_later_struct
Change-Id: I663f327585b4037eba62508a1f6484ca152bf3c5
2016-02-03 04:12:27 +01:00
Ethan Yonker
b5fab76bea Replace fix permissions with fix contexts for emulated storage
Fix permissions rarely fixed anything on more recent versions of
Android and usually made things worse. Instead we will replace it
with a more dumbed down option that should fix contexts on
/data/media with a few improvements to ensure that contexts get
fixed for multiple users and on adopted storage.

Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
2016-01-29 21:58:33 +01:00
Ethan Yonker
dedbb7f782 Make listbox translation work
Change-Id: I446f4499a43e6348a2b95846f3e5ea86967abbdc
2016-01-18 16:46:18 +01:00
that
1964d19c46 gui: add terminal emulator
Emulates enough of a VT-100 to run busybox vi.

Change-Id: I99c829c6c9de2246194ecb8b8b3cdf4ac34a0606
2016-01-07 22:30:39 +01:00
that
8834a0ffc0 gui: add keyboard support for Ctrl layer and more special keys
- rename NotifyKeyboard to NotifyCharInput
- input: handle arrow keys in NotifyKey with standard KEY_* codes
- fix page handler to return 0 from NotifyKey if key was handled
- fix GUIAction::NotifyKey to not swallow all keys
- change home button code from KEY_HOME to KEY_HOMEPAGE
  (to avoid collision with Home/End, conforms to Android 3.0+)

Change-Id: Ib138afa492df8d0c1975415e8b5334c8778ccc90
2016-01-07 22:30:39 +01:00
Aleksa Sarai
b25a18395e gui: PatternPassword: allow any N*N grid
Rather than only supporting a 3x3 grid, allow for multiple grid sizes
(using the CyanogenMod method of generating passphrases for non-3x3
grids). Also fix the detection of touches, as the old code was far too
sensitive for larger grids (and also didn't make much sense).

Change-Id: I343ef654e6d29ce0cb790a28281be7c7c9b171d9
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-01-02 19:44:48 +01:00
that
10ae24ff94 get rid of console thread for OpenRecoveryScript
- CLI commands run in a threaded action "twcmd"
- Console is displayed via "singleaction_page"
- move ORS execution code from GUI action to OpenRecoveryScript class
- remove unused function gui_changePackage
- don't change PageManager package in home action
- fix that /tmp/openrecoveryscript was not deleted after execution

Change-Id: Ic688c0b04647ce09e9db979b0bc5123f47cf4f70
2015-12-29 15:39:57 -06:00
Ethan Yonker
74db157b94 Multiple Language Support
This is similar to https://gerrit.omnirom.org/#/c/14014

A lot of the features built in the older patch set have been split
out into separate patches, most of which have already been merged.
The remaining functionality here should all be directly related to
language selection and loading. We always load English as a base
before loading other languages over the top of the base. The idea
is that if another language is missing a translation, then we will
still display the English.

Maybe still to do: read the /cache/recovery/last_locale file and
load a language based on that. For me, this file contains just:
en_US
We probably won't bother with region specific translations so we
would have to look at either trimming off the _US or using some
other method like perhaps a symlink or a combination of the two.

Thanks to _that for twmsg.cpp class

Change-Id: I9647a22e47883a3ddd2de1da51f64aab7c328f74
2015-12-19 08:31:01 -06:00
Ethan Yonker
44925ad190 GUI TextBox
Allows the GUI to create a scrollable text box for long text that
may not all fit on the screen. Also includes code to allow the
console to wrap on spaces and other such characters instead of
wrapping in the middle of a word.

To see an example of how to add a text box to the XML, see:
https://gerrit.omnirom.org/#/c/14183/

Change-Id: Ifd139172ede290046b58ea3fe526e2e06da1d4ef
2015-10-26 11:54:16 -05:00
Ethan Yonker
d0514ba806 Fix a bunch of warnings
Mostly adding __unused where needed.

Change-Id: Ia4f675b9b360782728c361ed1699db0cc277c3a5
2015-10-24 17:36:24 -05:00
Ethan Yonker
b7a54a3016 Allow text to scale to fit
Change-Id: Iacd4bb78f551b51d092ecde09521b5541e7dadcd
2015-10-16 22:57:35 +02:00
that
8ab5c13428 gui: support conditions for listbox items
Change-Id: Iea189ac53ec3d7c1bea83da7b77684778b1c0f46
2015-10-16 15:40:31 -05:00
that
20fb95d0a7 gui: extract methods for condition list handling
This is a preparation for list item conditions.

Change-Id: Iec731d1986a53b0362c534adf504dfe8db87d3f0
2015-10-16 22:33:15 +02:00
Ethan Yonker
56ce332315 Allow listbox to have a list of check boxes
For an example of how to implement a list of check boxes, see:

http://bit.ly/1Giacw2
https://gerrit.omnirom.org/#/c/14284/2/

Change-Id: I0752a084625f4a0ef8cc6d99597f2fb9aa2ab9e0
2015-10-16 15:30:51 -05:00
that
c01391c123 gui: allow listbox to be used as menu and as read-only list
Also enable string insertion for list items.

Example how to make a menu item:
<listitem name="Lights on!">
	<action>
		<action function="setbrightness">255</action>
	</action>
</listitem>

If no <data> element and no actions on any items exist, the list is
read only and no item selection is possible.

Change-Id: Ib2668a982df2514484d44faa0396dd17550f39f3
2015-07-14 16:07:11 +02:00
that
f6b2066ff3 gui: keyboard: support longpress label offset, code cleanup
To position the longpress label:
<longpress font="..." textcolor="..." x="5" y="0"/>
x and y is the distance from the upper right corner.

- extract method GUIKeyboard::DrawKey
- clean up handling of currently pressed key
- integrate key highlighting into main key drawing loops

Change-Id: I80ccf2975d30cffa2a48627a74ab3693c84e4fa4
2015-07-14 16:00:35 +02:00
that
f256b722f4 [WIP] gui: software drawn keyboard (code only)
Change-Id: I9f05c85f8d43ab012228a78b79220a27876a299d
2015-06-20 22:35:39 +02:00
Ethan Yonker
a2719156c2 Add resize2fs and ability to run resize2fs via GUI
Note: Only works on ext2/3/4 partitions. Only tested on ext4.

We can use this in some cases to resize the data partition if an
incorrect fstab caused recovery to not reserve the 16KB for a
crypto footer.

Sometimes the BoardConfig for a custom ROM does not have the
correct size for the system partition and if the ROM flashes a
raw system image, that image will not take up the full block
device. Running resize2fs can fix the size and may allow more
room in the system partition for customizations like busybox or
a larger gapps package.

Sometimes flashing a factory image may flash userdata with an
image with a file system that does not take up the full size of
the block device (e.g. factory images for the Nexus 6 will flash
userdata with a ~24GB userdata image, wasting ~30GB of space).
Using resize2fs we can easily fix this issue without having to do
a full format data.

Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
2015-05-28 09:47:25 -05:00
Ethan Yonker
eb32b1ff00 Mount system as read-only by default
Mounting system as rw can prevent future OTA updates. The purpose
of this patch set is to prevent TWRP from mounting sytem as rw on
the first boot. Device maintainers should update their twrp.fstab
files on these devices to include an additional line:
/system_image emmc /dev/block/../system

This line will allow TWRP to create a raw system image backup to
ensure that the user can return to an original state for future
OTA updates.

Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
2015-05-27 09:22:49 -05:00
that
d86f49d3f7 gui: keyboard: introduce struct Layout and simplify caps handling
Also minor cleanups:
- move array limits from #defines to a protected enum
- zero fill layouts in ctor

Change-Id: I8fe0f8465ebc646ad3bf3cc3f8490dbdd384f43d
2015-03-15 00:56:57 +01:00
that
e79878b7b6 gui: keyboard: add HitTestKey method, minor simplifications
Change-Id: I6cd0251dd9d933e6ebef977a553be7473e2d7034
2015-03-14 23:07:23 +01:00
that
6db855e1c0 gui: keyboard doesn't need its own action
This was questionable design and is unused anyway.
Also reduced a few redundant #includes.

Change-Id: I65bb01120e6072c5695755920242f6f9d73c816e
2015-03-14 21:31:43 +01:00
Vojtech Bocek
7e11ac5d3c Add UI for entering pattern for device decryption
Change-Id: Ia2d3268a96423e9ca3846500c57e674c4f8fa60b
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-03-13 12:12:58 -05:00
that
b2e8f672f3 gui: support string resources
storing strings in a map (for fast lookup) in resource manager

To define a string resource in <resources>:
<string name="foo">Hello</string>

To use a string, e.g.:
<text>%@foo%</text>

Not yet done: language-specific resources (should be solved not only for
strings, but for all kinds of resources - e.g. for localized images)

Change-Id: I3ba5cf5298c09e0d28a83973e9662f179271b33f
2015-03-11 07:38:37 -05:00
that
8d46c09ccf gui: kinetic scrolling for console
- Rebase console on ScrollList
- Add fastscroll bar to console
- ScrollList now has a mode that ignores selections
- Increase kinetic scrolling speed for lists showing many items

Change-Id: I6298d717d2e403f3e85e2c633d53c4284a066012
2015-03-05 04:50:33 +01:00
that
0af7795690 gui: introduce virtual RenderItem method in ScrollList
- so derived lists can draw whatever they want (multi-line etc.)
- replace GetListItem with RenderItem
- minor cleanup

Change-Id: I062e0a354f1c18ce0a5232b7542c4987b480e232
2015-03-05 04:46:10 +01:00
that
ba75a0e73b gui: don't truncate values to 0 after scaling
Avoids invisible lines (e.g. input cursor) when scaling down.

Change-Id: I595e8bdb2fa468c30f104867ad77be2423ec287f
2015-02-23 15:39:15 +01:00
that
a999821ad4 gui: proportional scrollbars
- Attribute "recth" in the <fastscroll> element is now the
*minimum* height for the scrollbar.
- Dragging the scrollbar moves the list.
- Touching outside the scrollbar jumps to the relative position.

Change-Id: Ic1f20b5ec68cf49e5be56be34f0c58c0f474618b
2015-02-21 15:34:19 +01:00
Ethan Yonker
21ff02a693 GUI: Support styles in xml to reduce xml file size
Also allow sliders to have their own text label instead of
requiring a whole separate text object for the label in the xml.

Change-Id: I6e314efb4bb454d496555ff7e003d743063a1308
2015-02-21 08:14:24 -06:00
that
9876ac3361 gui: support scrollable lists without headers
If the <header> element doesn't exist, the header is not drawn.

- minuitwrp: add function for clipping all drawing to a rectangle
...and another one to cancel it.

Change-Id: If0f688a5debee6ebd9c457999fe571705a42c5cc
2015-02-15 22:12:29 +01:00