I'm trying to come up with an effective way to create a gzipped archive of various system partitions on Android, piping everything out to stdout so as to be able to encrypt it as it comes across via
The workflow looks like this:
adb shell "/data/dobackup.sh" | gpg --output suchbackup.tar.gz.gpg --encrypt --sign --recipient firstname.lastname@example.org
The shell script needs to basically do this:
cat /dev/block/platform/msm_sdcc.1/by-name/recovery > recovery.img cat /dev/block/platform/msm_sdcc.1/by-name/system > system.img ...
However, as seen, I'd like to do this whole thing over an adb shell execution so that everything is transferred over USB, into memory, and quickly is encrypted then written to disk, ie leaving no unencrypted trace.
The problem I'm having is that I'm not sure how to manufacture the internals of the script into a tar.gz file composed of multiple files/sources. Basically, I'm looking to output a tar.gz file from stdout from this script which includes the following files inside:
/recovery.img /system.img /userdata.img /cache.img /...
Is there any way I can do this? I haven't encountered a problem like this in my travels so far.