Skip to content

Commit 48cc269

Browse files
committed
添加项目文件
0 parents  commit 48cc269

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2242
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 29
5+
buildToolsVersion "29.0.2"
6+
7+
defaultConfig {
8+
applicationId "cn.tniub.androidqqhook"
9+
minSdkVersion 19
10+
targetSdkVersion 29
11+
versionCode 1
12+
versionName "1.0"
13+
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_1_8
26+
targetCompatibility JavaVersion.VERSION_1_8
27+
}
28+
}
29+
30+
dependencies {
31+
compileOnly 'de.robv.android.xposed:api:82'
32+
compileOnly 'de.robv.android.xposed:api:82:sources'
33+
implementation 'cn.hutool:hutool-all:5.5.7'
34+
implementation 'com.alibaba:fastjson:1.1.72.android'
35+
36+
implementation fileTree(dir: 'libs', include: ['*.jar'])
37+
38+
implementation 'androidx.appcompat:appcompat:1.2.0'
39+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
40+
testImplementation 'junit:junit:4.13.1'
41+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
42+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
43+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cn.tniub.androidqqhook;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
25+
assertEquals("cn.tniub.androidqqhook", appContext.getPackageName());
26+
}
27+
}

app/src/main/AndroidManifest.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="cn.tniub.androidqqhook">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
8+
9+
<application
10+
android:allowBackup="true"
11+
android:icon="@mipmap/ic_launcher"
12+
android:label="@string/app_name"
13+
android:roundIcon="@mipmap/ic_launcher_round"
14+
android:supportsRtl="true"
15+
android:theme="@style/AppTheme">
16+
<meta-data
17+
android:name="xposedmodule"
18+
android:value="true" />
19+
<meta-data
20+
android:name="xposeddescription"
21+
android:value="QQ hook" />
22+
<meta-data
23+
android:name="xposedminversion"
24+
android:value="53" />
25+
26+
<activity android:name=".MainActivity">
27+
<intent-filter>
28+
<action android:name="android.intent.action.MAIN" />
29+
30+
<category android:name="android.intent.category.LAUNCHER" />
31+
</intent-filter>
32+
</activity>
33+
</application>
34+
35+
</manifest>

