Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnnnnnn committed May 30, 2024
0 parents commit e65a5b6
Show file tree
Hide file tree
Showing 49 changed files with 1,108 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/.idea/*
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Hook_WeChat_FaaS_Xposed

[Hook_WeChat_FaaS](https://github.com/FourTwooo/Hook_WeChat_FaaS)的Xposed版本

## 用法

1. 自编译or下载release中的apk文件
2. 安装到有LSPosed的设备上,作用域勾选微信
3. 打开微信,进入任意一个小程序
4. 访问Xposed插件暴露的API接口,执行云函数和获取日志


## API接口

| 接口名 | 参数 | 返回值 | 说明 |
| :---: | :---: | :---: | :---: |
| GET / || ok | 用于测试Xposed Server是否开启 |
| POST /CallWX | {"appid": "wxafec6f8422cb357b","jsapi_name": "login","data": "{\\"requestInQueue\\":false}"} | {"result": "wxafec6f8422cb357b-86"} | 调用云函数,返回请求序列号 |
| GET /wx_log || ["[WX-FaaS-HOOK] Find app: com.tencent.mm","[WX-FaaS-HOOK] start embeddedServer at 0.0.0.0:59999",...] | 查询近1500条日志|


## 注意事项
1. 第一次打开小程序执行自定义云函数后有可能会出现只有request但没有response的情况,需要划掉小程序重新打开,再执行一次自定义云函数
2. 必须进入到小程序页面才能打开Xposed Server,退出小程序后Xposed Server也会关闭
3. 本版本未经过充分测试,请勿在生产环境使用


## 效果图
wx.login请求和响应
![jscode request](images/image-1.png)
![jscode response](images/image-2.png)

UserCryptoManager.getLatestUserKey请求和响应
![getuserencryptkey request](images/image-3.png)
![getuserencryptkey response](images/image-4.png)


## 致谢
[Hook_WeChat_FaaS](https://github.com/FourTwooo/Hook_WeChat_FaaS)
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
61 changes: 61 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}

android {
namespace = "com.dawnnnnnn.wechat_cloud_function_hook"
compileSdk = 34

defaultConfig {
applicationId = "com.dawnnnnnn.wechat_cloud_function_hook"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

packaging {
jniLibs {
excludes += "META-INF/**"
}
resources {
excludes += "META-INF/**"
}
}

buildTypes {
release {
isMinifyEnabled = false
isShrinkResources = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
compileOnly("de.robv.android.xposed:api:82")
implementation("io.ktor:ktor-server-core:1.6.1")
implementation("io.ktor:ktor-server-netty:1.6.1")
implementation("io.ktor:ktor-gson:1.6.1")

}
Binary file added app/debug/app-debug.apk
Binary file not shown.
21 changes: 21 additions & 0 deletions app/debug/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.dawnnnnnn.wechat_cloud_function_hook",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-debug.apk"
}
],
"elementType": "File",
"minSdkVersionForDexing": 24
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Binary file added app/release/app-release.apk
Binary file not shown.
Binary file added app/release/baselineProfiles/0/app-release.dm
Binary file not shown.
Binary file added app/release/baselineProfiles/1/app-release.dm
Binary file not shown.
37 changes: 37 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.dawnnnnnn.wechat_cloud_function_hook",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 24
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.dawnnnnnn.wechat_cloud_function_hook

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.dawnnnnnn.wechat_cloud_function_hook", appContext.packageName)
}
}
29 changes: 29 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application

android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Wechat_cloud_function_hook"
tools:targetApi="34" >
<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="@string/app_description"/>
<meta-data
android:name="xposedminversion"
android:value="53" />
<meta-data
android:name="xposedscope"
android:resource="@array/scope" />
</application>
</manifest>
1 change: 1 addition & 0 deletions app/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.dawnnnnnn.wechat_cloud_function_hook.WeChatHook
Loading

0 comments on commit e65a5b6

Please sign in to comment.