r/Python • u/AutoModerator • 4h ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
6
Upvotes
r/Python • u/AutoModerator • 4h ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
View all comments
0
u/Ok-Schedule-6280 1h ago edited 1h ago
ZapMerge: merge the WhatsApp history of two iPhones by editing the encrypted iOS backup
I switched iPhones and my WhatsApp history ended up split between the old phone (years of chats) and the new one (recent weeks). Neither Apple nor WhatsApp offers a way to combine them, so I made one.
Repo: https://github.com/alanfederal/ZapMerge (MIT)
What My Project Does
It opens two encrypted iOS backups, extracts WhatsApp's ChatStorage.sqlite from each, merges them (older one as base, newer messages after a cutoff, duplicate chats joined), writes the result into a copy of the backup and re-encrypts the manifest so the phone restores it like a normal backup. Pure Python plus the cryptography package.
Target Audience
People comfortable running Python scripts who need to rescue a split WhatsApp history, and anyone curious about iOS backup encryption or WhatsApp's Core Data schema. It worked end to end on one real case; it is not a polished consumer tool. iPhone to iPhone only; Android uses a different database and is not supported.
Comparison
There is no official way from Apple or WhatsApp. Paid desktop transfer tools exist, but they are closed source. This is an open, documented method: the repo explains the backup crypto, the schema, and three bugs that only show up after a real restore. The most interesting one: ZSORT, which orders messages, restarts at 1 in every chat, and ZMESSAGECOUNTER is not a count but MAX(ZSORT)+1, the cursor for the next new message.
Feedback and test reports on other iOS/WhatsApp versions are welcome.