📜 ⬆️ ⬇️

Wardriving with HTC Hero

Not long ago, I decided to find out where are the open wifi points in my area. For this, I needed a laptop and a GPS receiver. The laptop benefit was found pretty quickly. But with the GPS had to torment.

From the arsenal of my gadgets, there was only one able to determine the location, and it was the HTC Hero. I didn’t find working programs that allow turning my PDA into a receiver, and they all wanted the phone to connect via Bluetooth, which would eat up the charge of the mobile in a few minutes.

Idea


')
Unfortunately, Android does not allow phones with official firmware to work with USB, but it allows sending logs via cable to a debugger. I decided to take advantage of this.

Implementation



First of all, I screwed logs (Log.i ("DroidGPS", (NMEA + "\ n")) to my already written Droid program);), it was important to send logs in the NMEA string. For its formation, I pulled a class from a non-working program found on the Internet.

The next step was to get the logs on the computer, the benefit of the Google SDK is under Linux. We get them thanks to the adb program from the tools folder:
spin@~$ ./androidSDK/tools/adb -s MYSERIALNUMBER -v raw DroidGPS:I *:S

The raw parameter allows you to get only the log line without unnecessary information such as a PID process. We also set to receive only logs with the DroidGPS tag.

Connection



Unfortunately, GPSD can only receive coordinates from devices like / dev / rfcomm0, etc., so you need to set up an exchange using fifo:
spin@~$ mkfifo /tmp/fifo

All logs are thrown there:
spin@~$ ./androidSDK/tools/adb -s MYSERIALNUMBER -v raw DroidGPS:I *:S &> /tmp/fifo

Finally, turn on GPSD:
spin@~$ gpsd /tmp/fifo

Result



Thanks to all this dance with tambourines, my demon began to receive coordinates, which I was not slow to use.

PS I put the application for my phone here: 7ion.ru/uploads/GPSlog.apk , and the SDK can be downloaded from the official Android site .

Source: https://habr.com/ru/post/97767/


All Articles