capacitor-dex-editor 0.0.68 → 0.0.69

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.
@@ -105,4 +105,99 @@ public class RustDex {
105
105
  byte[] dexBytes,
106
106
  String className
107
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
+ );
108
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-dex-editor",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "Capacitor-plugin-for-editing-DEX-files-in-APK",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",