Motorola Development Community

Member Login

Quick Search



Development Hacking, development, scripts etc


Reply
  #1  
Old 07-06-2005
MotoFans JUNR
 
Join Date: Jul 2005
Location: Argentina
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Playing with native.db

Dear all! Congratulation to everyone, the forum's contents are great!

I'm am trying to sync my E680 to my gentoo linux box. I don't want to use OTA, and I couldn't get any app to work with USB, so I am trying to do it by the hard way...

The E680 appz store the data in
/ezxlocal/sysDatabase/native.db

which is a Berkeley DB file (Btree, version 9, native byte-order). To play with it, we need the db-utils package (simple 'db' in gentoo).

One particulary interesting program in that package is db_dump. Here is a small script which extracts the contacts (name, tels, etc) from the database. Phone are displayed in reverse order, I will fix that these days. The goals is the get some format understood by thunderbird/evolution, to get at least a one-way synchronization tool. Since both (native.db, and thunderbird db) are stored in modified time order, It would be posible also to get a two-way synchronization tool.

Hope it helps someone!

matías
---------------
#!/bin/sh
db4.2_dump -p native.db | awk '
{ if ($1=="DATA=END")
f=0;
if (f==1)
print $0 ;
if (f==2)
if ($1="HEADER=END")
f=1;
if ($1=="database=contact_table")
f=2 ; } ' > kk

for i in 's/\\\00//g' 's/\\\02//g' 's/\\.\{2\}/ /g'
do
echo $i
cat kk | sed "$i" > kk.tmp
mv kk.tmp kk
done

cat kk | sort -f -d
Reply With Quote
  #2  
Old 07-06-2005
Administrator's Avatar
The Furious One
 
Join Date: Feb 2005
Location: Singapore
Posts: 3,186
Thanks: 15
Thanked 493 Times in 37 Posts
Send a message via MSN to Administrator
Default Re: Playing with native.db

cool! another great guy!
__________________
My favorite Motorola development site!

Reply With Quote
  #3  
Old 07-06-2005
MotoFans XPRT
 
Join Date: May 2005
Location: Germany, Hannover
Posts: 289
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pascal
Default Re: Playing with native.db

Quote:
Originally Posted by admin
cool! another great guy!
think so too

perhaps there is a way to do the same with sms?
Reply With Quote
  #4  
Old 07-06-2005
cytux's Avatar
MotoFans XPRT
 
Join Date: Jun 2005
Location: Houston, USA
Posts: 349
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Playing with native.db

Quote:
Originally Posted by matiu
Hope it helps someone!
Shure - this is great news! Many many thanks and welcome aboard! Another Gentooer.
__________________
% New UNIX password:
> penis
BAD PASSWORD: it's WAY too short
% New UNIX password:
Reply With Quote
  #5  
Old 07-06-2005
Administrator's Avatar
The Furious One
 
Join Date: Feb 2005
Location: Singapore
Posts: 3,186
Thanks: 15
Thanked 493 Times in 37 Posts
Send a message via MSN to Administrator
Default Re: Playing with native.db

wads a gentooer?

couldn't find the meaning on google. lol
__________________
My favorite Motorola development site!

Reply With Quote
  #6  
Old 07-06-2005
MotoFans XPRT
 
Join Date: May 2005
Location: Germany, Hannover
Posts: 289
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pascal
Default Re: Playing with native.db

i am a gentooer too

cytux shorted it a little bit

gentooer = gentoo user
Reply With Quote
  #7  
Old 07-06-2005
irinoxx's Avatar
MotoFans NWBE
 
Join Date: Mar 2005
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: Playing with native.db

Quote:
Originally Posted by matiu
Hope it helps someone!
Yes, this is great.
Thank you!
Reply With Quote
  #8  
Old 07-06-2005
MotoFans JUNR
 
Join Date: Jul 2005
Location: Argentina
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Playing with native.db

Quote:
Originally Posted by pascal
perhaps there is a way to do the same with sms?
Yes! It is possible. The question is: What to do with the data? I am using thunderbird. Will work next days in a C program to read from native.db and get usefull information in a .csv format (contacts, sms, mails, calentar info, todo items),
which can be later importable (manually) from thunderbird/evolution/kmail.

The cool thing to do, however, would be a two-way synchro tool, but in this case we should limite us to only one mail/calentar app. What you think? Which is the mail/calendar app that you use most in your Linux?

Here is a script to get the sms, the messages are a little mess up, but it is a beginning

matías

----------------- get_sms.sh

#!/bin/sh

# get data in kk file
db4.2_dump -p native.db | awk '
/DATA=END/ { f=0; }
/HEADER=END/ { if (f==2) f=1; }
/database=ems_table_in_flash/ { f=1 }
/.*/ { if (f==1) print $0 ; } ' > kk

# filters some chars
for i in 's/\\\00//g' 's/\\\02//g' 's/\\.\{2\}/ /g'
do
echo $i
cat kk | sed "$i" > kk.tmp
mv kk.tmp kk
done

# print and filter first 14 chars
cat kk | awk '{ print substr($0,14)}'
rm -f kk
#-----------------------------------
Reply With Quote
  #9  
Old 07-06-2005
MotoFans XPRT
 
Join Date: May 2005
Location: Germany, Hannover
Posts: 289
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to pascal
Default Re: Playing with native.db

Quote:
Originally Posted by matiu
Yes! It is possible. The question is: What to do with the data?
I want to backup my sms - have a lot of them - before i flash to e680i, and then insert them back on e680i

i am using at home kmail and at work evoulution (cause ximians exchange plugin), never tried thunderbird
Reply With Quote
  #10  
Old 07-06-2005
MotoFans JUNR
 
Join Date: Feb 2005
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Playing with native.db

@matiu
nice to here from one using linux wanting to use the phone for what it is ment to be: not for gaming but for PDA functions

syncing is one of my long time hunting for the e680(i).
I want to see syncing of
- calendar
- phonebook
- notes

The backup of SMS/MMS could be also a nice feature.

I prefer the KitchenSync way because i use kde with Kontact.

May be i can help getting this on the road
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem playing videos activexpert E6 General Chat 3 02-14-2008 05:57 AM
i need help playing videos on rokr e6 pinoy8181 E6 General Chat 4 08-14-2007 04:44 AM
Bicycle Playing Card Larry -The Lounge- 0 03-20-2007 08:18 AM
Help required for playing videos s.kris79 A1200 General Chat 3 01-18-2007 12:15 PM
playing videos HELP itzkinz E680i General Chat 1 02-12-2006 10:58 AM

 
Advertisement

Partner Links





Web Analytics