![]() |
SMS-based stolen phone locator
1 Attachment(s)
This script was born out of my rage of having my N900 stolen earlier this year. I wanted a simple SMS-based solution for retrieving my new N900 if it were ever stolen again. I used some python code for SMS send/recv and GPS tracking from the wiki and put it together for this.
Here's how it works: At phone startup, the script reads the SIM card number and compares it to your own valid number. If invalid, it'll send an SMS every x seconds to a pre-defined phone number that includes IMSI and GPS coordinates. It also makes a phone call to the same number after a user-defined number of seconds (to lower chance of thief closing out the phone app). Whether the SIM card is valid or not, the script listens for a user-defined SMS alert-code. When alert mode is activated, it returns texts to the incoming number with the same info as above (IMSI and GPS). Installation: 1. Send thief-be-caught.tar.gz to n900 2. Extract: tar cvf thief-be-found.tar.gz -C / 3. Fill out variables at the top of /etc/event.d/banana 3. Reboot 4. Check if script is running with: ps | grep sms Prereqs: python libraries (incl. python-location) To close the daemon: sh /usr/sbin/sms-quit.sh Notes: * Some alert code strings seem to be interpreted incorrectly by the SMS receiving procedure, so try changing the alert code if nothing happens. * Every time the GPS coordinates are read, the internal GPS and network positioning are enabled in case they were ever disabled. The location server will also be set to supl.google.com. I hope this helps someone get their phone back if anything unfortunate happens. I am new to sh and python scripting, so please test and improve or offer feedback. |
Re: SMS-based stolen phone locator
Thanks for that!
Do I have to activate it by sending SMS only? |
Re: SMS-based stolen phone locator
You may also be interested in http://www.whereismydevice.com, (see http://talk.maemo.org/showthread.php?t=51027) - you could integrate your script with this, which will then keep you updated even if the stolen n900 has no capability to send SMS, by updating the details on the website for you to monitor.
Cheers, Ben |
Re: SMS-based stolen phone locator
@Reeby
Yes, just send the ALERT_CODE you define. @benh Thanks. I'm setting up your scripts right now in case this falls through. |
Re: SMS-based stolen phone locator
Quote:
I now do it: cp /home/user/MyDocs/newfolder/* /usr/sbin and: cp /home/user/MyDocs/newfolder* /home/user/MyDocs/chmod 775 but that doesn't work :P do i have to follow the banana documents steps? don't really understand them |
Re: SMS-based stolen phone locator
AlexV12:
It requires either SSH or using XTerm. But please, don't do anything you don't know what is. EDIT: You updated right before me. Remember to do it as root. sudo gainroot |
Re: SMS-based stolen phone locator
Can somebody upload it to devel repository?
Thanks! |
Re: SMS-based stolen phone locator
Quote:
well it doesn't give an error but what do i do after i've copied the files to sbin and chmod? |
Re: SMS-based stolen phone locator
@alex
You must copy sms.py and sms_gps.py to the /usr/sbin folder. There is no chmod folder. chmod is a unix command that lets you change file permissions. In this case, we need these files to execute, so type in: Code:
cd /usr/sbin Make sure you edit the parameters at the top of this file. VALID_IMSI=XXXXXXXXXXX # this is your own IMSI SEND_TEXT_INTERVAL=120.0 # how often (sec) to send SMS HOME_PHONE=XXXXXXXXXX # designated phone number to send SMS and phone calls TIME_WAIT_TO_CALL=60 # time to wait (sec) after invalid SIM card detected before making phone call ALERT_CODE="XXXXXXXXX" # SMS code used to activate alert mode To fill out the VALID_IMSI field, you can find your own IMSI by entering this into the terminal: Code:
dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_imsi |
Re: SMS-based stolen phone locator
allright, i've done all that. how do you know when itms working?
like always xterm just goes to the next line (which normally means it worked what you typed) but how do you shut it off? i'm not going to try it before i can turn it off. |
All times are GMT. The time now is 03:36. |
vBulletin® Version 3.8.8