├── .gitignore
├── .idea
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── JavaTest
├── .gitignore
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── example
│ └── javatest
│ └── myClass.java
├── app.zip
├── app
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── dexpaser
│ │ └── zk
│ │ └── myapplication
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── xposed_init
│ ├── cpp
│ │ ├── Object.h
│ │ ├── base64.c
│ │ ├── base64.h
│ │ └── native-lib.cpp
│ ├── java
│ │ ├── android
│ │ │ ├── content
│ │ │ │ └── res
│ │ │ │ │ └── free
│ │ │ │ │ ├── AXmlResourceParser.java
│ │ │ │ │ ├── ChunkUtil.java
│ │ │ │ │ ├── IntReader.java
│ │ │ │ │ ├── StringBlock.java
│ │ │ │ │ └── XmlResourceParser.java
│ │ │ └── util
│ │ │ │ └── free
│ │ │ │ ├── AttributeSet.java
│ │ │ │ └── TypedValue.java
│ │ ├── com
│ │ │ └── dexpaser
│ │ │ │ └── zk
│ │ │ │ └── myapplication
│ │ │ │ ├── AppListAdapter.java
│ │ │ │ ├── HookLogin.java
│ │ │ │ ├── HookSettings.java
│ │ │ │ ├── Main.java
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── Util
│ │ │ │ ├── AXMLPrinter.java
│ │ │ │ ├── ApkInfo.java
│ │ │ │ ├── ApkUtils.java
│ │ │ │ ├── CMDUtil.java
│ │ │ │ ├── Dom4jXMLUtils.java
│ │ │ │ └── ss.java
│ │ │ │ ├── hookCookie.java
│ │ │ │ └── hookRes.java
│ │ └── org
│ │ │ └── xmlpull
│ │ │ └── v1
│ │ │ └── free
│ │ │ ├── XmlPullParser.java
│ │ │ ├── XmlPullParserException.java
│ │ │ ├── XmlPullParserFactory.java
│ │ │ └── XmlSerializer.java
│ ├── lib
│ │ └── XposedBridge-82.jar
│ ├── libs
│ │ ├── dom4j-2.0.1.jar
│ │ └── substrate-api.jar
│ └── res
│ │ ├── layout
│ │ ├── list_item.xml
│ │ ├── list_item_test.xml
│ │ └── main.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
│ └── dexpaser
│ └── zk
│ └── myapplication
│ └── ExampleUnitTest.java
├── build.gradle
├── dexpaserl.zip
├── dexpaserl
├── .gitignore
├── build.gradle
├── classes.dex
└── src
│ └── main
│ └── java
│ └── com
│ └── dexpaser
│ ├── Header.java
│ ├── Header_Items.java
│ ├── Opcodes.java
│ ├── PaserHaeder.java
│ ├── PaserItemsPaser.java
│ └── PaserUtil.java
├── dexpasermode
├── .gitignore
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── dexpaser
│ ├── Header.java
│ ├── Header_Items.java
│ ├── Opcodes.java
│ ├── PaserHaeder.java
│ ├── PaserItemsPaser.java
│ └── PaserUtil.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── hook_wx
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── hook_wx
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── xposed_init
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── hook_wx
│ │ │ ├── HookDevice.java
│ │ │ └── MainActivity.java
│ ├── lib
│ │ └── XposedBridge-82.jar
│ └── 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
│ └── hook_wx
│ └── ExampleUnitTest.java
├── hookcheck
├── .gitignore
├── .idea
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── workspace.xml
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── hookcheck
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── xposed_init
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── hookcheck
│ │ │ ├── Encode.java
│ │ │ ├── Encode1.java
│ │ │ ├── Encode2.java
│ │ │ ├── MainActivity.java
│ │ │ └── methodHookStart1.java
│ ├── lib
│ │ ├── XposedBridge-82.jar
│ │ └── XposedBridgeApi-54.jar
│ └── 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
│ └── hookcheck
│ └── ExampleUnitTest.java
├── hookdeviceinfo
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── hookdeviceinfo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── xposed_init
│ ├── cpp
│ │ ├── libsubstrate-dvm.so
│ │ ├── libsubstrate.so
│ │ ├── native-lib.cpp
│ │ └── substrate.h
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── hookdeviceinfo
│ │ │ ├── HTool.java
│ │ │ ├── HookDevice.java
│ │ │ ├── MainActivity.java
│ │ │ └── fanshe.java
│ ├── lib
│ │ └── XposedBridgeApi-54.jar
│ └── 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
│ └── hookdeviceinfo
│ └── ExampleUnitTest.java
├── jiemitest
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── jiemitest
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── jiemitest
│ │ │ └── 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
│ └── jiemitest
│ └── ExampleUnitTest.java
├── methodhook-master
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── methodhook_master
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── xposed_init
│ ├── java
│ │ └── com
│ │ │ └── binpang
│ │ │ ├── apiMonitor
│ │ │ ├── AbstractBahaviorHookCallBack.java
│ │ │ ├── AccountManagerHook.java
│ │ │ ├── ActivityManagerHook.java
│ │ │ ├── ActivityThreadHook.java
│ │ │ ├── AlarmManagerHook.java
│ │ │ ├── ApiMonitorHook.java
│ │ │ ├── ApiMonitorHookManager.java
│ │ │ ├── AudioRecordHook.java
│ │ │ ├── BlueToothHook.java
│ │ │ ├── CameraHook.java
│ │ │ ├── ConnectivityManagerHook.java
│ │ │ ├── ContentResolverHook.java
│ │ │ ├── ContextImplHook.java
│ │ │ ├── LocationHook.java
│ │ │ ├── MediaRecorderHook.java
│ │ │ ├── NetWorkHook.java
│ │ │ ├── NotificationManagerHook.java
│ │ │ ├── PackageManagerHook.java
│ │ │ ├── ProcessBuilderHook.java
│ │ │ ├── RuntimeHook.java
│ │ │ ├── SmsManagerHook.java
│ │ │ └── TelephonyManagerHook.java
│ │ │ └── methodhook
│ │ │ ├── FindMethod.java
│ │ │ ├── HookHelperFacktory.java
│ │ │ ├── HookHelperInterface.java
│ │ │ ├── HookParam.java
│ │ │ ├── Logger.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MethodHookCallBack.java
│ │ │ ├── XposeHookHelperImpl.java
│ │ │ └── methodHookStart.java
│ ├── lib
│ │ └── XposedBridgeApi-54.jar
│ └── res
│ │ ├── drawable
│ │ └── ic_launcher.png
│ │ ├── layout
│ │ └── activity_main.xml
│ │ └── values
│ │ ├── colors.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── methodhook_master
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 1.8
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/JavaTest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/JavaTest/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | dependencies {
4 | implementation fileTree(dir: 'libs', include: ['*.jar'])
5 | }
6 |
7 | sourceCompatibility = "1.6"
8 | targetCompatibility = "1.6"
9 |
--------------------------------------------------------------------------------
/JavaTest/src/main/java/com/example/javatest/myClass.java:
--------------------------------------------------------------------------------
1 | package com.example.javatest;
2 |
3 | public class myClass {
4 |
5 |
6 | public static void main(String[] args) {
7 | String a="UMEnvelope(version:1.0, address:5836a0ab7f2c746c4b001800, signature:998c4a642ebfe08af261ff2af629425128876828ec9a34265c38e680b00f385a, serial_num:4, ts_secs:1513656631, length:1453, entity:78 9C 8D 54 CD 6B 5D 45 14 BF 49 9A A4 C4 36 8D 94 7B 99 E2 03 9F BB 28 E6 32 67 3E CE CC BC DD F3 BD 04 8B 21 0D 7E 36 AB 30 77 66 6E 72 25 79 2F BD EF 25 D0 EC C4 22 52 22 B8 70 E7 4A 10 AD A0 E0 C2 82 1B B5 B8 96 DA 7F 41 88 1F 4B 41 57 AE 9C 34 7D 16 FA 84 96 0B 77 98 99 33 BF 73 7E E7 FC CE 69 A4 33 69 92 7E 9D 27 0D 42 A4 E6 68 A9 2D 54 C9 9C 12 E8 44 41 29 68 4A C9 34 CB 59..., guid:ae1d4d64c1a28d8ae97c082a9734af51739a0128f7879e2615252d8023120000, checksum:null, codex:0)";
8 |
9 | System.out.println(a.toCharArray());
10 | }
11 |
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/app.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app.zip
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # For more information about using CMake with Android Studio, read the
2 | # documentation: https://d.android.com/studio/projects/add-native-code.html
3 |
4 | # Sets the minimum version of CMake required to build the native library.
5 |
6 | cmake_minimum_required(VERSION 3.4.1)
7 |
8 | # Creates and names a library, sets it as either STATIC
9 | # or SHARED, and provides the relative paths to its source code.
10 | # You can define multiple libraries, and CMake builds them for you.
11 | # Gradle automatically packages shared libraries with your APK.
12 |
13 | file(GLOB native_srcs "src/main/cpp/*.cpp"
14 | "src/main/cpp/*.c"
15 | )
16 | add_library( # Sets the name of the library.
17 | zkjg-lib
18 |
19 | # Sets the library as a shared library.
20 | SHARED
21 |
22 | # Provides a relative path to your source file(s).
23 | ${native_srcs})
24 |
25 |
26 |
27 | # Searches for a specified prebuilt library and stores the path as a
28 | # variable. Because CMake includes system libraries in the search path by
29 | # default, you only need to specify the name of the public NDK library
30 | # you want to add. CMake verifies that the library exists before
31 | # completing its build.
32 |
33 | find_library( # Sets the name of the path variable.
34 | log-libxxx
35 |
36 | # Specifies the name of the NDK library that
37 | # you want CMake to locate.
38 | log )
39 |
40 | # Specifies libraries CMake should link to your target library. You
41 | # can link multiple libraries, such as libraries you define in this
42 | # build script, prebuilt third-party libraries, or system libraries.
43 |
44 | target_link_libraries( # Specifies the target library.
45 | zkjg-lib
46 | # Links the target library to the log library
47 | # included in the NDK.
48 | ${log-libxxx} )
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion '26.0.2'
6 | defaultConfig {
7 | applicationId "com.dexpaser.zk.myapplication"
8 | minSdkVersion 15
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 |
14 | externalNativeBuild {
15 | cmake {
16 | cppFlags ""
17 | cppFlags.add("-std=c++11")
18 | cppFlags.add("-landroid")
19 | cppFlags.add("-lz")
20 | /* cppFlags.add("-Wwritable-strings")*/
21 |
22 | }
23 | }
24 | }
25 | buildTypes {
26 | release {
27 | minifyEnabled false
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | }
30 | }
31 |
32 | externalNativeBuild {
33 | cmake {
34 | path "CMakeLists.txt"
35 | }
36 | }
37 | }
38 |
39 | dependencies {
40 | compile fileTree(include: ['*.jar'], dir: 'libs')
41 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
42 | exclude group: 'com.android.support', module: 'support-annotations'
43 | })
44 | compile 'com.android.support:appcompat-v7:25.3.1'
45 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
46 | testCompile 'junit:junit:4.12'
47 | compile files('src/main/libs/substrate-api.jar')
48 | provided files('src/main/lib/XposedBridge-82.jar')
49 | compile files('src/main/libs/dom4j-2.0.1.jar')
50 | }
51 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/zk/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/dexpaser/zk/myapplication/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.zk.myapplication", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.dexpaser.zk.myapplication.Main
--------------------------------------------------------------------------------
/app/src/main/cpp/base64.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file base64.h
3 | *
4 | * \brief RFC 1521 base64 encoding/decoding
5 | *
6 | * Copyright (C) 2006-2010, Brainspark B.V.
7 | *
8 | * This file is part of PolarSSL (http://www.polarssl.org)
9 | * Lead Maintainer: Paul Bakker
10 | *
11 | * All rights reserved.
12 | *
13 | * This program is free software; you can redistribute it and/or modify
14 | * it under the terms of the GNU General Public License as published by
15 | * the Free Software Foundation; either version 2 of the License, or
16 | * (at your option) any later version.
17 | *
18 | * This program is distributed in the hope that it will be useful,
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 | * GNU General Public License for more details.
22 | *
23 | * You should have received a copy of the GNU General Public License along
24 | * with this program; if not, write to the Free Software Foundation, Inc.,
25 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 | */
27 | #define POLARSSL_BASE64_C
28 | #define POLARSSL_SELF_TEST
29 | #ifndef POLARSSL_BASE64_H
30 | #define POLARSSL_BASE64_H
31 |
32 | #include
33 |
34 | #define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */
35 | #define POLARSSL_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */
36 |
37 | #ifdef __cplusplus
38 | extern "C" {
39 | #endif
40 |
41 | /**
42 | * \brief Encode a buffer into base64 format
43 | *
44 | * \param dst destination buffer
45 | * \param dlen size of the buffer
46 | * \param src source buffer
47 | * \param slen amount of data to be encoded
48 | *
49 | * \return 0 if successful, or POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL.
50 | * *dlen is always updated to reflect the amount
51 | * of data that has (or would have) been written.
52 | *
53 | * \note Call this function with *dlen = 0 to obtain the
54 | * required buffer size in *dlen
55 | */
56 | int base64_encode( unsigned char *dst, size_t *dlen,
57 | const unsigned char *src, size_t slen );
58 |
59 | /**
60 | * \brief Decode a base64-formatted buffer
61 | *
62 | * \param dst destination buffer
63 | * \param dlen size of the buffer
64 | * \param src source buffer
65 | * \param slen amount of data to be decoded
66 | *
67 | * \return 0 if successful, POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL, or
68 | * POLARSSL_ERR_BASE64_INVALID_CHARACTER if the input data is
69 | * not correct. *dlen is always updated to reflect the amount
70 | * of data that has (or would have) been written.
71 | *
72 | * \note Call this function with *dlen = 0 to obtain the
73 | * required buffer size in *dlen
74 | */
75 | int base64_decode( unsigned char *dst, size_t *dlen,
76 | const unsigned char *src, size_t slen );
77 | int base64_self_test( int verbose );
78 |
79 |
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 |
84 | #endif /* base64.h */
85 |
--------------------------------------------------------------------------------
/app/src/main/java/android/content/res/free/ChunkUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Android4ME
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package android.content.res.free;
17 |
18 | import java.io.IOException;
19 |
20 | /**
21 | * @author Dmitry Skiba
22 | *
23 | */
24 | class ChunkUtil {
25 |
26 | public static final void readCheckType(IntReader reader, int expectedType) throws IOException {
27 | int type=reader.readInt();
28 | if (type!=expectedType) {
29 | throw new IOException(
30 | "Expected chunk of type 0x"+Integer.toHexString(expectedType)+
31 | ", read 0x"+Integer.toHexString(type)+".");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/android/content/res/free/IntReader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Android4ME
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package android.content.res.free;
17 |
18 | import java.io.EOFException;
19 | import java.io.IOException;
20 | import java.io.InputStream;
21 |
22 | /**
23 | * @author Dmitry Skiba
24 | *
25 | * Simple helper class that allows reading of integers.
26 | *
27 | * TODO:
28 | * * implement buffering
29 | *
30 | */
31 | public final class IntReader {
32 |
33 | public IntReader() {
34 | }
35 | public IntReader(InputStream stream,boolean bigEndian) {
36 | reset(stream,bigEndian);
37 | }
38 |
39 | public final void reset(InputStream stream,boolean bigEndian) {
40 | m_stream=stream;
41 | m_bigEndian=bigEndian;
42 | m_position=0;
43 | }
44 |
45 | public final void close() {
46 | if (m_stream==null) {
47 | return;
48 | }
49 | try {
50 | m_stream.close();
51 | }
52 | catch (IOException e) {
53 | }
54 | reset(null,false);
55 | }
56 |
57 | public final InputStream getStream() {
58 | return m_stream;
59 | }
60 |
61 | public final boolean isBigEndian() {
62 | return m_bigEndian;
63 | }
64 | public final void setBigEndian(boolean bigEndian) {
65 | m_bigEndian=bigEndian;
66 | }
67 |
68 | public final int readByte() throws IOException {
69 | return readInt(1);
70 | }
71 | public final int readShort() throws IOException {
72 | return readInt(2);
73 | }
74 | public final int readInt() throws IOException {
75 | return readInt(4);
76 | }
77 |
78 | public final int readInt(int length) throws IOException {
79 | if (length<0 || length>4) {
80 | throw new IllegalArgumentException();
81 | }
82 | int result=0;
83 | if (m_bigEndian) {
84 | for (int i=(length-1)*8;i>=0;i-=8) {
85 | int b=m_stream.read();
86 | if (b==-1) {
87 | throw new EOFException();
88 | }
89 | m_position+=1;
90 | result|=(b<0;length-=1) {
114 | array[offset++]=readInt();
115 | }
116 | }
117 |
118 | public final byte[] readByteArray(int length) throws IOException {
119 | byte[] array=new byte[length];
120 | int read=m_stream.read(array);
121 | m_position+=read;
122 | if (read!=length) {
123 | throw new EOFException();
124 | }
125 | return array;
126 | }
127 |
128 | public final void skip(int bytes) throws IOException {
129 | if (bytes<=0) {
130 | return;
131 | }
132 | long skipped=m_stream.skip(bytes);
133 | m_position+=skipped;
134 | if (skipped!=bytes) {
135 | throw new EOFException();
136 | }
137 | }
138 |
139 | public final void skipInt() throws IOException {
140 | skip(4);
141 | }
142 |
143 | public final int available() throws IOException {
144 | return m_stream.available();
145 | }
146 |
147 | public final int getPosition() {
148 | return m_position;
149 | }
150 |
151 | /////////////////////////////////// data
152 |
153 | private InputStream m_stream;
154 | private boolean m_bigEndian;
155 | private int m_position;
156 | }
157 |
--------------------------------------------------------------------------------
/app/src/main/java/android/content/res/free/XmlResourceParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Android4ME
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package android.content.res.free;
17 |
18 | import android.util.free.AttributeSet;
19 |
20 | import org.xmlpull.v1.free.XmlPullParser;
21 |
22 | /**
23 | * @author Dmitry Skiba
24 | *
25 | */
26 | public interface XmlResourceParser extends XmlPullParser, AttributeSet {
27 | void close();
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/android/util/free/AttributeSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Android4ME
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package android.util.free;
17 |
18 | /**
19 | * @author Dmitry Skiba
20 | *
21 | */
22 | public interface AttributeSet {
23 | int getAttributeCount();
24 | String getAttributeName(int index);
25 | String getAttributeValue(int index);
26 | String getPositionDescription();
27 | int getAttributeNameResource(int index);
28 | int getAttributeListValue(int index, String options[], int defaultValue);
29 | boolean getAttributeBooleanValue(int index, boolean defaultValue);
30 | int getAttributeResourceValue(int index, int defaultValue);
31 | int getAttributeIntValue(int index, int defaultValue);
32 | int getAttributeUnsignedIntValue(int index, int defaultValue);
33 | float getAttributeFloatValue(int index, float defaultValue);
34 | String getIdAttribute();
35 | String getClassAttribute();
36 | int getIdAttributeResourceValue(int index);
37 | int getStyleAttribute();
38 | String getAttributeValue(String namespace, String attribute);
39 | int getAttributeListValue(String namespace, String attribute, String options[], int defaultValue);
40 | boolean getAttributeBooleanValue(String namespace, String attribute, boolean defaultValue);
41 | int getAttributeResourceValue(String namespace, String attribute, int defaultValue);
42 | int getAttributeIntValue(String namespace, String attribute, int defaultValue);
43 | int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue);
44 | float getAttributeFloatValue(String namespace, String attribute, float defaultValue);
45 |
46 | //TODO: remove
47 | int getAttributeValueType(int index);
48 | int getAttributeValueData(int index);
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/android/util/free/TypedValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Android4ME
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package android.util.free;
17 |
18 | /**
19 | * @author Dmitry Skiba
20 | *
21 | */
22 | public class TypedValue {
23 |
24 | public int type;
25 | public CharSequence string;
26 | public int data;
27 | public int assetCookie;
28 | public int resourceId;
29 | public int changingConfigurations;
30 |
31 | public static final int
32 | TYPE_NULL =0,
33 | TYPE_REFERENCE =1,
34 | TYPE_ATTRIBUTE =2,
35 | TYPE_STRING =3,
36 | TYPE_FLOAT =4,
37 | TYPE_DIMENSION =5,
38 | TYPE_FRACTION =6,
39 | TYPE_FIRST_INT =16,
40 | TYPE_INT_DEC =16,
41 | TYPE_INT_HEX =17,
42 | TYPE_INT_BOOLEAN =18,
43 | TYPE_FIRST_COLOR_INT =28,
44 | TYPE_INT_COLOR_ARGB8 =28,
45 | TYPE_INT_COLOR_RGB8 =29,
46 | TYPE_INT_COLOR_ARGB4 =30,
47 | TYPE_INT_COLOR_RGB4 =31,
48 | TYPE_LAST_COLOR_INT =31,
49 | TYPE_LAST_INT =31;
50 |
51 | public static final int
52 | COMPLEX_UNIT_PX =0,
53 | COMPLEX_UNIT_DIP =1,
54 | COMPLEX_UNIT_SP =2,
55 | COMPLEX_UNIT_PT =3,
56 | COMPLEX_UNIT_IN =4,
57 | COMPLEX_UNIT_MM =5,
58 | COMPLEX_UNIT_SHIFT =0,
59 | COMPLEX_UNIT_MASK =15,
60 | COMPLEX_UNIT_FRACTION =0,
61 | COMPLEX_UNIT_FRACTION_PARENT=1,
62 | COMPLEX_RADIX_23p0 =0,
63 | COMPLEX_RADIX_16p7 =1,
64 | COMPLEX_RADIX_8p15 =2,
65 | COMPLEX_RADIX_0p23 =3,
66 | COMPLEX_RADIX_SHIFT =4,
67 | COMPLEX_RADIX_MASK =3,
68 | COMPLEX_MANTISSA_SHIFT =8,
69 | COMPLEX_MANTISSA_MASK =0xFFFFFF;
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/AppListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ImageView;
10 | import android.widget.RelativeLayout;
11 | import android.widget.TextView;
12 |
13 | import java.util.List;
14 |
15 | /**
16 | * Created by zk on 2017/8/24.
17 | */
18 |
19 | public class AppListAdapter extends BaseAdapter {
20 | Context mContext;
21 | List mListData;
22 |
23 | AppListAdapter(Context context, List data) {
24 | this.mContext = context;
25 | this.mListData = data;
26 | }
27 |
28 | public int getCount() {
29 | return this.mListData.size();
30 | }
31 |
32 | public Object getItem(int arg0) {
33 | return this.mListData.get(arg0);
34 | }
35 |
36 | public long getItemId(int arg0) {
37 | return (long) arg0;
38 | }
39 |
40 | public View getView(int position, View convertView, ViewGroup parent) {
41 | final ViewHolder holder;
42 | if (convertView == null) {
43 | holder = new ViewHolder();
44 | convertView = LayoutInflater.from(this.mContext).inflate(R.layout.list_item_test, null);
45 | holder.icon = (ImageView) convertView.findViewById(R.id.icon);
46 | holder.name = (TextView) convertView.findViewById(R.id.name1);
47 | holder.pkg = (TextView) convertView.findViewById(R.id.pkg);
48 | holder.path = (TextView) convertView.findViewById(R.id.path);
49 | holder.layout = (RelativeLayout) convertView.findViewById(R.id.RelativeLayout1);
50 | convertView.setTag(holder);
51 | } else {
52 | holder = (ViewHolder) convertView.getTag();
53 | }
54 | ListItem info = (ListItem) this.mListData.get(position);
55 | holder.icon.setImageDrawable(info.icon);
56 | holder.name.setText(info.name);
57 | holder.pkg.setText(info.pkg);
58 | holder.path.setText(info.path);
59 |
60 | /* holder.layout.setOnClickListener(new View.OnClickListener() {
61 | @Override
62 | public void onClick(View v) {
63 | holder.layout.setBackgroundColor(Color.parseColor("#F5F5DC"));
64 | }
65 | });*/
66 |
67 | return convertView;
68 | }
69 |
70 | static class ListItem {
71 | Drawable icon;
72 | String name;
73 | String path;
74 | String pkg;
75 |
76 | ListItem() {
77 | }
78 | }
79 |
80 | final class ViewHolder {
81 | public ImageView icon;
82 | public TextView name;
83 | public TextView path;
84 | public TextView pkg;
85 | public RelativeLayout layout;
86 | }
87 |
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/HookLogin.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication;
2 |
3 | import android.content.res.Resources;
4 | import android.view.View;
5 |
6 | import java.lang.reflect.Method;
7 |
8 | import de.robv.android.xposed.XC_MethodHook;
9 | import de.robv.android.xposed.XposedHelpers;
10 | import de.robv.android.xposed.callbacks.XC_LoadPackage;
11 |
12 | public class HookLogin {
13 |
14 | public static void HookImp(final XC_LoadPackage.LoadPackageParam lpparam)
15 | {
16 |
17 | if(true
18 | )
19 | {
20 | Class> class1 = XposedHelpers.findClass("android.view.View",lpparam.classLoader);
21 | try {
22 | Class> aClass = XposedHelpers.findClass("android.support.v4.app.FragmentActivity", lpparam.classLoader);
23 |
24 | if (aClass==null){
25 | return;
26 | }
27 |
28 | XposedHelpers.findAndHookMethod("android.support.v4.app.FragmentActivity", lpparam.classLoader,
29 | "viewToString", class1, new XC_MethodHook() {
30 | @Override
31 | protected void afterHookedMethod(MethodHookParam param)
32 | throws Throwable {
33 |
34 |
35 |
36 | char v11 = ',';
37 | String text=".";
38 | View view =(View)param.args[0];
39 | StringBuilder v2 = new StringBuilder(228);
40 | String name = view.getClass().getName();
41 | v2.append(name);
42 | v2.append('{');
43 |
44 | int[] location = new int[2];
45 | view.getLocationOnScreen(location);
46 | v2.append(location[0]);
47 | v2.append(v11);
48 | v2.append(location[1]);
49 | v2.append(v11);
50 | v2.append(view.getWidth());
51 | v2.append(v11);
52 | v2.append(view.getHeight());
53 | v2.append(v11);
54 | char v9 = 'V';
55 | switch(view.getVisibility()) {
56 | case 0: {
57 | v2.append(v9); //�ɼ�
58 | break;
59 | }
60 | case 4: {
61 | v2.append('I'); //���ɼ�
62 | break;
63 | }
64 | case 8: {
65 | v2.append('G');//���ɼ�
66 | break;
67 | }
68 | default: {
69 | v2.append(text);//δ֪
70 | break;
71 | }
72 | }
73 |
74 | v2.append(v11);
75 |
76 | try {
77 | Method method = view.getClass().getMethod("getText");
78 | text =(String) method.invoke(view);
79 | v2.append(text);
80 | } catch (Throwable e) {
81 | }
82 |
83 | int v1 = view.getId();
84 | if(v1 != -1) {
85 | Resources v4 = view.getResources();
86 | if(v4!=null)
87 | {
88 | String v3="";
89 | switch(-16777216 & v1) {
90 | case 16777216:
91 | v3 = "android";
92 | break;
93 | case 2130706432:
94 | v3 = "app";
95 | break;
96 | default: {
97 | try {
98 | v3 = v4.getResourcePackageName(v1);
99 | }
100 | catch(Resources.NotFoundException v6_1) {
101 | v3="unknow";
102 | }
103 | }
104 | }
105 | String v5 = v4.getResourceTypeName(v1);
106 | String v0 = v4.getResourceEntryName(v1);
107 | v2.append(v11);
108 | v2.append(v3);
109 | v2.append(":");
110 | v2.append(v5);
111 | v2.append("/");
112 | v2.append(v0);
113 | }
114 | }
115 | else{
116 | v2.append(v11);
117 | }
118 | v2.append("}");
119 | param.setResult(v2.toString());
120 |
121 | }
122 | });
123 |
124 | } catch (Exception e1) {
125 | return;
126 | }
127 | }
128 |
129 |
130 |
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication;
2 |
3 | import android.content.pm.PackageInfo;
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.view.View;
8 | import android.widget.AdapterView;
9 | import android.widget.ListView;
10 | import android.widget.TextView;
11 |
12 | import com.dexpaser.zk.myapplication.Util.ApkInfo;
13 | import com.dexpaser.zk.myapplication.Util.ApkUtils;
14 |
15 | import java.io.BufferedReader;
16 | import java.io.File;
17 | import java.io.FileOutputStream;
18 | import java.io.FileReader;
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | public class MainActivity extends AppCompatActivity {
23 | boolean mHasRoot = true;
24 | private AppListAdapter mListAdapter;
25 | private List mListData;
26 | private ListView mListView;
27 | TextView text;
28 |
29 | {
30 | // System.loadLibrary("zkjg-lib");
31 | }
32 |
33 |
34 | public static native void aaattachBaseContext(int base, String my_packageName);
35 |
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.main);
39 | this.mHasRoot = isRoot();
40 | init();
41 |
42 |
43 |
44 |
45 |
46 | // hookRes.replaceClassLoader(getPackageName(),getClassLoader());
47 |
48 | }
49 |
50 | private void init() {
51 | CharSequence charSequence;
52 | if (this.mListData == null) {
53 | this.mListData = new ArrayList();
54 | }
55 | this.text = (TextView) findViewById(R.id.text);
56 | List packages = getPackageManager().getInstalledPackages(0);
57 | for (int i = 0; i < packages.size(); i++) {
58 | PackageInfo pak = (PackageInfo) packages.get(i);
59 | if ((pak.applicationInfo.flags & pak.applicationInfo.FLAG_SYSTEM) <= 0) {
60 | AppListAdapter.ListItem item = new AppListAdapter.ListItem();
61 | PackageInfo packageInfo = (PackageInfo) packages.get(i);
62 | item.icon = packageInfo.applicationInfo.loadIcon(getPackageManager());
63 | item.name = packageInfo.applicationInfo.loadLabel(getPackageManager()).toString();
64 | item.pkg = packageInfo.packageName;
65 | item.path = packageInfo.applicationInfo.publicSourceDir;
66 | this.mListData.add(item);
67 | }
68 |
69 |
70 | }
71 | TextView textView = this.text;
72 | if (this.mHasRoot) {
73 | charSequence = "";
74 | } else {
75 | charSequence = "";
76 | }
77 | // textView.setText(charSequence);
78 | initWidgets();
79 | }
80 |
81 | private boolean isRoot() {
82 | if (new File("/system/bin/su").exists() || new File("/system/xbin/su").exists()) {
83 | return true;
84 | }
85 | return false;
86 | }
87 |
88 | private void initWidgets() {
89 | this.mListView = (ListView) findViewById(R.id.list);
90 | this.mListAdapter = new AppListAdapter(this, this.mListData);
91 | this.mListView.setAdapter(this.mListAdapter);
92 |
93 | this.mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
94 | @Override
95 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
96 | parent.getItemAtPosition(position);
97 | view.setBackgroundColor(Color.parseColor("#F5F5DC"));
98 | String apkpath = mListData.get(position).path;
99 |
100 | ApkInfo apkInfo = ApkUtils.getApkInfo(apkpath);
101 |
102 |
103 | String my_packageName = apkInfo.getPackageName();
104 | String protect_Application = apkInfo.getApplication();
105 | String Main_Activity = apkInfo.getActivityName();
106 |
107 | writeFileData(my_packageName + "::" + protect_Application + "::" + Main_Activity);
108 |
109 | String s = readFile();
110 |
111 |
112 | }
113 | });
114 | }
115 |
116 |
117 | public void writeFileData(String message) {
118 |
119 | try {
120 |
121 | File file = new File("/sdcard/tuoke.txt");
122 | FileOutputStream fout = new FileOutputStream(file);
123 | byte[] bytes = message.getBytes();
124 |
125 | fout.write(bytes);
126 |
127 | fout.close();
128 |
129 | } catch (Exception e) {
130 |
131 | e.printStackTrace();
132 |
133 | }
134 |
135 | }
136 |
137 | public static String readFile() {
138 | StringBuffer sb = null;
139 | try {
140 | File file = new File("/sdcard/tuoke.txt");
141 | BufferedReader br = new BufferedReader(new FileReader(file));
142 | String readline = "";
143 | sb = new StringBuffer();
144 | while ((readline = br.readLine()) != null) {
145 | System.out.println("readline:" + readline);
146 | sb.append(readline);
147 | }
148 | br.close();
149 | System.out.println("读取成功:" + sb.toString());
150 | } catch (Exception e) {
151 |
152 | e.printStackTrace();
153 | return null;
154 | }
155 | return sb.toString();
156 | }
157 |
158 | }
159 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/Util/ApkInfo.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication.Util;
2 |
3 | /**
4 | * Created by zk on 2017/8/25.
5 | */
6 |
7 | public class ApkInfo {
8 |
9 | String apkName;
10 | String packageName;
11 | String application;
12 | String activityName;
13 | boolean bInit;
14 |
15 | public boolean isbInit()
16 | {
17 | return this.bInit;
18 | }
19 |
20 | public void setbInit(boolean bInit)
21 | {
22 | this.bInit = bInit;
23 | }
24 |
25 | public String getApkName()
26 | {
27 | return this.apkName;
28 | }
29 |
30 | public void setApkName(String apkName)
31 | {
32 | this.apkName = apkName;
33 | }
34 |
35 | public String getPackageName()
36 | {
37 | return this.packageName;
38 | }
39 |
40 | public void setPackageName(String packageName)
41 | {
42 | this.packageName = packageName;
43 | }
44 |
45 | public String getActivityName()
46 | {
47 | return this.activityName;
48 | }
49 |
50 | public void setActivityName(String activityName)
51 | {
52 | if(activityName==null){
53 | return;
54 | }
55 |
56 | int length = activityName.split("\\.").length;
57 |
58 | if(activityName.startsWith(".")){
59 | this.activityName=packageName+activityName;
60 | } else if(length==0){
61 | this.activityName=packageName+"."+activityName;
62 | } else{
63 | this.activityName = activityName;
64 | }
65 |
66 | }
67 |
68 | public String getApplication()
69 | {
70 | return this.application;
71 | }
72 |
73 | public void setApplication(String application)
74 | {
75 | if (application==null){
76 | return;
77 | }
78 | int length = application.split("\\.").length;
79 |
80 | if(application.startsWith(".")){
81 | this.application=packageName+application;
82 | }
83 | else if(length==0){
84 | this.application=packageName+"."+application;
85 | } else{
86 | this.application = application;
87 | }
88 | }
89 |
90 |
91 | @Override
92 | public String toString() {
93 | return "ApkInfo{" +
94 | "apkName='" + apkName + '\'' +
95 | ", packageName='" + packageName + '\'' +
96 | ", application='" + application + '\'' +
97 | ", activityName='" + activityName + '\'' +
98 | ", bInit=" + bInit +
99 | '}';
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/Util/ApkUtils.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication.Util;
2 |
3 | /**
4 | * Created by zk on 2017/8/25.
5 | */
6 |
7 |
8 | public class ApkUtils {
9 | public static ApkInfo getApkInfo(String path) {
10 | ApkInfo apkInfo = new ApkInfo();
11 | apkInfo.setApkName(path);
12 | String xml = AXMLPrinter.getManifestXMLFromAPK(path);
13 | System.out.println(xml);
14 | String packName = Dom4jXMLUtils.getPackageName(xml);
15 |
16 | apkInfo.setPackageName(packName);
17 | String applicationName = Dom4jXMLUtils.getApplicationName(xml);
18 |
19 | apkInfo.setApplication(applicationName);
20 | String activity = Dom4jXMLUtils.getMainActivty(xml);
21 |
22 | apkInfo.setActivityName(activity);
23 | return apkInfo;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/Util/CMDUtil.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication.Util;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStreamReader;
6 |
7 | /**
8 | * Created by zk on 2017/7/1.
9 | */
10 |
11 | public class CMDUtil {
12 |
13 |
14 |
15 |
16 | public static void runCMD(String cmd){
17 | try {
18 | Process process=Runtime.getRuntime().exec(cmd);
19 | BufferedReader br=new BufferedReader(new InputStreamReader(process.getInputStream()));
20 | String line=null;
21 | while ((line=br.readLine())!=null){
22 | System.out.println(line);
23 | }
24 |
25 | if (br==null){
26 | br.close();;
27 | }
28 |
29 | } catch (IOException e) {
30 | e.printStackTrace();
31 | }
32 | }
33 |
34 |
35 |
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dexpaser/zk/myapplication/Util/ss.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication.Util;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | /**
7 | * Created by zk on 2017/8/25.
8 | */
9 |
10 | public class ss extends Application {
11 |
12 |
13 | @Override
14 | public Context getBaseContext() {
15 | return super.getBaseContext();
16 | }
17 |
18 | @Override
19 | protected void attachBaseContext(Context base) {
20 | super.attachBaseContext(base);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/org/xmlpull/v1/free/XmlPullParserException.java:
--------------------------------------------------------------------------------
1 | /* -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- //------100-columns-wide------>|*/
2 | // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)
3 |
4 | package org.xmlpull.v1.free;
5 |
6 | /**
7 | * This exception is thrown to signal XML Pull Parser related faults.
8 | *
9 | * @author Aleksander Slominski
10 | */
11 | public class XmlPullParserException extends Exception {
12 | protected Throwable detail;
13 | protected int row = -1;
14 | protected int column = -1;
15 |
16 | /* public XmlPullParserException() {
17 | }*/
18 |
19 | public XmlPullParserException(String s) {
20 | super(s);
21 | }
22 |
23 | /*
24 | public XmlPullParserException(String s, Throwable thrwble) {
25 | super(s);
26 | this.detail = thrwble;
27 | }
28 |
29 | public XmlPullParserException(String s, int row, int column) {
30 | super(s);
31 | this.row = row;
32 | this.column = column;
33 | }
34 | */
35 |
36 | public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) {
37 | super ((msg == null ? "" : msg+" ")
38 | + (parser == null ? "" : "(position:"+parser.getPositionDescription()+") ")
39 | + (chain == null ? "" : "caused by: "+chain));
40 |
41 | if (parser != null) {
42 | this.row = parser.getLineNumber();
43 | this.column = parser.getColumnNumber();
44 | }
45 | this.detail = chain;
46 | }
47 |
48 | public Throwable getDetail() { return detail; }
49 | // public void setDetail(Throwable cause) { this.detail = cause; }
50 | public int getLineNumber() { return row; }
51 | public int getColumnNumber() { return column; }
52 |
53 | /*
54 | public String getMessage() {
55 | if(detail == null)
56 | return super.getMessage();
57 | else
58 | return super.getMessage() + "; nested exception is: \n\t"
59 | + detail.getMessage();
60 | }
61 | */
62 |
63 | //NOTE: code that prints this and detail is difficult in J2ME
64 | public void printStackTrace() {
65 | if (detail == null) {
66 | super.printStackTrace();
67 | } else {
68 | synchronized(System.err) {
69 | System.err.println(super.getMessage() + "; nested exception is:");
70 | detail.printStackTrace();
71 | }
72 | }
73 | }
74 |
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/app/src/main/lib/XposedBridge-82.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/lib/XposedBridge-82.jar
--------------------------------------------------------------------------------
/app/src/main/libs/dom4j-2.0.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/libs/dom4j-2.0.1.jar
--------------------------------------------------------------------------------
/app/src/main/libs/substrate-api.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/libs/substrate-api.jar
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
24 |
25 |
32 |
33 |
40 |
41 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_test.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
24 |
25 |
31 |
32 |
37 |
38 |
44 |
45 |
50 |
51 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Application
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/dexpaser/zk/myapplication/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser.zk.myapplication;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.1'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | google()
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/dexpaserl.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/dexpaserl.zip
--------------------------------------------------------------------------------
/dexpaserl/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/dexpaserl/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | dependencies {
4 | compile fileTree(dir: 'libs', include: ['*.jar'])
5 | }
6 |
7 | sourceCompatibility = "1.7"
8 | targetCompatibility = "1.7"
9 |
--------------------------------------------------------------------------------
/dexpaserl/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/dexpaserl/classes.dex
--------------------------------------------------------------------------------
/dexpaserl/src/main/java/com/dexpaser/Header.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser;
2 |
3 | /**
4 | * Created by zk on 2017/6/12.
5 | */
6 |
7 | public class Header {
8 |
9 |
10 | byte[] dex_magic;
11 | byte[] checksum;
12 | byte[]MSHA1;
13 | int file_size;
14 | int header_size ;
15 | int endian_tag ;
16 | int link_size ;
17 | int link_off;
18 | int map_off ;
19 | int string_ids_size ;
20 | int string_ids_off ;
21 | int type_ids_size ;
22 | int type_ids_off;
23 | int proto_ids_size ;
24 | int proto_ids_off ;
25 | int field_ids_size;
26 | int field_ids_off;
27 | int method_ids_size;
28 | int method_ids_off ;
29 | int class_defs_size;
30 | int class_defs_off ;
31 | int data_size ;
32 | int data_off;
33 |
34 |
35 | @Override
36 | public String toString() {
37 | return "Header{" +
38 | "\n\tdex_magic = " + PaserUtil.byteArray2String(dex_magic) +
39 | ", \n\tchecksum = " + PaserUtil.byteArray2String(checksum) +
40 | ", \n\tMSHA1 = " + PaserUtil.byteArray2String(MSHA1) +
41 | ", \n\tfile_size = " + file_size +
42 | ", \n\theader_size = " + header_size +
43 | ", \n\tendian_tag = " + Integer.toHexString(endian_tag) +
44 | ", \n\tlink_size = " + link_size +
45 | ", \n\tlink_off = " + link_off +
46 | ", \n\tmap_off = " + map_off +
47 | ", \n\tstring_ids_size = " + string_ids_size +
48 | ", \n\tstring_ids_off = " + string_ids_off +
49 | ", \n\ttype_ids_size = " + type_ids_size +
50 | ", \n\ttype_ids_off = " + type_ids_off +
51 | ", \n\tproto_ids_size = " + proto_ids_size +
52 | ", \n\tproto_ids_off = " + proto_ids_off +
53 | ", \n\tfield_ids_size = " + field_ids_size +
54 | ", \n\tfield_ids_off = " + field_ids_off +
55 | ", \n\tmethod_ids_size = " + method_ids_size +
56 | ", \n\tmethod_ids_off = " + method_ids_off +
57 | ", \n\tclass_defs_size = " + class_defs_size +
58 | ", \n\tclass_defs_off = " + class_defs_off +
59 | ", \n\tdata_size = " + data_size +
60 | ", \n\tdata_off = " + data_off +
61 | '}';
62 | }
63 |
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/dexpaserl/src/main/java/com/dexpaser/PaserHaeder.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.File;
5 | import java.io.FileInputStream;
6 | import java.io.InputStream;
7 |
8 | import static com.dexpaser.PaserUtil.byte2int;
9 |
10 | /**
11 | * Created by zk on 2017/6/12.
12 | */
13 |
14 | public class PaserHaeder {
15 | public static int DexFileBytesIndex = 0;
16 | public static byte DexFileBytes[] = readDexFile("/Users/zk/Documents/andriod/Development/workspace/hook和解析dex/app/build/outputs/apk/app-debug/classes.dex");
17 | public static Header header;
18 | public static int DexFileBytesIndex2 = 0;
19 |
20 | public static byte[] readDexFile(String path) {
21 | try {
22 | int byteread = 0;
23 | File oldfile = new File(path);
24 | if (oldfile.exists()) { //文件存在时
25 | InputStream inStream = new FileInputStream(path); //读入原文件
26 | ByteArrayOutputStream bos = new ByteArrayOutputStream();
27 | byte[] buffer = new byte[1024];
28 | int length = 0;
29 | while ((byteread = inStream.read(buffer)) != -1) {
30 | bos.write(buffer, 0, byteread);
31 | }
32 | inStream.close();
33 | return bos.toByteArray();
34 | }
35 | } catch (Exception e) {
36 | System.out.println("复制单个文件操作出错");
37 | e.printStackTrace();
38 | }
39 | return null;
40 | }
41 |
42 | public static byte[] getHeaderInfoByoff(int lenth) {
43 |
44 | byte[] bytes = new byte[lenth];
45 | for (int i = 0; i < lenth; i++) {
46 | bytes[i] = DexFileBytes[DexFileBytesIndex + i];
47 | }
48 | DexFileBytesIndex += lenth;
49 | return bytes;
50 |
51 | }
52 |
53 |
54 | public static byte[] getHeaderInfoByoff2(int lenth) {
55 |
56 | byte[] bytes = new byte[lenth];
57 | for (int i = 0; i < lenth; i++) {
58 | bytes[i] = DexFileBytes[DexFileBytesIndex2 + i];
59 | }
60 | DexFileBytesIndex2 += lenth;
61 | return bytes;
62 |
63 | }
64 |
65 | public static byte[] getHeaderInfoByoff(int off, int lenth) {
66 |
67 | byte[] bytes = new byte[lenth];
68 | for (int i = 0; i < lenth; i++) {
69 | bytes[i] = DexFileBytes[off + i];
70 | }
71 | return bytes;
72 |
73 | }
74 |
75 |
76 | public static void showAll(){
77 |
78 | header = new Header();
79 |
80 | byte[] dex_magic = getHeaderInfoByoff(8);
81 | byte[] checksum = getHeaderInfoByoff(4);
82 | byte[] MSHA1 = getHeaderInfoByoff(20);
83 | byte[] file_size = getHeaderInfoByoff(4);
84 | byte[] header_size = getHeaderInfoByoff(4);
85 | byte[] endian_tag = getHeaderInfoByoff(4);
86 | byte[] link_size = getHeaderInfoByoff(4);
87 | byte[] link_off = getHeaderInfoByoff(4);
88 | byte[] map_off = getHeaderInfoByoff(4);
89 | byte[] string_ids_size = getHeaderInfoByoff(4);
90 | byte[] string_ids_off = getHeaderInfoByoff(4);
91 | byte[] type_ids_size = getHeaderInfoByoff(4);
92 | byte[] type_ids_off = getHeaderInfoByoff(4);
93 | byte[] proto_ids_size = getHeaderInfoByoff(4);
94 | byte[] proto_ids_off = getHeaderInfoByoff(4);
95 | byte[] field_ids_size = getHeaderInfoByoff(4);
96 | byte[] field_ids_off = getHeaderInfoByoff(4);
97 | byte[] method_ids_size = getHeaderInfoByoff(4);
98 | byte[] method_ids_off = getHeaderInfoByoff(4);
99 | byte[] class_defs_size = getHeaderInfoByoff(4);
100 | byte[] class_defs_off = getHeaderInfoByoff(4);
101 | byte[] data_size = getHeaderInfoByoff(4);
102 | byte[] data_off = getHeaderInfoByoff(4);
103 |
104 |
105 | header.dex_magic = dex_magic;
106 | header.checksum = checksum;
107 | header.MSHA1 = MSHA1;
108 |
109 | header.file_size = byte2int(file_size);
110 | header.header_size = byte2int(header_size);
111 | header.endian_tag = byte2int(endian_tag);
112 | header.link_size = byte2int(link_size);
113 | header.link_off = byte2int(link_off);
114 | header.map_off = byte2int(map_off);
115 | header.string_ids_size = byte2int(string_ids_size);
116 | header.string_ids_off = byte2int(string_ids_off);
117 | header.type_ids_size = byte2int(type_ids_size);
118 | header.type_ids_off = byte2int(type_ids_off);
119 | header.proto_ids_size = byte2int(proto_ids_size);
120 | header.proto_ids_off = byte2int(proto_ids_off);
121 | header.field_ids_size = byte2int(field_ids_size);
122 | header.field_ids_off = byte2int(field_ids_off);
123 | header.method_ids_size = byte2int(method_ids_size);
124 | header.method_ids_off = byte2int(method_ids_off);
125 | header.class_defs_size = byte2int(class_defs_size);
126 | header.class_defs_off = byte2int(class_defs_off);
127 | header.data_size = byte2int(data_size);
128 | header.data_off = byte2int(data_off);
129 |
130 | System.out.println(header.toString());
131 |
132 |
133 | PaserItemsPaser.paserStringId();
134 | PaserItemsPaser.paserTypeId();
135 | PaserItemsPaser.paserProtoId();
136 | PaserItemsPaser.paserFieldId();
137 | PaserItemsPaser.paserMethodId();
138 | PaserItemsPaser.paserClassId();
139 |
140 | }
141 |
142 |
143 | public static void main(String[] args) {
144 | showAll();
145 |
146 | }
147 |
148 |
149 | }
150 |
--------------------------------------------------------------------------------
/dexpasermode/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/dexpasermode/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java'
2 |
3 | dependencies {
4 | compile fileTree(dir: 'libs', include: ['*.jar'])
5 | }
6 |
7 | sourceCompatibility = "1.7"
8 | targetCompatibility = "1.7"
9 |
--------------------------------------------------------------------------------
/dexpasermode/src/main/java/com/dexpaser/Header.java:
--------------------------------------------------------------------------------
1 | package com.dexpaser;
2 |
3 | /**
4 | * Created by zk on 2017/6/12.
5 | */
6 |
7 | public class Header {
8 |
9 |
10 | byte[] dex_magic;
11 | byte[] checksum;
12 | byte[]MSHA1;
13 | int file_size;
14 | int header_size ;
15 | int endian_tag ;
16 | int link_size ;
17 | int link_off;
18 | int map_off ;
19 | int string_ids_size ;
20 | int string_ids_off ;
21 | int type_ids_size ;
22 | int type_ids_off;
23 | int proto_ids_size ;
24 | int proto_ids_off ;
25 | int field_ids_size;
26 | int field_ids_off;
27 | int method_ids_size;
28 | int method_ids_off ;
29 | int class_defs_size;
30 | int class_defs_off ;
31 | int data_size ;
32 | int data_off;
33 |
34 |
35 | @Override
36 | public String toString() {
37 | return "Header{" +
38 | "\n\tdex_magic = " + PaserUtil.byteArray2String(dex_magic) +
39 | ", \n\tchecksum = " + PaserUtil.byteArray2String(checksum) +
40 | ", \n\tMSHA1 = " + PaserUtil.byteArray2String(MSHA1) +
41 | ", \n\tfile_size = " + file_size +
42 | ", \n\theader_size = " + header_size +
43 | ", \n\tendian_tag = " + Integer.toHexString(endian_tag) +
44 | ", \n\tlink_size = " + link_size +
45 | ", \n\tlink_off = " + link_off +
46 | ", \n\tmap_off = " + map_off +
47 | ", \n\tstring_ids_size = " + string_ids_size +
48 | ", \n\tstring_ids_off = " + string_ids_off +
49 | ", \n\ttype_ids_size = " + type_ids_size +
50 | ", \n\ttype_ids_off = " + type_ids_off +
51 | ", \n\tproto_ids_size = " + proto_ids_size +
52 | ", \n\tproto_ids_off = " + proto_ids_off +
53 | ", \n\tfield_ids_size = " + field_ids_size +
54 | ", \n\tfield_ids_off = " + field_ids_off +
55 | ", \n\tmethod_ids_size = " + method_ids_size +
56 | ", \n\tmethod_ids_off = " + method_ids_off +
57 | ", \n\tclass_defs_size = " + class_defs_size +
58 | ", \n\tclass_defs_off = " + class_defs_off +
59 | ", \n\tdata_size = " + data_size +
60 | ", \n\tdata_off = " + data_off +
61 | '}';
62 | }
63 |
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Oct 30 17:57:27 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/hook_wx/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/hook_wx/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 |
6 |
7 |
8 | defaultConfig {
9 | applicationId "com.example.hook_wx"
10 | minSdkVersion 19
11 | targetSdkVersion 26
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(include: ['*.jar'], dir: 'libs')
30 | implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
31 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
32 | testImplementation 'junit:junit:4.12'
33 | androidTestImplementation 'com.android.support.test:runner:0.5'
34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
35 | provided files('src/main/lib/XposedBridge-82.jar')
36 | }
37 |
--------------------------------------------------------------------------------
/hook_wx/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 |
--------------------------------------------------------------------------------
/hook_wx/src/androidTest/java/com/example/hook_wx/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hook_wx;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.hook_wx", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/hook_wx/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/hook_wx/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.example.hook_wx.HookDevice
--------------------------------------------------------------------------------
/hook_wx/src/main/java/com/example/hook_wx/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.hook_wx;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/hook_wx/src/main/lib/XposedBridge-82.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/lib/XposedBridge-82.jar
--------------------------------------------------------------------------------
/hook_wx/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hook_wx/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hook_wx/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Hook_WX
3 |
4 |
--------------------------------------------------------------------------------
/hook_wx/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hook_wx/src/test/java/com/example/hook_wx/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hook_wx;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/hookcheck/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/hookcheck/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hookcheck/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 1.8
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/hookcheck/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hookcheck/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hookcheck/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | buildToolsVersion "27.0.2"
6 |
7 |
8 | defaultConfig {
9 | applicationId "com.example.hookcheck"
10 | minSdkVersion 19
11 | targetSdkVersion 26
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | compile fileTree(include: ['*.jar'], dir: 'libs')
30 | compile 'com.android.support:appcompat-v7:26.1.0'
31 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
32 | testCompile 'junit:junit:4.12'
33 | androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
34 | exclude group: 'com.android.support', module: 'support-annotations'
35 | })
36 | compileOnly files('src/main/lib/XposedBridge-82.jar')
37 | }
38 |
--------------------------------------------------------------------------------
/hookcheck/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/hookcheck/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Dec 23 12:32:19 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/hookcheck/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/hookcheck/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Sat Dec 23 12:31:52 CST 2017
11 | ndk.dir=/Users/zk/Library/Android/sdk/ndk-bundle
12 | sdk.dir=/Users/zk/Library/Android/sdk
13 |
--------------------------------------------------------------------------------
/hookcheck/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 |
--------------------------------------------------------------------------------
/hookcheck/src/androidTest/java/com/example/hookcheck/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hookcheck;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.hookcheck", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/hookcheck/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
32 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/hookcheck/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.example.hookcheck.methodHookStart1
--------------------------------------------------------------------------------
/hookcheck/src/main/java/com/example/hookcheck/Encode1.java:
--------------------------------------------------------------------------------
1 | package com.example.hookcheck;
2 |
3 | import android.util.Log;
4 |
5 | import java.nio.ByteBuffer;
6 |
7 | /**
8 | * Created by zk on 2017/12/21.
9 | */
10 |
11 | public class Encode1 {
12 |
13 | class bp{
14 | public String a="1.0"; //version 默认
15 | public String b="5836a0ab7f2c746c4b001800";//address UMENG_APPKEY 默认
16 | public String c="fd123933bffbc688b5aec3046b2f8e95d54b1bec2fcfcbadd887b476a3413a5a";//signature
17 | public int d=1;//serial_num
18 | public int e=1513755389; //ts_secs ((int)(System.currentTimeMillis() / 1000));//ts_secs
19 | public int f=694;//length
20 | /* entity:*/ public ByteBuffer g=ByteBuffer.wrap(Encode.hexStringToBytes("789C8D924F6BD440188787DDA6420FED2A24BCB239E4182F613299C9CCE6B68858B0EAE21FF420C89B9959136836344B17DCCF504A0FBDFB097AF028540F7E02BD79F423F8114CD62E167451E6383F9EF7797F33BE4BBA437C00A1921429E672CAB4E4A9E639A5B1A2141C16B148B89FFBB0A7EB2A9A2F8F4C644A3CB48D4BC011118F18ECBE3D5E16C7387BA3EDBC2899E8887B8918C54C5091A49C2AC1204845C230E59A1BE44A68118FB84E7383DA4A25F338819B5395E12833349371969A8CCAF0D6F8F1D34950CF827DAC2ADBEC5B34301C3F79B890C1A4A9DB71F3BA091ABB0868102EE4E11DB8319E99A62E0D38BC55E3BEFB7DE8FE1810B553AC0045075867BC2FE7EFDE7F7801FD83FBF760FBC1B3E78A4FE05A90F8ED8ABD6501BDBB8F14115BC4F72E2FBF5E9CBE240743E764077F515EB7C3065621DAA9540CF5C83226BC6F1FBBA0DB23FD0AF55F36F3CE3E5D05B6E7B669FB84014D8DC59C699EA0CA636EBDD375C4294D65C4BF1BFC0DDD2A2B5BFEF106DEC9FAFEF62BB8E61F6EF227B002851B4004AEE4C34DF2ED1759B987FFEB4EA02B2CDC581821E4272B5FC8F1"));
21 | public String h="00003933bffbc688b5aec3046b2f8e95d54b1bec2fcfcbadd887b476a3410000";//guid
22 | public String i="8a40e464395aa7b957456e28af9c6563";//checksum
23 | public int j=0;//codex
24 |
25 | }
26 |
27 |
28 |
29 |
30 |
31 |
32 | private final Encode.db m = new Encode.db("version", (byte) 11, (short) 1);
33 | private final Encode.db n = new Encode.db("address", (byte) 11, (short) 2);
34 | private final Encode.db o = new Encode.db("signature", (byte) 11, (short) 3);
35 | private final Encode.db p = new Encode.db("serial_num", (byte) 8, (short) 4);
36 | private final Encode.db q = new Encode.db("ts_secs", (byte) 8, (short) 5);
37 | private final Encode.db r = new Encode.db("length", (byte) 8, (short) 6);
38 | private final Encode.db s = new Encode.db("entity", (byte) 11, (short) 7);
39 | private final Encode.db t = new Encode.db("guid", (byte) 11, (short) 8);
40 | private final Encode.db u = new Encode.db("checksum", (byte) 11, (short) 9);
41 | private final Encode.db v = new Encode.db("codex", (byte) 8, (short) 10);
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | public void b() {
50 | bp bpVar= new bp();
51 |
52 | Encode.a();
53 | if (bpVar.a != null) {
54 | Encode.a(m);
55 | Encode.a(bpVar.a);
56 | }
57 | if (bpVar.b != null) {
58 | Encode.a(n);
59 | Encode.a(bpVar.b);
60 | }
61 | if (bpVar.c != null) {
62 | Encode.a(o);
63 | Encode.a(bpVar.c);
64 | }
65 | Encode.a(p);
66 | Encode. a(bpVar.d);
67 | Encode. a(q);
68 | Encode. a(bpVar.e);
69 | Encode.a(r);
70 | Encode. a(bpVar.f);
71 | if (bpVar.g != null) {
72 | Encode. a(s);
73 | Encode. a(bpVar.g);
74 | }
75 | if (bpVar.h != null) {
76 | Encode. a(t);
77 | Encode. a(bpVar.h);
78 | }
79 | if (bpVar.i != null) {
80 | Encode. a(u);
81 | Encode. a(bpVar.i);
82 | }
83 | if (Encode.H()) {
84 | Encode. a(v);
85 | Encode. a(bpVar.j);
86 | }
87 | Encode.d();
88 | Encode. b();
89 | Log.e("wodelog", Encode.buffer.toString());
90 | Encode.buffer.setLength(0);
91 | }
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/hookcheck/src/main/java/com/example/hookcheck/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.hookcheck;
2 |
3 | import android.app.Activity;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.util.Log;
7 |
8 | import java.nio.ByteBuffer;
9 | import java.util.Locale;
10 |
11 | public class MainActivity extends Activity {
12 |
13 |
14 |
15 |
16 |
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_main);
22 |
23 | new Encode1().b();;
24 | }
25 |
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/hookcheck/src/main/lib/XposedBridge-82.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/lib/XposedBridge-82.jar
--------------------------------------------------------------------------------
/hookcheck/src/main/lib/XposedBridgeApi-54.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/lib/XposedBridgeApi-54.jar
--------------------------------------------------------------------------------
/hookcheck/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookcheck/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookcheck/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | HookCheck
3 |
4 |
--------------------------------------------------------------------------------
/hookcheck/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hookcheck/src/test/java/com/example/hookcheck/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hookcheck;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/hookdeviceinfo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/hookdeviceinfo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # For more information about using CMake with Android Studio, read the
2 | # documentation: https://d.android.com/studio/projects/add-native-code.html
3 |
4 | # Sets the minimum version of CMake required to build the native library.
5 |
6 | cmake_minimum_required(VERSION 3.4.1)
7 |
8 | # Creates and names a library, sets it as either STATIC
9 | # or SHARED, and provides the relative paths to its source code.
10 | # You can define multiple libraries, and CMake builds them for you.
11 | # Gradle automatically packages shared libraries with your APK.
12 |
13 | file(GLOB native_srcs "src/main/cpp/*.cpp"
14 |
15 | )
16 | add_library( # Sets the name of the library.
17 | zkjg-lib
18 |
19 | # Sets the library as a shared library.
20 | SHARED
21 |
22 | # Provides a relative path to your source file(s).
23 | ${native_srcs})
24 |
25 |
26 |
27 | # Searches for a specified prebuilt library and stores the path as a
28 | # variable. Because CMake includes system libraries in the search path by
29 | # default, you only need to specify the name of the public NDK library
30 | # you want to add. CMake verifies that the library exists before
31 | # completing its build.
32 |
33 | find_library( # Sets the name of the path variable.
34 | log-libxxx
35 |
36 | # Specifies the name of the NDK library that
37 | # you want CMake to locate.
38 | log )
39 |
40 | # Specifies libraries CMake should link to your target library. You
41 | # can link multiple libraries, such as libraries you define in this
42 | # build script, prebuilt third-party libraries, or system libraries.
43 |
44 | target_link_libraries( # Specifies the target library.
45 | zkjg-lib
46 | # Links the target library to the log library
47 | # included in the NDK.
48 | /Users/zk/Documents/Android/Development/workspace/hook和解析dex/hookdeviceinfo/src/main/cpp/libsubstrate.so
49 | /Users/zk/Documents/Android/Development/workspace/hook和解析dex/hookdeviceinfo/src/main/cpp/libsubstrate-dvm.so
50 | ${log-libxxx} )
--------------------------------------------------------------------------------
/hookdeviceinfo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 |
6 |
7 |
8 | defaultConfig {
9 | applicationId "com.example.hookdeviceinfo"
10 | minSdkVersion 19
11 | targetSdkVersion 26
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | externalNativeBuild {
17 | cmake {
18 | cppFlags ""
19 | cppFlags.add("-std=c++11")
20 | cppFlags.add("-landroid")
21 | cppFlags.add("-lz")
22 | /* cppFlags.add("-Wwritable-strings")*/
23 |
24 | }
25 | }
26 | }
27 |
28 | buildTypes {
29 | release {
30 | minifyEnabled false
31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
32 | }
33 | }
34 | externalNativeBuild {
35 | cmake {
36 | path "CMakeLists.txt"
37 | }
38 | }
39 | }
40 |
41 | dependencies {
42 | implementation fileTree(include: ['*.jar'], dir: 'libs')
43 | implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
44 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
45 | testImplementation 'junit:junit:4.12'
46 | androidTestImplementation 'com.android.support.test:runner:0.5'
47 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
48 | compileOnly files('src/main/lib/XposedBridgeApi-54.jar')
49 | }
50 |
--------------------------------------------------------------------------------
/hookdeviceinfo/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 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/androidTest/java/com/example/hookdeviceinfo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdeviceinfo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.hookdeviceinfo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.example.hookdeviceinfo.HookDevice
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/cpp/libsubstrate-dvm.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/cpp/libsubstrate-dvm.so
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/cpp/libsubstrate.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/cpp/libsubstrate.so
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/cpp/native-lib.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | # include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include "substrate.h"
19 | #include
20 | #include
21 |
22 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,"wodelog", __VA_ARGS__)
23 |
24 | char propValue_all[PROP_VALUE_MAX] = {0};
25 |
26 |
27 |
28 | int (*old__system_property_read)(int pi, char *name, char *value);
29 |
30 | int new__system_property_read(int pi, char *name, char *value) {
31 | int result;
32 | if (strcmp(propValue_all,"ro.debuggable")==0){
33 | strcpy(value,"0");
34 | }
35 | else if (strcmp(propValue_all,"persist.service.bdroid.bdaddr")==0){
36 | strcpy(value,"88:77:66:55");
37 | }else if (strcmp(propValue_all,"ro.boot.serialno")==0||strcmp(propValue_all,"ro.serialno")==0){
38 | strcpy(value,"aaaaab2c43a8b14e");
39 | }else if (strcmp(propValue_all,"net.hostname")==0){
40 | strcpy(value,"android-e8aaef782ac9aaaa");
41 | }else{
42 | result = old__system_property_read(pi, name, value);
43 | }
44 | result=strlen(value);
45 |
46 | LOGD("hook result(%d) system_property_read(%s): %s ",result, propValue_all, value);
47 | return result;
48 | }
49 |
50 |
51 | int (*old__system_property_find)(const char *name);
52 |
53 | int new__system_property_find(const char *name) {
54 | memset(propValue_all, 0, PROP_VALUE_MAX);
55 | strcpy(propValue_all,name);
56 | return old__system_property_find(name);
57 | }
58 |
59 | int (*old__system_property_get)(char *name, char *value);
60 |
61 | int new__system_property_get( char *name, char *value) {
62 | int result = old__system_property_get( name, value);
63 | // LOGD("hook system_property_get:%s : %s ", name, value);
64 | return result;
65 | }
66 |
67 | //配置,这里是hook可运行程序(即NDK小程序)的写法,下面那个就是hook dvm的写法
68 | //MSConfig(MSFilterExecutable,"/system/bin/app_process")
69 | MSConfig(MSFilterLibrary, "libc.so");
70 | //程序入口
71 | MSInitialize {
72 | MSImageRef image = MSGetImageByName("/system/lib/libc.so");
73 | if (image != NULL) {
74 |
75 | void *hook__system_property_read = MSFindSymbol(image, "__system_property_read");
76 | if (hook__system_property_read)
77 | MSHookFunction(hook__system_property_read, (
78 | void *) &new__system_property_read, (void **) &old__system_property_read);
79 | else
80 | LOGD("error find __system_property_read ");
81 |
82 |
83 | void *hook____system_property_find = MSFindSymbol(image, "__system_property_find");
84 | if (hook____system_property_find)
85 | MSHookFunction(hook____system_property_find, (
86 | void *) &new__system_property_find, (void **) &old__system_property_find);
87 | else
88 | LOGD("error find __system_property_read ");
89 |
90 |
91 | void *__system_property_get = MSFindSymbol(image, "__system_property_get");
92 | if (__system_property_get)
93 | MSHookFunction(__system_property_get, (
94 | void *) &new__system_property_get, (void **) &old__system_property_get);
95 | else
96 | LOGD("error find __system_property_get ");
97 | }
98 | }
99 |
100 | extern "C" {
101 | JNIEXPORT void JNICALL
102 | Java_com_example_hookdeviceinfo_MainActivity_haha(JNIEnv *env, jobject instance) {
103 | char propValue[PROP_VALUE_MAX] = {0};
104 | __system_property_get("ro.boot.serialno", propValue);
105 | //LOGD("serial:%s", propValue);
106 |
107 | memset(propValue, 0, PROP_VALUE_MAX);
108 | __system_property_get("ro.serialno", propValue);
109 | // LOGD("serial:%s", propValue);
110 |
111 |
112 | memset(propValue, 0, PROP_VALUE_MAX);
113 | __system_property_get("net.hostname", propValue);
114 | // LOGD("android_id:%s", propValue);
115 |
116 | memset(propValue, 0, PROP_VALUE_MAX);
117 | __system_property_get("persist.service.bdroid.bdaddr", propValue);
118 | LOGD("mac:%s", propValue);
119 |
120 |
121 | memset(propValue, 0, PROP_VALUE_MAX);
122 | const prop_info *pi = __system_property_find("persist.service.bdroid.bdaddr");
123 | if (pi != 0) {
124 | __system_property_read(pi, 0, propValue);
125 | LOGD("mac:%s", propValue);
126 | }
127 |
128 |
129 | }
130 |
131 | }
132 | jint JNI_OnLoad(JavaVM *vm, void *reserved) {
133 |
134 | JNIEnv *env = NULL;
135 | jint result = -1;
136 | if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) {
137 | return result;
138 | }
139 |
140 | return JNI_VERSION_1_6;
141 |
142 | }
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/java/com/example/hookdeviceinfo/HookDevice.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdeviceinfo;
2 |
3 | import android.content.ContentResolver;
4 | import android.os.Build;
5 | import android.util.Log;
6 |
7 | import java.io.File;
8 |
9 | import de.robv.android.xposed.IXposedHookLoadPackage;
10 | import de.robv.android.xposed.XC_MethodHook;
11 | import de.robv.android.xposed.XposedHelpers;
12 | import de.robv.android.xposed.callbacks.XC_LoadPackage;
13 |
14 | /**
15 | * Created by zk on 2017/12/17.
16 | */
17 |
18 | public class HookDevice implements IXposedHookLoadPackage {
19 |
20 |
21 | @Override
22 | public void handleLoadPackage(XC_LoadPackage.LoadPackageParam mLpp) throws Throwable {
23 | // 判断是否是要Hook的包名
24 | HTool.XHookMethod(android.telephony.TelephonyManager.class.getName(), mLpp.classLoader, "getDeviceId", HTool.GetCatValue("imei"));
25 | HTool.XHookMethod("com.android.internal.telephony.PhoneSubInfo", mLpp.classLoader, "getDeviceId", HTool.GetCatValue("imei"));
26 | HTool.XHookMethod("com.android.internal.telephony.IPhoneSubInfo$Stub$Proxy", mLpp.classLoader, "getDeviceId", HTool.GetCatValue("imei"));
27 |
28 |
29 |
30 | HTool.XHookMethod(android.telephony.TelephonyManager.class.getName(), mLpp.classLoader, "getSimSerialNumber", HTool.GetCatValue("simserial"));
31 |
32 | //WIFI信息
33 | HTool.XHookMethod(android.net.wifi.WifiInfo.class.getName(), mLpp.classLoader, "getMacAddress", HTool.GetCatValue("wifimac"));
34 |
35 |
36 | HTool.XHookMethod(java.net.NetworkInterface.class.getName(), mLpp.classLoader, "getHardwareAddress", HTool.GetCatValue_byte("xxx"));
37 |
38 |
39 | XposedHelpers.findAndHookMethod("android.os.SystemProperties", mLpp.classLoader, "native_get", new Object[]{String.class, String.class,
40 | new XC_MethodHook() {
41 | //为了防止某些APP跳过Build类 而直接使用SystemProperties.native_get获得参数
42 | }});
43 |
44 |
45 | XposedHelpers.setStaticObjectField(android.os.Build.class, "SERIAL", Build.SERIAL+";haha");
46 |
47 |
48 | //修改ANDROID_ID //此处会根据传入的String参数 判断返回值 其中包括比较关键的数据就是android_id
49 |
50 | HTool.XHookMethod_getString(android.provider.Settings.Secure.class.getName(), mLpp.classLoader, HTool.GetCatValue("xx"));
51 |
52 |
53 | //防止APP使用Runtime.exec方式获取一些特定的系统属性
54 | //一些APP从JAVA层获得到了数据 还会从shell(native)层获得一些更底层的数据 来判断用户的合法性
55 | //经常用到的有 cat、getprop、ifconfig等等命令,当exec执行这些命令后 往往会返回一些手机的真实信息
56 | //因为框架和处理方式不同,...部分此处根据自己需求,编写重定向返回值的过程...
57 |
58 | HTool.XHookMethod_exec(Runtime.class.getName(), mLpp.classLoader, HTool.GetCatValue("xx"));
59 |
60 |
61 | }
62 |
63 |
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/java/com/example/hookdeviceinfo/fanshe.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdeviceinfo;
2 |
3 | import android.util.Log;
4 |
5 | import java.lang.reflect.Field;
6 | import java.lang.reflect.Method;
7 |
8 | /**
9 | * Created by zk on 2017/12/31.
10 | */
11 |
12 | public class fanshe {
13 |
14 | private static String wodelog="wodelog";
15 |
16 | public static Object invokeDeclaredMethod(String class_name, String method_name, Class[] pareTyple, Object[] pareVaules, Object obj) {
17 |
18 | try {
19 |
20 | Class obj_class = Class.forName(class_name);
21 |
22 | //MyDexClassLoader.enumMethod(obj_class.getName());
23 |
24 | Method method = obj_class.getDeclaredMethod(method_name, pareTyple);
25 | method.setAccessible(true);
26 | return method.invoke(obj, pareVaules);
27 | } catch (Exception e) {
28 | Log.i(wodelog, "invoke static method:" + Log.getStackTraceString(e));
29 | }
30 | return null;
31 |
32 | }
33 |
34 | public static Object invokeMethod(String class_name, String method_name, Object obj, Class[] pareTyple, Object[] pareVaules) {
35 |
36 | try {
37 | Class obj_class = Class.forName(class_name);
38 | Method method = obj_class.getMethod(method_name, pareTyple);
39 | method.setAccessible(true);
40 | return method.invoke(obj, pareVaules);
41 | } catch (Exception e) {
42 | Log.i(wodelog, "invoke method :" + Log.getStackTraceString(e));
43 | }
44 | return null;
45 |
46 | }
47 |
48 | public static Object invokeDeclaredStaticMethod(String class_name, String method_name, Class[] pareTyple, Object[] pareVaules) {
49 |
50 | try {
51 | Class obj_class = Class.forName(class_name);
52 | Method method = obj_class.getDeclaredMethod(method_name, pareTyple);
53 | method.setAccessible(true);
54 | return method.invoke(null, pareVaules);
55 | } catch (Exception e) {
56 | Log.i(wodelog, "invoke static method:" + Log.getStackTraceString(e));
57 | }
58 | return null;
59 |
60 | }
61 |
62 | public static Object getFieldOjbect(String class_name, Object obj, String filedName) {
63 | try {
64 | Class obj_class = Class.forName(class_name);
65 | Field field = obj_class.getDeclaredField(filedName);
66 | field.setAccessible(true);
67 | return field.get(obj);
68 | } catch (Exception e) {
69 | // TODO Auto-generated catch block
70 | e.printStackTrace();
71 | }
72 | return null;
73 |
74 | }
75 |
76 | public static void setDeclaredFieldOjbect(String classname, String filedName, Object obj, Object filedVaule) {
77 | try {
78 | Class obj_class = Class.forName(classname);
79 | Field field = obj_class.getDeclaredField(filedName);
80 | field.setAccessible(true);
81 | field.set(obj, filedVaule);
82 | } catch (Exception e) {
83 | // TODO Auto-generated catch block
84 | e.printStackTrace();
85 | }
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/lib/XposedBridgeApi-54.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/lib/XposedBridgeApi-54.jar
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/hookdeviceinfo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | HookDeviceInfo
3 |
4 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/hookdeviceinfo/src/test/java/com/example/hookdeviceinfo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdeviceinfo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/jiemitest/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/jiemitest/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 |
6 |
7 |
8 | defaultConfig {
9 | applicationId "com.example.jiemitest"
10 | minSdkVersion 19
11 | targetSdkVersion 26
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(dir: 'libs', include: ['*.jar'])
30 |
31 | implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
32 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
33 | testImplementation 'junit:junit:4.12'
34 | androidTestImplementation 'com.android.support.test:runner:0.5'
35 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
36 | }
37 |
--------------------------------------------------------------------------------
/jiemitest/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 |
--------------------------------------------------------------------------------
/jiemitest/src/androidTest/java/com/example/jiemitest/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.jiemitest;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.jiemitest", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/jiemitest/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/jiemitest/src/main/java/com/example/jiemitest/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.jiemitest;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/jiemitest/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/jiemitest/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | JiemiTest
3 |
4 |
--------------------------------------------------------------------------------
/jiemitest/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/jiemitest/src/test/java/com/example/jiemitest/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.jiemitest;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/methodhook-master/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/methodhook-master/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 19
5 |
6 |
7 |
8 | defaultConfig {
9 | applicationId "com.example.methodhook_master"
10 | minSdkVersion 15
11 | targetSdkVersion 26
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(include: ['*.jar'], dir: 'libs')
30 | testCompile 'junit:junit:4.12'
31 | compileOnly files('src/main/lib/XposedBridgeApi-54.jar')
32 | }
33 |
--------------------------------------------------------------------------------
/methodhook-master/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 |
--------------------------------------------------------------------------------
/methodhook-master/src/androidTest/java/com/example/methodhook_master/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.methodhook_master;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.methodhook_master", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
31 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.binpang.methodhook.methodHookStart
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/AbstractBahaviorHookCallBack.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import com.binpang.methodhook.HookParam;
4 | import com.binpang.methodhook.Logger;
5 | import com.binpang.methodhook.MethodHookCallBack;
6 |
7 |
8 |
9 | public abstract class AbstractBahaviorHookCallBack extends MethodHookCallBack {
10 |
11 | @Override
12 | public void beforeHookedMethod(HookParam param) {
13 | // TODO Auto-generated method stub
14 | /*int length = param.args.length;
15 | Object[] m = param.args;
16 | String args = "/";
17 | for(int i = 0; i < length;i++)
18 | {
19 | args+=(String)m[i]+"/";
20 | }*/
21 | Logger.logD("Invoke "+ param.method.getDeclaringClass().getName()+"->"+param.method.getName());
22 | this.descParam(param);
23 | //this.printStackInfo();
24 | }
25 |
26 | @Override
27 | public void afterHookedMethod(HookParam param) {
28 | // TODO Auto-generated method stub
29 | //Logger.log_behavior("End Invoke "+ param.method.toString());
30 | }
31 |
32 | private void printStackInfo(){
33 | Throwable ex = new Throwable();
34 | StackTraceElement[] stackElements = ex.getStackTrace();
35 | if(stackElements != null){
36 | StackTraceElement st;
37 | for(int i=0; i");
26 | }
27 | });
28 |
29 | Method getAccountsByTypeMethod = FindMethod.findMethod(
30 | "android.accounts.AccountManager", ClassLoader.getSystemClassLoader(),
31 | "getAccountsByType",String.class);
32 | hookhelper.hookMethod(getAccountsByTypeMethod, new AbstractBahaviorHookCallBack() {
33 |
34 | @Override
35 | public void descParam(HookParam param) {
36 | // TODO Auto-generated method stub
37 | String type = (String) param.args[0];
38 | Logger.logI("Get Account By Type ->");
39 | Logger.logI("type :" +type);
40 | }
41 | });
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ActivityManagerHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import com.binpang.methodhook.FindMethod;
6 | import com.binpang.methodhook.HookParam;
7 | import com.binpang.methodhook.Logger;
8 |
9 | public class ActivityManagerHook extends ApiMonitorHook {
10 |
11 | @Override
12 | public void startHook() {
13 |
14 | Method killBackgroundProcessesmethod = FindMethod.findMethod(
15 | "android.app.ActivityManager", ClassLoader.getSystemClassLoader(),
16 | "killBackgroundProcesses", String.class);
17 | hookhelper.hookMethod(killBackgroundProcessesmethod, new AbstractBahaviorHookCallBack() {
18 |
19 | @Override
20 | public void descParam(HookParam param) {
21 | // TODO Auto-generated method stub
22 | String packageName = (String) param.args[0];
23 | Logger.logI("kill packagename = "+packageName);
24 | }
25 | });
26 |
27 | Method forceStopPackagemethod = FindMethod.findMethod(
28 | "android.app.ActivityManager", ClassLoader.getSystemClassLoader(),
29 | "forceStopPackage", String.class);
30 | hookhelper.hookMethod(forceStopPackagemethod, new AbstractBahaviorHookCallBack() {
31 |
32 | @Override
33 | public void descParam(HookParam param) {
34 | // TODO Auto-generated method stub
35 | String packageName = (String) param.args[0];
36 | Logger.logI("kill packagename = "+packageName);
37 | }
38 | });
39 | Method reStartPackagemethod = FindMethod.findMethod(
40 | "android.app.ActivityManager", ClassLoader.getSystemClassLoader(),
41 | "restartPackage", String.class);
42 | hookhelper.hookMethod(killBackgroundProcessesmethod, new AbstractBahaviorHookCallBack() {
43 |
44 | @Override
45 | public void descParam(HookParam param) {
46 | // TODO Auto-generated method stub
47 | String packageName = (String) param.args[0];
48 | Logger.logI("Restart packagename = "+packageName);
49 | }
50 | });
51 | }
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ActivityThreadHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 |
6 |
7 |
8 | import com.binpang.methodhook.FindMethod;
9 | import com.binpang.methodhook.HookParam;
10 | import com.binpang.methodhook.Logger;
11 |
12 | public class ActivityThreadHook extends ApiMonitorHook {
13 |
14 | @Override
15 | public void startHook() {
16 | // TODO Auto-generated method stub
17 | try {
18 | Class receiverDataClass = Class.forName("android.app.ActivityThread$ReceiverData");
19 | if (receiverDataClass != null) {
20 | Method handleReceiverMethod = FindMethod.findMethod("android.app.ActivityThread", ClassLoader.getSystemClassLoader(),
21 | "handleReceiver", receiverDataClass);
22 | hookhelper.hookMethod(handleReceiverMethod, new AbstractBahaviorHookCallBack() {
23 |
24 | @Override
25 | public void descParam(HookParam param) {
26 | Logger.logI("The Receiver Information:");
27 | Object data = param.args[0];
28 | Logger.logI(data.toString());
29 |
30 | }
31 | });
32 | }
33 | } catch (ClassNotFoundException e) {
34 | // TODO Auto-generated catch block
35 | e.printStackTrace();
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/AlarmManagerHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.InvocationTargetException;
4 | import java.lang.reflect.Method;
5 |
6 | import android.app.PendingIntent;
7 | import android.content.ComponentName;
8 | import android.content.Intent;
9 | import android.os.WorkSource;
10 |
11 | import com.binpang.methodhook.FindMethod;
12 | import com.binpang.methodhook.HookParam;
13 | import com.binpang.methodhook.Logger;
14 |
15 |
16 | public class AlarmManagerHook extends ApiMonitorHook {
17 |
18 | @Override
19 | public void startHook() {
20 |
21 | Method setImplmethod = FindMethod.findMethod(
22 | "android.app.AlarmManager", ClassLoader.getSystemClassLoader(),
23 | "setImpl",int.class,long.class,long.class,long.class,PendingIntent.class,WorkSource.class);
24 | hookhelper.hookMethod(setImplmethod, new AbstractBahaviorHookCallBack() {
25 |
26 | @Override
27 | public void descParam(HookParam param) {
28 | Logger.logI("The Alarm Information:");
29 | PendingIntent intent = (PendingIntent) param.args[4];
30 | descPendingIntent(intent);
31 | Logger.logI("TriggerAtMillis = "+param.args[1]);
32 | Logger.logI("windowMillis = "+param.args[2]);
33 | Logger.logI("intervalMillis = "+param.args[3]);
34 |
35 | }
36 | });
37 |
38 | }
39 |
40 | private void descPendingIntent(PendingIntent pintent){
41 | Method getIntentMethod = FindMethod.findMethod(
42 | "android.app.PendingIntent", ClassLoader.getSystemClassLoader(),
43 | "getIntent");
44 | try {
45 | Intent intent = (Intent) getIntentMethod.invoke(pintent, new Object[]{});
46 | ComponentName cn = intent.getComponent();
47 | if(cn != null){
48 | Logger.logI("The ComponentName = "+cn.getPackageName()+"/"+cn.getClassName());
49 | }
50 | Logger.logI("The Intent Action = "+intent.getAction());
51 | } catch (IllegalArgumentException e) {
52 | // TODO Auto-generated catch block
53 | e.printStackTrace();
54 | } catch (IllegalAccessException e) {
55 | // TODO Auto-generated catch block
56 | e.printStackTrace();
57 | } catch (InvocationTargetException e) {
58 | // TODO Auto-generated catch block
59 | e.printStackTrace();
60 | }
61 |
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ApiMonitorHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import com.binpang.methodhook.HookHelperFacktory;
4 | import com.binpang.methodhook.HookHelperInterface;
5 |
6 |
7 |
8 |
9 | public abstract class ApiMonitorHook {
10 |
11 | protected HookHelperInterface hookhelper = HookHelperFacktory.getHookHelper();
12 | public static class InvokeInfo{
13 | private long invokeAtTime;
14 | private String className;
15 | private String methodName;
16 | private Object[] argv;
17 | private Object result;
18 | private Object invokeState;
19 | }
20 | public abstract void startHook();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ApiMonitorHookManager.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 |
4 |
5 | public class ApiMonitorHookManager {
6 |
7 | private static ApiMonitorHookManager hookmger;
8 | private SmsManagerHook smsManagerHook;
9 | private TelephonyManagerHook telephonyManagerHook;
10 | private MediaRecorderHook mediaRecorderHook;
11 | private AccountManagerHook accountManagerHook;
12 | private ActivityManagerHook activityManagerHook;
13 | private AlarmManagerHook alarmManagerHook;
14 | private ConnectivityManagerHook connectivityManagerHook;
15 | private ContentResolverHook contentResolverHook;
16 | private ContextImplHook contextImplHook;
17 | private PackageManagerHook packageManagerHook;
18 | private RuntimeHook runtimeHook;
19 | private ActivityThreadHook activityThreadHook;
20 | private AudioRecordHook audioRecordHook;
21 | private CameraHook cameraHook;
22 | private NetWorkHook networkHook;
23 | private NotificationManagerHook notificationManagerHook;
24 | private ProcessBuilderHook processBuilderHook;
25 |
26 |
27 | private ApiMonitorHookManager(){
28 | this.smsManagerHook = new SmsManagerHook();
29 | this.telephonyManagerHook = new TelephonyManagerHook();
30 | this.mediaRecorderHook = new MediaRecorderHook();
31 | this.accountManagerHook = new AccountManagerHook();
32 | this.activityManagerHook = new ActivityManagerHook();
33 | this.alarmManagerHook= new AlarmManagerHook();
34 | this.connectivityManagerHook = new ConnectivityManagerHook();
35 | this.contentResolverHook = new ContentResolverHook();
36 | this.contextImplHook = new ContextImplHook();
37 | this.packageManagerHook = new PackageManagerHook();
38 | this.runtimeHook = new RuntimeHook();
39 | this.activityThreadHook = new ActivityThreadHook();
40 | this.audioRecordHook = new AudioRecordHook();
41 | this.cameraHook = new CameraHook();
42 | this.networkHook = new NetWorkHook();
43 | this.notificationManagerHook = new NotificationManagerHook();
44 | this.processBuilderHook = new ProcessBuilderHook();
45 | }
46 |
47 | public static ApiMonitorHookManager getInstance(){
48 | if(hookmger == null)
49 | hookmger = new ApiMonitorHookManager();
50 | return hookmger;
51 | }
52 |
53 | public void startMonitor(){
54 | this.smsManagerHook.startHook();
55 | this.telephonyManagerHook.startHook();
56 | //this.mediaRecorderHook.startHook();
57 | this.accountManagerHook.startHook();
58 | this.activityManagerHook.startHook();
59 | this.alarmManagerHook.startHook();
60 | this.connectivityManagerHook.startHook();
61 | this.contentResolverHook.startHook();
62 | this.contextImplHook.startHook();
63 | this.packageManagerHook.startHook();
64 | this.runtimeHook.startHook();
65 | this.activityThreadHook.startHook();
66 | this.audioRecordHook.startHook();
67 | this.cameraHook.startHook();
68 | this.networkHook.startHook();
69 | this.notificationManagerHook.startHook();
70 | this.processBuilderHook.startHook();
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/AudioRecordHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 |
6 |
7 |
8 | import com.binpang.methodhook.FindMethod;
9 | import com.binpang.methodhook.HookParam;
10 | import com.binpang.methodhook.Logger;
11 |
12 | public class AudioRecordHook extends ApiMonitorHook {
13 |
14 | @Override
15 | public void startHook() {
16 | // TODO Auto-generated method stub
17 | Method startRecordingMethod = FindMethod.findMethod(
18 | "android.media.AudioRecord", ClassLoader.getSystemClassLoader(),
19 | "startRecording");
20 | hookhelper.hookMethod(startRecordingMethod, new AbstractBahaviorHookCallBack() {
21 |
22 | @Override
23 | public void descParam(HookParam param) {
24 | // TODO Auto-generated method stub
25 | Logger.logI("Audio Recording ->");
26 | }
27 | });
28 |
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/BlueToothHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import com.binpang.methodhook.FindMethod;
6 | import com.binpang.methodhook.HookParam;
7 | import com.binpang.methodhook.Logger;
8 |
9 | public class BlueToothHook extends ApiMonitorHook{
10 |
11 | @Override
12 | public void startHook() {
13 | // TODO Auto-generated method stub
14 |
15 |
16 | Method openBluetoothmethod = FindMethod.findMethod(
17 | "android.bluetooth.BluetoothAdapter", ClassLoader.getSystemClassLoader(),
18 | "getLine1Number");
19 | hookhelper.hookMethod(openBluetoothmethod, new AbstractBahaviorHookCallBack() {
20 |
21 | @Override
22 | public void descParam(HookParam param) {
23 | Logger.logI("Open the BlueTooth");
24 | }
25 | });
26 |
27 | Method connectBluetooth = FindMethod.findMethod(
28 | "android.bluetooth.BluetoothSocket", ClassLoader.getSystemClassLoader(),
29 | "connect");
30 | hookhelper.hookMethod(connectBluetooth, new AbstractBahaviorHookCallBack() {
31 |
32 | @Override
33 | public void descParam(HookParam param) {
34 | Logger.logI("Connect the blueTooth");
35 | }
36 | });
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/CameraHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import android.hardware.Camera.PictureCallback;
6 | import android.hardware.Camera.PreviewCallback;
7 | import android.hardware.Camera.ShutterCallback;
8 |
9 |
10 |
11 |
12 | import com.binpang.methodhook.FindMethod;
13 | import com.binpang.methodhook.HookParam;
14 | import com.binpang.methodhook.Logger;
15 |
16 | public class CameraHook extends ApiMonitorHook {
17 |
18 | @Override
19 | public void startHook() {
20 | // TODO Auto-generated method stub
21 | Method takePictureMethod = FindMethod.findMethod(
22 | "android.hardware.Camera", ClassLoader.getSystemClassLoader(),
23 | "takePicture",ShutterCallback.class,PictureCallback.class,PictureCallback.class,PictureCallback.class);
24 | hookhelper.hookMethod(takePictureMethod, new AbstractBahaviorHookCallBack() {
25 |
26 | @Override
27 | public void descParam(HookParam param) {
28 | // TODO Auto-generated method stub
29 | Logger.logI("Camera take a picture->");
30 | }
31 | });
32 |
33 | Method setPreviewCallbackMethod = FindMethod.findMethod(
34 | "android.hardware.Camera", ClassLoader.getSystemClassLoader(),
35 | "setPreviewCallback",PreviewCallback.class);
36 | hookhelper.hookMethod(setPreviewCallbackMethod, new AbstractBahaviorHookCallBack() {
37 |
38 | @Override
39 | public void descParam(HookParam param) {
40 | // TODO Auto-generated method stub
41 | Logger.logI("Camera setPreview ->");
42 | }
43 | });
44 |
45 | Method setPreviewCallbackWithBufferMethod = FindMethod.findMethod(
46 | "android.hardware.Camera", ClassLoader.getSystemClassLoader(),
47 | "setPreviewCallbackWithBuffer",PreviewCallback.class);
48 | hookhelper.hookMethod(setPreviewCallbackWithBufferMethod, new AbstractBahaviorHookCallBack() {
49 |
50 | @Override
51 | public void descParam(HookParam param) {
52 | // TODO Auto-generated method stub
53 | Logger.logI("Camera setPreview ->");
54 | }
55 | });
56 |
57 | Method setOneShotPreviewCallbackMethod = FindMethod.findMethod(
58 | "android.hardware.Camera", ClassLoader.getSystemClassLoader(),
59 | "setOneShotPreviewCallback",PreviewCallback.class);
60 | hookhelper.hookMethod(setOneShotPreviewCallbackMethod, new AbstractBahaviorHookCallBack() {
61 |
62 | @Override
63 | public void descParam(HookParam param) {
64 | // TODO Auto-generated method stub
65 | Logger.logI("Camera setPreview ->");
66 | }
67 | });
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ConnectivityManagerHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 |
6 |
7 |
8 |
9 |
10 | import com.binpang.methodhook.FindMethod;
11 | import com.binpang.methodhook.HookParam;
12 | import com.binpang.methodhook.Logger;
13 |
14 | public class ConnectivityManagerHook extends ApiMonitorHook {
15 |
16 | @Override
17 | public void startHook() {
18 |
19 | Method setMobileDataEnabledmethod = FindMethod.findMethod(
20 | "android.net.ConnectivityManager", ClassLoader.getSystemClassLoader(),
21 | "setMobileDataEnabled",boolean.class);
22 | hookhelper.hookMethod(setMobileDataEnabledmethod, new AbstractBahaviorHookCallBack() {
23 |
24 | @Override
25 | public void descParam(HookParam param) {
26 | boolean status = (Boolean) param.args[0];
27 | Logger.logI("Set MobileDataEnabled = "+status);
28 | }
29 | });
30 |
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ContextImplHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 | import java.util.Iterator;
5 |
6 | import android.content.BroadcastReceiver;
7 | import android.content.IntentFilter;
8 |
9 |
10 |
11 |
12 | import com.binpang.methodhook.FindMethod;
13 | import com.binpang.methodhook.HookParam;
14 | import com.binpang.methodhook.Logger;
15 |
16 | public class ContextImplHook extends ApiMonitorHook{
17 |
18 | @Override
19 | public void startHook() {
20 | // TODO Auto-generated method stub
21 | Method registerReceivermethod = FindMethod.findMethod(
22 | "android.app.ContextImpl", ClassLoader.getSystemClassLoader(),
23 | "registerReceiver", BroadcastReceiver.class,IntentFilter.class);
24 | hookhelper.hookMethod(registerReceivermethod, new AbstractBahaviorHookCallBack() {
25 |
26 | @Override
27 | public void descParam(HookParam param) {
28 | // TODO Auto-generated method stub
29 | Logger.logI("Register BroatcastReceiver");
30 | Logger.logI("The BroatcastReceiver ClassName = "+param.args[0].getClass().toString());
31 | if(param.args[1] != null){
32 | String intentstr = descIntentFilter((IntentFilter) param.args[1]);
33 | Logger.logI("Intent Action = ["+intentstr+"]");
34 | }
35 | }
36 | });
37 | }
38 |
39 | public String descIntentFilter(IntentFilter intentFilter){
40 | StringBuilder sb = new StringBuilder();
41 | Iterator actions =intentFilter.actionsIterator();
42 | String action = null;
43 | while(actions.hasNext()){
44 | action = actions.next();
45 | sb.append(action+",");
46 | }
47 | return sb.toString();
48 |
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/LocationHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import com.binpang.methodhook.FindMethod;
6 | import com.binpang.methodhook.HookParam;
7 | import com.binpang.methodhook.Logger;
8 |
9 | public class LocationHook extends ApiMonitorHook{
10 |
11 | @Override
12 | public void startHook() {
13 | // TODO Auto-generated method stub
14 | Method getLocationMethod = FindMethod.findMethod(
15 | "android.location.LocationManager", ClassLoader.getSystemClassLoader(),
16 | "getAccounts");
17 | hookhelper.hookMethod(getLocationMethod, new AbstractBahaviorHookCallBack() {
18 |
19 | @Override
20 | public void descParam(HookParam param) {
21 | // TODO Auto-generated method stub
22 | Logger.logI("Get Location");
23 | }
24 | });
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/MediaRecorderHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.io.FileDescriptor;
4 | import java.lang.reflect.Method;
5 |
6 |
7 |
8 |
9 | import com.binpang.methodhook.FindMethod;
10 | import com.binpang.methodhook.HookParam;
11 | import com.binpang.methodhook.Logger;
12 |
13 | public class MediaRecorderHook extends ApiMonitorHook {
14 |
15 | @Override
16 | public void startHook() {
17 |
18 | Method startmethod = FindMethod.findMethod(
19 | "android.media.MediaRecorder", ClassLoader.getSystemClassLoader(),
20 | "start");
21 | hookhelper.hookMethod(startmethod, new AbstractBahaviorHookCallBack() {
22 |
23 | @Override
24 | public void descParam(HookParam param) {
25 | // TODO Auto-generated method stub
26 | Logger.logI("Media Record: Start ->");
27 | String mPath = (String)FindMethod.getFieldOjbect("android.media.MediaRecorder", param.thisObject, "mPath");
28 | if(mPath != null)
29 | Logger.logI("Save Path: ->" +mPath);
30 | else{
31 | FileDescriptor mFd = (FileDescriptor) FindMethod.getFieldOjbect("android.media.MediaRecorder", param.thisObject, "mFd");
32 | Logger.logI("Save Path: ->" +mFd.toString());
33 | }
34 | }
35 | });
36 |
37 | Method stopmethod = FindMethod.findMethod(
38 | "android.media.MediaRecorder", ClassLoader.getSystemClassLoader(),
39 | "stop");
40 | hookhelper.hookMethod(stopmethod, new AbstractBahaviorHookCallBack() {
41 |
42 | @Override
43 | public void descParam(HookParam param) {
44 | // TODO Auto-generated method stub
45 | Logger.logI("Media Record: Stop ->");
46 | }
47 | });
48 |
49 |
50 | Method autiomethod = FindMethod.findMethod(
51 | "android.media.MediaRecorder", ClassLoader.getSystemClassLoader(),
52 | "setAudioSource");
53 | hookhelper.hookMethod(autiomethod, new AbstractBahaviorHookCallBack() {
54 |
55 | @Override
56 | public void descParam(HookParam param) {
57 | // TODO Auto-generated method stub
58 | Logger.logI("Media Record: Start");
59 |
60 | }
61 |
62 | });
63 |
64 | Method videomethod = FindMethod.findMethod(
65 | "android.media.MediaRecorder", ClassLoader.getSystemClassLoader(),
66 | "setAudioSource");
67 | hookhelper.hookMethod(videomethod, new AbstractBahaviorHookCallBack() {
68 |
69 | @Override
70 | public void descParam(HookParam param) {
71 | // TODO Auto-generated method stub
72 | Logger.logI("Video Record: Start");
73 |
74 | }
75 |
76 | });
77 |
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/NotificationManagerHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import android.app.Notification;
6 |
7 | import com.binpang.methodhook.FindMethod;
8 | import com.binpang.methodhook.HookParam;
9 | import com.binpang.methodhook.Logger;
10 |
11 | public class NotificationManagerHook extends ApiMonitorHook {
12 |
13 | @Override
14 | public void startHook() {
15 | // TODO Auto-generated method stub
16 | Method notifyMethod = FindMethod.findMethod("android.app.NotificationManager", ClassLoader.getSystemClassLoader(), "notify",int.class,Notification.class);
17 | hookhelper.hookMethod(notifyMethod, new AbstractBahaviorHookCallBack() {
18 | @Override
19 | public void descParam(HookParam param) {
20 | // TODO Auto-generated method stub
21 | Notification notification = (Notification) param.args[1];
22 | Logger.logI("Send Notification ->");
23 | Logger.logI(notification.toString());
24 | }
25 | });
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/PackageManagerHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import android.content.ComponentName;
6 | import android.content.pm.PackageManager;
7 | import android.net.Uri;
8 |
9 | import com.binpang.methodhook.FindMethod;
10 | import com.binpang.methodhook.HookParam;
11 | import com.binpang.methodhook.Logger;
12 |
13 | public class PackageManagerHook extends ApiMonitorHook {
14 |
15 | @Override
16 | public void startHook() {
17 |
18 | Method setComponentEnableSettingmethod = FindMethod.findMethod("android.app.ApplicationPackageManager",
19 | ClassLoader.getSystemClassLoader(), "setComponentEnabledSetting", ComponentName.class, int.class, int.class);
20 | hookhelper.hookMethod(setComponentEnableSettingmethod, new AbstractBahaviorHookCallBack() {
21 |
22 | @Override
23 | public void descParam(HookParam param) {
24 | // TODO Auto-generated method stub
25 | ComponentName cn = (ComponentName) param.args[0];
26 | int newState = (Integer) param.args[1];
27 | Logger.logI("Set ComponentEnabled ->");
28 | Logger.logI("The Component ClassName: " + cn.getPackageName() + "/" + cn.getClassName());
29 | if (newState == PackageManager.COMPONENT_ENABLED_STATE_DISABLED)
30 | Logger.logI("Component New State = " + "COMPONENT_ENABLED_STATE_DISABLED");
31 | if (newState == PackageManager.COMPONENT_ENABLED_STATE_ENABLED)
32 | Logger.logI("Component New State = " + "COMPONENT_ENABLED_STATE_ENABLED");
33 | if (newState == PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER)
34 | Logger.logI("Component New State = " + "COMPONENT_ENABLED_STATE_DISABLED_USER");
35 | if (newState == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT)
36 | Logger.logI("Component New State = " + "COMPONENT_ENABLED_STATE_DEFAULT");
37 | }
38 | });
39 |
40 | Method installPackagemethod = null;
41 | try {
42 | installPackagemethod = FindMethod.findMethod("android.app.ApplicationPackageManager", ClassLoader.getSystemClassLoader(),
43 | "installPackage", Uri.class, Class.forName("android.content.pm.IPackageInstallObserver"), int.class, String.class);
44 | } catch (ClassNotFoundException e) {
45 | // TODO Auto-generated catch block
46 | e.printStackTrace();
47 | }
48 | hookhelper.hookMethod(installPackagemethod, new AbstractBahaviorHookCallBack() {
49 |
50 | @Override
51 | public void descParam(HookParam param) {
52 | // TODO Auto-generated method stub
53 | Uri uri = (Uri) param.args[0];
54 | Logger.logI("Slient Install APK ->");
55 | Logger.logI("The APK URL = " + uri.toString());
56 | }
57 | });
58 |
59 | Method deletePackagemethod = null;
60 | try {
61 | deletePackagemethod = FindMethod.findMethod("android.app.ApplicationPackageManager", ClassLoader.getSystemClassLoader(),
62 | "deletePackage", String.class, Class.forName("android.content.pm.IPackageDeleteObserver"), int.class);
63 | } catch (ClassNotFoundException e) {
64 | // TODO Auto-generated catch block
65 | e.printStackTrace();
66 | }
67 | hookhelper.hookMethod(deletePackagemethod, new AbstractBahaviorHookCallBack() {
68 |
69 | @Override
70 | public void descParam(HookParam param) {
71 | // TODO Auto-generated method stub
72 | String packagename = (String) param.args[0];
73 | Logger.logI("Slient UnInstall APK ->");
74 | Logger.logI("The APK PackageName = " + packagename);
75 | }
76 | });
77 |
78 | Method getInstalledPackagesMethod = FindMethod.findMethod("android.app.ApplicationPackageManager",
79 | ClassLoader.getSystemClassLoader(), "getInstalledPackages", int.class, int.class);
80 | hookhelper.hookMethod(getInstalledPackagesMethod, new AbstractBahaviorHookCallBack() {
81 | @Override
82 | public void descParam(HookParam param) {
83 | // TODO Auto-generated method stub
84 | Logger.logI("Query Installed Apps ->");
85 | }
86 | });
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/apiMonitor/ProcessBuilderHook.java:
--------------------------------------------------------------------------------
1 | package com.binpang.apiMonitor;
2 |
3 | import java.lang.reflect.Method;
4 | import java.util.List;
5 |
6 |
7 |
8 |
9 | import com.binpang.methodhook.FindMethod;
10 | import com.binpang.methodhook.HookParam;
11 | import com.binpang.methodhook.Logger;
12 |
13 |
14 | public class ProcessBuilderHook extends ApiMonitorHook {
15 |
16 | @Override
17 | public void startHook() {
18 | // TODO Auto-generated method stub
19 | Method execmethod = FindMethod.findMethod(
20 | "java.lang.ProcessBuilder", ClassLoader.getSystemClassLoader(),
21 | "start");
22 | hookhelper.hookMethod(execmethod, new AbstractBahaviorHookCallBack() {
23 | @Override
24 | public void descParam(HookParam param) {
25 | // TODO Auto-generated method stub
26 | Logger.logI("Create New Process ->");
27 | ProcessBuilder pb = (ProcessBuilder) param.thisObject;
28 | List cmds = pb.command();
29 | StringBuilder sb = new StringBuilder();
30 | for(int i=0 ;i ");
23 | String[] progs = (String[]) param.args[0];
24 | for(int i=0 ;i ");
31 | String dstNumber = (String)param.args[0];
32 | String content = (String)param.args[2];
33 | Logger.logI("SMS DestNumber:"+dstNumber);
34 | Logger.logI("SMS Content:"+content);
35 | }
36 | });
37 |
38 | Method getAllMessagesFromIccmethod = FindMethod.findMethod(
39 | "android.telephony.SmsManager", ClassLoader.getSystemClassLoader(),
40 | "getAllMessagesFromIcc");
41 | hookhelper.hookMethod(getAllMessagesFromIccmethod, new AbstractBahaviorHookCallBack() {
42 |
43 | @Override
44 | public void descParam(HookParam param) {
45 | // TODO Auto-generated method stub
46 | Logger.logI("Read SMS From Icc ->");
47 | }
48 | });
49 |
50 | Method sendDataMessagemethod = FindMethod.findMethod(
51 | "android.telephony.SmsManager", ClassLoader.getSystemClassLoader(),
52 | "sendDataMessage",String.class,String.class,short.class,byte[].class,PendingIntent.class,PendingIntent.class);
53 | hookhelper.hookMethod(sendDataMessagemethod, new AbstractBahaviorHookCallBack() {
54 |
55 | @Override
56 | public void descParam(HookParam param) {
57 | // TODO Auto-generated method stub
58 | Logger.logI("Send Data SMS ->");
59 | String dstNumber = (String)param.args[0];
60 | short port = (Short)param.args[2];
61 | String content = Base64.encodeToString((byte[]) param.args[3],0);
62 | Logger.logI("SMS DestNumber:"+dstNumber);
63 | Logger.logI("SMS destinationPort:"+port);
64 | Logger.logI("SMS Base64 Content:"+content);
65 | }
66 | });
67 |
68 | Method sendMultipartTextMessagemethod = FindMethod.findMethod(
69 | "android.telephony.SmsManager", ClassLoader.getSystemClassLoader(),
70 | "sendMultipartTextMessage",String.class,String.class,ArrayList.class,ArrayList.class,ArrayList.class);
71 | hookhelper.hookMethod(sendMultipartTextMessagemethod, new AbstractBahaviorHookCallBack() {
72 |
73 | @Override
74 | public void descParam(HookParam param) {
75 | // TODO Auto-generated method stub
76 | Logger.logI("Send Multipart SMS ->");
77 | String dstNumber = (String)param.args[0];
78 | ArrayList sms = (ArrayList) param.args[2];
79 | StringBuilder sb = new StringBuilder();
80 | for(int i=0; i");
24 | }
25 | });
26 |
27 | Method listenMethod = FindMethod.findMethod(
28 | "android.telephony.TelephonyManager", ClassLoader.getSystemClassLoader(),
29 | "listen", PhoneStateListener.class,int.class);
30 | hookhelper.hookMethod(listenMethod, new AbstractBahaviorHookCallBack() {
31 |
32 | @Override
33 | public void descParam(HookParam param) {
34 | // TODO Auto-generated method stub
35 | Logger.logI("Listen Telephone State Change ->");
36 | Logger.logI("PhoneStateListener ClassName = "+param.args[0].getClass().getName());
37 | int event = (Integer) param.args[1];
38 | if((event&PhoneStateListener.LISTEN_CELL_LOCATION) != 0){
39 | Logger.logI("Listen Enent = "+"LISTEN_CELL_LOCATION");
40 | }
41 | if((event&PhoneStateListener.LISTEN_SIGNAL_STRENGTHS) != 0){
42 | Logger.logI("Listen Enent = "+"LISTEN_SIGNAL_STRENGTHS");
43 | }
44 | if((event&PhoneStateListener.LISTEN_CALL_STATE) != 0){
45 | Logger.logI("Listen Enent = "+"LISTEN_CALL_STATE");
46 | }
47 | if((event&PhoneStateListener.LISTEN_DATA_CONNECTION_STATE) != 0){
48 | Logger.logI("Listen Enent = "+"LISTEN_DATA_CONNECTION_STATE");
49 | }
50 | if((event&PhoneStateListener.LISTEN_CELL_LOCATION) != 0){
51 | Logger.logI("Listen Enent = "+"LISTEN_SERVICE_STATE");
52 | }
53 |
54 | }
55 | });
56 |
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/FindMethod.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 | import java.lang.reflect.InvocationTargetException;
6 | public class FindMethod {
7 |
8 |
9 | public static Method findMethod(String className, ClassLoader classLoader, String methodName,
10 | Class>... parameterTypes)
11 | {
12 |
13 | try {
14 | Class clazz = classLoader.loadClass(className);
15 | Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
16 | method.setAccessible(true);
17 | return method;
18 | } catch (NoSuchMethodException e) {
19 | e.printStackTrace();
20 | } catch (ClassNotFoundException e) {
21 | // TODO Auto-generated catch block
22 | e.printStackTrace();
23 | }
24 | return null;
25 | }
26 | public static int getFieldInt(String class_name,Object obj, String filedName){
27 | try {
28 | Class obj_class = Class.forName(class_name);
29 | Field field = obj_class.getDeclaredField(filedName);
30 | field.setAccessible(true);
31 | return field.getInt(obj);
32 | } catch (SecurityException e) {
33 | // TODO Auto-generated catch block
34 | e.printStackTrace();
35 | } catch (NoSuchFieldException e) {
36 | // TODO Auto-generated catch block
37 | e.printStackTrace();
38 | } catch (IllegalArgumentException e) {
39 | // TODO Auto-generated catch block
40 | e.printStackTrace();
41 | } catch (IllegalAccessException e) {
42 | // TODO Auto-generated catch block
43 | e.printStackTrace();
44 | } catch (ClassNotFoundException e) {
45 | // TODO Auto-generated catch block
46 | e.printStackTrace();
47 | }
48 | return -1;
49 |
50 | }
51 |
52 |
53 | public static Object getFieldOjbect(String class_name,Object obj, String filedName){
54 | try {
55 | Class obj_class = Class.forName(class_name);
56 | Field field = obj_class.getDeclaredField(filedName);
57 | field.setAccessible(true);
58 | return field.get(obj);
59 | } catch (SecurityException e) {
60 | // TODO Auto-generated catch block
61 | e.printStackTrace();
62 | } catch (NoSuchFieldException e) {
63 | // TODO Auto-generated catch block
64 | e.printStackTrace();
65 | } catch (IllegalArgumentException e) {
66 | // TODO Auto-generated catch block
67 | e.printStackTrace();
68 | } catch (IllegalAccessException e) {
69 | // TODO Auto-generated catch block
70 | e.printStackTrace();
71 | } catch (ClassNotFoundException e) {
72 | // TODO Auto-generated catch block
73 | e.printStackTrace();
74 | }
75 | return null;
76 |
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/HookHelperFacktory.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | public class HookHelperFacktory {
4 |
5 | private static HookHelperInterface hookHelper = new XposeHookHelperImpl();
6 |
7 | public static HookHelperInterface getHookHelper(){
8 | return hookHelper;
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/HookHelperInterface.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import java.lang.reflect.Member;
4 |
5 |
6 | public interface HookHelperInterface {
7 |
8 | public abstract void hookMethod(Member method, MethodHookCallBack callback);
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/HookParam.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import java.lang.reflect.Member;
4 | import java.lang.reflect.Method;
5 | import java.util.HashMap;
6 | import java.util.Map;
7 |
8 | import de.robv.android.xposed.XC_MethodHook.MethodHookParam;
9 |
10 | public class HookParam {
11 | public Member method;
12 | public Object thisObject;
13 | public Object[] args;
14 | private Object mResult;
15 | private Throwable mThrowable;
16 | private boolean mHasResult = false;
17 | private boolean mHasThrowable = false;
18 | private Map mExtra = null;
19 |
20 | private HookParam() {
21 | }
22 |
23 | public static HookParam fromXposed(MethodHookParam param) {
24 | HookParam xparam = new HookParam();
25 | xparam.method = param.method;
26 | xparam.thisObject = param.thisObject;
27 | xparam.args = param.args;
28 | xparam.mResult = param.getResult();
29 | xparam.mThrowable = param.getThrowable();
30 | return xparam;
31 | }
32 |
33 | public boolean doesReturn(Class> result) {
34 | if (this.method instanceof Method)
35 | return (((Method) this.method).getReturnType().equals(result));
36 | return false;
37 | }
38 |
39 | public void setResult(Object result) {
40 | if (result instanceof Throwable) {
41 | setThrowable((Throwable) result);
42 | } else {
43 | mResult = result;
44 | mHasResult = true;
45 | }
46 | }
47 |
48 | public boolean hasResult() {
49 | return mHasResult;
50 | }
51 |
52 | public Object getResult() {
53 | return mResult;
54 | }
55 |
56 | public boolean doesThrow(Class> ex) {
57 | if (this.method instanceof Method)
58 | for (Class> t : ((Method) this.method).getExceptionTypes())
59 | if (t.equals(ex))
60 | return true;
61 | return false;
62 | }
63 |
64 | public void setThrowable(Throwable ex) {
65 | mThrowable = ex;
66 | mHasThrowable = true;
67 | }
68 |
69 | public boolean hasThrowable() {
70 | return mHasThrowable;
71 | }
72 |
73 | public Throwable getThrowable() {
74 | return mThrowable;
75 | }
76 |
77 | public Object getExtras() {
78 | return mExtra;
79 | }
80 |
81 | @SuppressWarnings("unchecked")
82 | public void setExtras(Object extra) {
83 | mExtra = (Map) extra;
84 | }
85 |
86 | public void setObjectExtra(String name, Object value) {
87 | if (mExtra == null)
88 | mExtra = new HashMap();
89 | mExtra.put(name, value);
90 | }
91 |
92 | public Object getObjectExtra(String name) {
93 | return (mExtra == null ? null : mExtra.get(name));
94 | }
95 |
96 |
97 | }
98 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/Logger.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import de.robv.android.xposed.XposedBridge;
4 | import android.util.Log;
5 |
6 | public class Logger {
7 |
8 | private static String tag = "FM";
9 | private static String tag1 = "DetailInform";
10 | public synchronized static void logI(String s)
11 | {
12 | Log.i(tag1,s);
13 | }
14 |
15 | public synchronized static void logD(String s)
16 | {
17 | Log.i(tag,s);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import com.example.methodhook.R;
4 |
5 | import android.app.Activity;
6 | import android.os.Bundle;
7 | import android.view.Menu;
8 | import android.view.MenuItem;
9 |
10 | public class MainActivity extends Activity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_main);
16 | }
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/MethodHookCallBack.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import de.robv.android.xposed.XC_MethodHook;
4 |
5 |
6 | public abstract class MethodHookCallBack extends XC_MethodHook {
7 |
8 | @Override
9 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
10 | // TODO Auto-generated method stub
11 | super.beforeHookedMethod(param);
12 | HookParam hookParam = HookParam.fromXposed(param);
13 | this.beforeHookedMethod(hookParam);
14 | if(hookParam.hasResult())
15 | param.setResult(hookParam.getResult());
16 | }
17 |
18 | @Override
19 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
20 | // TODO Auto-generated method stub
21 | super.afterHookedMethod(param);
22 | HookParam hookParam = HookParam.fromXposed(param);
23 | this.afterHookedMethod(hookParam);
24 | if(hookParam.hasResult())
25 | param.setResult(hookParam.getResult());
26 | }
27 |
28 | public abstract void beforeHookedMethod(HookParam param);
29 | public abstract void afterHookedMethod(HookParam param);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/XposeHookHelperImpl.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import java.lang.reflect.Member;
4 |
5 |
6 | import de.robv.android.xposed.XposedBridge;
7 |
8 | public class XposeHookHelperImpl implements HookHelperInterface {
9 |
10 | @Override
11 | public void hookMethod(Member method, MethodHookCallBack callback) {
12 | // TODO Auto-generated method stub
13 | XposedBridge.hookMethod(method, callback);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/java/com/binpang/methodhook/methodHookStart.java:
--------------------------------------------------------------------------------
1 | package com.binpang.methodhook;
2 |
3 | import com.binpang.apiMonitor.ApiMonitorHookManager;
4 |
5 | import android.content.pm.ApplicationInfo;
6 | import de.robv.android.xposed.IXposedHookLoadPackage;
7 | import de.robv.android.xposed.XposedBridge;
8 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
9 |
10 | public class methodHookStart implements IXposedHookLoadPackage{
11 |
12 | //private String HOOKPACKAGENAME1 = "com.binpang.apiMonitor";
13 | //private String HOOKPACKAGENAME2 = "com.binpang.methodhook";
14 | @Override
15 | public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
16 |
17 | // TODO Auto-generated method stub
18 | //if(lpparam.appInfo == null ||
19 | // (lpparam.appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) !=0){
20 | // return;
21 | //}else
22 | //if(lpparam.isFirstApplication){
23 | //Logger.logI("hello");
24 | //Logger.logI("the package = "+lpparam.packageName +" has hook");
25 | //Logger.logI("the app target id = "+android.os.Process.myPid());
26 | ApiMonitorHookManager.getInstance().startMonitor();
27 | //}else{
28 |
29 | //}
30 | }
31 | }
32 |
33 |
34 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/lib/XposedBridgeApi-54.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/methodhook-master/src/main/lib/XposedBridgeApi-54.jar
--------------------------------------------------------------------------------
/methodhook-master/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skyun1314/hook_and_parse_dex2/27f59f1322e70de43e00066cf69139f71c8992a2/methodhook-master/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/methodhook-master/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/methodhook-master/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | methodHook-master
3 |
4 |
--------------------------------------------------------------------------------
/methodhook-master/src/test/java/com/example/methodhook_master/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.methodhook_master;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':dexpaserl', ':dexpasermode', ':methodhook-master', ':jiemitest', ':JavaTest', ':hookdeviceinfo', ':hookcheck', ':hook_wx'
2 |
--------------------------------------------------------------------------------