[GUIDE] SIM Card Locks randomly - Howto solve. (rooted SE X10i/a phones only) - XPERIA X10 Android Development

You might be reading this because you experienced the things I've experienced on three different X10i devices so far:
After rooting the phone according to instructions found here on XDA-Developers, the phones started to lock the SIM-card, to what it seems, on a random basis over and over.
Sometimes it can go days before it suddenly locks up, other times just minutes between the locking intervals.
There is a solution.
Some of you might already have solved this problem, unintentionally.
There was a post further down on the "X10 rooting guide" suggesting what apps to remove. One of the apps suggested there, are the cause of the this problem, and once removed it also removed the problem.
Remember: If you don't have problems, you don't need to fix it either. -"Don't fix what isn't broken."
Before you read on, keep in mind you are having root-access and can cause some "serious" damage to the system files if you execute the wrong commands.
I hereby declines any responsibility if you choose to follow this guide.
You execute the commands at your own risk.
I assume you got everything already set up for adb access. If not, read on: http://forum.xda-developers.com/showthread.php?t=532719
The problem:
The Android OS uses parts of the SIMtoolkit (STK) to access the simcard in the phone.
Only one application/tool can connect to the simcard at a time, so any other application that needs access to the information on the SIM-card should to go through the STK.
However, there are a few "badly" written applications that doesn't go through the proper "channels" to access the SIM-card. They're often written to access the SIM-card directly. This causes a conflict, where STK is "smart" enough to move aside.
Every time an application or a tool connects to the SIM-card, the SIM-card resets and locks down again, requiring one to enter the PIN-code once again.
In the X10i's case, the "conflicting" application are Sony Ericsson's own "Backup and Restore" application.
The Android OS launches applications in a "prefetch" manner so they are available quickly once needed.
This causes "Backup and Restore" to get in between and "steal" the SIM-card connection every single time it's loaded, either by you, or by the Android OS itself.
This causes the SIM-card to reset and lock down every time the Android OS decides to unload "Backup and Restore" to free up memory.
Sony Ericssons developers should make the "Backup and Restore" app to go through Androids proper ways to access the SIM-card: via STK (SIMcard ToolKit) and not directly.
The solution: (Phone will reboot, save all data before proceeding)
Move/remove Sony Ericsson's application named "Backup and Restore".
There are better applications for backup available out there anyway, such as "Titanium Backup".
EDIT: As a user mentioned, further down among the posts here, it is possible to remove "Backup and Restore" with Titanium Backup. Just install Titanium Backup from the Android market, and then remove it from there:
1: Start Titanium Backup, accept root access.
2: Tap "Backup/Restore" at the top.
3: Scroll down and tap "Backup and Restore" in the list that appears.
4: Tap "Un-Install !"
5: Reboot the phone to clean out eventually remains of it in the phones memory. (Not necessary tho)
If the solution above isn't possible for some reason, follow these instructions: (Only if solution above fails)
The apk file is named: "semc-backup-rachael.apk". It's found in /system/app/
To move it out of harms way, execute the following commands in an adb-shell:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mkdir /system/app/temp1
mv /system/app/semc-backup-rachael.apk /system/app/temp1/
reboot
Once the phone rebooted, the "Backup and Restore" app should be no more, and therefor less random SIM-card lockups. (You still have to unlock the SIM-card after reboot, doooh)
If everything seems to be working in order after the reboot, and the "Backup and Restore" application are gone, Proceed to "CleanUp" further down.
If things do fail, execute the following to restore it to the previous state:
Do not execute this unless you want to restore the previous state:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mv /system/app/temp1/* /system/app/
reboot
The CleanUp:
To remove any leftovers after a successful reboot: (WARNING: Unless you have an external backup of the semc-backup-rachael.apk file, this will be irreversible )
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
rm /system/app/temp1/*
rmdir /system/app/temp1
reboot

********In the X10i's case, the "conflicting" application is Sony Ericsson's own "Backup and Restore" application.*********8
If that was the case, I would have faced the same problem......But I am not....

Mine wasn't rooted until yesterday, but the same problem occurred to me few times on soft *20. After updating to *26 and using the Universalandroot app, everything seems to be fine.

it is the problem ..
I had same issue too, .. after removing backup and restore its gone
before i tried if it works and it worked for me like hell
install some task killer app (advanced task killer (ADK) from market for example)
turn on backup and restore (use middle button to go to the mainscreen)
run ADK and kill everything.
Maybe it will not shows on first try . Because you never know if the Bac and Res is currently accesing the sim card or not. But after few tries it will disconnect your sim and ask you for PIN.
off course you do not have the issue if you are not using some task killer app.

Backup and restore was causing this too for me, I figured it out last night LOL
Wish I had read it here first and saved myself loads of time.

Isn't it possible by just removing the "backup and restore.apk" with Titanium, i"m just a noob in this kind of things (rooted my x10i about 1 hour ago and already had the sim lock fault)

That's how I did it. Froze it first just to be sure.
Sent from my X10i using Tapatalk

ok.. since we are on sim card topic.. my problem is similar to this, i posted it here twice on forum but wasnt able to get any answer.. so problem is everytime i go out of reception i.e. basement, subway etc. so when i come back to reception(signal) area phone wont connect automatically, i hv to do it manually everytime.. even then it will show msg- your sim card does not allow connection to network. till date problem is not solved but i hv to go to STK and toggle SELECT VISITED NETWORK and RESELECT VISITED NETWORK. and set it on SELECT... then again doing manual searching will connect the phone...( i got this trick? on a local network provider forum, it works! but still lot of work each time..lol..)
i have rooted x10i with 26.. i have TB free version..
do u guys think above solution of removing SE backup n restore would repair the problem.. im just planning to remove it using TB.. plz put ur thoughts thanx

thank you it help me alot
Sent from my X10i using XDA App

Nice catch this was pissing me off for some time now.
I was killing tasks with ATK (using ATK widget) and afer cold boot first killing woud lock the SIM and I had no idea why.
Now I loaded backup and restore and killed tasks with ATK and sim was locked instantly. So SE backup & restore is gone.
Thanks and greetings KRadovan

I also removed the backup app with Titanium. No problems anymore. Thanks for the help on this one.
Sent from my X10i using XDA App

Thank for solving my problem, the backup and restore function was causing the problem here too.

Okay and now, I just downloaded tatanium and it says, no root access. Is there another way to remove backup and restore. My phone is not routed.

Chicane301 said:
Okay and now, I just downloaded tatanium and it says, no root access. Is there another way to remove backup and restore. My phone is not routed.
Click to expand...
Click to collapse
No there is not. Just root your phone with http://forum.xda-developers.com/showthread.php?t=740240
and then remove it.

Oke thanks, working on it. I'm not sure if I should root my phone, but it doesn't leave me a choice right now.
Done and backup and restore is removed. Thanks for the info and help everyeone!!

Still problems?
Hi
I've been having the same problems for the last couple of days on my X10 Mini Pro. It's rooted, I've removed Backup & Restore (and some other apps like stupid pre-installed demo(!) games) but it didn't solve it for me.
To find what causes this I've written a small app. It checks the sim-state periodically. If it's in some way unavailable or a pin-code is required to unlock it, it warns you by vibrating plus default notification sound.
If you're quick you can try and debug the event(s) with an app like aLogCat.
At least you'll get notified of not being reachable.
Thought i'd share it (see attached .apk)
Since I have no Market Account you have to upload it to your phone manually. Use ADB/Dos-prompt or MyPhoneExplorer.

-----------

Related

[Q] process com.android.systemui has stopped

Hu guys,
i was googling for some hours but couldnt find a soltuion to this. Everytime i install ANY app on my new sgs2 and reboot I get the following error message:
The application Status Bar (process com.android.systemui) has stopped unexpectedly. Please try again.
I get the message twice and then the bar is gone. When i dont press force close I see the bar just working perfectly in the background.
Only solution is factory reset, but as soon i install apps (no matter which) i start getting the same problems.
Thinking of returning the phone
Marcie
Can you post what's in the 'About Phone's screen, what network you're using and where you bought your phone.
Sent from my GT-I9100 using Tapatalk
Try a reflash as i only got that problem when i pushed systemui.apk and didnt reboot straight after. Sounds like a corruption somewherw
Sent from my GT-I9100 using XDA Premium App
the problem was when ever i made the inital configuration i ticked the box to sync my google config. my google config was from my old sgs1 which must have corrupted my phone. i reset the phone and unticked the google config option and i dont have the problem anymore.
Ahhh!!! I got the same problem!!! Is there any way to fix this? Anyone?
marcie82, i'm having the same problem and your post was the only post I found that addresses the issue. When you wrote that you've reset your phone, did you mean you reflashed it?
I just got the same phone from amazon.. and it worked fine when i first opened it but then the task bar disappeared..
i reset it back to original factory settings.. it's downloading my old apps now.. i'll keep on debugging this thing until something comes up
A buddy of mine had a similar issue, for him it was com.android.phone that kept randomly crashing, sometimes mid-call and thereby terminating the call.
We tried factory reset and other things as well, nothing helped.
So we ended up re-flashing the FW (he was on KE2 and we flashed a stock KE7), that is now ~2 weeks ago and he never had any crashes anymore since then.
So, long story short, try reflashing (a maybe newer) FW with odin, factory once more (if the ROM doesn't do it while flashing) and see if it gets any better.
Also check the CSC setting, we set it to generic XEU after the flash - use w/e suits your region/FW.
installing applications
i noticed that as soon as i go to google market and click on the 'my apps' button.. it starts downloading all the apps i previously purchased automatically.. is there a way to prevent that from happening?
Settings -> Privacy
"Back uo my data" and "Automatic restore"
untick at least the auto-restore, or the auto-backup too, maybe that helps.
I got both disabled by default (first thing I set after a wipe) and it never tried to restore my apps by itself (yay for AppBackupAndRestore ).
could it be a specific application?
debugging progress: i noticed that it's not installing *any* app that causes this task bar thing disappearing (at least not in my case):
i restored my phone to factory default.. then i disabled my automatic restore and defaults. then i installed only one app from my very long list of apps. (for some reason i had to do it from my 3g connection and not wifi.. but that's a different problem)..
anyways i installed it and it worked just fine! i restarted my phone just to make sure and the task bar is still there!
i'm gonna go through my apps ans install them one by one.. i know it's a painstaking process but hey i gotta give back to the android community
A
A trick I used in a similar situation was the following :
Use Titanium Backup. U make a backup of the application that has the problem. Then u wipe the data of this application and then u restore the data.
For me that trick miraculoussly solved that problem ...
http://forum.xda-developers.com/showthread.php?t=1162680
Had the same problem with not working phone/contacts, freezing like "process com.android.phone - Force Close" etc.
I realized the error happens only after upgrading for example to KG, than after a short period making a backup of the whole system, downgrading to KF, then restoring with Titanium Backup.
It restores the whole system, including settings, and accounts and so on. This might be the problem. It seems nobody realized that the MODEM and PHONE is upgraded too, so there might be some components not compatible with earlier versions.
Solution: restore only user apps & data, not the system settings. Use a separate app for SMS, call logs, contacts or calendar. Do a cache wipe and then a fact reset from MENU+UP+POWER (restore menu), then reinstall your choice of firmware, restore user apps&data with Titanium or anything preferred, then enter/restore everything else manually. No problem when upgrading.
Tested, had 3 sleepless nights, but works for me.
Noob in need of androidized kindle help!
Hey ya'll,
I just rooted and downloaded ics4 onto my kindle. It was working great all day and I used the gba emulator for android and everything.
Now, for some reason I keep getting the error "unfortunately, system UI has stopped working".The tool bar on the bottom of the screen with the home and back buttons aren't even there anymore. I have rebooted and gone into TWRP and done a system reboot and everything yet that keeps happening. Why do you think that is ?
caused by Titanium
hlaja said:
Had the same problem with not working phone/contacts, freezing like "process com.android.phone - Force Close" etc.
I realized the error happens only after upgrading for example to KG, than after a short period making a backup of the whole system, downgrading to KF, then restoring with Titanium Backup.
It restores the whole system, including settings, and accounts and so on. This might be the problem. It seems nobody realized that the MODEM and PHONE is upgraded too, so there might be some components not compatible with earlier versions.
Solution: restore only user apps & data, not the system settings. Use a separate app for SMS, call logs, contacts or calendar. Do a cache wipe and then a fact reset from MENU+UP+POWER (restore menu), then reinstall your choice of firmware, restore user apps&data with Titanium or anything preferred, then enter/restore everything else manually. No problem when upgrading.
Tested, had 3 sleepless nights, but works for me.
Click to expand...
Click to collapse
I am sure the problem caused by restore system data by Titanium. I have tried four times today. Factory reset and flash and restore. Only when I restore system data caused this problem.
Why resurrect a two year old thread?
For information, restoring apps WILL NOT cause instability......restoring data ESPECIALLY data from system apps WILL.
RULE OF THUMB......
If you are upgrading your android OS (eg...ICS to JB).....
DO NOT restore system app data....ever
For user apps....if the app runs as soon as you open it, you *should* be ok to re-install the data.
If the app requires the downloading of 'additional files' on first run, DO NOT re-install as this data is likely to be OS version specific......
My wife says I'm a phone geek....She's probably right
Due to an update of an Xposed module, I had badly corrupted my systemui. The phone was totally unusable, and I could only press the OK button notifying the stopped event at startup.
Lucky me, I still had not updated to 4.4.3. Via Skipsoft Android Toolkit I updated to the last Android release, and my systemui got fixed. I did not choose to do a complete wipe, so I actually maintained my previous apps. In relation to root, I did not loose it, but I had to reinstall SuperSU to get the non-official apps working again.
I hope this helps somebody else in my same condition, with no need to do a system wipe!
com.android.systemui stops working when battwry gets less then 16 %
Hi guys ,
Can anyone upload the system ui file for android KitKat?
I tried all things to fix "Unfortunately com.android.system ui. Has stopped working when battery gets lower then 16% so I think I should replace the system ui file from system app folder
Hey everyone, I just had this same problem pop up onto my phone while I was checking my messages. Ive never rooted my Motorola Droid Razr HD and the power button is jammed at the moment as well. Is there a way around this problem or is this phone done for?
Maybe you should try increasing the heapsize in the build.prop file, the no. of notifications in the status bar causes this crash. if you want to know more about the heapsize etc. google for this crash in cyanogenmod fourms.

[Q] While using fix permissions, everything gone

This is the most weird problem I've ever met.
ROM: CM7 N2 (.35 kernel new baseband)
CWM:5.0.2.0
At first, because I encountered Market FC problem, and as everyone suggested in the thread that I should fix permissions via rom manager/CWM recovery.
Thus I chose that option in recovery. After that, I reboot, but it hang at the logo. I then boot again and found that ALL MY SETTINGS BECAME DEFAULT, they all GONE(both user apps and system settings).
But all the Link2sd apps still there, and some of them can be executed. It's very strange, because if ext partition mounted well, then the settings should be there too......So I tried to enter /data via Rootexplorer , but it showed that nothing inside.(due to the fix permission IMO)
And I'm unable to use rom manager to upgrade my cwm, because the SU didnt let me do that. I've adjusted the settings, but SU app keep denied rom manager's request(IMO another issue caused by fix permission).
What should I do now? The latest backup is 1 week ago, and I've made some important changes within this week.(unable to re-do them again after restore, some REAL LIFE things)
Really need help right now
EDIT: SMSs and call logs are all gone, although I have a gmail backup, but still lost 20+ messages ....

[Q] Can't Detect Sim Card - Software Issue

Hi
I recently installed Touchpal Dialer to replace the Android Stock Dialer (Phone). I then used Titanium Backup to uninstall the stock dialer. (I only select Phone and pressed 'Uninstall'). However in the process of uninstall, something crashed (some process stopped working) and I was stuck on Force Close (which repeatedly pops up).
So to return to Android I rebooted. However the phone can no longer detect the the SIM card (and hence the network). I tried to access Settings>Call, but I get the error "The application Settings (process com.android.settings) has stopped unexpectedly".
My first thought was to restore Phone using Titanium Backup, but this seemed to be stuck (or at least it was taking excessively long >20min).
Then I reinstalled the rom but that doesn't affect the files required to detect the sim card.
How do I fix this and get my phone to be able to dial again?
Any and all help is much appreciated.
pzling said:
Hi
I recently installed Touchpal Dialer to replace the Android Stock Dialer (Phone). I then used Titanium Backup to uninstall the stock dialer. (I only select Phone and pressed 'Uninstall'). However in the process of uninstall, something crashed (some process stopped working) and I was stuck on Force Close (which repeatedly pops up).
So to return to Android I rebooted. However the phone can no longer detect the the SIM card (and hence the network). I tried to access Settings>Call, but I get the error "The application Settings (process com.android.settings) has stopped unexpectedly".
My first thought was to restore Phone using Titanium Backup, but this seemed to be stuck (or at least it was taking excessively long >20min).
Then I reinstalled the rom but that doesn't affect the files required to detect the sim card.
How do I fix this and get my phone to be able to dial again?
Any and all help is much appreciated.
Click to expand...
Click to collapse
If there was a point in time when everything was working and then one change was made, the stock dialer was removed, then things stopped working, the solution would be to revert back to the working point in time.
Curious, what guide suggested the removal of the stock dialer?
As a side note, before removing files it is always best to either make a complete backup, nandroid, or to at least backup the specific file being removed so it can be quickly and easily replaced.
The main issue here seems to be the removal of the stock dialer. On the technical side of things, the dialer is a very integrated component of Android.
In AOSP, which all ROMs to some degree are based off, the dialer apk file contains not only the dialer but also browsing of contacts and links in on the back end with a few files.
Once you restore the Dialer, I think called phone.apk or something similar, the issues should go away such as FC. If there are issues accessing the SIM card after restoring the previously removed file, off the top of my head, my best guess would be to clear out the settings stored on the data partition. A setting could have been created during the dialer removed state which might prevent the system from restoring proper SIM access.
Hope that adds a bit more detail around the standard process of removing files and making adjustments!
Cheers thanks, much appreciated.
Largely the guide of my ignorance that decided to remove the stock dialer. It's only in the last half hour or so that I've just come by a guide that specifically says to *not* remove the stock dialer. In the first instance I thought it wouldn't be such a big deal as Titanium Backup could always restore it ... in which it turned out it couldn't.
So after all's said and done, is there a way (apart from Ti Backup) to restore just the stock dialer phone.apk (say by download or other)?
Another approach I'm considering is to find a way to flash a custom / stock ROM to fix this. However as my phone is unbranded and on HBOOT 1.49.0018, I'm finding this very difficult with the standard methods posted. On the other hand, ideas are starting to run out and desperation running high!
pzling said:
Hi
I recently installed Touchpal Dialer to replace the Android Stock Dialer (Phone). I then used Titanium Backup to uninstall the stock dialer. (I only select Phone and pressed 'Uninstall'). However in the process of uninstall, something crashed (some process stopped working) and I was stuck on Force Close (which repeatedly pops up).
So to return to Android I rebooted. However the phone can no longer detect the the SIM card (and hence the network). I tried to access Settings>Call, but I get the error "The application Settings (process com.android.settings) has stopped unexpectedly".
My first thought was to restore Phone using Titanium Backup, but this seemed to be stuck (or at least it was taking excessively long >20min).
Then I reinstalled the rom but that doesn't affect the files required to detect the sim card.
How do I fix this and get my phone to be able to dial again?
Any and all help is much appreciated.
Click to expand...
Click to collapse
I have had this happen to me a few times, this mostly happens when you apply a mod/tweak to a rom that is not compatible. Do a wipe and re-flash the rom that you want and it should fix the problem.
Thanks so much for this, that's fixed it.
Re wiping, since you can wipe from the Recovery and installation of the rom wipes before flashing anyway, is it necessary to use a wipe img? If so, what is recommended? (As I'm on HBOOT 1.49, I seem to only be able to run CWM 4.0.1.4 Shooteru Recovery).
ROM not booting
Looks like I've dug myself into another hole again.
The 'Sim Card detection' problem was fixed with a wipe from CWM 4.0.1.4 and flashed with ShaWn3D v1.4 rom. Everything works and I was happy.
But I was keen to try out the LeeDroid rom but the WiFi error keeps recurring despite my attempts with the solutions provided at
http://forum.xda-developers.com/showthread.php?t=1248838.
I've tried:
- re-flashing LeeDroid with so many versions of bcm4329.ko I've lost count
- reflashing the kernel with the LeeDroid kernel addet
- re-flashing another rom altogether (King Cobra v1.9) to see if it makes a difference; it doesn't - WiFi persists.
So now I've decided to go back to the ShaWn3D rom but now although the flash is successful, the boot is stuck at the white HTC splash screen.
What have I done wrong?

[Q] Viber crashes if using restored bkup data

Hey all.
I'm on a Samsung Galaxy S2 GT-i9100 running SlimSaber 4.4.2 20140531 (Kernel 3.0.80-SlimKernel+)
I backed up my APKs and Data with MyBackup Pro
Switched from NeatROM by flashing to Slim Saber
Restored all my data using MyBackup Pro
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.AccountAuthenticatorService 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
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)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
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
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
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
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.
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
7amdoun said:
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.
Click to expand...
Click to collapse
NICE!!!
You Legend! Your and only your process works!
Thank you!
BTW you don't know the location in the Android file system where all the photo's that have been sent and received is located do you? I need to restore my images but not sure where they are saved....(all good found the saved location /storage/sdcard0/viber/media...)
kmmc said:
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)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
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
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
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
Click to expand...
Click to collapse
You are most welcome! Glad it worked out for you too!
blocka said:
You Legend! Your and only your process works!
Thank you!
BTW you don't know the location in the Android file system where all the photo's that have been sent and received is located do you? I need to restore my images but not sure where they are saved....(all good found the saved location /storage/sdcard0/viber/media...)
Click to expand...
Click to collapse
hello, while yes this way was VERY easy to do thank you so much for that!, the main problem im having is that i was searching for ways to bring back "voice messages" and this appeared to work it even shows that they are back but when i try to listen to *any of them i get this popup saying "you have chosen to delete this voice message" which i never did, any clue how to get voice messages back or how to rip and or convert from a TB file or from the restored folder on device?
Hey thatexan
This video may help in finding the files in the first place: https://www.youtube.com/watch?v=GVdjj1DRwMA
But unfortunately I have no ideas on how to get them to play. I haven't personally tried but if those really are the files, it is most likely that your voice messages are still in your backups but the location to them has not been updated in the Viber... and thus Viber thinks they have been deleted. I never tried fixing the photos issue so I don't have the steps that might help with your voice messages. Some suggestions though:
1) It is possible that in the viber database, it states where to find the photos/voice recordings. If you can find out where then you will need to update the location to point to the correct place
2) OR try receiving a new voice message in Viber and find out where it is stored.. then try putting your old voice recordings there.
3) If just placing your files there isn't enough, try poking around SQL lite to see if you can see the latest voice recording entry in the database and use that as a clue as to what to do - maybe the database needs to be updated with the new location for the old files?
I hope these suggestions help you find the solution. Do reply & share if you find a way to fix it.
thatexan said:
hello, while yes this way was VERY easy to do thank you so much for that!, the main problem im having is that i was searching for ways to bring back "voice messages" and this appeared to work it even shows that they are back but when i try to listen to *any of them i get this popup saying "you have chosen to delete this voice message" which i never did, any clue how to get voice messages back or how to rip and or convert from a TB file or from the restored folder on device?
Click to expand...
Click to collapse
THX a lot !!! tryed so much and your way works
but don't need SQlite - just make a backup (i used TITANIUM), put it on your PC, open it, search for these two files, copy them
copy /sdcard/viber/ media
and replace them with an explorer (i used ES)
reboot - done :good:
btw - any idea how to integrate files from desktop-version missing on phone ???
Glad it worked Sorry I have no ideas on the integration with the desktop-version though.
kmmc said:
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)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
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
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
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
Click to expand...
Click to collapse
U are a genius .. titanium somehow deleted my backup (I am sure it was my fault, although I'm still not sure if I did anything out of the way) and so I tried all kinds of apps and recovery tools (android and windows) to no avail, finally reached Ur helpful post ... sheer brilliance is what U offer .. and a life saver ... I can't thank U enough .. do take Ur knowledge seriously, I scoured the internet, and no one offers what U do and that means a lot, out of the whole world, U are the only one with such an amazing workaround. Beautifully Brilliant ... :good:
Wow, thanks for all the kind words Anubis. It's only the mercy of Jesus that the solution works and still works.. I've got a programming & linux background and it helped give an idea as to what might be causing the issue Really glad it's continuing to help others!
Have a great day,
Kristy
Great guide, kmmc !!! I worked like a charm Thank you!
Hi Kmmc and all....!!
I am in same situation as yours..!!
I have moved to new smartphone and above situation has arised for me to move viber from old smart phone to new smart phone..
Just to reconfirm I have to have follow the backup process through same steps as suggested by you .
can i take backup on google drive through email so that i dont need to play around with sd card switch between old and new phone..
instead through gdrive i can download directly in new phone.. ?
next step would be to install viber on new phone and copy the vober_data and viber_messages file in the given path as suggested by you.
is that the right approach and understanding I am stating correctly ?
will appreciate your revert as well other members benefited by your solution..
To reiterate , your is the soimplest solution / approach compared to what all I have been exploring since last 4 days..no concerete solutions and mostly text backup or paid softwares. you are gem of a person
leo..!
cla1966 said:
THX a lot !!! tryed so much and your way works
but don't need SQlite - just make a backup (i used TITANIUM), put it on your PC, open it, search for these two files, copy them
copy /sdcard/viber/ media
and replace them with an explorer (i used ES)
reboot - done :good:
btw - any idea how to integrate files from desktop-version missing on phone ???
Click to expand...
Click to collapse
Thanks to @cla1966 and @kmmc for their instructions here, worked a treat.
Dear,
I got the same problem and follow your instruction step by step but it didn't work to me
I locate the 2 file (viber_data and viber_messages) in Titaniumbackup folder and restore to viber/media then restart but all the messages still didn't appear
I wish I know what's wrong
My phone is Xperia Z5
Szeretnék segítséget kérni. Sony xperia tipon viber üzenetek visszahozása lehetségeS?

Failed to Restore Whatsapp Database after migrating from STOCK to LineageOS 14.1

I'm struggling with something that never happened to me, I'm unable to restore my database to my recently upgraded Samsung J3 2016 - is running LineageOS 14.1 now
The phone was running stock Android 5.1.1, version J320FXXU0AQI1, nothing fancy here.
Made some research about what ROM to use and decided to upgrade to LineageOS 14.1, I'm really sick and tired of Google spying my steps, my contacts and the number of times i take a piss every day, and so on. Right now I don't have any Google account associated with the mobile (could this be the problem, since this is a custom ROM?)
Everything ran smoothly, backed up my contacts, call logs, SMS, pictures and the ENTIRE Whataspp folder. This method always worked fine on several phones I've upgraded or simple swapped equipment to a more up-to-date hardware. Everytime worked like a charm, restored logs, contacts and so on, in what it concerns to Whatsapp i simply moved the ENTIRE folder to the new phone (or upgraded phone), installed the Whatsapp app and is just straight forward for the app to ask me for a SMS code to activate the software and then asked me to restore my backed up database. It has been very simple so far, but not this time:
When it reachs the point to detect and restore my database Whatsapp states that can find one Database from 1970 (???? WTF) with 0 bytes, and after that it fails to restore my data (not strange, 0 bytes is no data). I've already tried earlier versions of Whataspp, tried different databases (there are 7 in my folder, i don't believe all of them are corrupted). I'm reaching 0 ways to explore. BTW, i dont use Google drive to store my backups because its enough for Google to know how many times i take a piss everyday, i rather have the backups with me, on my phone (thanks any way Google), but the files are safe in my desktop and on my phone for now, inaccessible so far but their're there.
Can any one point me some way to try to revive my database? Just a note, i have an older phone that still have Whatsapp there, i didn't erased it, maybe it's there something of interest for this situation?
Thanks so much in advance for everyone that can help, any hint can be helpful.
Update!
I've managed to get another phone, exactly the same, Samsung J3 201 J320F.
I've sent my whatsapp folder to the phone, signed in to my google account, installed whatasapp and, like 98% of the times my backup is ok and is restored. Now I have two phones:
1- one with Whataspp working fine (the one with Stock ROM 5.1.1 J320FXXU0AQI1
2- another one, the main phone, where i want to put my whataspp backup working but it simply doesnt work (previous post). Everything elese is settled and working just fine. Maybe whatasapp doesnt like Custom ROMs??
So, I'm sure that my backups are fine, right now I have access to anything that i may need i guess. I don't believe that Im the first person not beeing able to restore whataspp backups in LineageOS.
Please help
New developments.: I've installed Ressurection 5.8.5, the latest available for this phone. It runs ok, but Whataspp problem is still there, the backup is marked to have 0Kb, somehow Whataspp simple doesn't want to recover my backup if I'm using a custom firmware (I receive a warning about no support from them if I have problems at the beginning of the startup process).
So far this method didn't work (Whatsapp shows my Backup with 0Kb):
1) Copy your latest crypt 12 file to /sdcard/WhatsApp/Databases/
2) Install / Activate WhatsApp
3) WhatsApp will retrieve the key from their server and restore your backup.
I've tried this method that appeared to have some success in same cases. Followed everything but no luck, Whataspp detects a 0Kb backup also.
Meanwhile I still don't believe that I'm the very 1st person that this happens, I'm still very impressed with this. If the OP thinks I'm in the wrong Topic please feel free to move it to the right place, maybe there I'll have better luck.
Not that I have much knowledge in that direction, but the issue sounds more like it is about the file than Whatsapp itself. Maybe some permission issue? If you use a filemanager app like total commander, can it read the file fully? I found a topic that had 0 byte filesize issue and a simple reboot apparently fixed it.
musschrott said:
Not that I have much knowledge in that direction, but the issue sounds more like it is about the file than Whatsapp itself. Maybe some permission issue? If you use a filemanager app like total commander, can it read the file fully? I found a topic that had 0 byte filesize issue and a simple reboot apparently fixed it.
Click to expand...
Click to collapse
Hello musschrott, and thanks for replying.
I've tried moving the database file, erase it, changing it's name and the android system allows me to do it, i think the file itself is free to be read by Whataspp, but your other tip, the permissions in system made me google around (even more..) about it and I found here on XDA this. : "The privacy protection in the drop down menu and the permission in the app settings." (credits to LegoTechniker). On the privacy protection is all ON but in the Permission is all OFF and Whataspp nor the System ask me to turn it ON and it can result on whatasapp reading files with 0Kb from 1970.
I'll give a try but only tomorrow because the code/phonecall from Whataspp have a 48h delay and keeps increasing everytime I try a different method to solve this issue.
musschrott, thanks again!
tomalamix said:
Hello musschrott, and thanks for replying.
I've tried moving the database file, erase it, changing it's name and the android system allows me to do it, i think the file itself is free to be read by Whataspp, but your other tip, the permissions in system made me google around (even more..) about it and I found here on XDA this. : "The privacy protection in the drop down menu and the permission in the app settings." (credits to LegoTechniker). On the privacy protection is all ON but in the Permission is all OFF and Whataspp nor the System ask me to turn it ON and it can result on whatasapp reading files with 0Kb from 1970.
I'll give a try but only tomorrow because the code/phonecall from Whataspp have a 48h delay and keeps increasing everytime I try a different method to solve this issue.
musschrott, thanks again!
Click to expand...
Click to collapse
For everyone and specially those who helped (musschrott).
This has worked for me: giving full permissions to Whataspp in "Settings - Privacy" and in "Settings - Applications" worked like a charm, you have to do it BEFORE you start Whatsapp.
Best regards to everyone and thanks once more!
Make sure the WhatsApp backup file is in internal storage, and rename the backup file to msgstore.db.crypt.
After upgrading to LineageOS 14.1,install WhatsApp.When asked to restore from backup,choose the "msgstore.db.crypt" file.
mango9 said:
Make sure the WhatsApp backup file is in internal storage, and rename the backup file to msgstore.db.crypt.
After upgrading to LineageOS 14.1,install WhatsApp.When asked to restore from backup,choose the "msgstore.db.crypt" file.
Click to expand...
Click to collapse
Yes,
Those are the basic steps, but BEFORE running Whatasapp for the 1st time you have to give permissions in the system to Whatsapp because these are all OFF and the system doesn't ask to turn them ON when the permission is needed, simply presents you a file with 0Kb from 1970 and that's it. Again, you have to do this BEFORE the 1st Whatsapp startup and everything should run well.
Best regards
My issue is I gave full write permissions but then it goes straight to the Google Drive restore and does not show my local backup.
When I followed this by Rahil:
https://www.reddit.com/r/whatsapp/comments/np2zjp
"So today I finally fixed the issue myself
Click to expand...
Click to collapse
Steps: 1)make sure you rename the database as it should be.
2)Install whatsapp
3)Insert your number when asked
4)Use Otp/code
5)Then the app will ask you for google drive permission ,click allow/ok
6)Then the app will ask for contact permission ,simply deny this permission (very important)
7)Then the app will ask for storage permission ,hit allow (very important)
8)Then you will see your local storage behind the popup saying allow google drive and crap You will need to press add account and have your fingers ready for instant tapping between add account and instant tapping restore button ,and out of 10-30 times doing this practice, you will luckily hit restore button, I know this sounds confusing, And I can make a tutorial video if you want ,this works 100%
9)once it is restored ,you will still see app asking google drive option, don't click skip (this will reset the app ,leading to nothing restored) , So when the app is asking to restore from google drive, close the app right away (very important)
10)open the app ,and the app will ask you to set name ,set your name ,and you'll see all your backup"
Click to expand...
Click to collapse
It works but then it shows my local backup as 0k and from 12/31/1969
This is Driving me wild and now I have to wait 12 hrs to try again. Has anyone solved this ridiculous error?
dpoverlord said:
My issue is I gave full write permissions but then it goes straight to the Google Drive restore and does not show my local backup.
When I followed this by Rahil:
https://www.reddit.com/r/whatsapp/comments/np2zjp
It works but then it shows my local backup as 0k and from 12/31/1969
This is Driving me wild and now I have to wait 12 hrs to try again. Has anyone solved this ridiculous error?
Click to expand...
Click to collapse
Did you find a solution to this? I have the exact same problem

Categories

Resources