Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 Well, another success here thanks to zuccster. I used his sql to modify the telephony.db. I didn't use ssh though. I did it all on the phone using Android Terminal Emulator, which is free on the Market. Just open up Android Terminal Emulator and (as described by zuccster), type the following: # sqlite3 /data/data/com.android.providers.telephony/databases/telephony.db SQLite version 3.5.9 Enter ".help" for instructions sqlite> update carriers set current=1 where _id=131; sqlite> update carriers set current=null where _id=95; .quit That gets it working. My previous attempts to replace the telephony.db weren't successful - I reckon there is a cache somewhere on the phone of the db, so replacing the file won't update the cache. I haven't rebooted my phone yet to see if the changes are overwritten. We could probably stick the sql into an apk for people to run as an application, but this is just ignoring the underlying problem of how the database gets written in the first place. As pulser says, the MMS.apk would probably be able to tell us more.
Guest quincy456 Posted January 22, 2010 Report Posted January 22, 2010 this truly truly is excellent - the one thing that makes me sim swap into other phones is the mms failure issue - i'm on voda - gonna have a stab at this. thanks a million for your work so far!
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 (edited) I've put the commands into a script which is easier than typing the whole thing out. Just unzip the attached files to anywhere on your sd card, then navigate to them using the android terminal and type: sh apn_exec.sh The files attached in the zip are: "apn_sql_commands" --> This one contains the sql commands "apn_exec.sh" --> This is the one you run and which uses the previous file. A little bit of bad news though is that my settings also reverted back for some unknown reason (just like zuccster). But at least you can rewrite really quickly once the above files are on your sd card.apn_modify.zip Edited January 22, 2010 by le_lutin
Guest v0n Posted January 22, 2010 Report Posted January 22, 2010 Well, another success here thanks to zuccster. I used his sql to modify the telephony.db. I didn't use ssh though. I did it all on the phone using Android Terminal Emulator, which is free on the Market. Just open up Android Terminal Emulator and (as described by zuccster), type the following: # sqlite3 /data/data/com.android.providers.telephony/databases/telephony.db SQLite version 3.5.9 Enter ".help" for instructions sqlite> update carriers set current=1 where _id=131; sqlite> update carriers set current=null where _id=95; .quit That gets it working. My previous attempts to replace the telephony.db weren't successful - I reckon there is a cache somewhere on the phone of the db, so replacing the file won't update the cache. I haven't rebooted my phone yet to see if the changes are overwritten. We could probably stick the sql into an apk for people to run as an application, but this is just ignoring the underlying problem of how the database gets written in the first place. As pulser says, the MMS.apk would probably be able to tell us more. Lack of success here. Still can't retrieve MMS from O2 after changes to telephony.db. I use Modaco 1.7 U8230 vanilla.
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 Lack of success here. Still can't retrieve MMS from O2 after changes to telephony.db. I use Modaco 1.7 U8230 vanilla. I suppose it depends on whether the apn with id 131 is set up for MMS on your phone. When I was playing around I found that taking the battery out seemed to reset all my apns (they reverted to the ones that are automatically set up on the phone). After I did this I had four APNs listed, with the one called "o2 Pay monthly MMS" at the top and selected as the default. This selected APN is, in fact, already set up for MMS, it was also the one with id number 131 in my telephony db (after the battery-out reboot). If i were you, i'd delete all my apns, shut down the phone, take out the battery, put it back in and then boot. Then follow the procedure to modify the telephony.db
Guest quincy456 Posted January 22, 2010 Report Posted January 22, 2010 ok sorry it's probably obvious - but can anyone tell me how to "navigate to the sd card" in terminal? idiots step by step would be very much appreciated! i got better terminal emulator from the market when i open it i get: export PATH=/data/local/bin:$PATH $ $
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 ok sorry it's probably obvious - but can anyone tell me how to "navigate to the sd card" in terminal? idiots step by step would be very much appreciated! i got better terminal emulator from the market when i open it i get: export PATH=/data/local/bin:$PATH $ $ type "ls" (without quotes) to see what folder you are in and what the subfolders are in that folder. if you are at the root folder, "cd sdcard" should get you into the sdcard
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 (edited) Here is a very slightly modified script which will also show you the contents of telephony.db AFTER the script updates the database. Entry 131 should have a "1" at the end of it. Just to be clear, this script replaces the script I posted above.apn_modify.zip Edited January 22, 2010 by le_lutin
Guest zuccster Posted January 22, 2010 Report Posted January 22, 2010 Here is a very slightly modified script which will also show you the contents of telephony.db AFTER the script updates the database. Entry 131 should have a "1" at the end of it. Just to be clear, this script replaces the script I posted above. I'm wondering if there's any mileage in updating one of the existing O2 APN entries to have the correct values, then setting it as default? Then we wouldn't have to manually add a new one.
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 I'm wondering if there's any mileage in updating one of the existing O2 APN entries to have the correct values, then setting it as default? Then we wouldn't have to manually add a new one. The apn that I used was the default one. Delete all your apns, then take out your battery. When the phone starts up you will find new apns. The one that is selected by default works for internet and mms.
Guest zuccster Posted January 22, 2010 Report Posted January 22, 2010 The apn that I used was the default one. Delete all your apns, then take out your battery. When the phone starts up you will find new apns. The one that is selected by default works for internet and mms. Sorry, I meant carrier entry in the telephony.db, rather than APN
Guest le_lutin Posted January 22, 2010 Report Posted January 22, 2010 Sorry, I meant carrier entry in the telephony.db, rather than APN Sorry, I'm being a bit thick here, what do you mean?
Guest zuccster Posted January 23, 2010 Report Posted January 23, 2010 Sorry, I'm being a bit thick here, what do you mean? As I think you observed above, we've no need to add the new O2 Pay Monthly MMS APN that I suggested from the O2 Galaxy page via Settings ... -> APNs (which becomes entry 131 in telephony.db). Instead, we can just use SQL to update the existing O2 postpay APN that ships with the ROM update carriers set current=null where current=1; update carriers set user='o2wap',password='password',proxy='193.113.200.195',port='8080',mmsproxy='193.113.200.195',mmsport='8080',mmsc='http://mmsc.mms.o2.co.uk:8002',type=null,current=1 where name = 'o2 UK Postpay'; (For me, this needs to be the selected APN in Settings.. ->APNs or it fails.) So, we have MMS, *until* the T-Mobile setting is mysteriously restored I've observed default T-Mobile setting being restored in the telephony.db when: - I change from/to 2G/3G manually (and I suspect when it switches automatically between the two) - I change the selected APN in settings... ->APNs (nasty gotcha) So, tried deleting / renaming the 'T-Mobile UK' carrier entry - no dice. The restoration of default entry is obviously done on the mcc / mnc values, as if I switch those of the O2 entry for the T-Mobile UK values, it remains unmolested, but doesn't function. If I get time over the weekend I'll turn my attention to identifying what process is making the change.
Guest starkos Posted January 23, 2010 Report Posted January 23, 2010 Just wanted to say great work everyone and your efforts are appreciated :)
Guest quincy456 Posted January 23, 2010 Report Posted January 23, 2010 Yep seconded - thanks a million guys - mine works a treat using the first script (haven't tried the second) on Vodafone UK When it stopped working i was confused but if it is the 2g/3g thing - think i'll make it lock to 2g for now. Might all this be included in the next Vanilla ROM? After al those hours changing APNs and it still not work this it excellent!!
Guest pulser Posted January 23, 2010 Report Posted January 23, 2010 Sorry, not had enough time to read the whole thread again (I'm a Hero man, aka. a traitor on this board), but a skim through suggests people are still having the 'settings lost on reboot' issue. If this is resolved, please ignore this interruption. If not, how about 'de-imaging' boot.img, and modifying init.rc to run a shell script that re-does the changes. If someone can write a list of commands that does what you need (probably sqlite ones from what I've seen), and put it into a shell script, that could be popped into boot.img, marked as chmod +x to make it executable, and then init.rc could call it on each boot and re-set the settings to what you want. This all presumes that the setting is reset earlier in the boot process than init.rc is run. Otherwise, this won't work! And, this is not a 'clean' approach. You'd still be best to find the root cause of the issue and patch that, but this should give you a usable solution until then, presuming I've read correctly :)
Guest le_lutin Posted January 23, 2010 Report Posted January 23, 2010 Sorry, not had enough time to read the whole thread again (I'm a Hero man, aka. a traitor on this board), but a skim through suggests people are still having the 'settings lost on reboot' issue. If this is resolved, please ignore this interruption. If not, how about 'de-imaging' boot.img, and modifying init.rc to run a shell script that re-does the changes. If someone can write a list of commands that does what you need (probably sqlite ones from what I've seen), and put it into a shell script, that could be popped into boot.img, marked as chmod +x to make it executable, and then init.rc could call it on each boot and re-set the settings to what you want. This all presumes that the setting is reset earlier in the boot process than init.rc is run. Otherwise, this won't work! And, this is not a 'clean' approach. You'd still be best to find the root cause of the issue and patch that, but this should give you a usable solution until then, presuming I've read correctly :) Thanks for all the help guys. Found a few bits of code in the android source which I'll be looking into soon to see why the default keeps getting changed: (these may or may not be of use) http://209.85.229.132/search?q=cache:HSgf9...mp;client=opera http://gitorious.org/easyweb2/packages-app...pnSettings.java http://209.85.229.132/search?q=cache:KTWuf...mp;client=opera
Guest le_lutin Posted January 23, 2010 Report Posted January 23, 2010 Thanks for all the help guys. Found a few bits of code in the android source which I'll be looking into soon to see why the default keeps getting changed: (these may or may not be of use) http://209.85.229.132/search?q=cache:HSgf9...mp;client=opera http://gitorious.org/easyweb2/packages-app...pnSettings.java http://209.85.229.132/search?q=cache:KTWuf...mp;client=opera zuccster et al, Is there any way to get the debug output of the phone? Is there an equivalent of the log4j.xml file for android, where I could change the debug level? Also where is the debug file (if any)? Is ADB the only solution or is it possible to do this just on the device itself? There is an update method in the TelephonyProviders.java file (from the first link). I figure this is what is being called when our settings get overwritten. If i had a log file I could see which class is calling this method.
Guest zuccster Posted January 23, 2010 Report Posted January 23, 2010 zuccster et al, Is there any way to get the debug output of the phone? Is there an equivalent of the log4j.xml file for android, where I could change the debug level? Also where is the debug file (if any)? Is ADB the only solution or is it possible to do this just on the device itself? There is an update method in the TelephonyProviders.java file (from the first link). I figure this is what is being called when our settings get overwritten. If i had a log file I could see which class is calling this method. I don't know, I'm afraid. I've grepped file descriptors and found that the only process that has telephony.db open is "com.android.phone" I suspect something else is accessing it momentarily, but I'm struggling with the busybox shell at the moment. I'll keep trying
Guest zuccster Posted January 23, 2010 Report Posted January 23, 2010 Sorry, not had enough time to read the whole thread again (I'm a Hero man, aka. a traitor on this board), but a skim through suggests people are still having the 'settings lost on reboot' issue. If this is resolved, please ignore this interruption. If not, how about 'de-imaging' boot.img, and modifying init.rc to run a shell script that re-does the changes. If someone can write a list of commands that does what you need (probably sqlite ones from what I've seen), and put it into a shell script, that could be popped into boot.img, marked as chmod +x to make it executable, and then init.rc could call it on each boot and re-set the settings to what you want. This all presumes that the setting is reset earlier in the boot process than init.rc is run. Otherwise, this won't work! And, this is not a 'clean' approach. You'd still be best to find the root cause of the issue and patch that, but this should give you a usable solution until then, presuming I've read correctly :) Yeah, that makes sense, except the settings are reset not only at boot, but when moving between 2/3g networks :-(
Guest le_lutin Posted January 26, 2010 Report Posted January 26, 2010 As I think you observed above, we've no need to add the new O2 Pay Monthly MMS APN that I suggested from the O2 Galaxy page via Settings ... -> APNs (which becomes entry 131 in telephony.db). Instead, we can just use SQL to update the existing O2 postpay APN that ships with the ROM update carriers set current=null where current=1; update carriers set user='o2wap',password='password',proxy='193.113.200.195',port='8080',mmsproxy='193.113.200.195',mmsport='8080',mmsc='http://mmsc.mms.o2.co.uk:8002',type=null,current=1 where name = 'o2 UK Postpay'; (For me, this needs to be the selected APN in Settings.. ->APNs or it fails.) So, we have MMS, *until* the T-Mobile setting is mysteriously restored I've observed default T-Mobile setting being restored in the telephony.db when: - I change from/to 2G/3G manually (and I suspect when it switches automatically between the two) - I change the selected APN in settings... ->APNs (nasty gotcha) So, tried deleting / renaming the 'T-Mobile UK' carrier entry - no dice. The restoration of default entry is obviously done on the mcc / mnc values, as if I switch those of the O2 entry for the T-Mobile UK values, it remains unmolested, but doesn't function. If I get time over the weekend I'll turn my attention to identifying what process is making the change. I had a look at some of the source code and it did seem to support what you were saying about the restoration of the "current" carrier from the mcc/mnc values. BUT I just did a quick test and swapped round the mnc values for carrier 95 and 131 (T-Mobile and O2). update carriers set current=1 where _id=131; update carriers set current=null where _id=95; update carriers set mnc=30 where _id=131; update carriers set mnc=10 where _id=95; select * from carriers; .quit Executed this on the phone. Everything updates as it should. I send an MMS and it sends fine. I then switch from 2g to 3g and try to send an MMS --> it doesn't work. So I look into the telephony.db and find that the mnc swap that I did IS STILL THERE, but the default has changed back from 131 to 95. So basically what I'm saying is, if the "current" was updated based on mmc/mnc surely it shouldn't have updated the db in the above scenario? Correct me if i'm wrong zuccster (I probably am cos you know a lot more about this than I do!)
Guest jlgmax Posted January 26, 2010 Report Posted January 26, 2010 Ive been following this with great interest as the MMS problem is the achilies heel for the Pulse for me at the moment. Would it be possible to devise some kind of apk or batch file which we could run as a workaround ? I usually keep my phone locked to 2g to conserve battery life anyway and would not reboot very often, so an apk which I could run each time I need to re-enable MMS would be great until such time as someone can work out a permanent fix ! Is there any chance of one of you guys developing some kind of workaround apk like this or is it more difficult than that ? Cheers !
Guest le_lutin Posted January 26, 2010 Report Posted January 26, 2010 Woohoo! Got it working even when you change networks from 2g/3g! The key was to swap the "numeric" values of the apns in the telephony.db. I will look into making this into an apk, but if anyone has any experience in this they might be able to rustle up something very quickly (it's just sqlite statements with a java wrapper I think). Updated script attached. Please let me know if this works for you.o2_MMS_Fix.zip
Guest twe Posted January 26, 2010 Report Posted January 26, 2010 Woohoo! Got it working even when you change networks from 2g/3g! The key was to swap the "numeric" values of the apns in the telephony.db. I will look into making this into an apk, but if anyone has any experience in this they might be able to rustle up something very quickly (it's just sqlite statements with a java wrapper I think). Updated script attached. Please let me know if this works for you. Nice work, was wondering though would you need to make one for each provider [.apk]? i.e. I am on Vodafone.... thanks
Guest le_lutin Posted January 26, 2010 Report Posted January 26, 2010 Nice work, was wondering though would you need to make one for each provider [.apk]? i.e. I am on Vodafone.... thanks I think you would have one apk, but different options within it. Not sure. Does the script I made work for you?
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now