Someone with ROOT, request! - Hero CDMA General

Hi, odd request but can someone with a rooted CDMA hero perform the following and send me the settings.db that you get
adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
Hope someone can help!
Thanks

Unfortunately, I'm stuck at work and I can't do it for you now. I'm sure by the time I get home you'll have found someone. If not I'll do it later. Unfortunately, I won't be home until 1am.

Out of curiosity what exactly do you need this file for? What are you trying to do/hack?

H:\android-sdk-windows\tools>adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
1248 KB/s (39936 bytes in 0.031s)
H:\android-sdk-windows\tools>
sprint pcs

Yeah, why do you need this? I just pulled it off my phone to see what was in it, and while I don't see anything that's obviously personal information, one of the tables does contain something called "google_login_public_key" which a quick search suggests is used for encrypting other personal information and passwords.
I would recommend NOT sending this file to anyone unless you know exactly what you're handing over. I'm certainly not suggesting malevolence, but I'm not really sure what a person could do with this information.
If you have some specific question about the structure of the database, why don't you just ask that?

For anyone wondering, this is what would be contained in that.
http://developer.android.com/reference/android/provider/Settings.System.html

Opps I didn't think there was anything personal in it!
Its just a file with all the system settings in it.
The reason I want it is because my app (proximity sensor, in the themes and apps subforum here) doesn't work on CDMA heros unless auto backlight is on. But works all the time on GSM heros (which I have)
So I am working on a fix which turns the autobacklight on when the program starts, then off again when it exits. To do this I need to know what HTC called the auto backlight setting, which is in settings.db
I have my settings.db and found the correct name, made the changes and it toggles autobacklight for me perfectly, however when I sent it to a user with a CDMA hero it didn't! So I am thinking the name used is different for some reason.
Hope all this makes sence!
Thanks
Tom Reay

I'm not sure if this is exactly what you're looking for, but the creation string for the "system" table is:
CREATE TABLE system (_id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT UNIQUE ON CONFLICT REPLACE,value TEXT);
and the auto-backlight entry is:
_id,name,value
4364,screen_auto,1
Obviously, the 1 means auto-backlight is on right now. However, when I turn auto-backlight off, that entry disappears from the table.
Is that different from the gsm hero?
Like I said before, I'm not totally sure what the "google_login_public_key" (in the "gservices" table) does. And a further look shows hex values for logging_id, logging_id2, and android_id in the "secure" table, and digest in the "htcservices" table. I'm not sure if any of this is personal info.

Thanks, thats really helpful,
On the GSM hero it is screen_brightness_mode , which if set to 1 enables auto backlight, 0 disables
If this setting on the CDMA Hero? The GSM does not have screen_auto
I found this by opening settings.db in notepad and using ctrl+f!
Thanks for the help!

This is so frustrating!
Setting screen_auto to 1 with System.Settings.putInt(1, "screen_auto") does work, but only once you go to menu->setings->sound and display, then it kicks in and works.
Anyone got any insight into this? I don't understand why HTC would change this!

I am not 100% sure of the inner workings, but it sounds like their may be a trigger in that when you go to the screen it re-reads those settings. Probably can't watch what it does their with a debug can you? You would have to figure out how to mimic going into that screen and throwing what ever trigger it does to re-read that setting or reset it.

Related

Idea for a small but useful app... suggestions?

I'm fairly certain this is a simple app to build, but I've got some questions I'm hoping some folks in the forum here can help me with!
Basically, I need an app that can toggle the roaming settings for my device.
The Reason:
In a nutshell, I work in a poor reception area where I need to roam on another network to get good coverage.
On the Titan (CDMA device), I get very poor battery life and dropped calls when it keeps trying to switch back to the barely visible home network. I can help keep the signal and save battery while I'm at work if I first set the service to "roaming only" when I'm there.
Problem is, switching from "automatic" and "roaming only" and back again is a very tedious process, buried under many menus and clicks.
To illustrate, I have to click Start, settings, phone, services, roaming, get settings, roaming only. Why it takes so many clicks and menus is a mystery to me, but that's the only way I've seen to do this. Even worse, some of these clicks take a couple of seconds to register before going on to the next screen, which makes this whole process take a few moments each time.
The Object:
I'd like to have an app that will toggle these settings so that all those menus and clicks aren't necessary. Then, one could even map this app to a hardware button for the ultimate ease of use!
The problem is that I don't know how to write a program that accesses that kind of internal phone information. Is this sort of stuff (roaming, forwarding, etc) even available to a developer?
Does anyone have any reference resources or tips/opinions they could share with me?
Thanks!
:bump: no one?
I dont think there is much that can be done in this regard programmatically..I'd look around a bit, but dont keep much hopes..
the best possible solution for u would be to use mortscript (free), which can simmulate all those clicks and menus, and will surely provide u the same effect..
mortscript is quite easy to pickup even if u r a non-programmer and if u have had even the most basic classes of any programming language then it'll be a breeze for u..
I think you want to look at RIL_SetRoamingMode and RIL_GetRoamingMode.
There are three options:
Value Description
RIL_ROAMMODE_HOMEONLY
The user is restricted to the home network. The user does not roam.
RIL_ROAMMODE_AUTOMATICA
Network defined. The effect of this setting is carrier dependent.
RIL_ROAMMODE_AUTOMATICB
Network defined. The effect of this setting is carrier dependent.
AUTOMATICA or AUTOMATICB may be the roam only setting as defined by Sprint, I would set the phone to roaming only then call RIL_GetRoamingMode and see what the return value is.
There may be other ways to do this, this is just the first I've found and I'm at work so I can't test this out.
Dishe has a CDMA device. I dunno whether the same RIL functions are there for CDMA as well as GSM. So far I've seen hdr files and dlls for gsm ril's only, but that might be cuz I never looked around for CDMA ones
shantzg001 said:
Dishe has a CDMA device. I dunno whether the same RIL functions are there for CDMA as well as GSM. So far I've seen hdr files and dlls for gsm ril's only, but that might be cuz I never looked around for CDMA ones
Click to expand...
Click to collapse
http://msdn2.microsoft.com/en-us/library/aa919907.aspx
"This function retrieves the CDMA roaming mode."
cool, I'm actually away for the weekend now (responding from my device), but thanks for all the helpful responses!
vinny75, I'm going to look into that when I get back and report back what I see.
Until I'm able to determine what changes internally when roaming settings are toggled, I guess I'll have to settle with something like MortScript as shantzg001 suggested for now.
MortScript is a great automation tool, I've never really played with it before! However I'd still rather have a standalone app that can determine which state is currently active, and toggle it.
In other words, with mortscript, I need to have 2 apps- a "roaming only" app, and then a "automatic" app. Ideally, I'd want one program that could detect the current setting, and switch to the other. This way, it could be mapped to a button, etc...
But I'll have to settle with what I have for now. Unless I'm missing something, you can't have mortscript toggle something that detailed, can you?
I'm new, still figuring out how to calculate x,y for mouse clicks...
Any suggestions would be welcome!
I take it those functions didn't work?
looks like its for embedded CE, and not for Windows Mobile...
I could play with it some more, but in the mean time a simple script might be my only option...
Dishe said:
looks like its for embedded CE, and not for Windows Mobile...
I could play with it some more, but in the mean time a simple script might be my only option...
Click to expand...
Click to collapse
Well you could always have mortscript alternate the mode it changes to by writing to a file "Roaming" or "Not Roaming" or something to that effect so the most you would have to do is click the button twice instead of once yes?

nombCrypt - beta

Hello Everyone,
I just got my 8525 in the mail yesterday and upgraded the boot loader, radio, and WM6. I had a little trouble but in the end, all that I can't get working right is the internet for Cingular. I really appreciate all the hard work everyone puts into this. Here is my thank you, this is my first app so go easy on me.
nomb
nombCrypt
nombCrypt is an encryption program I originally made for the desktop but then decide to port it over. It uses a password you provide and encrypts either a block of text or files using 256bit Rijndael (AES). This level of encryption was given the ok to encrypt Top Secret documents. It can of course decrypt as well. This is for Windows Mobile 6. Please enjoy and every developer of course likes to get back feedback.
Planned/Requested Improvements
Truecrypt like encrypted containers
Implement Encrypted Backups (P)
Get File Encrypt Status Bar Working (P/R) <-- I'm dreading writing the working class :'(
Use Device ID As Salt Option (P)
Randomize Salt More (P)
Add More Encryption Algorithms (P)
Change File Open Dialog To Open Less (R) completed - now initially looks for *.nen (nombCrypt Enc. Files)
Encryption Password Confirmation (R) completed
Clipboard Paste Button (R) completed
Clipboard Clear Button (R) completed
Take Off Start Menu Icon (R) completed
Change Icon (R) completed
Add Exit To The Menu (R) completed
Add Time Out Feature (R) completed - (see page two for details)
Integrate nombCrypt Into WM6 More (P)
I. Encrypt MS Certificate Store (R)
Other Fixes
Improved Text Encryption So The End TextBox Is Opened Less
Added file error checking to the file decryption process
Two screenshots and the cab file are attached.
I hope you guys enjoy...
nomb
Hey! I wanted to do the same thing too! Just that I use my own XOR method (One Time Pad-like) instead. Of all the thing, it works alright, except that I can't get it to do a Copy-Paste. (see here http://forum.xda-developers.com/showthread.php?t=321014)
Also, from what it seems, I would presume that (since you uses AES), the end result would be in 'relatively' binary format (right?), which may not be very program friendly.
I was going to do about the same thing, except that I'll have my end result Base64 encoded, such that I can have them pasted to Notes and have it sycned to outlook. And I have my PC based software to do the job there (if required).
Previously, I used a software called Ccrryyppttoo, which did quite alright, but it seems that my PC is doing some coding, when synced, that makes it goes funny (i.e. cannot be decrypted anymore).
I'll PM you a demo of what I did (in Java web), of which I intended to do it in PPC
With Rijnael the resulting encrypted string/file gets encoded into base64 as well because if it didn't, all the characters wouldn't be represented. You can paste this into notes just fine.
Mine is programmed in c# so there is a clipboard function which works relatively well. If you'd like to help with this your more than welcome to. Or if you want to join your project with mine that would be cool too. I plan to support all major and a lot of minor encryption algorithms that I can find. Plus people were complaining about how the encrypted backup on the ppc should use the device id to encrypt instead of the randomly generated key so I plan to implement that as well.
I'm looking forward to seeing your demo.
nomb
Hmm.. so it is b64 encoded.. niicceee. Hmmm. . I should try out C# soon.
Anyway, there is a suggestion, I'm not sure if you have the library for it. After my symmetric cipher program, I'm in thinking about a asymmetric-public-private key cipher, which people can exchange short messages in secret (e.g. via email, IM, SMS) without the need to exchange the key/password. It is relatively done now, I'll show you the web base version once it is done. It runs on the Java security class, which I'm not sure if C# has those library or not.
The idea is, Alice go to my page, generate a pair of keys. Alice then send Bob her pub key. Bob use pub key, go to my page, encrypt the message. Send it to Alice. Alice decrypt message at my page. No software to install, no secret key exchanged.
Yup c# has the ability to do that built into its cryptography namespace.
That is a cool idea, but instead of having Alice send the key to him. You should just make a db to keep track of the keys and then have him answer a question about Alice or something like that to use the pub key. that way thats even one less step they have to worry about. Or have Alice put in his email address and have your site auto email him the pub key. That would be good too.
But sweet idea, maybe I'll make my program talk to your site.
Have you tried mine yet?
nomb
I dont like the "answer a question" method, as in that case, you might as well use the answer as the password?
Anyway, the emailing the pub key is an idea
I'm not in my own PC yet, can't send it to my phone from this PC. Will try it out later tonight.
hanmin said:
I dont like the "answer a question" method, as in that case, you might as well use the answer as the password?
Click to expand...
Click to collapse
Ya I'm at work and was hungry so I wasn't thinking strait. I don't like that idea either. ^^
I think my next step in mine is to build the background worker class to update the progress bar when you encrypt/decrypt a file.
If you just point your phone to the cab above it will install it for you. You don't need a comp unless u don't have a dataplan.
nomb
I dont have data in my plan.. although O2 gives me 1MB+ a month free.. I'm not using it.
Anyway, I've tested your software, a few comments.
Slightly major problems:
[1] It is not wise to do a 'All folders' and 'All Files' upon browsing (for file to be de/encrypt). People (e.g. me) has gazillion files around and it may take ages to load the list.
[2] You may want to pop up a Window, asking the user to confirm his/her password upon encryption (one of the thing I intended to add on mine )
[3] I'm not able to paste any data onto the 'start text' area. E.g., I have encrypted my stuff, saved it into Notes. Later, I wanted to get it back, I copy the encrypted code from my Notes, and no way of pasting it into the 'Start text'
[4] You already knew this, but, good to have some kind of progress bar to indicate the progress
[5] Hmmm.. on the browsing, there doesn't seems to have a way to find files on my Storage Card's root directory
[6] For security reason, probably it is good for you to add a 'Clear Clipboard' button?
Minor:
[1] I find it annoying that once I had the software installed, it is on my Start menu
[2] You could use a better icon, I just see a black square on my not so bright screen. I can help you on this.
[3] Add an "Exit" on the menus below?
Other possible suggestions:
[1] Have a time out on your software, such that, e.g. if there is no activity on software after a certain amount of time, it will do one/some/all of these (a) close itself (b) clear the password, input, output (c) clear the clipboard
Good suggestions, I'll have those done by tomorrow. I can't play with the storage card aspect yet because I don't have one. :'( Soon though I'm hoping to get a 4gb. And ya, i can't make icons worth any.
Oh, to past it back I always did ctrl+v from the keyboard. But I'll throw a button up there to do that. And I'll make sure to take it off of the start menu.
1 good comment would have been nice. Altho criticism is good.
nomb
Haha.. sorry for the lack of good comments, I was trying to think of something to suggest. But come to think of it my post on top are good comments (e.g. niiiiccceee Base 64 encoded), and the fact that it has the simple string->string encryption.
I did googling a bit, and found these
http://www.entity.cc/ICONS/security-icons.php
http://www.hscripts.com/freeimages/icons/computer/lock-icon.php
http://icons.qarchive.org/
which you may want to use as your icons?
Ya I was just teasing you. The icon I have now I got off of your last link at somepoint I just don't remember when. But I think I will probably use one of the others. But ya, I'll work on those fixes and then attach the updated program. Then once I get those fixes done, I'll work on adding the differnt encryption algorithms and the encrypted backups.
nomb
Did you wrote any backup software before for the PPC? I'm not really sure, but it seems that backup-ing can have a lot of issues. You have the "Copy everything" backup, the PIM only backup, etc. Some backups are ROM-flashing/upgrading friendly, some are not. You can have a backup software all standalone by itself. I would recommend you to have the backup software seperated and have encryption onto it as a plugin. Take a look at PIM-backup, it is very popular here.
Hi,
This is a very interesting thread. Thanks for your efforts so far (is there a donation link anywhere?)
A basic question...I understood that to carry out really secure encryption it would be necessary to write a filter driver that worked within the core ROM Image. Is this not the case?
Can I encrypt the MS certificate store too? The crypto protection on this store could be beefed up...
Once again I am very pleased that this thread has appeared and will be testing your software with interest,
Well done for your work so far,
Sam.
Hey there PianoSam,
First I just want to make it clear I'm not doing this to make money. If anyone donates I want it to be because they like the software. I am at work so PayPal is blocked but I'll put my donation link on the front page later today.
Also, I am going to try and incorporate the encryption as much as possible. If that is a feature you'd like, then after I get all of the previously requested changes done, I'll start on that for you.
And thank you for your kind words.
nomb
***EDITED***
Sorry I didn't answer you question at first.
Question: A basic question...I understood that to carry out really secure encryption it would be necessary to write a filter driver that worked within the core ROM Image. Is this not the case?
Answer: I pondered over this for a little while and I can't think of a reason this would be necessary. However, I've only had my phone for two days. Can you find where you saw that so I can read it as well and maybe gather a little bit on information so I can do some research on the topic? If thats what needs to be done then thats what I'll do but I can't see why. Let me know!
Added another cab with all the fixes I've completed.
nombCrypt-beta.cab <-- On the front page.
I added the donate link.
I added the timeout feature and thought I would make a comment on it.
It is a two minute timeout. Whenever you fucos on a textbox the timer is stopped and when the textbox looses focus, the timer is on. The downside to this is if you were in the middle of typing and set your device down, it wont timeout. I could make it so when you start typing into the textbox it restarts the two minutes and you have two minutes to complete your message but I didn't know if that was a good idea or not.
Also, when you copy, and go to another program to paste it in, you have two minutes before the clipboard is cleared and the program shutdown.
When the encryption program is encrypting something, the timeout is not running. It starts afterwards.
I can tweak this as much as you guys would like, just let me know.
nomb
I've tested your Beta.. niiiiiccceeeeee.. it is gooood. Almost prefect. Few things (OH NO! )
- The "Clear" button doesn't seems to be working. It is suppose to clear the clipboard only? Should you clear off everything as well?
Other requests/suggestion
<rant>
- I'm not sure why I thought I need it.. but it would be good to have a copy function for the "End Text" as well. I thought I may need it one day. Not sure why. It ought to make the screen a bit crowded, I thought.
Anyway, slightly related to the suggestion above, I've just revisited the design I made on my copy-paste-failed PPC attempt, I have this idea which I thought you might want to use it. For my design, I do not have "Start Text" and "End Text", I only have ONE TextField "Message" (and another for the password). The user enter the encrypted/plain text on this "Message". Click on the button "Encrypt" or "Decrypt", the result will then overwrite whatever that is in "Message" TextField.
Example:
(1) "Message"=<plain text>. User key in password, click "Encrypt", "Message"=<encrypted text>.
(2) "Message"=<encrypted text>. User key in password, click "Dencrypt", "Message"=<plain text>.
In such cases, you only need a pair of copy-paste to perform copy-paste on both (in a way) encrypted and plain text.
</rant>
As for the time out issue, I thought the typing-sensitive time out would be a better choice. The moment that you are worried about your data being seen is when you are away from your phone. You can have focus on your TextField but you can be million miles away from your phone. But, you ought to be around to be typing stuff, right?
BTW, I'm also wondering on the working of this time out feature. I thought there ought to be a 'clock' running and when time's up, it will clear the stuff needed to be cleared, right? So, if I were to forget to switch off the application, the timer will not be another running software that drain my battery, right?
Good work.
hanmin said:
- The "Clear" button doesn't seems to be working. It is suppose to clear the clipboard only? Should you clear off everything as well?
Click to expand...
Click to collapse
The "clear" button is in the clipboard row, i think i tagged it on the left, and only clears the clipboard. If you go to menu->reset it will clear everything like your looking for.
hanmin said:
- I'm not sure why I thought I need it.. but it would be good to have a copy function for the "End Text" as well. I thought I may need it one day. Not sure why. It ought to make the screen a bit crowded, I thought.
Click to expand...
Click to collapse
The "Copy" button copies the end text to the clipboard. Not the start text.
hanmin said:
Anyway, slightly related to the suggestion above, I've just revisited the design I made on my copy-paste-failed PPC attempt, I have this idea which I thought you might want to use it. For my design, I do not have "Start Text" and "End Text", I only have ONE TextField "Message" (and another for the password). The user enter the encrypted/plain text on this "Message". Click on the button "Encrypt" or "Decrypt", the result will then overwrite whatever that is in "Message" TextField.
Click to expand...
Click to collapse
I originally had it setup this way, however there was a time when I had wrote a huge paragraph in it and encrypted it, and then found out I had forgot a line. I switched it so this wont happen.
hanmin said:
As for the time out issue, I thought the typing-sensitive time out would be a better choice. The moment that you are worried about your data being seen is when you are away from your phone. You can have focus on your TextField but you can be million miles away from your phone. But, you ought to be around to be typing stuff, right?
Click to expand...
Click to collapse
The timeout I have running in it now, (new version that isn't up yet), is completely off of the user's actions. Whenever you do anything in the program the timer resets. Except for encrypting/decrypting. The timer is off for those functions incase you encrypt a file that takes longer.
hanmin said:
BTW, I'm also wondering on the working of this time out feature. I thought there ought to be a 'clock' running and when time's up, it will clear the stuff needed to be cleared, right? So, if I were to forget to switch off the application, the timer will not be another running software that drain my battery, right?
Click to expand...
Click to collapse
The timeout feature does not clear everything in the program. I have it so it actually completely closes the program. So if you forget to close it and walk away, the program will end so it doesn't drain your battery.
hanmin said:
Good work.
Click to expand...
Click to collapse
Thanks, wait till you see the next version...
nomb
I got the progressbar working for encryption, now for decryption.

Identifying symlink to avoid "infinite" loop when browsing files.

Hi,
I have tested this behaviour on both a N1 and the emulator. Could anyone tell me if that is a problem? How can I avoid the recursive code going forever? What is happening?
If you use any file browser/manager and starting going into /sys/devices/w1 bus master/subsystem/devices/w1 bus master/subsystem it will go inner forever, repeating that pattern devices/w1 bus master/subsystem/ all the way.
So when I run a recursive search it keeps going deeper and deeper and seems never to finish.
What is happening, how to avoid this behaviour?
I tried different file managers and they all seem to be going forever into these folders, although when I do a search through Astro it doesn't seem to get stuck with this loop (It seems to ignore the /sys folder, but I am not sure if this happens also in any other folder).
Some people point me this problem can be related to symlinks, but I didn't find a way of checking for those symbolic links with Android's Java.
I know it can be done (as proved by Astro file manager), I just don't know how.
Hopefully it won't involve any call to functions which I'll have to create using NDK, which would be a pain.
Regards.
astro goes infinite for me on an N1
I think any app needs to do some extra checks instead of following stuff down.
eg the "find" command has the "-follow" option
open a terminal or use "adb shell" and "cd /sys/bus"
now type in "find" and it will display all the files directories and symlinks without following them
now type in "find -follow" - you will need to press Control-C to get out, you will see that each line has an error "too many symlinks" - kernel has protection/limit for symlink levels.
writers of file managers could easily fix this, but you have to ask what you were doing in their anyway?
Lol, I was trying to find some info to address this problem under Android & found a relevant thread I thought might help, only to discover it was you (jfbaro) having this conversation on another forum
Specifically, this thread on anddev.org.
I don't know Android yet, but a getCanonicalPath() like call is always going to be at the heart of spotting in advance & avoiding this type of problem, whatever your environment & language. If it doesn't work either the function is broken or you're making a mistake somewhere, I'm fairly sure.
In the above thread you say this doesn't help you. Can you post what getCanonicalPath returns for both /sys/device/subsystem/ & /sys/device/subsystem/sys/ ?
Let's assume you start your traverse at / & have reached /sys/device/subsystem/. When you check to see if it's safe to follow /sys/device/subsystem/sys you should discover that the latter is actually /sys, and that further, it is in your list of already scanned directories, hence you do not search further down that branch.
Where is this breaking down?
[Edit:] You might also find something of use buried in this bug thread which involves similar issues. Funnily enough it concerns Eclipse, but all that matters is that it's a Java based example of the problem. From a quick scan, getCanonicalPath again seems to be the solution though I think they avoid any performance hit by only using it on files known to be sym-links.

[Q] Debugging help needed

I have a user of my app who is having a problem running it. My code launches another activity in the same app, and he is saying it is stopping before it should & returning to the previous activity, and he doesn't see any Force Close warnings.
I have run my code in the emulator & on my phone, I can't reproduce the error. We both run Android 2.2 on our phones, his is an HTC EVO & mine is a HTC Wildfire, as far as I can tell his specs are better than mine so shouldn't cause an issue - I deliberately chose a low spec for for my dev work so the code ought to run on anything.
As a bit of an Andoid dev noob (but been coding for years), is there any easy way I can make a special build of the app to send to him that would log any errors that happen ? I'd like to get a stack dump as well if possible, as I'm not sure exactly what routine in the activity its crashing out in. The activity that crashes is Gallery with 9 images in it, he can't flick through them or select one. I'm stumped as to whats causing it, any assistance would be gratefully received.
Thanks.
Why not point to your app and let others here try it on their phones? It could simply be other apps installed on his phone interfering with your app.
Long time programmer here too and when I get to where you're at (and I"m sure you've put some hours into this LOL), I go back to STEP 1.
I comment-out any and all code but the bare minimum; break it down to the Intent, startActivity and maybe a Toast message in the second activity. Even parse down your XML files to bare minimum.
See if that works. Then, ADD BACK ONE LINE OF CODE AT A TIME Run program and make sure it works. Yeah, it's painful, but in my 20 years of coding, I've learned to put my pride aside and to not "pretend" all the code I've written is correct.
Sometimes on bigger projects, I"ll change or add a couple of lines of code, run a back up and test. Rinse and repeat LOL. That way, I know I"m only a couple of lines of code from what "used" to work.
Good Luck!
Thanks both of you.
old_dude - Its a paid app. Only £0.99 but I don't think people would pay to help me. There is a free version of the same app (with less functionality) that this guy can get to work. If your really interested the 2 versions are -
Plink Log - Free Version
Plink Log Pro - Paid version
Rootstonian - agreed thats the approach I'd normally take if I was having problems on my dev phone or the emulator. The problem is that its OK on my HTC Wildfire/Android2.2 but on this guys HTC EVO/Android2.2 its having problems. I dont really want to keep sending him .apks with 1 or 2 lines extra enabled just to see if that fixes his specific issue. I was hoping there was something I could code to catch whatever crashes the activity & log it somewhere for me to analyse. When I do PC dev work, I have a global exception handler that catches anything I dont explicitly handle, and dumps the full call stack into a Log File I can read later.
I think I'll just have to take the existing app & put loads of debug code into it to save messages into a log file & see what bits of code are being called & what isn't & then get him to email me the results.
Thanks for the ideas guys, its always useful to get input from another perspective.
Dave
Hmmmm, just discovered setDefaultUncaughtExceptionHandler - might be able to use that with printStackTrace. Sounds interesting.

getting data off of broken G1/Dream [rooted]

I have a broken G1, the screen is shot, and something else is screwed up, because it won't process anything. Once it boots it shows the background for a moment, then the lock screen comes on, but without a background. Then it looses all functionality. I can't get it to do anything. However, what's interesting, is that if I get an incoming call, I can answer using the button (not screen), and talk normally. Anyway, I want to know if there is a way, probably using ADB to get all my contacts minimally (since they're not all sync'd w/ Google), but ideally I would like to make a system image from it and run it in one of the emulators (Eclipse, Spring Source or Android SDK is what I have installed now). Any help would be awesome. There are also a few nandroid backups that I could use somehow, but they are a little old.
As far as I know, contacts data is stored in a sqlite-database which is located on /data. As long as you can connect with adb to your phone, you can copy that database to your pc and analyze it using sqlite3.
In this article you can find some additional information. It's a bit old, but still valid and at least it can give you a hint.
If you cannot access to your phone using adb, you can also extract the contacts.db from your latest nandroid backup. You can use unyaffs or mount your image on a linux system as yaffs file system and extract the file(s) you want. Then you can use again sqlite3 to extract the contacts data.
The same way, you can extract other data. It's enough to concentrate on the /data partition of the G1. As long as adb is running, you can copy them to your local PC, if not, you need to extract them from your latest nandroid backup in the same way I described above.
there is an awesome application called droid explorer (i forget the developers name) that you can download free to your pc (probably mac too) if you have usb debugging turned on then all you have to do is plug your phone into pc via usb.
when your phone comes up you have all the options you need here plus more!
seriously i recommend it to everyone. i use it at work sometimes to access my phone without getting caught, it has a great screen-cast function (a bit laggy)
if you dont have usb debugging turned on then look in the forum how to do it via adb. if you cant find droid explorer let me know and i can put it in my dropbox.
another option is get a used g1 from ebay and swap motherboards. or just fix your screen or whatever the problem is
Ok... So I did a little snooping via adb, and fortunately I did leave usb debugging on, so that's a plus. Now there were 2 things that I've tried pulling:
/data/data/com.android.contacts
and
/data/data/com.android.providers.contacts
Unfortunately, these both just gave me .xml files that only had a few lines of code, none of which included contacts or any kind of useful info.
@AndDiSa: I'm going to read the linked article now, but currently I don't have anything useful from /data. Any tips on how I would go about extracting the contacts.db? Articles or links are always great!
@demkantor: I will check that out. Since I don't really know how messed up the phone is, I don't know how useful droid explorer will be, but it sounds like a good utility anyway.
I don't really feel like getting parts for my phone. It's already waaaay behind the curve, and while it's a super fun phone to mess around with, I think it's time to move to something new (like the Droid 1 that I got as a toy phone/media player since I don't have verizon).
Anyway, further help appreciated!
(Oh, and I have to replace the digitizer for my Droid. LOL)
I am not on my PC at the moment, but try to look for
/data/com.android.providers.contacts/databases/contacts2.db
at least in GB this should be the right file or do a
find /data -name "cont*db" -print
in adb shell to look for it.
Sent from my Gingerbread on Dream using XDA App
I'll check it out tomorrow and let you know how it goes. Thanks!
OK! Good news. I found the contacts2.db and was able to pull it. I got SQLite3.exe and started messing around with it. Now what I tried from the link didn't work, as I couldn't get the .db file imported, and don't really know how to declare that as the target of commands. Using the .tables or .databases commands didn't get any results either. .databases just said something like 0-Main and 9-local or something. Do you know how to pull this part off? Hope to hear back soon.
Thanks,
kyle_engineer
Didn't try to use sqlite3 on windows yet, on the phone, you need to do
sqlite3 contacts2.db
> .dump
and you will get all content of the database dumped as sql statements.
Sent from my Gingerbread on Dream using XDA App
Awesome man!!! the .dump worked and I was able to actually get a table output on the screen. Now I just need ot know how to make that something printable (ideally), and I need to try it with my actual G1, not my Droid1... I'll thank you tomorrow when it's done.
Ugh!
So I've been able to correctly import a .db from my droid 1 and get it properly printed on the screen using sqlite3. That worked fine. Now I've pulled the .db from my G1 (which has the needed contacts), and I can't get it to print correctly. Here is what I'm dealing with...
Code:
SQLite3 version 3.7.20
Enter ".help? for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
_sync_state settings
_sync_state_metadata status_updates
accounts v1_settings
activities view_contacts
agg_exceptions view_contacts_restricted
android_metadata view_data
calls view_data_restricted
contact_entities_view view_groups
contact_entities_view_restricted view_raw_contacts
contacts view_raw_contacts_restricted
data view_v1_contact_methods
groups view_v1_extensions
mimetypes view_v1_group_membership
name_lookup view_v1_groups
nickname_lookup view_v1_organizations
packages view_v1_people
phone_lookup view_v1_phones
properties view_v1_photos
raw_contacts
sqlite>
From here, no matter what I try to use the .schema and "select * from XXXX" on, I don't get any user friendly table like I did with the other .db file... could something be messed up with this .db?
Please let me know when you get a chance.
Thanks in advance!
-kyle_engineer

Categories

Resources