Commit Graph

3733 Commits

Author SHA1 Message Date
Pierre Roth e136fd495c Fix typos / inconsistencies in German language
Change-Id: Id3b4cca16ec18f63fb71f7e0ae09d2cc2d8516f8
2017-06-07 08:55:59 +02:00
nkk71 5073003302 cryptfs: Remove dm-crypt device on failed table load
* The dm-crypt device needs to be removed from
   the device-mapper driver list otherwise it will
   remain busy and cannot be used later on by
   other processes (eg vold_decrypt) or for further
   testing/debugging in recovery.

Change-Id: I35e43a79ecc3de234ddb9f87f7d75c6439ea7454
2017-05-23 14:59:57 +02:00
that 9c3b7e990e etc: remove "." from LD_LIBRARY_PATH
We shouldn't load libraries from some random working directory.
For example it breaks busybox when you're in /system/lib.

Change-Id: Ia1f8f4fda9e6182c0cd8c5ac727c2b1eb09c84a2
2017-05-16 22:56:51 +02:00
Michael Bestas 5f05255911 mtdutils: Fix mounting partitions by-name
Change-Id: I8314bb94bf5bcd9576995cd2ecdc5133c5f5ea11
2017-05-15 22:17:39 +02:00
that 0d0d522b88 gui: fix line wrapping in terminal, issue #876
Apparently we are supposed to delay going to the next line until the next
character is printed.

Change-Id: I5cd0cc128cc00dcdd0dd2dd9508281f1249db257
2017-05-15 15:14:32 -05:00
Ethan Yonker 805a5dfe89 3.1.1
Change-Id: I6ab4169836e460d1652d29c24ad1c5a55191efe7
2017-05-12 09:37:41 -05:00
Ethan Yonker 0afc1fdc48 Fix reboot when no OS is present
Change-Id: Idc3d3c79b8a7acf0f632ed39703766005d73de29
2017-05-12 16:21:54 +02:00
Ethan Yonker 84d61ce31c Update TWRP to AOSP 7.1.2
Change-Id: I19c1546efb4182aac62c690e3cc05b04e3a9a32e
2017-05-10 16:11:35 -05:00
Ethan Yonker 6355b56c93 Adopted Storage: backup keys but do not wipe them
Change-Id: I545a32848ee686ecfacd13604ae3f18f5d206dfc
2017-05-01 09:42:17 -05:00
bigbiff bigbiff b5ecaad27a ADB Backup: fix adb restore issues
Set Backup_FileName on adb backup to fix restore.
Set read_from_adb after EOF to return properly
from newer adb client prompt.
Create setter and getter for Backup_FileName
for openrecoveryscript.cpp which is not a
friend class.
Fix condition for twrpTar::Get_Size() and adb backup.
Change-Id: I7eb8168fa3416366b996e220cecbc0e1bcec5e8e
2017-04-23 14:37:22 -04:00
Ethan Yonker 76958ae984 3.1.0
Change-Id: Iab21513c7d703304a4591fdf5af1317e2336a8a7
2017-03-07 21:30:46 -06:00
Captain Throwback a52891b6b3 Revert "Fix adb shell in 7.0 tree"
This reverts commit 0a8a7cebf1.

Change-Id: Icdb1f2e93aeaf35a66b6f67eaff51d9af5fd2e9a
2017-03-07 23:18:50 +01:00
Captain Throwback 3184b2f739 file_contexts: remove symlink to binary file and use text version instead
Some older update binaries can't read the binary file_contexts, so include
the text version of the file to prevent errors. This removes the symlink
to the binary version of the file and uses the concatenated file_contexts
from the OUT build folder.

