Open jackwilsdon opened 1 year ago
I've been digging around on seedvault's repo, and it turns out all apks are unencrypted inside the backup folder (they even keep the correct apk mimetype in linux), all seedvault does is encrypt their filename. The following golang code should correctly get the new filename:
h := sha256.Sum256([]byte(metadataMeta.Salt + "APK" + packageName + suffix))
encrypted_name := base64.RawURLEncoding.EncodeToString(h[:])
The suffix variable is an empty string for non split apks, while split apks will have an empty suffix for the "base" apk and all the others will use the name value that is found inside of the metadata.
From there it's just a matter of copying and renaming the correct files. I know nothing of golang (above code is my first dive in it) , so can't make a pr and hope it's up to standard, but hopefully this info helps you/someone.
We currently don't seem to be extracting APKs from backups.