Allow uncrypt to work without socket communication

It was inconvenient to uncrypt a update package under adb shell
because the uncrypt executable required a socket to start its job.
Add a workaround to allow uncrypt executes without socket
communication.

Test: run uncrypt under adb shell, and the block map generates successfully
Bug: 29906218

Change-Id: Ibc328b31636d925dc429ede8dcec7392a721dd53
(cherry picked from commit 28c1e5d3aa9610db6e141380b1435937fc7f07db)
1 file changed
tree: f4ef81c91bc7af1ec97976cdae165c5f9902245a
  1. Android.mk
  2. CleanSpec.mk
  3. NOTICE
  4. README.md
  5. adb_install.cpp
  6. adb_install.h
  7. applypatch/
  8. asn1_decoder.cpp
  9. asn1_decoder.h
  10. bootloader.h
  11. bootloader_message/
  12. common.h
  13. default_device.cpp
  14. device.cpp
  15. device.h
  16. edify/
  17. error_code.h
  18. etc/
  19. fonts/
  20. fuse_sdcard_provider.cpp
  21. fuse_sdcard_provider.h
  22. fuse_sideload.cpp
  23. fuse_sideload.h
  24. install.cpp
  25. install.h
  26. interlace-frames.py
  27. minadbd/
  28. minui/
  29. mounts.cpp
  30. mounts.h
  31. otafault/
  32. otautil/
  33. print_sha1.h
  34. recovery-persist.cpp
  35. recovery-persist.rc
  36. recovery-refresh.cpp
  37. recovery-refresh.rc
  38. recovery.cpp
  39. res-hdpi/
  40. res-mdpi/
  41. res-xhdpi/
  42. res-xxhdpi/
  43. res-xxxhdpi/
  44. roots.cpp
  45. roots.h
  46. rotate_logs.cpp
  47. rotate_logs.h
  48. screen_ui.cpp
  49. screen_ui.h
  50. tests/
  51. tools/
  52. ui.cpp
  53. ui.h
  54. uncrypt/
  55. update_verifier/
  56. updater/
  57. verifier.cpp
  58. verifier.h
  59. wear_touch.cpp
  60. wear_touch.h
  61. wear_ui.cpp
  62. wear_ui.h
README.md

The Recovery Image

Quick turn-around testing

mm -j && m ramdisk-nodeps && m recoveryimage-nodeps

# To boot into the new recovery image
# without flashing the recovery partition:
adb reboot bootloader
fastboot boot $ANDROID_PRODUCT_OUT/recovery.img

Running the tests

# After setting up environment and lunch.
mmma -j bootable/recovery

# Running the tests on device.
adb root
adb sync data

# 32-bit device
adb shell /data/nativetest/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest/recovery_component_test/recovery_component_test

# Or 64-bit device
adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test
adb shell /data/nativetest64/recovery_component_test/recovery_component_test

Running the manual tests

recovery-refresh and recovery-persist executables exist only on systems without /cache partition. And we need to follow special steps to run tests for them.

  • Execute the test on an A/B device first. The test should fail but it will log some contents to pmsg.

  • Reboot the device immediately and run the test again. The test should save the contents of pmsg buffer into /data/misc/recovery/inject.txt. Test will pass if this file has expected contents.