Change-Id: Ia57c9b47c95945721d3dfa1ec8e18c4bb199adff
2017-03-07 12:10:20 -05:00
nkk71 201d4b21bc vold_decrypt: Add back missing xml and get rid of compiler warning
Change-Id: I883112e2618f560e96002e2076e2735cc20cfac3
2017-03-06 21:39:10 +01:00
Ethan Yonker 64c5c0a9ba Add TWRP app install to landscape and watch themes
Change-Id: Id48245218dc3ee3c6506521ce0134e6a579b6f4a
2017-03-06 12:42:54 -06:00
nkk71 71c6c50d0d crypto: Use system's vold for decryption
If TWRP crypto fails to decrypt partition, mount the system
  partition and use system's own vold to attempt decryption.
  This provides a fallback for proprietary OEM encryption as well as
  encryption methods which TWRP hasn't been updated for.

  Requirements in device tree:
  * fstab.{ro.hardware} in device/recovery/root
    The fstab does not need to be complete, but it does need the
    data partition and the encryption entries.

  * 'TW_CRYPTO_USE_SYSTEM_VOLD := true' in BoardConfig
  or
  * 'TW_CRYPTO_USE_SYSTEM_VOLD := <list of services>'

  Notes:
  * Setting the flag to 'true' will just use system's vdc+vold
    or
  * Setting the flag with additional services, will also start them
    prior to attempting vdc+vold decryption, eg: for qualcomm based
    devices you usually need 'TW_CRYPTO_USE_SYSTEM_VOLD := qseecomd'

  * For each service listed an additional import will be automatically
    added to the vold_decrypt.rc file in the form of
    init.recovery.vold_decrypt.{service}.rc
    You will need to add any not already existing .rc files in
    your device/recovery/root folder.

  * The service names specified in the vold_decrypt.{service}.rc files
    have to be named 'sys_{service}'
    eg: 'service sys_qseecomd /system/bin/qseecomd'

  * Any service already existing in TWRP as {service} or sbin{service} will
    be stopped and restarted as needed.

  * You can override the default init.recovery.vold_decrypt.rc file(s)
    by placing same named ones in your device/recovery/root folder.
    If you do, you'll need to manually add the needed imports.

  * If /vendor and /firmware folders are temporarily moved and symlinked
    to the folders and files in the system partition, the properties
    'vold_decrypt.symlinked_vendor' and 'vold_decrypt.symlinked_firmware'
    will be set to 1.
    This allows for additional control in the .rc files for any extra
    actions (symlinks, cp files, etc) that may be needed for decryption
    by using: on property:vold_decrypt.symlinked_vendor=1 and/or
    on property:vold_decrypt.symlinked_firmware=1 triggers.

  Debug mode: 'TW_CRYPTO_SYSTEM_VOLD_DEBUG := true' in BoardConfig
  * Specifying this flag, will enable strace on init and vdc, which will
    create separate log files in /tmp for every process created, allowing
    for detailed analysis of which services and files are being accessed.
  * Note that enabling strace will expose the password in the logs!!
  * You need to manually add strace to your build.

Thanks to @Captain_Throwback for co-authoring and testing.

Tested successfully on HTC devices:
M8 (KK through MM), M9 (MM and N), A9 (N), 10 (N), Bolt (N),
Desire 626s (MM), U Ultra (N)

HTC One X9 (MTK device)

And by Nikolay Jeliazkov on: Xiaomi Mi Max

Change-Id: I4d22ab55baf6a2a50adde2e4c1c510c142714227
2017-03-06 18:50:52 +02:00
TheStrix 09e8693b7a Fix missing libf2fs.so needed by mkfs.f2fs
* Relink libf2fs.so in all cases except PLATFORM_SDK_VERSION=23
   with no CM_PLATFORM_SDK_VERSION set as 4 or above.

Change-Id: I58bcc7daeb2d67d41b8912cea73690d94f26dd56
2017-03-06 17:06:56 +01:00
Matt Mower cc19c6f9bb ADBBU: Cleanup string usage/namespace
* string.h header defined twice
* Specify namespace for stringstream

Change-Id: I7002671c7c0108007adffac9d4d5016b1482f5e6
2017-03-01 22:59:41 +01:00
Ethan Yonker ddb63e27f2 Timeout for decrypt
Sometimes, usually because of proprietary binaries related to keymaster,
decrypt will hang waiting for the keymaster to initialize forever. This patch
enables a timeout so that we don't get stuck trying to decrypt forever.
A timeout is especially important when dealing with the default password
because the user has no option to cancel when TWRP tries to decrypt.

NOTE: This patch only adds a timeout for FDE. FBE will require some special
handling because we need access to some static data and that data is not
available across a fork.

Special thanks to nkk71 for cleaning up some issues in my patch set.

Change-Id: Iccf2fe769ac27a7dcd6bfebfe7d2e9eddd034308
2017-03-01 15:56:47 -06: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
big biff 35b8a40810 Merge "twrpDigest: don't crash when zip.md5 file is empty" into android-7.1 2017-03-01 01:10:24 +01:00
big biff ced41a4a55 Merge "Update Hungarian localization" into android-7.1 2017-03-01 01:09:44 +01:00
kaneawk c42cb2e6ca languages: update chinese translation
Change-Id: I48ac4bfe55cfd4ee7805b86f5af31e915dfaaaa7
2017-03-01 02:38:13 +08:00
Wechy77 9bb12a6761 Update Hungarian localization
Change-Id: I13c1b6be4e1f7dcd026bfaa03d0c097200d498ba
2017-02-25 21:43:08 +01:00
Matt Mower 653a170935 Tweak MTP startup routine
* As a precaution, (non-permanently) disable MTP if TWRP crashes.
* Remove a duplicate logging of 'Starting MTP'.
* Combine and improve readability of conditions before MTP starts.
* Remove unnecessary Disable_MTP() call if conditions unsatisfied.

Change-Id: I61ac772fc123da5b84c3061fbcf2116531bc4e2f
2017-02-24 03:10:17 +01:00
Matt Mower e07f010963 Fix handling of USB config during MTP switching
The property set of sys.usb.config was not part of the original 'Only
change USB mode to mtp when ready for MTP' commit. Further, it adds an
additional USB off/on toggle to the MTP startup routine, potentially
confusing the host computer. The default init.recovery.usb.rc already
sets the usb functions to 'adb' during 'on fs'.

It is possible that devices could run into issues with MTP startup due
to sys.usb.config not yet being set. This is actually due to a poor
design decision in Enable_MTP(), where sys.usb.config would not be
configured for mtp if sys.usb.config had never been set. It is not
necessary to check for a previous value, just set it.

Fix the USB PID for adb-only mode in Disable_MTP().

Change-Id: I21b5e64c9bdcd3104372a8b4eb8ea50cf4561892
2017-02-23 19:21:33 -06:00
that d1afb52fea twrpDigest: don't crash when zip.md5 file is empty
Change-Id: I14145b32c7993bb0cd236b2982ed00bc2c791282
2017-02-23 23:05:59 +01:00
Captain Throwback 1b3fa22d71 logd: add seclabel so that service runs in 7.1 tree builds
Change-Id: If9bfcf6bdeac91e82e9615b671acbee5acffe0cc
2017-02-23 13:16:02 -06:00
Matt Mower 9b4d8dd8f3 Use LOGI/LOGE for non-EVENT_LOGGING events
Change-Id: Iaebc613a25a727a91205d2f361e9d7719036d88d
2017-02-23 20:14:10 +01:00
Matt Mower c0f84e77d2 Run language_helper.py from inside languages dir
compare_xml.py and language_helper.py make different assumptions about
the directory from which they are called. Assume the script is run from
within the languages directory for both.

Change-Id: I4207919360d82dcd3cfbdebcff38f0e872554744
2017-02-23 20:02:05 +01:00
Matt Mower ff2c6b2d52 Update MTP debugging tags
Change-Id: I8cf8b32d5a98ac2470386cbaf70cfc87f44e94f6
2017-02-23 20:01:07 +01:00
Matt Mower a8e6d83155 Do not unconditionally remove MTP storage on unmount
* It is not necessary to Remove_MTP_Storage() for a partition if an
  MTP_Storage_ID has not been assigned.
* The hack to force-set tw_mtp_enabled=1 should no longer be necessary
  now that we're checking whether MTP really needs to be disabled for
  a volume before running Disable_MTP().

Change-Id: I1b7233eedd9da7c6be0c67fc60243f3837105173
2017-02-23 19:42:48 +01:00
Matt Mower 84830ce015 Only change USB mode to mtp when ready for MTP
Commit 'Do not toggle USB ID during MTP startup if not needed' changed
the default USB mode to 'mtp,adb'. Depending on the device, this can
result in an unfortunate side effect of crashing an ORS sideload
midway through the process (it's not clear to me whether the kernel or
the connected computer is responsible). Only put USB into mtp mode
when MTP storage is starting-up.

The hack to change the USB mode to adb when a user compiles TWRP
without MTP support is no longer necessary now that 'adb' is the
startup mode.

Change-Id: I8ed13d6ab8e85621533997b8c37ef7ebec0fcf85
2017-02-23 12:30:59 -06:00
D. Andrei Măceș 9ce12ec20d build: [FIXUP] Addendum for BusyBox get/setprop & API 24 vs 25
Change-Id: I9c909bc990210fc3ec2ed3edf0ac106248f613ba
2017-02-23 16:00:44 +01:00
MinSeong Kim 663ad8e9d0 Fix "ordered comparison between pointer and zero".
From Clang 4.x releases, DR583 and DR1512 will be addressed.
This patch, in advance, fixes the error(s).

Test: `mmma bootable/recovery`
Change-Id: I29dc85ae681307c322ab3a698c3f3bbad1c784ee
Signed-off-by: MinSeong Kim <minseong.kim@linaro.org>
2017-02-23 15:27:05 +01:00
SevenMaxs c7a2f934b5 Update Russian localization
Added new strings (Scripts language_helper.py and compare_xml.py were used).

