Commit Graph

1909 Commits

Author SHA1 Message Date
Ethan Yonker ffc9174145 Really fix background color on 480x800 theme
Change-Id: I70324ae3e4fffe88bc2b5a02becb7d1f4f0ceab0
2015-07-22 08:22:33 -05:00
maxwen 44d59eaf16 minui: add BOARD_USE_CUSTOM_RECOVERY_FONT
we want to use it in charger

Change-Id: I3e0288b074bd7203214d218aaee69cb4798e9531
2015-07-16 02:36:38 +02:00
Ethan Yonker b81d905165 Add ntfs-3g support
Add support for mounting ntfs via ntfs-3g and support for wiping
and repairing ntfs partitions.

Change-Id: I82dc4626f459bb93b86eb9ebba64ad3a6560781b
2015-07-14 16:54:04 +02:00
Ethan Yonker 961d20e09c Make system read only show no matter what on first TWRP boot
Initial value for tw_mount_system_ro is now 2. If the value of
tw_mount_system_ro is 2 during boot, then we will show the system
read only prompt and ignore the value from the lifetime writes
check.

Note: Changed the value of FILE_VERSION which will trigger the
data manager to throw out previous settings and start with default
values so that existing TWRP users will get the prompt at least
once.

Change-Id: I447767b64617f855156a19a5dc15c4ece6dff7b8
2015-07-14 16:53:43 +02:00
Matt Mower ec009e8cd4 Allow devices to override USB init
This enables devices to provide their own USB configuration. The
contents of init.recovery.usb.rc can most simply be modified and
included in a device's init.recovery.${ro.hardware}.rc.

Use option:
TW_EXCLUDE_DEFAULT_USB_INIT := true

Rationale: Some devices handle USB pid switching in the kernel. In this
case, USB init provides switching functions which differ from the
standard on property:sys.usb.config=xyz. Other devices should not see
USB attempt mtp,adb mode when TW_EXCLUDE_MTP is set.

Cherry-picked from android-5.0

Change-Id: Ief0fcaf46a1782102166fc1b733a34b1a1ba0802
2015-07-14 16:48:43 +02:00
Captain Throwback 7fe1b3987a Update path for libcryptfs_hw to proper variable
Change-Id: Ie91d161f4e439a870534639f44a03df22f4fe39a
2015-07-14 16:38:50 +02: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
Ethan Yonker 983be2a3fb Fix minor background bug in 480x800 xml
Change-Id: Ib67a356f8d5e6bb0f982c081fc88b6462c7fbd74
2015-07-13 15:04:47 -05:00
that b63e2f9156 gui: allow specifying object type in element name
e.g. '<button ...>' instead of '<object type="button" ...>'

Also get rid of default parameters to make things more explicit.

Change-Id: Ie4d1231b725aeb6cbf0041622c9780c86cf8e1c1
2015-07-13 15:04:11 -05:00
Kra1o5 c9556ccb5e Add flag to disable double buffering
Some devices don't support double buffering, so add
the flag TW_DISABLE_DOUBLE_BUFFERING to disable it

Change-Id: Ia9c233fa229ae9c221a6c6f219b216d1753052f4
2015-06-29 19:42:40 +02:00
Ethan Yonker f2786d37af 2.8.7.0
Change-Id: I712e2d51e412ab5c6167f7c7b29ebf987cd6963c
2015-06-20 16:00:24 -05:00
Matt Mower e9260740ac Cleanup device_id retrieval
* If TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID is defined:
  - provide the header that defines property functions/constants
  - actually look for hardware_id before attempting to append it
* Perform string length checks rigorously.
* Only perform newline removal if string is used before sanitization.
* Copy changes to htcdumlock, but rely on cmdline only.

ps3: fix merge conflict in data.cpp includes

Change-Id: I720d3bc8416758f5f83782e8bc298b32eda1a573
2015-06-20 15:57:56 -05:00
that f256b722f4 [WIP] gui: software drawn keyboard (code only)
Change-Id: I9f05c85f8d43ab012228a78b79220a27876a299d
2015-06-20 22:35:39 +02:00
ramsudharsan f846cac378 Fix mass storage in recovery
The proper order is mass_storage,adb.

Some systems cannot recognize the mass storage otherwise.

