Skip to content

saltpp/sample_fake_gps_location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

  • Sample codes to inject fake location to GpsLocationProvider of Android
  • This is just for testing purpose. Please don't abuse.
  • Base codes is android-4.3.1_r1 branch of AOSP repository
  • I have cheked only with Samsung Galaxy Nexus
  • Brief description is here (Only Japanease text)
  • Demo is here (YouTube)

Files

  • patches/

    • diff_all_gits.txt

      • Differences generated by "repo forall -c git diff"
    • android/

      • Files that are applied patch to android-4.3.1_r1 branch of AOSP repository
  • app/

    • TestFakeLocation.apk

      • Sample application built by Eclipse
    • TestFakeLocation/

      • Eclipse project

How to build

  • You can build a ROM for Galaxy Nexus by the following steps:
    I haven't confirmed with other devices.
// Get source tree
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.3.1_r1
$ repo sync -j8

// Apply patches (Copy files that are applied patch)
$ cp -rf patches/android/* .

// Get Samsung proprietary binaries
$ wget https://dl.google.com/dl/android/aosp/broadcom-maguro-jwr66v-67de03a5.tgz
$ wget https://dl.google.com/dl/android/aosp/imgtec-maguro-jwr66v-8c6053ac.tgz
$ wget https://dl.google.com/dl/android/aosp/invensense-maguro-jwr66v-d0d44515.tgz
$ wget https://dl.google.com/dl/android/aosp/nxp-maguro-jwr66v-c43474a5.tgz
$ wget https://dl.google.com/dl/android/aosp/samsung-maguro-jwr66v-03e74ff7.tgz
$ wget https://dl.google.com/dl/android/aosp/widevine-maguro-jwr66v-9189a15f.tgz
$ tar zxvf broadcom-maguro-jwr66v-67de03a5.tgz
$ tar zxvf imgtec-maguro-jwr66v-8c6053ac.tgz
$ tar zxvf invensense-maguro-jwr66v-d0d44515.tgz
$ tar zxvf nxp-maguro-jwr66v-c43474a5.tgz
$ tar zxvf samsung-maguro-jwr66v-03e74ff7.tgz
$ tar zxvf widevine-maguro-jwr66v-9189a15f.tgz
$ ./extract-broadcom-maguro.sh     // input "I ACCEPT"
$ ./extract-imgtec-maguro.sh
$ ./extract-invensense-maguro.sh
$ ./extract-nxp-maguro.sh
$ ./extract-samsung-maguro.sh
$ ./extract-widevine-maguro.sh

// Get Samsung proprietary binaries from the device
$ adb pull /system/vendor/etc/sirfgps.conf
$ cp sirfgps.conf vendor/samsung/maguro/proprietary/
$ adb pull /system/vendor/lib/hw/gps.omap4.so
$ cp gps.omap4.so vendor/samsung/maguro/proprietary/
$ adb pull  /system/vendor/firmware/ducati-m3.bin
$ cp ducati-m3.bin vendor/samsung/maguro/proprietary/

// Modify make file to integrate Samsung proprietary binaries
$ vim vendor/samsung/maguro/proprietary/Android.mk
  Add the following before endif
  ----------
  include $(CLEAR_VARS)
  LOCAL_MODULE := sirfgps
  LOCAL_MODULE_OWNER := samsung
  LOCAL_SRC_FILES := sirfgps.conf
  LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_SUFFIX := .conf
  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
  include $(BUILD_PREBUILT)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := gps.omap4
  LOCAL_MODULE_OWNER := samsung
  LOCAL_SRC_FILES := gps.omap4.so
  LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_SUFFIX := .so
  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/hw
  include $(BUILD_PREBUILT)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := ducati-m3
  LOCAL_MODULE_OWNER := samsung
  LOCAL_SRC_FILES := ducati-m3.bin
  LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_SUFFIX := .bin
  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/firmware
  include $(BUILD_PREBUILT)
  ----------

$ vim vendor/samsung/maguro/device-partial.mk
  Add the following (Please don't forget to add \ to end of previous line)
  ----------
  sirfgps \
  gps.omap4 \
  ducati-m3 \
  libpn544_fw
  ----------

// Build
$ source build/envsetup.sh
$ lunch full_maguro-userdebug
$ make -j8
$ make -j8 otapackage

// Copy to device
$ adb push out/target/product/maguro/full_maguro-ota-eng.xxxxx.zip /sdcard/
$ adb reboot recovery

// Flash by TWRP

Others

  • To use Google apps

    $ adb push gapps-jb43-20131116-dmd151.zip /sdcard/
    $ adb reboot recovery
    // Flash by TWRP
    
  • To use SuperSU

    $ adb push UPDATE-SuperSU-v1.43.zip /sdcaard/
    $ adb reboot recovery
    // Flash by TWRP
    

About

Sample codes to inject fake location to GpsLocationProvider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published