Change-Id: Id6f220d17e748cd10ff8ff8b21c2e40d84be5ec9
2017-02-21 11:12:50 +03:00
nijel8 2dd66f4962 cryptfs: Fix encryption issue due to stack corruption.
Ioctl BLKGETSIZE expects pointer to unsigned long as argument.

On 64bit target using pointer to unsigned int can cause stack
corruption due to type mismatch.

props to https://github.com/aopp/android_system_vold/commit/f8b8787317fc94439b63bc891eeda83f7ae2f4f6

Change-Id: I1d76c65e29479c8f0cd44b6892069b21b8249b95
2017-02-19 21:34:12 +01:00
Ethan Yonker 91758440d3 Add a listxattr tool for listing xattrs
Change-Id: Ib80bab2b605ce77cd8fdc717d8bcfa8085516679
2017-02-16 21:54:51 -06:00
Ethan Yonker 8d039f7bd8 libtar: support backing up and restoring new Android user.* xattr
Support for backing up and restoring user.default, user.inode_cache, and
user.inode_code_cache xattrs introduced in Android 7.x

Change-Id: I6e0aa7fc9cd30ed004ef28ebb58d60a82e518123
2017-02-16 21:50:05 -06:00
Matt Mower 9cc33c8391 Partition: Remove unused has_data_media variable
Change-Id: Ic1a3aa2b57db5539ce6f6740a63bfe6d33890d70
2017-02-16 17:09:44 +01:00
Matt Mower 0c00571d49 GUI: Fix typo in warning message
Change-Id: I991ad86a453273139bcafbb9f68898631dfb6b51
2017-02-16 17:07:43 +01:00
Matt Mower d821c96c52 Symlink file_contexts --> file_contexts.bin
The presence of /file_contexts is still important to TWRP:
- files written while in adb shell only pick up contexts if
  /file_contexts is present
- fixContexts looks for /file_contexts
- if !USE_EXT4 (is this possible), then make_ext4fs looks for
  /file_contexts when wiping

In the event than file_contexts.bin also becomes more important in the
future, leave it in place and create a symlink to it.

Change-Id: Ic87852248d42d5ea6bf936df160efa41294b6520
2017-02-16 17:06:48 +01:00
Matt Mower 6244806a62 Fix bldr msg file open mode when offset specified
It was pointed out to me by gmrt that O_APPEND is incorrect, as lseek
before writing would be undone (perhaps we avoided this issue due to
an inability to write beyond the end of a partition) and O_RDWR is not
necessary to lseek. When AOSP switched from fopen to open, they also
removed the full partition wipe (fopen in wb mode) before each write,
so this is no longer an issue. Completely restore the original AOSP
file access mode flags.

Change-Id: I42b4efc5f499360ce5b761d3a2a5d4dac4cdfb65
2017-02-16 05:19:59 +01:00
z31s1g d1d3cb6ef0 DE language update
Change-Id: I20b8e99bf011e8f3894f20fef1a5d46cca4cd3b6
2017-02-12 16:51:50 +01:00
big biff 116f6700e3 Merge "languages: update italian translation" into android-7.1 2017-02-10 17:36:40 +01:00
Stefano Gottardo 650d29f8c4 languages: update italian translation
Change-Id: I03c194ccf270ef9dfb910626741d6be76945df05
2017-02-10 14:23:13 +01:00
SevenMaxs 5cec2d8b77 Update ru.xml for TWRP ver. 3.0.3.0
Added new strings and minor fix for Russian localization.

Change-Id: I696b9088813a543e5b05366552a6630828dd12df
2017-02-10 13:32:20 +01:00
Ethan Yonker 01f4e035aa Improve backup display names with emulated storage
-Change backup display name to say that we are excluding storage
-Add warning message during backup of any partition with data media
-Also eliminate unused variable from twrpTar class

Maybe this will make the people in issue 276 happy, but probably not because
they already lost their data, or because the warning text is yellow instead of
red.
https://github.com/TeamWin/Team-Win-Recovery-Project/issues/276

Change-Id: I98303fe7f6b7a25fea029637c90145258d41ee46
2017-02-07 21:30:01 -06:00
Dees Troy b5e7ca96ef Merge "Fix crash during check for TWRP app" into android-7.1 2017-02-08 04:23:49 +01:00
big biff e1a11463bd Merge "Adjust & Improve Chinese translations for zh_CN/TW again" into android-7.1 2017-02-07 13:50:06 +01:00