├── 20191031_HookBegin ├── HookBegin │ ├── .gitignore │ ├── .idea │ │ ├── encodings.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ └── runConfigurations.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── wx │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ │ └── xposed_init │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── wx │ │ │ │ │ ├── HookTest.java │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── wx │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app_new.apk └── app_old.apk ├── 20191031_HookWeixnMM ├── HookWeixnMM │ ├── .gitignore │ ├── .idea │ │ ├── encodings.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ └── runConfigurations.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── wx │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ │ └── xposed_init │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── wx │ │ │ │ │ ├── HookTest.java │ │ │ │ │ ├── Hookinsert.java │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── wx │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── hookinsert.apk ├── hooktest.apk └── 微信.apk └── README.md /20191031_HookBegin/HookBegin/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.0" 6 | defaultConfig { 7 | applicationId "com.example.wx" 8 | minSdkVersion 15 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | repositories { 22 | jcenter() 23 | } 24 | dependencies { 25 | compileOnly 'de.robv.android.xposed:api:82' 26 | compileOnly 'de.robv.android.xposed:api:82:sources' 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | implementation 'androidx.appcompat:appcompat:1.1.0' 29 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 30 | testImplementation 'junit:junit:4.12' 31 | androidTestImplementation 'androidx.test:runner:1.2.0' 32 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 33 | 34 | } 35 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/androidTest/java/com/example/wx/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.wx; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.InstrumentationRegistry; 6 | import androidx.test.runner.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getTargetContext(); 24 | 25 | assertEquals("com.example.wx", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 16 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.example.wx.HookTest -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/java/com/example/wx/HookTest.java: -------------------------------------------------------------------------------- 1 | package com.example.wx; 2 | 3 | import de.robv.android.xposed.IXposedHookLoadPackage; 4 | 5 | import de.robv.android.xposed.XC_MethodHook; 6 | 7 | import de.robv.android.xposed.XposedBridge; 8 | 9 | import de.robv.android.xposed.XposedHelpers; 10 | 11 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 12 | 13 | public class HookTest implements IXposedHookLoadPackage { 14 | 15 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable { 16 | 17 | if (loadPackageParam.packageName.equals("com.example.wx")) { 18 | 19 | XposedBridge.log(" has Hooked!"); 20 | 21 | Class clazz = loadPackageParam.classLoader.loadClass( 22 | 23 | "com.example.wx.MainActivity"); 24 | 25 | XposedHelpers.findAndHookMethod(clazz, "toastMessage", new XC_MethodHook() { 26 | 27 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 28 | 29 | super.beforeHookedMethod(param); 30 | 31 | //XposedBridge.log(" has Hooked!"); 32 | 33 | } 34 | 35 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 36 | 37 | param.setResult("你已被劫持"); 38 | 39 | } 40 | 41 | }); 42 | 43 | } 44 | 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/java/com/example/wx/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.wx; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.os.Bundle; 6 | 7 | import android.view.View; 8 | 9 | import android.widget.Button; 10 | 11 | import android.widget.Toast; 12 | 13 | public class MainActivity extends AppCompatActivity { 14 | 15 | private Button button; 16 | 17 | @Override 18 | 19 | protected void onCreate(Bundle savedInstanceState) { 20 | 21 | super.onCreate(savedInstanceState); 22 | 23 | setContentView(R.layout.activity_main); 24 | 25 | button = (Button) findViewById(R.id.button); 26 | 27 | button.setOnClickListener(new View.OnClickListener() { 28 | 29 | public void onClick(View v) { 30 | 31 | Toast.makeText(MainActivity.this, toastMessage(), Toast.LENGTH_SHORT).show(); 32 | 33 | } 34 | 35 | }); 36 | 37 | } 38 | 39 | public String toastMessage() { 40 | 41 | return "我未被劫持"; 42 | 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /20191031_HookBegin/HookBegin/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |