Previous friends want to be able to modify the Android GPS information, that is, to allow other applications to obtain GPS information, access to the modified information. At first, it sounded very unreliable, and later on-line search the next information, found or someone to fix, mainly through the ancient river release of injected code, the content of their own to inject into the memory of the corresponding application. Here, the process of injection is not described, the main reason why can modify the content, with the acquisition of GPS information for example.
The first thing to get GPS information in Android is this way:
Key code appeared, mainly through the Getsystemservice () method to get the handle, the middle omitted a series of complex search steps,, we finally found a place, file Android.os.ServiceManager.java in the GetService () Method:
Scache:,,, look here, directly according to the name from the HashMap, if there is a direct return.
Key code to read, then how to do it, very simple, is to write a class, implement IBinder interface, and then through the reflection of the corresponding name and your own IBinder added to Scache this hashmap, then the program through Getsystemservice () method takes the IBinder class that is implemented by itself. Then is the realization of their own ibinder class, fortunately, on GitHub found this project: Https://github.com/aeoliazhang/android_inject_hook_demo, this is to modify the IMEI information, The code is quite comprehensive, and the test Gpsibinder is modified according to the Imeibinder.
The code is so much, but did not put the specific compilation and operation of the record, so do it yourself. The pit is still a lot of, novice still spend a little more time, have free will compile and run the process to paste out.
Android modified IMEI, GPS and other information analysis