Commit Graph

74 Commits

Author SHA1 Message Date
Ethan Yonker
58f2132bc3 Merge AOSP android-9.0.0_r3
Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
2018-08-24 11:17:39 -05:00
Ethan Yonker
8373cfe28c Update to AOSP 8.0 base
Change-Id: I29fe722b4eb9718765327902779046840a01433e
2017-09-08 07:14:59 -05:00
Matt Mower
0c00571d49 GUI: Fix typo in warning message
Change-Id: I991ad86a453273139bcafbb9f68898631dfb6b51
2017-02-16 17:07:43 +01: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
Matt Mower
d4a1118152 GUI: Improve automatic determination of TW_THEME
* If TW_THEME is not defined, then check both DEVICE_RESOLUTION and
  TARGET_SCREEN_WIDTH x TARGET_SCREEN_HEIGHT for width/height. Use
  the determined width and height to automatically select landscape,
  portrait, or watch, as well as associated mdpi/hdpi.

* Improve the display of the error message so it fits in a standard 80
  character width terminal without line wraps.

* Write relevant errors for missing themes that clarify what went
  wrong.

Change-Id: I94b02349ce38bf6a9cecde403d78ff2490821d8a
2017-02-02 12:07:26 -06:00
nkk71
6e4114f8b7 gui: Fix Android.mk for TW_CUSTOM_THEME
Change-Id: I7814e3960914ebefdc03cf9cf6f44e193efea932
2017-02-02 16:16:52 +01:00
Matt Mower
840576155a Move sh selection out of GUI makefile
* The TWRP_SH_TARGET variable is only used if TW_USE_TOOLBOX == false,
  so it doesn't really need to be defined.
* Move the busybox sh symlink creation nearer to the toolbox/busybox
  build rules and take advantage of LOCAL_POST_INSTALL_CMD which has
  been around since Android 4.3.

Change-Id: I7850f9c3e113d43ad519dd5c9a7d25e36ec1c426
2017-01-18 13:04:35 -06:00
Matt Mower
c55b9a7893 Move pigz symlinks out of GUI makefile
* Unify the building of pigz and its symlinks under the same module.
  LOCAL_POST_INSTALL_CMD has been around since Android 4.3, use it.

Change-Id: I6a1f74216b6f5a5283fc17839b9b6f19571f3be5
2017-01-18 13:04:35 -06:00
Matt Mower
874136434a SELinux can be assumed for Android 4.4+
Change-Id: I7410a0c8e439eec90a955ee9201efd9a92bb9635
2017-01-18 12:40:26 -06:00
that
55f2bdac06 gui: remove old unmaintained 2.x theme
Change-Id: I1181307989c7478ac6b84bf77732ee5dcff52ed1
2017-01-18 17:23:17 +01:00
niks255
d73903c8eb gui: Detect device resolution with TARGET_SCREEN_HEIGHT/WIDTH
* Ease the compilation with Lineage/CM configurations
    when TW_THEME or DEVICE_RESOLUTION are not defined

Change-Id: I35a8ce651ba5333c8426baa3d70fcbc42a2e5e59
2017-01-18 16:49:11 +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
0a8a7cebf1 Fix adb shell in 7.0 tree
busybox sh does not seem to work properly in 7.0 trees so use
mksh for sh instead.

Change-Id: Ia33bc3894f929b1348c8714d4ddd00a2671c7e94
2016-11-30 16:47:20 +01:00
Ethan Yonker
34ae483e02 Update to 7.0
Change-Id: I621cc47352f7ac552d9602485825ae3a6f9ae516
2016-08-24 15:32:18 -05:00
bigbiff
ce8f83c48d ADB: Add adb backup for TWRP.
Functionality for client side to backup
tar and image streams over adbd to the client under backup.ab.

Using adb backup on the client side you can backup the partitions
TWRP knows about.

On the client side you can do the following:
adb backup -f <filename> --twrp <options> where options are
--compress: compress data
system: backup system
cache: backup cache
data: backup data
boot: backup boot
etc for each partition.

You can string multiple options,
i.e. adb backup -f <filename> --twrp --compress cache system data

adb backup in TWRP will take any option corresponding
to TWRP fstab partitions, e.g. efs boot as well.

If you do not specify the filename with the -f option,
adb will backup your data to a filename backup.ab on the client.
You can then rename the file and encrypt it with desktop tools.

If you don't want to use command line arguments:
adb backup --twrp

will bring up the gui and allow you to choose partitions
from the backup page.

