├── ic_launcher-web.png ├── libs ├── substrate-api.jar └── android-support-v4.jar ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── values-sw600dp │ └── dimens.xml ├── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── menu │ └── main.xml ├── values-sw720dp-land │ └── dimens.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── layout │ └── activity_main.xml ├── bin └── jarlist.cache ├── .classpath ├── project.properties ├── proguard-project.txt ├── .project ├── AndroidManifest.xml ├── README.md └── src └── org └── phoneos └── cydiahook ├── Main.java └── MainActivity.java /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /libs/substrate-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/libs/substrate-api.jar -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/libs/android-support-v4.jar -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zencodex/cydia-android-hook/HEAD/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependency. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CydiaHook 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-18 15 | -------------------------------------------------------------------------------- /res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CydiaHook 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### CydiaHook 2 | ========== 3 | 4 | 利用Cydia Substrate SDK 开发,可以HOOK java层或NATIVE层 API接口。 5 | 6 | ### 本代码功能 7 | 写代码的初衷是因为有个app,需要保存数据到SD卡上,并且app里面有判断SD挂载的状态。没有SD卡,会造成程序逻辑有问题,很多功能无法正常使用,而我的手机没有装SD卡。 8 | 9 | 另外这种HOOK方式也有助于调试程序,不必因为修改ROM底层,而引起手机变砖,简便好用,目前Cydia Substrate在某些手机中可能会有不稳定的情况,我测试的机型是ZTE U969,还找不到相关ROM。 10 | 11 | - HOOK android.os.Environment.getExternalStorageState(),强制返回,已挂在状态。 12 | - 执行mount bind 挂载可以读写目录到 SD卡的路径,每个终端方案商的挂载点都可能不同,请根据自己的情况,修改成正确的挂载点路径。 13 | - 可以根据自身需要,修改挂载实现函数,可以HOOK framework中的任何API。在Main.java里,比如IMEI,GPS模拟等等。 14 | 15 | ### 准备工作 16 | 17 | - ROOT过的手机一部,没有ROOT的,请自行搜索方法。 18 | - Eclipse 上安装 Android Substrate SDK,参考:
19 | http://www.cydiasubstrate.com/id/73e45fe5-4525-4de7-ac14-6016652cc1b8/ 20 | - 手机端去Google Play 下载安装 Cydia Substrate 21 | - Eclipse 导入本代码,编译后安装到手机。 22 | - 手机上运行Substrate,界面上点击“Link Substrate Files”,再点击 “Restart System(Soft)” 23 | - 通过CydiaHook,查看挂载路径和状态。 24 | 25 | 参考官方的入门教程 VioletExample:
26 | http://www.cydiasubstrate.com/id/20cf4700-6379-4a14-9bc2-853fde8cc9d1/ 27 | 28 | ======= 29 | cydia-android-hook 30 | ================== 31 | 32 | Cydia Substrate demo, hook getExternalStorageState, always return MOUNTED status. 33 | -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | 17 | 25 | 26 |