• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root GPS Kernel module for gps without java

giantpune

Android Enthusiast
This is a kernel module I whipped up for our phone. It creates a couple virtual files for interacting with the GPS without having to mess with any java. The idea behind this module is so you could make something like those "find my droid" or "androidlost" applications. By interfacing with the kernel directly, you don't need to go through any java program. When you rely on an apk to track your phone, you are really just hoping that the person that stole it is too stupid to uninstall that apk. Interfacing with the kernel directly lets you be more sneaky about how and where you implement your phone tracking. You could put a sh script inside the ramdisk, for example, and the only way to uninstall it would be to install a different ramdisk. The only way to know it exists would be to open a root file browser and browse to that location.

However, the official jni doesnt provide any way to access gps that I found. If you want to talk to gps features, google says you have to go through java. This kernel module uses a few of LG's diagnostic functions to let you set the gps status and get longitude/latitude. It creates /proc/gpsStatus and /proc/gpsLocation.

Code:
# insmod /data/local/tmp/gps_loc.ko
# cat /proc/gpsLocation
55.751,37.616
# rmmod gps_loc

Download gps_loc.c.tar.gz from Sendspace.com - send big files the easy way
 
However you want. This module isn't trying to be the complete solution. It is only designed to get past the big hurdle of having to go through the java garbage. With that out of the way, it opens you up to write a complete "wherethehellismyphone" using native code, or bash scripts, or whatever you want.

I guess the simplest way would be to write a script that emails you the gps location of your phone once an hour.
 
Hello, the file is no longer available. Can you please upload it again? And also, does your code work only for LG devices or can it be implemented for other devices too? Any information regarding this would be greatly appreciated.
 
Back
Top Bottom