To restore the backup use the following convention:
adb restore <filename>

Structures are used to store metadata in binary inside
of the file itself. If the metadata structure is modified,
update the adb version so that it will invalidate older
backups and not cause issues on restore. When restoring,
we currently do not support picking specific partitions.
It's all or nothing.

Change-Id: Idb92c37fc9801dc8d89ed2a4570e9d12e76facf8
2016-07-31 22:20:18 -05:00
Xuefer
ebc4cfae31 adds TW_ADDITIONAL_RES to TW_RES
make it easier to add aditional resource files not just complete new theme

Change-Id: I6daca75929da03031812e66f25455e189b37a780
Signed-off-by: Xuefer <xuefer@gmail.com>
2016-01-29 18:27:12 +01:00
Xuefer
b6e5fd9f76 add Simplified and Tranditional Chinese language
Change-Id: I417779259b08834d0bd9ec12ce31dda8c62d669b
Signed-off-by: cofface <cofface@163.com>
Signed-off-by: 996314227@qq.com
Signed-off-by: kaneawk <kaneawk@gmail.com>
Signed-off-by: Xuefer <xuefer@gmail.com>
2016-01-29 18:23:34 +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
Xing
0af1ac13d1 do not include stlport headers unless link to it
Change-Id: I8344d270ddb601694b5fef0fa7b22ea437030728
2015-12-23 22:36:41 +02: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
z31s1g
28f0a92bb2 gui: stock theme rework
Tries to combine the current theme with a touch of material.
Page structure is untouched for the most part.
Layout grid is changed to achieve a "less random" placement of
objects on a page.

Change-Id: Icaf796be410431b17d5be6ccc1134d40912bef0b
2015-12-19 08:28:11 -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
88037f476f Remove support for non-TTF fonts
This patch set removes support in TWRP for the old .dat file
format as well as support for the AOSP style fonts in header
files. We need TTF for scaling.

Note that the old AOSP style header font is still supported in
minui which is not used by TWRP.

Change-Id: I6124a3333d479f1fc668138f7e32c4be9b519552
2015-10-15 09:23:39 -05:00
Ethan Yonker
c798c9cd24 Merge up to AOSP marshmallow-release
In order to maintain compatibility with older trees, we now have
minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to
handle ifdef issues in minui/minui.d because healthd includes
minui/minui.h and there was no other alternative to make minui.h
compatible with older trees without having to modify healthd rules
which is outside of TWRP.

Note that the new minui does not currently have support for qcom
overlay graphics. Support for this graphics mode will likely be
added in a later patch set. If you are building in a 6.0 tree and
have a device that needs qcom overlay graphics, be warned, as off
mode charging may not work properly. A dead battery in this case
could potentially brick your device if it is unable to charge as
healthd handles charging duties.

Update rules for building toolbox and add rules for making toybox

Use permissive.sh in init.rc which will follow symlinks so we do
not have to worry about what binary is supplying the setenforce
functionality (toolbox, toybox, or busybox).

Fix a few warnings in the main recovery binary source code.

Fix a few includes that were missing that prevented compiling in
6.0

Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
2015-10-09 11:15:29 -05:00
that
d16b2ce73e gui: support new theme directory structure
Change-Id: I8622da5ae321ba69a55b38e2f0b878b7ec149d02
2015-07-27 20:39:19 +02: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
Ethan Yonker
30fa335a85 Allow touch to use a key code to sync touch events
This is needed to make touch work on the x86-64 emulator target
though I have seen the key code used on other devices as a way to
synchronize touch events.

Change-Id: I31a3cc56e6470f2c707641b537140e44f5e686aa
2015-03-13 11:37:03 -05:00
Ethan Yonker
591b920536 Reduce themes to 5 and rely on scaling
This will significantly reduce theme maintainence and should be a
lot more sustainable over time. Eliminate most themes leaving only
5 remaining in 3 categores:
 * watch_mdpi: 320x320
 * portrait_mdpi: 480x800
 * portrait_hdpi: 1080x1920
 * landscape_mdpi: 800x480
 * landscape_hdpi: 1920x1200

Add handling to map the old DEVICE RESOLUTION to the new TW_THEME
build flag. New devices should specify a theme using the new
TW_THEME build flag using one of the 5 values from the list above.
Long term we will eliminate the use of the DEVICE_RESOLUTION flag
in favor of the new flag.

Change the way sliders render so that they completely follow the
placement="5". This will probably break some custom themes but is
necessary so that we can retain the aspect ratio on slider images
and still have them rendered at the center of the screen.