Change-Id: I2a79ac6dfd7247032f774125c75586e45fea7633
Signed-off-by: ramsudharsan <ramsudharsanm@gmail.com>
2015-06-18 00:09:15 +02:00
Xuefer bfce504167 fix settingsstorage mark
Change-Id: I60755ca66f048d1484c3d55dc60099679ba987f6
2015-06-17 17:06:41 -05:00
Ethan Yonker 6511c4d178 Allow ORS set command to work with spaces in the value
Change-Id: I1a61ba7ad5479f8aa31a0c9c18bf228cf32104e9
2015-06-17 16:58:16 -05:00
Dees Troy 28a85d232f Make sure that adbd restarts after sideload
Change-Id: I7d82b95cd8749c6f8569739162708705faa6f1f7
2015-06-17 23:40:25 +02:00
jenkins 796991360d framebuffer: s6 edge takes a little lomger to initialize fb0
Change-Id: I48a5b25a227afb8637fcce7e4a1e2fc6bcc56b03
2015-06-17 23:39:37 +02:00
Xuefer a163f15eec add magic property.* value for accessing system property variables
Change-Id: Ic916da6e7ecbf79396febfe1e5f0b0ae8570083f
2015-06-17 16:38:08 -05:00
xiaolu 26ffa869d0 minuitwrp: fix crash when taking a screenshot.
when "gr_mem_surface.format = GGL_PIXEL_FORMAT_RGBA_8888", "gl->recti" will be crash.
this is a simple fix.

Change-Id: I39da7298286f34cdf7eae98f6b082c36695b222e
2015-06-17 23:26:24 +02:00
xiaolu 9416f4f9d6 partition: recreate tw_internal_path(/data/media/0), after wipe media from data or format /data.
Change-Id: I3671d7a5759260a4e74952168483a6816eb28f5d
2015-06-17 23:17:06 +02:00
Ethan Yonker e1abe616f2 Fix ORS scripts displaying an error after completing
Change-Id: I1329705fca870b4e3017607ad7c7875aa00d664b
2015-06-17 23:12:34 +02:00
Ethan Yonker 0e2c657cc8 Fix system read only behavior during boot
Change-Id: I90dbdd06465e2ddaaade86b930beff91991432eb
2015-06-09 21:45:07 +02:00
Xuefer 0eb2aab058 avoid possible dead loop for invalid utf8
Change-Id: Ida48b7ff119030312836aa109072ac4de7c5b9d6
2015-06-04 18:44:34 +02:00
that c7b631b7a2 gui: set tw_file to the currently flashed file name without path
To allow themes to show more of the file name on narrow displays.

Change-Id: I4962eed5e4a01f73a3cde126f2ba56428209fccc
2015-06-01 23:36:57 +02:00
Ethan Yonker 74db84e026 Fix double free crash during encrypted backups
Calling flush_libtar_buffer would inadvertantly set buffer_status
when no buffer is currently allocated. Later when we called
free_libtar_buffer, this would attempt to free the write_buffer
and cause a crash. This patch checks the value of buffer_status in
flush_libtar_buffer to prevent us from freeing the buffer when it
is not necessary.

Change-Id: Ic5b462fe5881be6e9c6fcc355b369bc90477f737
2015-06-01 09:55:04 -05:00
that 5267a21667 gui: move retainaspect handling to the resource ctors
LoadResources should only decide on the resource type,
everything else is handled by the resources themselves.

Change-Id: I30f68293960c23560979f650efc4393992cf5824
2015-06-01 03:03:28 +02:00
Agontuk a29361a8e6 Don't try to read temparature file if TW_NO_CPU_TEMP is set to true.
Otherwise, recovery log gets filled up with
"I:Cannot find file /sys/class/thermal/thermal_zone0/temp"

This also fixes build warnings due to duplicate definition of TW_NO_CPU_TEMP.

Change-Id: Ib7fdcd103d6684249c38c8b14ec85f2faba158f6
2015-06-01 02:56:19 +02:00
Ethan Yonker d6966f4426 Fix unable to uncheck the mount read only check box
Change-Id: I1bbc25df6f35f79549f1eb06feb4db9ec0475aa5
2015-05-30 14:52:21 -05:00
Xuefer 46bdc96815 remove useless memset and \n
fgets reads up to one byte less than size then with \0 at the end
adding \n after \0 is useless too

Change-Id: I7758d7a8f885bdde2b491a9cb75800f831d77c1f
2015-05-29 17:56:19 +02:00
ramsudharsan 8335324d2a minuitwrp: remove unused variable
Change-Id: I0beb3b349efd4f08491c92bb51c12caf3653cb73
Signed-off-by: ramsudharsan <ramsudharsanm@gmail.com>
2015-05-29 17:32:02 +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
Matt Mower f746dbb054 Only include uncrypt if not in system/core
Some android trees have uncrypt in system/core (cm-11.0). This breaks
building recovery since two modules of the same name conflict. Only
include the local copy of uncrypt if it doesn't already exist in
system/core.

