Commit Graph
7512 Commits
Author SHA1 Message Date
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
gitbuildkicker 467dbbd907 merge in oc-release history after reset to master 2017-03-05 00:06:52 -08:00
Tianjie Xu d0080d92c9 Merge "Fix an error on bootloadermessager test teardown" am: b694ba8aab am: 536989892c
am: b2dfc0182a

Change-Id: Ie4ee06310e7ea9c36e5323f4990f71f2f8fb771e
2017-03-03 21:56:10 +00:00
Tianjie Xu b2dfc0182a Merge "Fix an error on bootloadermessager test teardown" am: b694ba8aab
am: 536989892c

Change-Id: I457f30c36fde0dd407a9684fbc7c2d68ac2b94c0
2017-03-03 21:53:10 +00:00
Tianjie Xu 536989892c Merge "Fix an error on bootloadermessager test teardown"
am: b694ba8aab

Change-Id: I9e32f0468e4d5fb22190d9c64b2804666d8202fb
2017-03-03 21:50:09 +00:00
Tianjie Xu b694ba8aab Merge "Fix an error on bootloadermessager test teardown" 2017-03-03 21:43:14 +00:00
Tianjie Xu cace743c4d Fix an error on bootloadermessager test teardown
The test should not clear bcb during teardown on devices without
/misc.

Bug: 35712836
Test: The test tears down without errors after /misc removed from the fstab.
Change-Id: I42df89feb18fac5a435cd17eef97a6bad0f44545
2017-03-03 11:59:28 -08:00
Wei Wang b466e1f135 Merge "Recovery Test: add SideloadTest to test FUSE support on target" am: 53feebea4f am: 3d605c54e3
am: 685391c5e9

Change-Id: I656a9c7f1e4880bb00e7aaad7f9e55104a7096a7
2017-03-03 01:31:45 +00:00
Wei Wang 685391c5e9 Merge "Recovery Test: add SideloadTest to test FUSE support on target" am: 53feebea4f
am: 3d605c54e3

Change-Id: If8fb74e5d040cf73b9e08abff1cc8fed574e0d64
2017-03-03 01:17:57 +00:00
Wei Wang 3d605c54e3 Merge "Recovery Test: add SideloadTest to test FUSE support on target"
am: 53feebea4f

Change-Id: Idc6cf3db83322316f31c99b0e0490f8b0939d8b1
2017-03-03 01:14:57 +00:00
Treehugger Robot 53feebea4f Merge "Recovery Test: add SideloadTest to test FUSE support on target" 2017-03-03 01:10:55 +00:00
Wei Wang b72a15a2ab Recovery Test: add SideloadTest to test FUSE support on target
FUSE FS is required in recovery sideload functionalites.
This CL is to add a native test to flag when FUSE is not
supported in the device kernel.

Bug: 35768196
Test: mma, run recovery_component_test on marlin and pass all
Change-Id: I43b6dbee658010df56ba4d4b0e91baa7fd1c4480
2017-03-02 15:38:22 -08: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
gitbuildkicker da4fed98d8 merge in oc-release history after reset to master 2017-03-01 00:07:07 -08:00
Tianjie Xu 8359389e87 Merge "Skip BootloaderMessageTest, UncryptTest for devices without /misc" am: 0f26468eda am: 5cce91a95a
am: 6b0959a6bb

Change-Id: I1dc478edd656d4a20b4b886570d8ff822fe5e29e
2017-03-01 03:34:22 +00:00
Tianjie Xu 6b0959a6bb Merge "Skip BootloaderMessageTest, UncryptTest for devices without /misc" am: 0f26468eda
am: 5cce91a95a

Change-Id: Iab56aa614ff6d910b65bf50327177837dd3fdf1b
2017-03-01 03:29:22 +00:00
Tianjie Xu 5cce91a95a Merge "Skip BootloaderMessageTest, UncryptTest for devices without /misc"
am: 0f26468eda

Change-Id: Iab64d6894c3d228ce3e4bb9b57db30eecbcb09c5
2017-03-01 03:27:22 +00:00
Treehugger Robot 0f26468eda Merge "Skip BootloaderMessageTest, UncryptTest for devices without /misc" 2017-03-01 03:25:02 +00:00
Tao Bao 7d524a440f Merge "recovery: Remember the last log position." am: d549616b24 am: 6691dacf56
am: b1ddf973d0

