Commit Graph

1647 Commits

Author SHA1 Message Date
Ethan Yonker
fb7a2dad7d Fix adb sideload page on 1440x2560 layout
Change-Id: If79086b0128e57087fd87f07d56984eb2a15d8b2
2014-12-18 21:16:54 +01:00
Kra1o5
0024e3826b Add support for custom kernel headers
Change-Id: I39fe4de8919e59dd75e8cb535fa0648948035c26
2014-12-17 11:47:33 +01:00
Dees Troy
87da424556 Fixes for compiling crypto in older trees
Some of these fixes needed to be made anyway. Note that older
trees will still need to have files / repos copied into them from
newer trees. Namely we need:
system/security/softkeymaster
hardware/libhardware/include/hardware/keymaster.h

Maybe others as I did not document very carefully what I was
pulling in.

Change-Id: I465fd1fbe228803ec02fba047b151f07ea13d5ca
2014-12-12 18:50:11 +00:00
Ethan Yonker
2d11d498ca Fix compiling of dosfstools for arm64
Change-Id: If99d0be4b73cdeb388c6cb1b35a215d3b8b3b58d
2014-12-12 11:43:21 -06:00
Ethan Yonker
619a721a30 Improve resource error logging
Actually display the name of the item or the filename of the item
that we were unable to load in the log to make it easier to
determine what went wrong.

Change-Id: I027b35aab286e4d0f1957bcfb28ed40d81f9bbb2
2014-12-12 17:10:20 +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
ac21cb5ae3 Fix loading of png images in custom themes
Change-Id: I7eebc474c025eda534adb04d061795623ebecdda
2014-12-12 15:21:52 +01:00
Matt Mower
b6ef4781d2 Revert "Fix USB Mass Storage on some devices"
This reverts commit 9eb1cd4752.

Change-Id: I66d3d6bb5633e6df3e8f7db250fc6d62817a5489
2014-12-12 15:21:28 +01:00
Dees Troy
b47f28b05a Fix generating symlinks for older trees
Symlinks for unpigz, toolbox, and busybox were not generating in
older trees.

Change-Id: I3ca2a2047510954e66fb3cf49eef6af713d3268e
2014-12-12 15:20:55 +01:00
Ethan Yonker
452e420a2e EPOLLWAKEUP handling in minui/events.c
Older trees may not have EPOLLWAKEUP defined so we will work
around the lack of EPOLLWAKEUP support as best we can. This should
only maybe affect how charger handles waking up the screen in off
mode charging in older trees. No impact on TWRP itself.

Change-Id: Ia72ebfc12778b2bcda648edc27d2092c2ead415c
2014-12-12 15:20:35 +01:00
bigbiff
d5c6069287 This fixes kernel panic on find7 when disabling MTP before flashing zips.
Change-Id: Id11a0fb1a88424d9dd70190c313781607bad3bb8
2014-12-11 18:48:08 -05:00
bigbiff
b38de7e2f4 make header layout more readable for 1440x2560
Change-Id: I109c7ae5963b5b4d9d1a8190e364a7685c41dbdd
2014-12-10 19:05:09 +01:00
Ethan Yonker
0bc17c6fd3 Fix occasional MTP kernel panic
Add a short sleep between setting up the sysfs entries for MTP and
actually sending MTP data to the MTP device. In some cases a
kernel panic was happening because we were sending data too soon.

Change-Id: Ie5e05690846fc84f161c91829de448bc049f87e2
2014-12-10 18:55:35 +01: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
that
ceb7b8e576 crypto: fix build in < 5.0 tree
Change-Id: Ie4ed3e91cfb7e509bac1d6db885bd3f415d2b168
2014-12-10 17:22:09 +01:00
Matt Mower
201727911f Fix mkexfatfs exclusion when TW_NO_EXFAT enabled
Push to android-5.0

Conflicts:
	Android.mk

Change-Id: I0b831a4e6e52e4b314751035b750e6a398cb4d2d
2014-12-10 16:40:43 +01:00
soyu
d5a7c0edf1 add support unicode font not only ascii
need to define custom theme(include custom ttf files)
  in device tree :

  TW_CUSTOM_THEME := device/xxxx/yyyy/recovery/res

  For example:
  https://github.com/twrp/android_device_xiaomi_armani

Change-Id: I6bebdfbdd75c99bfe216a8c0789af63c6fe4b9de
2014-12-09 21:14:48 +01:00
Ethan Yonker
38c2ff8e90 Include libext2_quota.so if present for e2fsprogs utilities
Needed starting in 5.0 lollipop for e2fsck, mke2fs, and tune2fs
binaries.

Change-Id: Ie76517df4690f6407cb63d0607c6c0c8a77975e5
2014-12-09 13:42:18 -06:00
Ethan Yonker
8a59459479 Update minui to work properly
minui is not used by TWRP but it is included in AOSP recovery
source and healthd (formerly charger) uses minui for displaying
the battery charging animation during off-mode charging.

