capacitor-dex-editor 0.0.69 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +22 -0
- package/android/src/main/cpp/CMakeLists.txt +57 -0
- package/android/src/main/cpp/apk/apk_handler.cpp +121 -0
- package/android/src/main/cpp/apk/zip_utils.cpp +425 -0
- package/android/src/main/cpp/arsc/arsc_parser.cpp +390 -0
- package/android/src/main/cpp/dex/dex_builder.cpp +752 -0
- package/android/src/main/cpp/dex/dex_parser.cpp +620 -0
- package/android/src/main/cpp/dex/smali_disasm.cpp +1223 -0
- package/android/src/main/cpp/dex/smali_to_java.cpp +576 -0
- package/android/src/main/cpp/include/apk/apk_handler.h +41 -0
- package/android/src/main/cpp/include/apk/zip_utils.h +57 -0
- package/android/src/main/cpp/include/arsc/arsc_parser.h +98 -0
- package/android/src/main/cpp/include/dex/dex_builder.h +189 -0
- package/android/src/main/cpp/include/dex/dex_parser.h +137 -0
- package/android/src/main/cpp/include/dex/smali_disasm.h +127 -0
- package/android/src/main/cpp/include/dex/smali_to_java.h +50 -0
- package/android/src/main/cpp/include/xml/android_resources.h +495 -0
- package/android/src/main/cpp/include/xml/axml_parser.h +147 -0
- package/android/src/main/cpp/jni_bridge.cpp +872 -0
- package/android/src/main/cpp/third_party/miniz.c +646 -0
- package/android/src/main/cpp/third_party/miniz.h +605 -0
- package/android/src/main/cpp/third_party/miniz_common.h +97 -0
- package/android/src/main/cpp/third_party/miniz_export.h +6 -0
- package/android/src/main/cpp/third_party/miniz_tdef.c +1597 -0
- package/android/src/main/cpp/third_party/miniz_tdef.h +199 -0
- package/android/src/main/cpp/third_party/miniz_tinfl.c +770 -0
- package/android/src/main/cpp/third_party/miniz_tinfl.h +150 -0
- package/android/src/main/cpp/third_party/miniz_zip.c +4895 -0
- package/android/src/main/cpp/third_party/miniz_zip.h +454 -0
- package/android/src/main/cpp/third_party/nlohmann_json/CMakeLists.txt +0 -0
- package/android/src/main/cpp/third_party/nlohmann_json/single_include/nlohmann/json.hpp +24765 -0
- package/android/src/main/cpp/xml/axml_parser.cpp +1701 -0
- package/android/src/main/java/com/aetherlink/dexeditor/CppDex.java +295 -0
- package/android/src/main/java/com/aetherlink/dexeditor/DexManager.java +146 -50
- package/package.json +1 -1
- package/android/src/main/java/com/aetherlink/dexeditor/RustDex.java +0 -203
- package/android/src/main/jniLibs/arm64-v8a/libdex_rust.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libdex_rust.so +0 -0
- package/android/src/main/jniLibs/x86/libdex_rust.so +0 -0
- package/android/src/main/jniLibs/x86_64/libdex_rust.so +0 -0
package/package.json
CHANGED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
package com.aetherlink.dexeditor;
|
|
2
|
-
|
|
3
|
-
import android.util.Log;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* RustDex - Rust 实现的 DEX 解析器 JNI 接口
|
|
7
|
-
* 使用 azw413/smali crate 实现高性能 DEX 搜索
|
|
8
|
-
*/
|
|
9
|
-
public class RustDex {
|
|
10
|
-
private static final String TAG = "RustDex";
|
|
11
|
-
private static boolean libraryLoaded = false;
|
|
12
|
-
|
|
13
|
-
static {
|
|
14
|
-
try {
|
|
15
|
-
System.loadLibrary("dex_rust");
|
|
16
|
-
libraryLoaded = true;
|
|
17
|
-
Log.d(TAG, "Rust library loaded successfully");
|
|
18
|
-
} catch (UnsatisfiedLinkError e) {
|
|
19
|
-
Log.w(TAG, "Failed to load Rust library: " + e.getMessage());
|
|
20
|
-
libraryLoaded = false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 检查 Rust 库是否可用
|
|
26
|
-
*/
|
|
27
|
-
public static boolean isAvailable() {
|
|
28
|
-
return libraryLoaded;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 在 DEX 中搜索
|
|
33
|
-
* @param dexBytes DEX 文件字节数组
|
|
34
|
-
* @param query 搜索查询
|
|
35
|
-
* @param searchType 搜索类型: class, method, field, string, code
|
|
36
|
-
* @param caseSensitive 是否区分大小写
|
|
37
|
-
* @param maxResults 最大结果数
|
|
38
|
-
* @return JSON 格式的搜索结果
|
|
39
|
-
*/
|
|
40
|
-
public static native String searchInDex(
|
|
41
|
-
byte[] dexBytes,
|
|
42
|
-
String query,
|
|
43
|
-
String searchType,
|
|
44
|
-
boolean caseSensitive,
|
|
45
|
-
int maxResults
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 列出 DEX 中的类
|
|
50
|
-
* @param dexBytes DEX 文件字节数组
|
|
51
|
-
* @param packageFilter 包名过滤器
|
|
52
|
-
* @param offset 偏移量
|
|
53
|
-
* @param limit 限制数量
|
|
54
|
-
* @return JSON 格式的类列表
|
|
55
|
-
*/
|
|
56
|
-
public static native String listClasses(
|
|
57
|
-
byte[] dexBytes,
|
|
58
|
-
String packageFilter,
|
|
59
|
-
int offset,
|
|
60
|
-
int limit
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 获取类的 Smali 代码
|
|
65
|
-
* @param dexBytes DEX 文件字节数组
|
|
66
|
-
* @param className 类名
|
|
67
|
-
* @return JSON 格式的 Smali 代码
|
|
68
|
-
*/
|
|
69
|
-
public static native String getClassSmali(
|
|
70
|
-
byte[] dexBytes,
|
|
71
|
-
String className
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 修改 DEX 中的类
|
|
76
|
-
* @param dexBytes DEX 文件字节数组
|
|
77
|
-
* @param className 类名
|
|
78
|
-
* @param newSmali 新的 Smali 代码
|
|
79
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
80
|
-
*/
|
|
81
|
-
public static native byte[] modifyClass(
|
|
82
|
-
byte[] dexBytes,
|
|
83
|
-
String className,
|
|
84
|
-
String newSmali
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 添加新类到 DEX
|
|
89
|
-
* @param dexBytes DEX 文件字节数组
|
|
90
|
-
* @param newSmali 新类的 Smali 代码
|
|
91
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
92
|
-
*/
|
|
93
|
-
public static native byte[] addClass(
|
|
94
|
-
byte[] dexBytes,
|
|
95
|
-
String newSmali
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 从 DEX 中删除类
|
|
100
|
-
* @param dexBytes DEX 文件字节数组
|
|
101
|
-
* @param className 要删除的类名
|
|
102
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
103
|
-
*/
|
|
104
|
-
public static native byte[] deleteClass(
|
|
105
|
-
byte[] dexBytes,
|
|
106
|
-
String className
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
// ==================== 方法级操作 ====================
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* 列出类中的所有方法
|
|
113
|
-
* @param dexBytes DEX 文件字节数组
|
|
114
|
-
* @param className 类名
|
|
115
|
-
* @return JSON 格式的方法列表
|
|
116
|
-
*/
|
|
117
|
-
public static native String listMethods(
|
|
118
|
-
byte[] dexBytes,
|
|
119
|
-
String className
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 获取单个方法的 Smali 代码
|
|
124
|
-
* @param dexBytes DEX 文件字节数组
|
|
125
|
-
* @param className 类名
|
|
126
|
-
* @param methodName 方法名
|
|
127
|
-
* @param methodSignature 方法签名(可为空字符串表示不限制)
|
|
128
|
-
* @return JSON 格式的方法 Smali 代码
|
|
129
|
-
*/
|
|
130
|
-
public static native String getMethod(
|
|
131
|
-
byte[] dexBytes,
|
|
132
|
-
String className,
|
|
133
|
-
String methodName,
|
|
134
|
-
String methodSignature
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* 添加方法到类
|
|
139
|
-
* @param dexBytes DEX 文件字节数组
|
|
140
|
-
* @param className 类名
|
|
141
|
-
* @param methodSmali 方法的 Smali 代码
|
|
142
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
143
|
-
*/
|
|
144
|
-
public static native byte[] addMethod(
|
|
145
|
-
byte[] dexBytes,
|
|
146
|
-
String className,
|
|
147
|
-
String methodSmali
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* 删除类中的方法
|
|
152
|
-
* @param dexBytes DEX 文件字节数组
|
|
153
|
-
* @param className 类名
|
|
154
|
-
* @param methodName 方法名
|
|
155
|
-
* @param methodSignature 方法签名(可为空字符串表示不限制)
|
|
156
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
157
|
-
*/
|
|
158
|
-
public static native byte[] deleteMethod(
|
|
159
|
-
byte[] dexBytes,
|
|
160
|
-
String className,
|
|
161
|
-
String methodName,
|
|
162
|
-
String methodSignature
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
// ==================== 字段级操作 ====================
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 列出类中的所有字段
|
|
169
|
-
* @param dexBytes DEX 文件字节数组
|
|
170
|
-
* @param className 类名
|
|
171
|
-
* @return JSON 格式的字段列表
|
|
172
|
-
*/
|
|
173
|
-
public static native String listFields(
|
|
174
|
-
byte[] dexBytes,
|
|
175
|
-
String className
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* 添加字段到类
|
|
180
|
-
* @param dexBytes DEX 文件字节数组
|
|
181
|
-
* @param className 类名
|
|
182
|
-
* @param fieldSmali 字段的 Smali 定义(如 ".field public myField:I")
|
|
183
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
184
|
-
*/
|
|
185
|
-
public static native byte[] addField(
|
|
186
|
-
byte[] dexBytes,
|
|
187
|
-
String className,
|
|
188
|
-
String fieldSmali
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* 删除类中的字段
|
|
193
|
-
* @param dexBytes DEX 文件字节数组
|
|
194
|
-
* @param className 类名
|
|
195
|
-
* @param fieldName 字段名
|
|
196
|
-
* @return 修改后的 DEX 字节数组,失败返回 null
|
|
197
|
-
*/
|
|
198
|
-
public static native byte[] deleteField(
|
|
199
|
-
byte[] dexBytes,
|
|
200
|
-
String className,
|
|
201
|
-
String fieldName
|
|
202
|
-
);
|
|
203
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|