ADB: Add adb backup for TWRP.

Functionality for client side to backup
tar and image streams over adbd to the client under backup.ab.

Using adb backup on the client side you can backup the partitions
TWRP knows about.

On the client side you can do the following:
adb backup -f <filename> --twrp <options> where options are
--compress: compress data
system: backup system
cache: backup cache
data: backup data
boot: backup boot
etc for each partition.

You can string multiple options,
i.e. adb backup -f <filename> --twrp --compress cache system data

adb backup in TWRP will take any option corresponding
to TWRP fstab partitions, e.g. efs boot as well.

If you do not specify the filename with the -f option,
adb will backup your data to a filename backup.ab on the client.
You can then rename the file and encrypt it with desktop tools.

If you don't want to use command line arguments:
adb backup --twrp

will bring up the gui and allow you to choose partitions
from the backup page.

To restore the backup use the following convention:
adb restore <filename>

Structures are used to store metadata in binary inside
of the file itself. If the metadata structure is modified,
update the adb version so that it will invalidate older
backups and not cause issues on restore. When restoring,
we currently do not support picking specific partitions.
It's all or nothing.

Change-Id: Idb92c37fc9801dc8d89ed2a4570e9d12e76facf8
29 files changed
tree: 2908e48dfb44eae96c49113a177108f3cbb714f2
  1. adbbu/
  2. applypatch/
  3. bmlutils/
  4. crypto/
  5. digest/
  6. dosfstools/
  7. edify/
  8. etc/
  9. exfat/
  10. fb2png/
  11. flashutils/
  12. fonts/
  13. fuse/
  14. gpt/
  15. gui/
  16. htcdumlock/
  17. injecttwrp/
  18. libblkid/
  19. libcrecovery/
  20. libmincrypt/
  21. libpixelflinger/
  22. libtar/
  23. minadbd/
  24. minadbd.old/
  25. minui/
  26. minui.old/
  27. minuitwrp/
  28. minzip/
  29. mmcutils/
  30. mtdutils/
  31. mtp/
  32. openaes/
  33. orscmd/
  34. pigz/
  35. prebuilt/
  36. res/
  37. res-hdpi/
  38. res-mdpi/
  39. res-xhdpi/
  40. res-xxhdpi/
  41. res-xxxhdpi/
  42. scripts/
  43. sepolicy/
  44. simg2img/
  45. testdata/
  46. tests/
  47. toolbox/
  48. tools/
  49. toybox/
  50. twrpTarMain/
  51. uncrypt/
  52. updater/
  53. .gitignore
  54. adb_install.cpp
  55. adb_install.h
  56. Android.mk
  57. asn1_decoder.cpp
  58. asn1_decoder.h
  59. bootloader.cpp
  60. bootloader.h
  61. CleanSpec.mk
  62. common.h
  63. data.cpp
  64. data.hpp
  65. default_device.cpp
  66. device.cpp
  67. device.h
  68. find_file.cpp
  69. find_file.hpp
  70. fixContexts.cpp
  71. fixContexts.hpp
  72. fuse.h
  73. fuse_sdcard_provider.c
  74. fuse_sdcard_provider.h
  75. fuse_sideload.c
  76. fuse_sideload.h
  77. infomanager.cpp
  78. infomanager.hpp
  79. install.cpp
  80. install.h
  81. interlace-frames.py
  82. legacy_properties.h
  83. legacy_property_service.c
  84. legacy_property_service.h
  85. mounts.c
  86. mounts.h
  87. NOTICE
  88. openrecoveryscript.cpp
  89. openrecoveryscript.hpp
  90. partition.cpp
  91. partitionmanager.cpp
  92. partitions.hpp
  93. progresstracking.cpp
  94. progresstracking.hpp
  95. README.md
  96. recovery.cpp
  97. recovery_ui.h
  98. roots.cpp
  99. roots.h
  100. screen_ui.cpp
  101. screen_ui.h
  102. set_metadata.c
  103. set_metadata.h
  104. tarWrite.c
  105. tarWrite.h
  106. tw_atomic.cpp
  107. tw_atomic.hpp
  108. twcommon.h
  109. twinstall.cpp
  110. twinstall.h
  111. twrp-functions.cpp
  112. twrp-functions.hpp
  113. twrp.cpp
  114. twrpDigest.cpp
  115. twrpDigest.hpp
  116. twrpDU.cpp
  117. twrpDU.hpp
  118. twrpTar.cpp
  119. twrpTar.h
  120. twrpTar.hpp
  121. ui.cpp
  122. ui.h
  123. variables.h
  124. verifier.cpp
  125. verifier.h
  126. verifier_test.cpp
  127. verifier_test.sh
README.md

Team Win Recovery Project (TWRP)

You can find a compiling guide here.