Change-Id: Ie2d7cdedf0d4c9ad148c43b317d1f22d1e50e1f7
2015-05-19 21:08:46 +02:00
Tom Marshall 56fe5e71e5 recovery: Add lz4 libs if available
* Required by transparent compresssion in make_ext4fs.

Change-Id: I566c9e1281cc0dd725e96db32da0a1c3c000030e
2015-05-19 21:06:12 +02:00
that 203bcc97f7 partitionmanager: remove broken and unused progress calculation code
img_bps and file_bps were uninitialized (the values are only calculated
at the end of the backup), and occasionally could be 0.

Don't divide by zero, it's bad for the program's health.

Change-Id: I3f6f5a144c24f32508ca25de49491261c7f6e674
2015-05-19 20:54:43 +02:00
that c7572eb87a partition: support texfat module
Change-Id: I21d0498fc16fdb29d09d6e6fe715e57d1f35e72b
2015-05-19 20:50:00 +02:00
codelover 352b75eddb Backup: fix 'out of memory' issue when backing up large partition as image
Restore: improve image restoration speed

* Workaround for devices that need to backup partition as image, eg: dm-verity
* Increased block size used for partition restore, now using 8M instead of 4K

Change-Id: Ie7e7ff3283d71a7e459d76f72caea9f57e71c628
2015-05-19 20:43:53 +02:00
that 4e0e3fcfdb bootloader: align with AOSP code
- Define a minimal Volume structure so that AOSP code for handling /misc
  works in TWRP without major changes.
- Remove set/get_bootloader_message_*_name

Change-Id: Ifcee59568141a184adebb94b8ef8beca072a7942
2015-05-18 21:02:47 +02:00
Matt Mower d411f8da8e GUI: Prevent duplicate page overlays
If a page is requested for overlay, ensure it doesn't already exist in
the stack of existing overlays. If it does, erase the existing page
and push_back the new one.

Change-Id: I9feeea06cf7aad2e08a8c3bc567aaa761db2c3bc
2015-05-18 18:51:49 +02:00
Matt Mower cf94db1d5b TZ: Update default time zone string
The strings were updated in https://gerrit.omnirom.org/12827 but the
default values where accidentally forgotten.

Change-Id: I423f315cd9509fc61f14bfe4c13a28fbc2722315
2015-05-18 15:25:46 +02:00
Dees Troy c657cc0037 Support Qualcomm hardware decrypt
Change-Id: I121ef0f5da209be48f6d87559d539c7fc6d85336
2015-05-15 10:52:46 -05:00
Kra1o5 de50c5f552 Add option to use new heap_id_mask instead of old heap_mask
Use TW_NEW_ION_HEAP := true to use it

Change-Id: I2ad105fa6d122b460ed4b5dc78563077b7904567
2015-04-23 21:49:57 +02:00
that 2252d24c96 twrpTar: fix segfault after encrypted backups
also use unsigned int for core_count instead of unsigned long long.
I'll change it back when 4-billion-core devices are common.

PS2
- cast return value via intptr_t (may be important for 64 bit platforms)
- output errors from TWFunc::Wait_For_Child to console

Change-Id: I04158daa0b64e44d68e179d626a83d81cf5d49f7
2015-04-03 22:33:04 +02:00
that 9eadc51fd5 bootloader: fix crash with empty lines in /cache/recovery/command
original fix from commit 93ffa7579c
copied to our code.

Also fixed a whitespace issue in the same code block.

Change-Id: I6396803659c6880cde4f2b2ef08efab5721c215d
2015-03-27 00:06:51 +01:00
Ethan Yonker 0e9dec8758 2.8.6.0
Change-Id: Ibab69893bee968cfac8e25a4f166acf7cc8b4fc9
2015-03-24 21:56:13 -05:00
Ethan Yonker bc2bc6bb67 Fix reboot for some devices
Change-Id: I06caac2e80bd7eb311778796f974846e9ce844fa
2015-03-25 03:54:12 +01:00
that 202e51b1c2 gui: add DST rules to time zones for USA and Europe
This should fix daylight saving time display for most users.
For fully correct time zones we need the tzdata database.

Change-Id: I7b7693ab0abaf20be217bd06d525f03fb89b7217
2015-03-25 03:45:05 +01:00
Vojtech Bocek 0fdcbec65a Fix TWFunc::Wait_For_Child reporting success when child segfaults
Change-Id: Ic17624b32ca4aea43c72aea0c3d6dec0441ddee4
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2015-03-20 21:16:03 +01:00