Commit Graph

9577 Commits

Author SHA1 Message Date
Tao Bao 4489f7497a Merge "recovery: Minor clean up to choose_recovery_file()." am: 73d21d1c1c am: 4a2bde2d26
am: 1f1a738968

Change-Id: I181515b3d8b80bcdd5e29136a50d58984ddedca6
2017-03-07 19:54:09 +00:00
Tao Bao 1f1a738968 Merge "recovery: Minor clean up to choose_recovery_file()." am: 73d21d1c1c
am: 4a2bde2d26

Change-Id: Ib0d23cb6913b6133009efc14d070232f9c9e2bed
2017-03-07 19:51:39 +00:00
Tao Bao 4a2bde2d26 Merge "recovery: Minor clean up to choose_recovery_file()."
am: 73d21d1c1c

Change-Id: I06d44be6abee33c6760bd3e9bf8a5d0945c6e442
2017-03-07 19:49:40 +00:00
Tao Bao 73d21d1c1c Merge "recovery: Minor clean up to choose_recovery_file()." 2017-03-07 19:45:40 +00: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
Tao Bao 08fc6beef8 recovery: Minor clean up to choose_recovery_file().
Test: 'View recovery logs' on bullhead and sailfish.
Change-Id: I53272b121e3e55e6fe4c77b71e3c2e819e72cb64
2017-03-07 00:57:08 -08:00
Tao Bao a8d72bc3b4 recovery: Drop the "--stages" / '-g' argument.
This was introduced in commit c87bab1018.
But the stage info should be passed through BCB only (there's a
dedicated field in struct bootloader_message).

This CL removes it from recovery arguments, and also moves 'stage'
variable to std::string.

Test: 'stage' variable is not used by any device-specific recovery code.
Test: Code search shows no hit of '--stages' use.
Change-Id: Iccbde578a13255f2b55dd4a928e9ecf487f16b97
2017-03-07 00:12:06 -08:00
gitbuildkicker 885a1fc151 merge in oc-release history after reset to master 2017-03-07 00:06:47 -08:00
Tao Bao db7e898080 recovery: Add SetStage() into 'Run graphics test'.
This allows a quicker test for stage UI.

Bug: 27804510
Test: 'Run graphices test' with the new recovery image.
Change-Id: I47689ae8e4cac6d7e5d1f6a10b9e393d50d713f3
2017-03-06 23:53:16 -08:00
Tianjie Xu a4e0bb321b Merge "Refractor the code for imgdiff" am: a2e7a07031 am: 68571e27d8
am: 36ee8dd262

Change-Id: I8ce462fa0d6c9ea601e1e3d3c9386cc3fcaa7972
2017-03-07 03:14:43 +00:00
Tianjie Xu 36ee8dd262 Merge "Refractor the code for imgdiff" am: a2e7a07031
am: 68571e27d8

Change-Id: Ia09afb0b5c510171196e9b072506d973019dc60d
2017-03-07 03:12:42 +00:00
Tianjie Xu 68571e27d8 Merge "Refractor the code for imgdiff"
am: a2e7a07031

Change-Id: Ic183461ff0f29d73b2baee2f28fa7a580f01d5c7
2017-03-07 03:10:43 +00:00
Treehugger Robot a2e7a07031 Merge "Refractor the code for imgdiff" 2017-03-07 03:06:09 +00:00
Tianjie Xu 1ea84d6da9 Refractor the code for imgdiff
Put ImageChunk and some helper functions into a class. Also switch to
using std::vector instead of malloc.

Bug: 18606652
Test: imgdiff_test passed on host. Also generate a complete incremental OTA package.
The file content is the same and time consumption is similar.

Change-Id: Id603ada4e130ef521218400761a119001a86ca79
2017-03-06 15:41:02 -08: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
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