Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Viber crashes if using restored bkup data

OP kmmc

2nd June 2014, 09:35 AM   |  #1  
OP Junior Member
Thanks Meter: 3
 
7 posts
Join Date:Joined: Aug 2012
Hey all.

I'm on a Samsung Galaxy S2 GT-i9100 running SlimSaber 4.4.2 20140531 (Kernel 3.0.80-SlimKernel+)
  1. I backed up my APKs and Data with MyBackup Pro
  2. Switched from NeatROM by flashing to Slim Saber
  3. Restored all my data using MyBackup Pro
  4. Mostly everything works except for Viber

A fresh installation of Viber works. But the moment I restore my data, it will not start up anymore. I've checked CatLog and the main error seems to be permission based:

Code:
Failed to chmod(/data/data/com.viber.voip/databases/viber_messages):
libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)

Unable to create files directory /data/data/com.viber.voip/files
I've tried manually changing the permissions to follow the same perms from the "fresh data" of Viber - but that doesn't seem to fix this error.

Full Viber log:


06-02 15:22:57.295 I/ViberApplication(11763): ViberApplication, initialization STARTED
06-02 15:22:58.145 W/FileUtils(11763): Failed to chmod(/data/data/com.viber.voip/app_optimized): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)
06-02 15:22:58.145 W/FileUtils(11763): Failed to chmod(/data/data/com.viber.voip/app_working): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)
06-02 15:22:58.150 W/ContextImpl(11763): Unable to create files directory /data/data/com.viber.voip/files
06-02 15:22:58.155 W/ContextImpl(11763): Unable to create files directory /data/data/com.viber.voip/files
06-02 15:22:58.165 I/ActivityManager(2256): Process com.viber.voip:remote (pid 11763) has died.
06-02 15:23:33.815 I/ActivityManager(2256): Process com.viber.voip (pid 9564) has died.
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/com.viber.service.VoipConnectorService in 1000ms
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/.api.billing.InAppBillingService in 11000ms
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/com.viber.service.contacts.authentication.AccountA uthenticatorService in 21000ms
06-02 15:23:34.865 I/ActivityManager(2256): Start proc com.viber.voip for service com.viber.voip/com.viber.service.VoipConnectorService: pid=11961 uid=10113 gids={50113, 3003, 1028, 1015, 1023, 3002, 3001}
06-02 15:23:36.350 W/FileUtils(11961): Failed to chmod(/data/data/com.viber.voip/databases/viber_data): libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)
06-02 15:23:36.355 W/FileUtils(11961): Failed to chmod(/data/data/com.viber.voip/databases/viber_messages): libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)


I'm no Android developer but I am comfortable enough with basic Linux.. any help you can extend is appreciated!

Rgds,
Kristy
Last edited by kmmc; 2nd June 2014 at 10:06 AM. Reason: expand on phone specs
2nd June 2014, 11:28 AM   |  #2  
OP Junior Member
Thanks Meter: 3
 
7 posts
Join Date:Joined: Aug 2012
Smile Fixed! Android Viber Backup and Restore Successful
Okay, thank Jesus I managed to get this fixed and this is what it took.

This solution required a Rooted device.
  • Restore Viber backup (for me I did this using MyBackup Pro)
  • Install SQLite Debugger from the Play Store
  • Using SQLite, try locating the Viber database files by selecting App then choosing Viber from the list (if you want to locate the database manually, for me it was under /data/data/com.viber.voip/databases)
  1. Choose the "viber_data" database
  2. Open the database, scroll to the bottom, choose "Create backup"
  3. Save the backup somewhere on your SD card (not inside the viber folder or else it will get deleted)

Repeat the same steps for the "viber_messages" database
  • Uninstall Viber (or if you are using MyBackup Pro, go under Toolbox and "Wipe the Cache & Data" for Viber)
  • Reinstall Viber so that a fresh, clean working set of databases are generated by the app (or re-open Viber)
  • Do the usual setup of entering your phone number, letting it sync contacts etc
  • Once Viber has settled down, close it
  1. Re-open SQLite Debugger
  2. Navigate back to the "viber_data" database
  3. This time, choose Restore Backup
  4. Select the backup file from your SD card
  5. Kill Viber if requested and wait for the restoration

Rinse and repeat for the "viber_messages" database

Once it is all done, reboot your device and hopefully, the next time you open Viber, the old messages & calls are all there! Unfortunately for me, presumably due to the change in ROMs, the photos sent in Viber messages are in my Gallery but NOT in Viber itself.. I suspect this can be fixed if the path is saved somewhere in the messages database - but right now, I'm just glad to have the text back.

If you get repeated errors from Viber during this process, try freezing the app using MyBackup Pro Toolbox (I believe Titanium Backup also has this option)


====

If this helped you, please click the THANKS
Last edited by kmmc; 2nd June 2014 at 11:35 AM.
The Following 2 Users Say Thank You to kmmc For This Useful Post: [ View ]
17th June 2014, 09:36 PM   |  #3  
Senior Member
Flag Cairo
Thanks Meter: 223
 
564 posts
Join Date:Joined: Jan 2012
More
IT WORKED. THANK YOU VERY MUCH...

I've read so many guides around and they all resulted in either viber crashing or deleting messages right after connecting.

I had really lost hope of ever getting my messages back.
The Following User Says Thank You to Dr. Hurt For This Useful Post: [ View ]
18th June 2014, 03:35 AM   |  #4  
OP Junior Member
Thanks Meter: 3
 
7 posts
Join Date:Joined: Aug 2012
Smile You are most welcome!
You are most welcome! I I'm a web developer and having to figure this one out gave me some insight into phone app development. Glad it helped someone

Quote:
Originally Posted by 7amdoun

IT WORKED. THANK YOU VERY MUCH...

I've read so many guides around and they all resulted in either viber crashing or deleting messages right after connecting.

I had really lost hope of ever getting my messages back.

The Following User Says Thank You to kmmc For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes