[Q] restoring sms db not working via adb push - Samsung Galaxy Nexus

Hey guys,
I have been doing this for quiet a while i.e. whenever i install a new rom, I take these 4 files and backup them up like
Code:
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db-journal
adb pull /data/data/com.android.providers.telephony/databases/telephony.db
adb pull /data/data/com.android.providers.telephony/databases/telephony.db-journal
and then restore them as
Code:
adb push mmssms.db /data/data/com.android.providers.telephony/databases/
adb push mmssms.db-journal /data/data/com.android.providers.telephony/databases/
adb push telephony.db /data/data/com.android.providers.telephony/databases/
adb push telephony.db-journal /data/data/com.android.providers.telephony/databases/
It was working fine i.e. my all the previous SMS get restored. But last night when i tried this on 4.2.2 Official rom. It didn't work. the adb shell showed me that the file has been pushed (transferred byte etc information) but when i booted the phone and checked my sms, it was empty.
Can someone tell me whats going on here ?
P.S:
Don't ask why i am not using an app to backup and restore my sms. Long story. Right now i just want these files to replace my original files and restore my texts.

AW: [Q] restoring sms db not working via adb push
I hadn't the time to take a look at the update and the database layer. There is the possibility that Google changed the sqlite version or the schema of the mms database. If this would be the issue, restore through xmls is nearly the only way to solve it.
And you are sure that the database is valid and not corrupted?
Sent from my Nexus 7

-star- said:
I hadn't the time to take a look at the update and the database layer. There is the possibility that Google changed the sqlite version or the schema of the mms database. If this would be the issue, restore through xmls is nearly the only way to solve it.
And you are sure that the database is valid and not corrupted?
Sent from my Nexus 7
Click to expand...
Click to collapse
I haven't checked the databases yet since i didn't expect this to happen. I will spend time to compare the schema and perhaps some manual fix.
Meantime, are you aware of any utility which can export sms from mmssms.db to xml ?

so i did a little bit of google and some reading and finally i am able to restore my files. Probably the issue was with permissions. Here is what i do after copying files to the desired location
Code:
adb shell
cd /data/data/com.android.providers.telephony/databases/
chown 1001 mmssms.db
chown 1001 mmssms.db-journal
chown 1001 telephony.db-journal
chown 1001 telephony.db
chgrp 1001 mmssms.db
chgrp 1001 mmssms.db-journal
chgrp 1001 telephony.db-journal
chgrp 1001 telephony.db
chmod u=rw mmssms.db
chmod u=rw mmssms.db-journal
chmod u=rw telephony.db-journal
chmod u=rw telephony.db
chmod g=rw mmssms.db
chmod g=rw mmssms.db-journal
chmod g=rw telephony.db-journal
chmod g=rw telephony.db
chmod o= mmssms.db
chmod o= mmssms.db-journal
chmod o= telephony.db-journal
chmod o= telephony.db
reboot
Now the question is that I have never done this permission modification earlier. Why i have to do now ?

Thanks for above info, sorted my phone, for the record if you set the wrong permissions on those files it will put you in a boot loop (with CM9 at least). Phone starts up, Telephony force closes about 3 times then the device reboots.

Thanks heaps, fixed my problem too!!

Related

[Q] adb push file to /system -> no change [solved]

Hi,
I have a problem pushing a file to my Desire. ('file' is a placeholder)
Code:
$ adb remount
$ adb push file /system/etc/permissions/file
failed to copy 'file' to '/system/etc/permissions/file': Out of memory
My next thoght: oh, yeah - s-on... switching to recovery.
Code:
$ adb push file /system/etc/permissions/file
166 KB/s (1026 bytes in 0.006s)
Ok, seems to be fine. Rebooting, ls /system/etc/permissions/... what?! no 'file'.
So my problem is: when I push a file to /system/etc all seems to be fine until reboot, then the file isn't there. It's the same for overwriting and adding files.
You didn't mount the system partition the second time.
Code:
$ adb shell mount -w /system
Ok, thank you for your help. Why isn't there an error when I push a file to an unmounted filesystem?
Same situation here.
Can you make steps for me as a reference?
PLEASE HELP ME!!! /___\
ps. sorry for my bad english