This patch fixes / updates minui to use updated code to load png
files into memory.

Change-Id: I706d10d66de95886396d866e80615b1fb905d201
2014-12-09 13:30:48 -06:00
Ethan Yonker
c56ab4c72d Fix slidervalue not showing up in some cases
The button vibration slider was not showing up on portrat layouts.
This commit fixes that issue and maybe some other issues.

Change-Id: Ia0c0ed319358db3b99887b3b37aa7737c7caf0cc
2014-12-08 22:16:57 -06:00
Ethan Yonker
448c8dc4c1 Fix png graphics load / display on AArch64
This is mostly kang from AOSP resources.c for loading png files
into RAM, but for ease of compatibility we retained the older
gr_surface data types throughout and ensured that we retain
support for alpha blended png files.

Change-Id: Ieea552173d3bfe885460407be73088bbad75663f
2014-12-09 04:46:00 +01:00
Ethan Yonker
76084ebd74 Remove new images from AOSP
TWRP does not use these images.

Change-Id: I48be648232826aabc14f9674862de7b0b981b988
2014-12-09 04:44:55 +01:00
Ethan Yonker
1902c79d11 Use linker64 on AArch64
Patch Set 3: Combine into one sed - by bigbiff

Change-Id: Ice3147fae76575f6e09c7df201bcd3f949aa24ea
2014-12-09 04:32:34 +01:00
bigbiff
7cb4c3322b add function to partition.cpp to return max file size to mtp responder
Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
2014-12-04 17:32:27 +01:00
Ethan Yonker
253368a072 Reduce libs needed for decrypt and clean up old decypt files
Trim cryptfs.c to remove functions that TWRP does not use for
decrypt and remove the need for libfs_mgr from cryptfs.c by
passing some items to cryptfs.c from the partition manager.

Add support for new fstab flags:
encryptable and forceencrypt=/path/to/cryptokey
For example:
flags=forceencrypt=/dev/block/platform/sdhci-tegra.3/by-name/MD1
Note that "footer" is the default, so you do not need to set this
flag on devices that use the footer for the crypto key.
Also add mounttodecrypt if you need to mount a partition during
the decrypt cycle for firmware of proprietary libs.

Clean up decrypt and only support one version

Android 5.0 lollipop decrypt should be backwards compatible with
older versions so we will only support one version, 1.3 that came
with 5.0 lollipop.

Remove support for Samsung TouchWiz decrypt. It does not work with
the latest versions of Samsung encryption anyway and it has not
been updated to work with any AOSP decryption higher than 1.1

Change-Id: I2d9c6e31df50268c91ee642c2fa090f901d9d5c9
2014-12-04 17:30:16 +01: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
cdc3ef5feb TWRP MTP: make sure inotify_fd is set
Originally the inotify_init() call was part of a separate thread
which would occasionally allow the readDirs function to run and
start trying to add watches before inotify_fd was init'ed properly
and result in the add watch failing. This patch set relocates the
inotify_init call to happen outside and before starting the
separate thread to ensure that inotify_fd is set properly.

Change-Id: I8748c23473b60b57887df9d692834f3d2b249802
2014-11-25 15:00:08 -06:00
Ethan Yonker
ec0fa4ad68 Properly set tw_settings_path after decrypt on data media devices
When tw_settings_path is not set correctly for /data/media/0 when
present, custom themes will not load (and who knows what else may
also be broken) so set it properly after decrypting the device.

Change-Id: Id3dff04f62cf9c953c8a2ca07fe9ac597dcda20f
2014-11-20 09:51:06 -06:00
Dees Troy
c8f58997e2 Fix process to disable stock recovery flashing
/system/etc/install-recovery.sh no longer exists on AOSP devices
so we will stop checking for it.

Change-Id: I9074dfc443371a27b909faa8f66998683cfb6171
2014-11-20 15:29:17 +00:00
Ethan Yonker
2b556013bf Add /firmware to the mount list for L decrypt
Needed by Nexus 6 and possibly others

Change-Id: I3309e2141a21a94dce90e34cced16450b591a92c
2014-11-19 16:15:21 -06:00
Ethan Yonker
0e67837dd0 Add flag for including additional files built from source in TWRP
Some devices may need additional binaries or libs that TWRP
normally does not need included in /sbin
Use TW_RECOVERY_ADDITIONAL_RELINK_FILES to build them from source
and get them added to the recovery ramdisk.
For example, Nexus 9 needs libc++ included in order to decrypt
the data partition. The following will build it from source and
include it in TWRP:
TARGET_RECOVERY_DEVICE_MODULES := libc++
TW_RECOVERY_ADDITIONAL_RELINK_FILES := \
    out/target/product/volantis/system/lib/libc++.so

Change-Id: I147c0d5569c83514d2e50226ecc50e80bf8aac36
2014-11-18 12:17:10 -06:00
Ethan Yonker
cceebb8189 Tweak 5.0 L decrypt
Mount the vendor partition if it exists so we can use any
proprietary files we may need.
Relocate auto decrypt when default_password is in use to after all
partitions are added so that we can mount the vendor partition.

Change-Id: I93455a35695779f53ef57a82d3d45c7216c13639
2014-11-18 10:18:14 -06:00
Ethan Yonker
560e65f899 Make libmincrypttwrp a shared library
Change-Id: I8c3f084fc34b00edb4cd1b652290df8bc80ea1db
2014-11-17 11:37:20 -06:00
Ethan Yonker
03ea978f63 Clean up make flash utility make files
Change-Id: Ie396be7d9636a8b481bcf7c062f94ce51a4b1fde
2014-11-17 09:36:46 -06:00
bigbiff
85939e5a1b Thanks to _that, return null if vector is empty
Change-Id: Idc44455dd0c971c876ae283528c4367a82e145bd
2014-11-15 21:07:22 -05:00
Ethan Yonker
4eca40d7d8 Add lollipop decrypt support
Kang in cryptfs.c and cryptfs.h from vold.
Use TW_INCLUDE_L_CRYPTO := true to enable.
Ramdisk must contain the normal fstab file in the root in the
usual format of:
fstab.{ro.hardware}
For examble for Nexus 5:
fstab.hammerhead
Or on many Qualcomm devices:
fstab.qcom

Tested against Android 5.0 lollipop on Nexus 7 2012 grouper. Not
sure if or how this will work when we are dealing with a device
with a hardware keystore. Long term we need to add a GUI element
to allow entering a pattern. For now you can decrypt a pattern
unlock by converting the dots to numbers in the following format:
123
456
789

So an upper-case L would translate to 14789 as a password entered
on the keyboard.

Change-Id: I02c29e1f1c2eb29bf002c9fe0fc118357300b5b3
2014-11-12 18:07:24 +01: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
bigbiff
4e36d50b06 update theme thanks to Alexey71 on xda.
Change-Id: Id5a0d40d05b0d7e56fb3e8f0578c201957508b70
2014-11-11 20:28:39 -05:00
Ethan Yonker
6c41bfd2f3 Fix openaes
timeb was removed from bionic so include the necessary code in
libopenaes as needed to make it work again.

Change-Id: Idf9eea4e09c7f149a53ed3e952feea0c6674cea6
2014-11-08 15:12:28 -06:00
Ethan Yonker
a2dc2f22d0 Make custom themes work again
Change-Id: Ib9ad011428603979f7dd8a2708989feb9b13e075
2014-11-08 08:13:40 -06:00
Ethan Yonker
f9796a4a5f Release map after zip install
Change-Id: I4ae145669786ad0932297ae0ae095cbc6f3f696b
2014-11-08 07:28:03 -06:00
Ethan Yonker
c30edd12c5 Fix potential tree conflicts with scrypt
Change-Id: Iac40957e40cb9c10795dd6a1f67ca902c95dd9bc
2014-11-08 07:05:47 -06:00
Ethan Yonker
24813426b9 Update adb sideload feature
Change-Id: Ib503d0e87434e1a28430779302d6565211c26592
2014-11-07 17:25:46 -06:00
Ethan Yonker
57e3587b8e Fix zip install
We never used the feature for running a custom theme during zip
install. We can re-implement this later if we like. For now, we
will remove this feature until we are ready to make it work.

Change-Id: Ice71b0b863c7ef17376e3f973d48b810be567c33
2014-11-07 14:54:20 -06:00
Ethan Yonker
5a95c3ff41 Disable custom theme and fix png loading
We will have to update the zip handling later. Now at least TWRP
boots up to the GUI.

Change-Id: I4182896eb095cab52fb0f1c9c20b6605e35677b9
2014-11-07 13:33:07 -06:00
Ethan Yonker
67eb72ae4d Add new needed libs for 5.0 recovery
Change-Id: I9444e50b32517aebeca5ff3644c1c2f0dfff9d29
2014-11-07 10:44:37 -06:00
Ethan Yonker
f96087e68f Fix up install functions
Change-Id: I62110806f60cd923fb761f5e5f2544da3d5b68b1
2014-11-07 10:38:51 -06:00
Ethan Yonker
d7f2092ea0 Fix up tw_reboot function
Change-Id: I53d329e493f4bcb3fe9ed177e7b2dede30ccf490
2014-11-07 10:33:08 -06:00
Ethan Yonker
c376ac8d9c Fix merge derp in main Android.mk file
Change-Id: Id6fcae7b7b8d9a03ff09711844e987084bd001ac
2014-11-07 10:23:52 -06:00