API function hooks on Android, using Cydiahook to implement
It's been released for almost a year, and it's been discovered that some people need it, and some of them fork on GitHub.
Example code, posted on GitHub, address: Https://github.com/zencodex/cydia-android-hook
Cydiahook
With Cydia substrate SDK development, you can hook Java layer or native Layer API interface.
This code features
The original purpose of the code is because there is an app that needs to save the data to the SD card, and the app has the status of judging the SD mount. There is no SD card, there will be a problem with the program logic, a lot of features are not working properly, and my phone is not installed SD card.
In addition this hook way also helps debug program, do not need to modify ROM bottom, and cause cell phone brick, easy to use, at present Cydia substrate in some mobile phone may have unstable situation, I test the model is ZTE U969, still can't find related ROM.
- Hook android.os.Environment.getExternalStorageState (), forced return, suspended in state.
- Perform mount bind mount can read and write directories to the SD card path, each terminal plan vendor's mount point may be different, please modify the correct mount point path according to your own situation.
- Depending on your needs, you can modify the Mount implementation function to hook any API in the framework. In Main.java, such as IMEI,GPS simulations and so on.
Preparatory work
- Root of the mobile phone, no root, please search the method yourself.
- Install the Android substrate SDK on Eclipse, refer to:
http://www.cydiasubstrate.com/id/73e45fe5-4525-4de7-ac14-6016652cc1b8/
- Mobile phone to Google Play download install Cydia substrate
- Eclipse Imports this code and installs it to your phone after compilation.
- Run substrate on your phone, click "Link substrate Files" on the interface, and then click "Restart System (Soft)"
- View the mount path and status through Cydiahook.
Refer to the official introductory tutorial Violetexample:
http://www.cydiasubstrate.com/id/20cf4700-6379-4a14-9bc2-853fde8cc9d1/
Cydia-android-hook
Cydia substrate demo, Hook getexternalstoragestate, always return mounted status.
API function hooks on Android, using Cydiahook to implement