Change-Id: Iaac30245dfe49d2024e6e871f08f8b439065e739
2017-03-01 02:38:49 +00:00
Tao Bao b1ddf973d0 Merge "recovery: Remember the last log position." am: d549616b24
am: 6691dacf56

Change-Id: If020fcbe02e879e96b1b6481c1aae4029785483e
2017-03-01 02:36:18 +00:00
Tao Bao 6691dacf56 Merge "recovery: Remember the last log position."
am: d549616b24

Change-Id: Ibf3ad2e7dc5c8e1de8f6c5eefe7efec4a2b63a4f
2017-03-01 02:33:48 +00:00
Tao Bao d549616b24 Merge "recovery: Remember the last log position." 2017-03-01 02:26:46 +00:00
Tianjie Xu ca94856416 Skip BootloaderMessageTest, UncryptTest for devices without /misc
Skip these two tests if /misc partition is not found in fstab.

Bug: 35712836
Test: Both test skip correctly if there's no /misc in fstab.${hardware}.
Change-Id: I38417a8677030229a335e43eaef85ae70c4e0845
2017-02-28 17:55:27 -08: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
Tao Bao c9447cc505 recovery: Remember the last log position.
After reading one log entry, it should stay at the same menu position.

Test: 'View recovery logs' -> Read -> Exit
Change-Id: I4b579be4c2fe1e3a1dcc4873e128fd0b2d619ba3
2017-02-28 15:27:08 -08:00
kaneawk c42cb2e6ca languages: update chinese translation
Change-Id: I48ac4bfe55cfd4ee7805b86f5af31e915dfaaaa7
2017-03-01 02:38:13 +08:00
Bill Yi d07422c448 Import translations. DO NOT MERGE
Change-Id: I90d94072de955eca8ea38762faa5d3e5a4f295db
Auto-generated-cl: translation import
2017-02-27 17:41:01 -08:00
gitbuildkicker 2d8d083714 merge in oc-release history after reset to master 2017-02-26 00:07:39 -08:00
Wechy77 9bb12a6761 Update Hungarian localization
Change-Id: I13c1b6be4e1f7dcd026bfaa03d0c097200d498ba
2017-02-25 21:43:08 +01:00
Tao Bao fd64bb60c4 Merge "recovery: Don't show "No /cache partition found" on screen." am: 021304503a am: 7c77883b06
am: 43248cc36c

Change-Id: I078f19d294d225479620b378e2644796325698c5
2017-02-24 20:06:15 +00:00
Tao Bao 43248cc36c Merge "recovery: Don't show "No /cache partition found" on screen." am: 021304503a
am: 7c77883b06

Change-Id: I1797129fa70266d9fe5eb09dece6b00cf75b6f2a
2017-02-24 20:03:45 +00:00
Tao Bao 7c77883b06 Merge "recovery: Don't show "No /cache partition found" on screen."
am: 021304503a

Change-Id: I5bc7cba2eb474faf60212877cd621d8ab06fe00c
2017-02-24 20:01:14 +00:00
Treehugger Robot 021304503a Merge "recovery: Don't show "No /cache partition found" on screen." 2017-02-24 19:54:19 +00:00
Tao Bao f7f1da3fb5 recovery: Don't show "No /cache partition found" on screen.
People have been confused by the message and thought that's an error.

Test: Boot recovery on sailfish; choose 'View recovery logs'.
Change-Id: I2c540f18d6493c1a129233d10ecbc96823dd3601
2017-02-24 10:16:18 -08:00
Elliott Hughes 1de1c7124e Merge "Add a missing #include for openat(2)." am: 3ac0dd2a56 am: cdfe2895b4
am: a82df97dd8

Change-Id: Ie157634ac0e83d168a980fe1b3c72664179551ce
2017-02-24 17:03:37 +00:00
Elliott Hughes a82df97dd8 Merge "Add a missing #include for openat(2)." am: 3ac0dd2a56
am: cdfe2895b4

Change-Id: I0924ddf2096e076bd6a32b850c25e575f080041d
2017-02-24 17:00:36 +00:00
Elliott Hughes cdfe2895b4 Merge "Add a missing #include for openat(2)."
am: 3ac0dd2a56

Change-Id: I29988a3e7d509587d55c7a821c4ced2e0f32ebe4
2017-02-24 16:59:06 +00:00
Elliott Hughes 3ac0dd2a56 Merge "Add a missing #include for openat(2)." 2017-02-24 16:55:25 +00: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