Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more debugging, a package filter, a mode to only verify metadata, and more help output #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sure-fire
Copy link

Having spent the past 72 hours struggling to recover a CalyxOS backup onto a GrapheneOS phone, this tool was invaluable. Thank you for creating it!

To troubleshoot issues and generally learn how Seedvault is supposed to work, I added more debugging messages. Eventually, I started adding some convenient features and decided it was worth offering up.

Since I was searching across multiple backups, trying to test mnemonic phrases and find certain app data, I added a "--check" flag to verify when I had the right mnemonic and a "--package" flag to extract only the needed package.

While I was at it, I added "--debug" so it can be either an environment variable or a command-line option. Plus a "--help" flag and detailed output.

Let it be known that this is the first time I've written Golang and had it actually compile. So please be gentle. 😅

…r metadata check only

Added even more debugging messages (because they are incredibly helpful)
New "--debug" parameter (DEBUG environment variable still works, for backward compatability)
New "--check" parameter stops just before extracting packages, confiring that the metadata was decrypted
New "--package" parameter lets the user specify a single app name to be extacted (eg. com.android.providers.telephony)
New "--help"  parameter provides details and example command
Moved usage info to a new printHelp() function
@sure-fire
Copy link
Author

Here's an example / test run: (possibly also a mini-tutorial if anyone else is trying to salvage their text messages):

$ ./extract --help
usage: extract [PATH] [MNEMONIC] [optional]
    PATH      should be a 13-digit folder name (inside .SeedVaultAndroidBackup)
    MNEMONIC  should be a twelve word phrase

    Optional arguments include:
       --check    confirms that the backup metadata is valid, but does not extract the data
       --list     lists the package names only, but does not extract the data
       --debug    enables excessive amounts of output *INCLUDING SENSITIVE DATA, LIKE KEYS AND PHRASES*
       --package  specifies a Android package name -- all others will be skipped

    Example usage:
         extract my_backups/.SeedVaultAndroidBackup/1708344900209 'buzz float culture lake paper season amused rain marine promote coyote mechanic' --list
         extract my_backups/.SeedVaultAndroidBackup/1708344900209 'buzz float culture lake paper season amused rain marine promote coyote mechanic' --check
         extract my_backups/.SeedVaultAndroidBackup/1708344900209 'buzz float culture lake paper season amused rain marine promote coyote mechanic' --package com.android.contacts

$ export PHRASE="buzz float culture lake paper season amused rain marine promote coyote mechanic"

$ export BACKUPS="/mnt/backups/pixel"

$ ./extract $BACKUPS/.SeedVaultAndroidBackup/1708344900209 "$PHRASE" --check
CHECK-MODE ENABLED: extract on '1708344900209' stopped before deploying 179 packages

$ ./extract $BACKUPS/.SeedVaultAndroidBackup/1708344900209 "$PHRASE" --list --package com.android.providers.telephony
    com.android.providers.telephony

$ ./extract $BACKUPS/.SeedVaultAndroidBackup/1708344900209 "$PHRASE" --package com.android.providers.telephony
    extracting com.android.providers.telephony.tar

$ ls *.tar
com.android.providers.telephony.tar

$ tar xvf com.android.providers.telephony.tar
apps/com.android.providers.telephony/_manifest
apps/com.android.providers.telephony/d_f/000000_sms_backup
apps/com.android.providers.telephony/d_f/000001_mms_backup

$ cd apps/com.android.providers.telephony/d_f

$ python3 -c "import zlib; print(zlib.decompress(open('000000_sms_backup','rb').read()))" > 000000_sms_backup.json

(Note: filenames and mnemonic phrases have been changed to protect the innocent)

@sure-fire sure-fire changed the title Added help, extended debugging, added a package filter, added mode for metadata check only Added more debugging, a package filter, a mode to only verify metadata, and more help output Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant