I have formatted my phone, but I made a Nandroid Backup before.
I then installed Whatsapp again, expecting it to download the chats from the cloud. It didn't. I then deleted Whatsapp and the newly generated /data/data/com.whatsapp, extracted it from the Nandroid Backup and put it on my phone, and reinstalled Whatsapp. However, it immediately crashes. It starts and just closes again.
If I copy back the newly generated com.whatsapp folder without my messages, it starts but my chats are gone. If I copy the folder from the backup, it doesn't even boot.
How do I get my chats back? Can I "mix" the working folder with just the msgstore.db from the old one? I don't want to mess more up ...
Answer
To restore WhatsApp's functionality, you need to uninstall and reinstall it again. Then, open a terminal and issue
su
ls -l /data/data/com.whatsapp
, noting down the content of the third and fourth columns. The third identifies the file owner, while the fourth is the group.
After that, restore your backup and, in a terminal, issue
su
chown -R . /data/data/com.whatsapp
, replacing
and
with the data you previously noted down. This procedure sets the correct ownership for WhatsApp data, letting you effectively restore your backup.
Reason behind the failure
I was finally able to reproduce the issue.
Your phone has SELinux installed, and set in Enforcing mode. Now, SELinux is able to limit even the root user, and it does so by enforcing certain so-called contexts. The appropriate context for app data is u:object_r:app_data_file:s0, while the context of the backup was u:object_r:system_data_file:s0. This can be seen at line 13 of your log, which reads
02-22 11:38:10.673 7269 7269 W SharedPreferenc: type=1400 audit(0.0:909): avc: denied { read } for name="com.whatsapp_preferences.xml" dev=mmcblk0p12 ino=73372 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=0
(tcontext
is the file's context).
Basically, SELinux denied WhatsApp the right to operate any changes under /data/data/com.whatsapp despite ownership and permissions, because the app isn't allowed to edit anything belonging to the abovementioned tcontext.
No comments:
Post a Comment