Add code to the console slideout button so that it can be centered.
Centering the slideout button allows us to keep the button at the
center of the screen when retaining aspect ratios on the image.

Add more retain aspect ratios for home, back, slideout, folder,
file, and lock screen images.

Change the way we build the top bar in TWRP. It is now mostly
drawn using fill objects and the TWRP logo is a separate image so
that we can retain its aspect ratio during scaling. Thanks to Mark
Norelus for providing the TWRP logo.

Change-Id: I801a7b3163cad9ef353461f4c327690a9ccbb3aa
2015-03-12 18:41:34 -05:00
Ethan Yonker
63e414fc8a Scale the GUI to fit the screen
With this patch set, if needed, we scale the images during early
boot. TTF support is needed to properly scale the font. No font
scaling is done on the old style fixed width font used in the
console.

Special thanks to _that for figuring out the scaling and blending
function calls to make this possible.

Change-Id: If2f79bef16d6db2e1298bfc3d00c9bcca2bee37a
2015-02-10 14:11:50 -06:00
Ethan Yonker
0a3a98f892 Unify scrollable list code
The goal of this patch set is to eliminate the code duplication
caused by copy/paste of the code in the file selector, listbox,
and partition list GUI elements. Those classes will now utilize a
single GUIScrollList class that will handle rendering and
scrolling.

Change-Id: I0cb98ab36cf47178296034293435225658c779cd
2015-02-05 14:51:24 -06:00
Dees Troy
3454ade92d Use /twres instead of /res for theme resources
AOSP and other ROM trees now do a rm -rf of the res folder during
the ramdisk creation process that removes the TWRP resources.
Using /twres instead of /res works around this issue making TWRP
more compatible with AOSP and other build trees.

Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
2015-01-22 15:21:27 -06:00
Ethan Yonker
751a85e759 Allow for X and Y offsets in GUI
These can be used to center a lower resolution theme onto a
higher resolution screen. May be useful for Nexus 9 unless or
until we decide to do a 1536x2048 theme or on devices like the
Moto 360 and LG G Watch R.

The build flags will only affect the stock theme. If a custom
theme wishes to apply an offset, it can be done by setting
tw_x_offset and / or tw_y_offset in the variables section of the
XML.

Change-Id: I2390769ed861b96a4a3bb8a0f06d9021ec91b6b9
2015-01-09 23:37:04 +01:00
that
6bea38acdf gui: remove dead build flag TWRP_SIMULATE_ACTIONS
isn't used by the code, can be set via datamanager instead.

Change-Id: I3d98c85c91ce41f32de90345715f2f456f628419
2015-01-01 10:56:52 +01:00
that
c1f5c0f7fd gui: fix DEVICE_RESOLUTION warnings in Android.mk
Indenting the warnings with tab resulted in a make error
"*** commands commence before first target.  Stop."
instead of the intended message. Using spaces instead.

Also fixed the web link to point to the current build guide on XDA
instead of the outdated one on rootzwiki.

Change-Id: I8b25d39edae16dbc479c0e36bd11e12b49b4fbb0
2014-12-29 17:00:50 +01:00
Ethan Yonker
4b94cfd391 Attempt to set the proper uid/gid/contexts on new files and dirs
Files and folders that we create during backups, copy log, or MTP
operations often do not have the proper uid/gid/contexts assigned.
We will attempt to read the proper contexts from the settings
storage path and assign those same contexts to any files or dirs
that we create.

Change-Id: I769f9479854122b49b499de2175e6e2d026f8afd
2014-12-12 09:20:42 -06:00
Ethan Yonker
738be7a3ff Use one mizip for all
The new minzip did not compile in older trees due to needing
mmap64. For older trees we will just use mmap instead. Remove all
files and code pertaining to minzipold. Updater should now build
properly in older trees as well.

Eliminate use of PLATFORM_VERSION in favor of PLATFORM_SDK_VERSION
which should be more consistent and reliable.

Change-Id: I38d2b604a73d1b17a2072c7d60e990b81ece0c10
2014-12-10 11:54:02 -06:00
erikcas
1db013bf28 bootable recovery: we upgraded to 5.0.1
Change-Id: I9e2f359dd7274e1ae885f6a3b392d5ab5ca99ac9
2014-12-03 16:05:35 +01:00
Ethan Yonker
75bf041a8a Make the android-5.0 branch compile in 4.4 to 4.1
Migrate previous minzip to minzipold replacing the existing
minzipold. This will break compatibility with trees that do not
support selinux (ICS and older). Migrate former verifier files to
verifierold.

Add fuse.h to recovery source because older trees do not have it.

Add LOCAL_MODULE_TAGS where needed for 4.1 tree.

Change-Id: Iade57cb2b0115af7fce9f56aa98636b1744a1ef4
2014-12-02 10:34:15 -06:00
Ethan Yonker
bcc502cff9 Make TWRP compile for arm64
-Remove dosfstools for arm64 until we can make it compile
-Fix TW_USE_TOOLBOX flag to work again
-Fix symlinking and handling of sh when using mksh
-Fix legacy properties to find futex_wake function
-Fix libcrecovery to not use bsd_signal anymore
-Fix rules for building with regards to libcrecovery
-Update toolbox_recovery rules to compile tools in lollipop
-Fix a few compile errors specific to arm64

Testers report that TWRP does not boot on Nexus 9 and we fail to
get a shell for adb shell. At least it compiles without errors.

Change-Id: I286be8628defb60cc527b8a548c0bdfcb0ebb574
2014-11-12 11:03:50 -06:00
Ethan Yonker
a2dc2f22d0 Make custom themes work again
Change-Id: Ib9ad011428603979f7dd8a2708989feb9b13e075
2014-11-08 08:13:40 -06:00
HandyMenny
466dc9764b gui: Disable unnecessary checks if TW_CUSTOM_THEME is defined
if TW_CUSTOM_THEME is defined there's no need to check if
$(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION) exist.

Change-Id: I234374eb1db187758102ca64884a94a81c938b54
2014-10-20 14:50:07 +02:00
Vojtech Bocek
76ee903d84 Add support for TrueType fonts
* Keeps original font system in place
* Uses the same API as original font system:
   - You can render only one line at a time
   - You can only use one font and color for one gr_text* call
* Caches all rendered text, with a string cache limited to 400
  entries, then it trucates to 250, which results in memory
  usage hovering around 5-10MB

Change-Id: I36107b9dcd8d57bae4486fce8b8f64e49ef3d906
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-10-14 15:06:56 +02:00
Ethan Yonker
6277c79727 Attempt to automatically identify data/media devices
Change-Id: Ia3007fbced9ce3bc94efdb3dacc582a5e68a49a4
2014-09-19 22:34:09 -05:00
Matt Mower
55c75cad80 Build block TWRP with RECOVERY_VARIANT
Enable TWRP to reside alongside other recoveries with the naming
convention: bootable/recovery(-flag). If TWRP resides at
bootable/recovery and a device does not specify RECOVERY_VARIANT, then
it will build like normal. If TWRP resides at bootable/recovery-twrp,
then its makefiles will only be parsed if a device specifies
'RECOVERY_VARIANT := twrp'. This prevents TWRP specific makefile
warnings/errors (notably, missing DEVICE_RESOLUTION) when another
recovery is being built.

Change-Id: I8f02fffcd79c309c7123b9428eedc69af02e126e
2014-09-03 10:53:37 -05:00
bigbiff bigbiff
c7eee6fef0 add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.

Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
2014-09-02 21:44:49 -04:00
Ethan Yonker
d9b7200824 Add 320x320 theme and split out watch.xml for square watch layout
Change-Id: I7fe38b20913a981942105637a527a2d26ed035a5
2014-07-30 08:46:38 -05:00
big biff
ba535e3b6c add 1440x2560 theme to TWRP
Based on work by Chris Phelps <cphelps76@droidconcepts.com>
58963336b8
4ec10303cb
c48bd24123
f0944ded30
But with other original changes too.

Change-Id: I809a37a3983187e62568a1e2403b6637a692220d
2014-07-29 00:44:51 +00:00
Dees Troy
7d4cedc1d8 Revert "add 1440x2560 theme to TWRP"
This reverts commit c45181db09.

Change-Id: I9dfb2733d9eb30c32bc1e307e382ee8e4e47a0b6
2014-07-29 02:27:14 +02:00
bigbiff bigbiff
c45181db09 add 1440x2560 theme to TWRP
Change-Id: I9e54d2bcfe89e1e0e3205ce2f4156cfd22dca5b5
2014-07-28 09:00:36 -05:00
Ethan Yonker
780cd39e42 Allow ui.xml to include additional xml files to read
Use common portrait and landscape xml files based on resolution
defined by the device.

Change-Id: Iec528f9d846d49857ff98de1ac201e25dbb60339
2014-07-28 08:50:59 -05:00