[Q] Most installed apps gone [Insertcoin 1.0.8 Gingerbread]

I was trying to update to latest version of Google Maps modified by ownhere, running following in the terminal:
Code:
andreas-macbook-pro:platform-tools Andreas$ ./adb remount
remount succeeded
andreas-macbook-pro:platform-tools Andreas$ ./adb uninstall com.google.android.maps
Failure
andreas-macbook-pro:platform-tools Andreas$ ./adb uninstall maps
Failure
andreas-macbook-pro:platform-tools Andreas$ ./adb uninstall com.google.android.apps.maps
Success
Wrote the wrong package name first times, so uninstallation failed.
Time to push the apk to the phone:
Code:
andreas-macbook-pro:platform-tools Andreas$ ./adb push /Users/Andreas/Downloads/maps5.8.0-ownhere.apk /system/app
failed to copy '/Users/Andreas/Downloads/maps5.8.0-ownhere.apk' to '/system/app/maps5.8.0-ownhere.apk': Out of memory
andreas-macbook-pro:platform-tools Andreas$ ./adb push /Users/Andreas/Downloads/maps5.8.0-ownhere.apk /system/app
failed to copy '/Users/Andreas/Downloads/maps5.8.0-ownhere.apk' to '/system/app/maps5.8.0-ownhere.apk': Out of memory
andreas-macbook-pro:platform-tools Andreas$ ./adb push /Users/Andreas/Downloads/maps5.8.0-ownhere.apk /data/app
776 KB/s (9317013 bytes in 11.722s)
/system was almost full (3 MB free) and realized that maybe /system/app is not the correct location when using insertcoin, changing to /data/app where my installed apps were located according to the app Quick system info.
I tried to navigate to /data/app with Astro but it could not open that folder. Attempted to delete the file from /data/app using adb:
Code:
# pwd
/
# rm /data/app/maps5.8-ownhere-resign.apk
rm: can't stat '/data/app/maps5.8-ownhere-resign.apk': Not a directory
# rm ./data/app/maps5.8-ownhere-resign.apk
rm: can't stat './data/app/maps5.8-ownhere-resign.apk': Not a directory
# rm data/app/maps5.8-ownhere-resign.apk
rm: can't stat 'data/app/maps5.8-ownhere-resign.apk': Not a directory
Could not browse the /data/app directory either ("can't cd to app").
Astro crashed and kept crashing, so I rebooted the phone. Now, almost all of the apps that has been installed from the market were gone, and those on the home screens were displayed by generic android icons.
How can I get my apps back?
titanium backup or my backup root ??
if apps are still there, back them up, then do a factory reset and restore the backup
I got backups from when I first installed a custom ROM, but no daily fresh (didn't think updating google maps would mess up anything). All applications are still showing up under settings>applications>manage applications, most of them with gray generic android icons with a small SD card in the lower right corner.
Titanium is one of the apps that I cannot start anymore.

build.prop problem

I've been trying to edit my build.prop file for the past couple days and anytime I do anything at all to my build.prop file, my phone boots up with a black screen. I have no idea what I'm doing wrong.
1 method I've tried:
Code:
adb reboot recovery
adb shell mount /system or adb shell and then mount /system
adb pull /system/build.prop
I modify the line:
ro.sf.lcd_density=320 to be ro.sf.lcd_density=240
Code:
adb push build.prop /system/
Then I reboot and I get a blank screen after the Google logo.
Makes sure permissions to build.prop are correctly set after you push it to /system/. The permission should be 644. Simply run,
Code:
adb shell
chmod 644 /system/build.prop
after you've pushed the modified file over.
firefox360 said:
Makes sure permissions to build.prop are correctly set after you push it to /system/. The permission should be 644. Simply run,
Code:
adb shell
chmod 644 /system/build.prop
after you've pushed the modified file over.
Click to expand...
Click to collapse
Thank you very much. Seems it was just a permissions issue.

Restore SMS/MMS db through CWM?

Is it possible to backup the SMS app data (all texts/picture messages) on the stock rom (4.1.1 JellyBean) by just copying the data at /data/data/com.android.telephony/ ? And then to restore just copy these back after the reflash or data wipe through adb in CWM?
I'm trying to do this with as little app installs as possible, and also trying to learn where things are stored and in what format, etc.
Just in case anyone else was interested in this, you can do this. You need these files:
/data/data/com.android.providers.telephony/databases/mmssms.db and mmssms.db-journal, and then if you have any pictures in the threads you need to also copy the /data/data/com.android.providers.telephony/app_parts folder as well. Permissions for mmssms.db should be 660 with the owner and group = radio. mmssms.db-journal should have 600 permissions and same group and owner = radio.
dmarmstr said:
Just in case anyone else was interested in this, you can do this. You need these files:
/data/data/com.android.providers.telephony/databases/mmssms.db and mmssms.db-journal, and then if you have any pictures in the threads you need to also copy the /data/data/com.android.providers.telephony/app_parts folder as well. Permissions for mmssms.db should be 660 with the owner and group = radio. mmssms.db-journal should have 600 permissions and same group and owner = radio.
Click to expand...
Click to collapse
I'm pretty sure I followed these directions to a 'T', when I open messenger it's not showing any conversations. I did everything through a script and copied it out to "sdcard", then just copied everything back in when i got done flashing a new rom....pretty straight forward concept, idk....just no dice. I can even view the .db file I restored in sqlite and it looks like everything's legit. what might I be missing?
Did you set permissions and groups correctly? Can you do a screen shot of the adb output?
I have attached a screen shot of what the permissions and group/owner should look like.
Here are the steps that I needed to do to get this to work:
adb push mmssms.db /data/mytemp
adb push mmssms.db-journal /data/mytemp
adb shell
<inside shell now in CWM so you have root>
mv data/mytemp/* data/data/com.android.providers.telephony/databases
chmod 600 data/data/com.android.providers.telephony/databases/mmssms.db-journal
chmod 660 data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
chown radio data/data/com.android.providers.telephony/databases/mmssms.db
chown radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
rm -rf data/mytemp
Also, if you do have app_parts to move, you need to do the same, but the chmod should do this:
chmod 666 data/data/com.android.providers.telephony/app_parts/*
chgrp radio data/data/com.android.providers.telephony/app_parts/*
chown radio data/data/com.android.providers.telephony/app_parts/*
Help
dmarmstr said:
Did you set permissions and groups correctly? Can you do a screen shot of the adb output?
I have attached a screen shot of what the permissions and group/owner should look like.
Here are the steps that I needed to do to get this to work:
adb push mmssms.db /data/mytemp
adb push mmssms.db-journal /data/mytemp
adb shell
<inside shell now in CWM so you have root>
mv data/mytemp/* data/data/com.android.providers.telephony/databases
chmod 600 data/data/com.android.providers.telephony/databases/mmssms.db-journal
chmod 660 data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
chown radio data/data/com.android.providers.telephony/databases/mmssms.db
chown radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
rm -rf data/mytemp
Also, if you do have app_parts to move, you need to do the same, but the chmod should do this:
chmod 666 data/data/com.android.providers.telephony/app_parts/*
chgrp radio data/data/com.android.providers.telephony/app_parts/*
chown radio data/data/com.android.providers.telephony/app_parts/*
Click to expand...
Click to collapse
When i do these steps the message app just tells me that it stopped working and needs to quit. Any thoughts?
Hi, I have a quick question. I got this file or whatever as a group thing from a friend. Looks wierd to me since there are regular apps or regular group text msgs that can send pictures to a group of friends. I was told it was just to let me see the pics of him fishing with his buddies and all that other file stuff looks...well fishy to me lol. Is he trying to track me or something?

[MOD] Remove CarrierIQ

The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you haven't made your system writable you can use TWRP's file manager to delete the files.
This also removes HTC logging apps too.
Use a file Manager like Solid Explorer or Root Explorer and go to and delete the following (Make a backup of all if you want to OTA later):
/system/app
QXDM2SD.apk
QXDM2SD.odex
HtcResetNotify.apk
HtcResetNotify.odex
Htcloglevel.apk
Htcloglevel.odex
Smith.apk
Smith.odex
Udove.apk
Udove.odex
/system/priv-app
IQ-tmobile-release-signed.apk
IQ-tmobile-release-signed.odex
IQToggle.signed.apk
IQToggle.signed.odex
MyBreeze.apk
MyBreeze.odex
/system/lib
system/lib/libiq_service_tmobile_2.2.so
/data/data
com.carrieriq.tmobile
com.carrieriq.tmobile.IQToggle
You can use an app like https://play.google.com/store/apps/details?id=com.lookout.carrieriqdetector to check if CarrierIQ is gone (You can use it to check that it's there also).
Viper ROM has it removed
Sent from my HTC One_M8 using Tapatalk
Not everybody wants to flash a custom ROM.
Sent from my HTC One_M8 using Tapatalk
Thank you for posting this, I never knew about carrier iq until now.
Sent from my HTC One_M8 using Tapatalk
What's it for?
Nexus 7
fmedrano1977 said:
What's it for?
Nexus 7
Click to expand...
Click to collapse
http://en.wikipedia.org/wiki/CarrierIQ
Thank You!
SmiLey497 said:
The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you don't I think you can use TWRP's file manager to delete it.
Use a file Manager like Solid Explorer or Root Explorer and go to and delete the following:
/system/app
QXDM2SD.apk
QXDM2SD.odex
HtcResetNotify.apk
HtcResetNotify.odex
Htcloglevel.apk
Htcloglevel.odex
Smith.apk
Smith.odex
/system/priv-app
IQ-tmobile-release-signed.apk
IQ-tmobile-release-signed.odex
IQToggle.signed.apk
IQToggle.signed.odex
/system/lib
system/lib/libiq_service_tmobile_2.2.so
/data/data
com.carrieriq.tmobile
com.carrieriq.tmobile.IQToggle
You can use an app like https://play.google.com/store/apps/details?id=com.lookout.carrieriqdetector to check if it's gone (You can use it to check that it's there also).
Click to expand...
Click to collapse
Thank you! I was having trouble finding the iq it is much different from the lg g2 as I used system tuner to disable carrier iq and was having trouble doing the same on the m8! thanks again!
Technowhiteboi said:
Thank you! I was having trouble finding the iq it is much different from the lg g2 as I used system tuner to disable carrier iq and was having trouble doing the same on the m8! thanks again!
Click to expand...
Click to collapse
NP
Will this work if I don't remove the .odex files? I don't see the .odex files using solid explorer or fx file explorer root.
Love u smiley.U had a great contribution for the g2 now this.
---------- Post added at 03:34 PM ---------- Previous post was at 03:21 PM ----------
How do u like it m8 from the g2
erapmicks said:
Love u smiley.U had a great contribution for the g2 now this.
---------- Post added at 03:34 PM ---------- Previous post was at 03:21 PM ----------
How do u like it m8 from the g2
Click to expand...
Click to collapse
Been pretty good so far.
Thank you! I didn't have the ODEX files, but following your guide removed carrierIQ from my M8.
Worked for me
SmiLey497 said:
The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you haven't made your system writable you can use TWRP's file manager to delete the files...
Click to expand...
Click to collapse
Thanks for this guide. I was able to use it to remove CarrierIQ from the 4.4.3 T-Mobile version (used the RUU to get a fresh, stock setup first).
At first I tried just renaming the files (adding a "z" to the front of every name), but the phone still loaded some of the services even though the name was different. I ended up doing a chmod 0000 to all the files to stop them from loading.
I did everything from the TWRP file manager because I wanted to make sure I could reverse all my actions in case it failed to boot up.
Good stuff. Thanks OP!
I found I had to restore the CarrierIQ files in order to take an OTA update. To make it easier, I threw these together in order to enable and disable CarrierIQ easily...
It needs to run as root in a shell on the phone. The mount command makes the system partition writable. You should reboot after this for the changes to take effect (and for the system partition to go back to read only).
I take no responsibility. If you don't know what you are doing, don't use these.
Code:
# Disable CarrierIQ
mount -o rw,remount -t ext4 /dev/block/mmcblk0p45 /system
chmod 000 /system/app/HtcLogLevel.apk
chmod 000 /system/app/HtcLogLevel.odex
chmod 000 /system/app/HtcResetNotify.apk
chmod 000 /system/app/HtcResetNotify.odex
chmod 000 /system/app/QXDM2SD.apk
chmod 000 /system/app/QXDM2SD.odex
chmod 000 /system/app/Smith.apk
chmod 000 /system/app/Smith.odex
chmod 000 /system/app/UDove.apk
chmod 000 /system/app/UDove.odex
chmod 000 /system/priv-app/IQ-tmobile-release-unsigned.signed.apk
chmod 000 /system/priv-app/IQ-tmobile-release-unsigned.signed.odex
chmod 000 /system/priv-app/IQToggle_v1.1.3.signed.apk
chmod 000 /system/priv-app/IQToggle_v1.1.3.signed.odex
chmod 000 /system/priv-app/MyBreeze.apk
chmod 000 /system/priv-app/MyBreeze.odex
chmod 000 /system/lib/libiq_service_tmobile_2.2.so
chmod 000 /data/data/com.carrieriq.tmobile
chmod 000 /data/data/com.carrieriq.tmobile.IQToggle
Code:
# Enable CarrierIQ
mount -o rw,remount -t ext4 /dev/block/mmcblk0p45 /system
chmod 644 /system/app/HtcLogLevel.apk
chmod 644 /system/app/HtcLogLevel.odex
chmod 644 /system/app/HtcResetNotify.apk
chmod 644 /system/app/HtcResetNotify.odex
chmod 644 /system/app/QXDM2SD.apk
chmod 644 /system/app/QXDM2SD.odex
chmod 644 /system/app/Smith.apk
chmod 644 /system/app/Smith.odex
chmod 644 /system/app/UDove.apk
chmod 644 /system/app/UDove.odex
chmod 644 /system/priv-app/IQ-tmobile-release-unsigned.signed.apk
chmod 644 /system/priv-app/IQ-tmobile-release-unsigned.signed.odex
chmod 644 /system/priv-app/IQToggle_v1.1.3.signed.apk
chmod 644 /system/priv-app/IQToggle_v1.1.3.signed.odex
chmod 644 /system/priv-app/MyBreeze.apk
chmod 644 /system/priv-app/MyBreeze.odex
chmod 644 /system/lib/libiq_service_tmobile_2.2.so
chmod 644 /data/data/com.carrieriq.tmobile
chmod 644 /data/data/com.carrieriq.tmobile.IQToggle
So if I had busybox installed, I could run these as shell scripts from a root terminal on the phone? [Obviously I would chmod 744 or 755 them first.]
syntropic said:
So if I had busybox installed, I could run these as shell scripts from a root terminal on the phone? [Obviously I would chmod 744 or 755 them first.]
Click to expand...
Click to collapse
I believe that is correct. I'm pretty sure you will need to be S-off in order to write to the system partition.
I use ADB with a root prompt, so you will need to do a su command at the start if you are using this in a terminal.
FreydNot said:
I believe that is correct. I'm pretty sure you will need to be S-off in order to write to the system partition.
I use ADB with a root prompt, so you will need to do a su command at the start if you are using this in a terminal.
Click to expand...
Click to collapse
I would probably opt for using ADB as well, but it would be nice to set up two shortcuts on the desktop that execute these scripts. Something that would su - && run the script, and then back again.
But thanks a lot for sharing them!
anyone know where I can get these files back so I can apply the OTA updates? thanx
Hey... Strangely, I was about to run a bash script with all the chmod commands above. However, I decided to download a few Play store apps that detect it. Each app said I did not have it installed.
I checked the files in the list above and confirmed they were there. Anyone have any idea why CarrierIQ is not present?
About the only thing I have done outside of this which may affect it is that I had disabled the my-t-mobile app since it has that option to monitor your "experience". Since I wanted to avoid this, I just disabled the app.
Could this app be tied to CarrierIQ's functionality??
And then I found this:
http://support.t-mobile.com/docs/DOC-10849
Which seems to confirm my theory above. Of course, as cool as T-Mobile can be, I don't necessarily trust them.
But still, has anyone used an app that has alerted them to the presence of Carrier IQ, while also opting out of allowing T-Mobile to collect diagnostics (which is in the My T-Mobile or My Account app)?
Please let me know.

Categories

Resources