app/src/main/assets/xposed_init

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cn.tniub.androidqqhook.HookQQ
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package cn.tniub.androidqqhook;
2+
3+
import android.os.Environment;
4+
5+
import java.io.File;
6+
7+
class Constant {
8+
9+
static final String FILENAME_HTTP_SERVER_URL = "http_server_url.txt";
10+
static final String PATH_SAVE_HTTP_SERVER_URL = Environment.getExternalStorageDirectory().getAbsolutePath()
11+
+ File.separator + "config/";
12+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package cn.tniub.androidqqhook;
2+
3+
import cn.tniub.androidqqhook.hooks.methods.A1;
4+
import cn.tniub.androidqqhook.hooks.methods.A2;
5+
import cn.tniub.androidqqhook.hooks.methods.A3;
6+
import cn.tniub.androidqqhook.hooks.methods.C;
7+
import cn.tniub.androidqqhook.hooks.methods.CalShareKeyByBouncycastle;
8+
import cn.tniub.androidqqhook.hooks.methods.Cryptor;
9+
import cn.tniub.androidqqhook.hooks.methods.D2Key;
10+
import cn.tniub.androidqqhook.hooks.methods.GenECDHKeyEx;
11+
import cn.tniub.androidqqhook.hooks.methods.GetAndroidId;
12+
import cn.tniub.androidqqhook.hooks.methods.GetBssidAddr;
13+
import cn.tniub.androidqqhook.hooks.methods.GetIMSI;
14+
import cn.tniub.androidqqhook.hooks.methods.GetMacAddr;
15+
import cn.tniub.androidqqhook.hooks.methods.GetQIMEI;
16+
import cn.tniub.androidqqhook.hooks.methods.InitShareKeyByBouncycastle;
17+
import cn.tniub.androidqqhook.hooks.methods.LoginPwd;
18+
import cn.tniub.androidqqhook.hooks.methods.NickName;
19+
import cn.tniub.androidqqhook.hooks.methods.SetPriKey;
20+
import cn.tniub.androidqqhook.hooks.methods.SetPubKey;
21+
import cn.tniub.androidqqhook.hooks.methods.SetShareKey;
22+
import cn.tniub.androidqqhook.hooks.methods.SetSigInfo;
23+
import cn.tniub.androidqqhook.hooks.methods.TGTKey;
24+
import cn.tniub.androidqqhook.hooks.methods.TLV547;
25+
import cn.tniub.androidqqhook.hooks.methods.WloginSigInfo;
26+
import de.robv.android.xposed.IXposedHookLoadPackage;
27+
import de.robv.android.xposed.XposedBridge;
28+
import de.robv.android.xposed.callbacks.XC_LoadPackage;
29+
30+
public class HookQQ implements IXposedHookLoadPackage {
31+
32+
private XC_LoadPackage.LoadPackageParam loadPackageParam;
33+
34+
private boolean isMobileQQ() {
35+
return loadPackageParam.packageName.equals("com.tencent.mobileqq");
36+
}
37+
38+
@Override
39+
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
40+
this.loadPackageParam = loadPackageParam;
41+
if (!isMobileQQ()) {
42+
return;
43+
}
44+
XposedBridge.log("com.tencent.mobileqq hooked!");
45+
new SetPriKey(loadPackageParam).hookMethod();
46+
new SetPubKey(loadPackageParam).hookMethod();
47+
new SetShareKey(loadPackageParam).hookMethod();
48+
new GenECDHKeyEx(loadPackageParam).hookMethod();
49+
new CalShareKeyByBouncycastle(loadPackageParam).hookMethod();
50+
new InitShareKeyByBouncycastle(loadPackageParam).hookMethod();
51+
52+
new GetAndroidId(loadPackageParam).hookMethod();
53+
new GetMacAddr(loadPackageParam).hookMethod();
54+
new GetIMSI(loadPackageParam).hookMethod();
55+
56+
new D2Key(loadPackageParam).hookMethod();
57+
new A1(loadPackageParam).hookMethod();
58+
new A2(loadPackageParam).hookMethod();
59+
new A3(loadPackageParam).hookMethod();
60+
new GetQIMEI(loadPackageParam).hookMethod();
61+
new GetBssidAddr(loadPackageParam).hookMethod();
62+
63+
new TGTKey(loadPackageParam).hookMethod();
64+
new Cryptor(loadPackageParam).hookMethod();
65+
new NickName(loadPackageParam).hookMethod();
66+
new C(loadPackageParam).hookMethod();
67+
new WloginSigInfo(loadPackageParam).hookMethod();
68+
new SetSigInfo(loadPackageParam).hookMethod();
69+
new LoginPwd(loadPackageParam).hookMethod();
70+
71+
}
72+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package cn.tniub.androidqqhook;
2+
3+
import android.annotation.SuppressLint;
4+
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.Button;
7+
import android.widget.EditText;
8+
9+
import androidx.appcompat.app.AppCompatActivity;
10+
11+
import java.util.Random;
12+
13+
import cn.hutool.core.io.FileUtil;
14+
import cn.hutool.core.io.IORuntimeException;
15+
import cn.hutool.core.util.CharsetUtil;
16+
17+
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
18+
19+
private Button btn_test;
20+
private Button btn_save;
21+
private EditText et_url;
22+
23+
@Override
24+
protected void onCreate(Bundle savedInstanceState) {
25+
super.onCreate(savedInstanceState);
26+
setContentView(R.layout.activity_main);
27+
28+
findView();
29+
loadConfig();
30+
setListener();
31+
}
32+
33+
private void findView() {
34+
btn_test = findViewById(R.id.btn_test);
35+
btn_save = findViewById(R.id.btn_save);
36+
et_url = findViewById(R.id.et_url);
37+
}
38+
39+
private void loadConfig() {
40+
try {
41+
String http_server_url = FileUtil.readString(Constant.PATH_SAVE_HTTP_SERVER_URL + Constant.FILENAME_HTTP_SERVER_URL, CharsetUtil.UTF_8);
42+
et_url.setText(http_server_url);
43+
} catch (IORuntimeException e) {
44+
e.printStackTrace();
45+
}
46+
}
47+
48+
private void setListener() {
49+
btn_test.setOnClickListener(this);
50+
btn_save.setOnClickListener(this);
51+
}
52+
53+
@SuppressLint("NonConstantResourceId")
54+
@Override
55+
public void onClick(View v) {
56+
switch (v.getId()) {
57+
case R.id.btn_test:
58+
doTest();
59+
break;
60+
case R.id.btn_save:
61+
doSave();
62+
loadConfig();
63+
break;
64+
default:
65+
break;
66+
}
67+
}
68+
69+
private void doTest() {
70+
new MyAsyncTask().execute("test", "test rand " + new Random().nextInt(Integer.MAX_VALUE));
71+
}
72+
73+
private void doSave() {
74+
try {
75+
FileUtil.writeString(et_url.getText().toString(), Constant.PATH_SAVE_HTTP_SERVER_URL + Constant.FILENAME_HTTP_SERVER_URL, CharsetUtil.UTF_8);
76+
} catch (IORuntimeException e) {
77+
e.printStackTrace();
78+
}
79+
}
80+
}

0 commit comments

Comments
 (0)