capacitor-dex-editor 0.0.1

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.
File without changes
package/dist/docs.json ADDED
@@ -0,0 +1,303 @@
1
+ {
2
+ "api": {
3
+ "name": "DexEditorPluginPlugin",
4
+ "slug": "dexeditorpluginplugin",
5
+ "docs": "DEX编辑器插件 - 通用执行器接口\n通过 action 参数调用 dexlib2 的全部功能",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "execute",
10
+ "signature": "(options: DexExecuteOptions) => Promise<DexExecuteResult>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "DexExecuteOptions"
16
+ }
17
+ ],
18
+ "returns": "Promise<DexExecuteResult>",
19
+ "tags": [
20
+ {
21
+ "name": "param",
22
+ "text": "options.action 操作名称"
23
+ },
24
+ {
25
+ "name": "param",
26
+ "text": "options.params 操作参数"
27
+ }
28
+ ],
29
+ "docs": "通用执行器 - 调用任意 dexlib2 功能",
30
+ "complexTypes": [
31
+ "DexExecuteResult",
32
+ "DexExecuteOptions"
33
+ ],
34
+ "slug": "execute"
35
+ }
36
+ ],
37
+ "properties": []
38
+ },
39
+ "interfaces": [
40
+ {
41
+ "name": "DexExecuteResult",
42
+ "slug": "dexexecuteresult",
43
+ "docs": "",
44
+ "tags": [],
45
+ "methods": [],
46
+ "properties": [
47
+ {
48
+ "name": "success",
49
+ "tags": [],
50
+ "docs": "",
51
+ "complexTypes": [],
52
+ "type": "boolean"
53
+ },
54
+ {
55
+ "name": "data",
56
+ "tags": [],
57
+ "docs": "",
58
+ "complexTypes": [],
59
+ "type": "any"
60
+ },
61
+ {
62
+ "name": "error",
63
+ "tags": [],
64
+ "docs": "",
65
+ "complexTypes": [],
66
+ "type": "string | undefined"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "name": "DexExecuteOptions",
72
+ "slug": "dexexecuteoptions",
73
+ "docs": "",
74
+ "tags": [],
75
+ "methods": [],
76
+ "properties": [
77
+ {
78
+ "name": "action",
79
+ "tags": [],
80
+ "docs": "",
81
+ "complexTypes": [
82
+ "DexAction"
83
+ ],
84
+ "type": "DexAction"
85
+ },
86
+ {
87
+ "name": "params",
88
+ "tags": [],
89
+ "docs": "",
90
+ "complexTypes": [
91
+ "Record"
92
+ ],
93
+ "type": "Record<string, any>"
94
+ }
95
+ ]
96
+ }
97
+ ],
98
+ "enums": [],
99
+ "typeAliases": [
100
+ {
101
+ "name": "DexAction",
102
+ "slug": "dexaction",
103
+ "docs": "支持的操作类型",
104
+ "types": [
105
+ {
106
+ "text": "'loadDex'",
107
+ "complexTypes": []
108
+ },
109
+ {
110
+ "text": "'saveDex'",
111
+ "complexTypes": []
112
+ },
113
+ {
114
+ "text": "'closeDex'",
115
+ "complexTypes": []
116
+ },
117
+ {
118
+ "text": "'getDexInfo'",
119
+ "complexTypes": []
120
+ },
121
+ {
122
+ "text": "'getClasses'",
123
+ "complexTypes": []
124
+ },
125
+ {
126
+ "text": "'getClassInfo'",
127
+ "complexTypes": []
128
+ },
129
+ {
130
+ "text": "'addClass'",
131
+ "complexTypes": []
132
+ },
133
+ {
134
+ "text": "'removeClass'",
135
+ "complexTypes": []
136
+ },
137
+ {
138
+ "text": "'renameClass'",
139
+ "complexTypes": []
140
+ },
141
+ {
142
+ "text": "'getMethods'",
143
+ "complexTypes": []
144
+ },
145
+ {
146
+ "text": "'getMethodInfo'",
147
+ "complexTypes": []
148
+ },
149
+ {
150
+ "text": "'getMethodSmali'",
151
+ "complexTypes": []
152
+ },
153
+ {
154
+ "text": "'setMethodSmali'",
155
+ "complexTypes": []
156
+ },
157
+ {
158
+ "text": "'addMethod'",
159
+ "complexTypes": []
160
+ },
161
+ {
162
+ "text": "'removeMethod'",
163
+ "complexTypes": []
164
+ },
165
+ {
166
+ "text": "'getFields'",
167
+ "complexTypes": []
168
+ },
169
+ {
170
+ "text": "'getFieldInfo'",
171
+ "complexTypes": []
172
+ },
173
+ {
174
+ "text": "'addField'",
175
+ "complexTypes": []
176
+ },
177
+ {
178
+ "text": "'removeField'",
179
+ "complexTypes": []
180
+ },
181
+ {
182
+ "text": "'classToSmali'",
183
+ "complexTypes": []
184
+ },
185
+ {
186
+ "text": "'smaliToClass'",
187
+ "complexTypes": []
188
+ },
189
+ {
190
+ "text": "'disassemble'",
191
+ "complexTypes": []
192
+ },
193
+ {
194
+ "text": "'assemble'",
195
+ "complexTypes": []
196
+ },
197
+ {
198
+ "text": "'searchString'",
199
+ "complexTypes": []
200
+ },
201
+ {
202
+ "text": "'searchCode'",
203
+ "complexTypes": []
204
+ },
205
+ {
206
+ "text": "'searchMethod'",
207
+ "complexTypes": []
208
+ },
209
+ {
210
+ "text": "'searchField'",
211
+ "complexTypes": []
212
+ },
213
+ {
214
+ "text": "'fixDex'",
215
+ "complexTypes": []
216
+ },
217
+ {
218
+ "text": "'mergeDex'",
219
+ "complexTypes": []
220
+ },
221
+ {
222
+ "text": "'splitDex'",
223
+ "complexTypes": []
224
+ },
225
+ {
226
+ "text": "'getStrings'",
227
+ "complexTypes": []
228
+ },
229
+ {
230
+ "text": "'modifyString'",
231
+ "complexTypes": []
232
+ },
233
+ {
234
+ "text": "'openApk'",
235
+ "complexTypes": []
236
+ },
237
+ {
238
+ "text": "'closeApk'",
239
+ "complexTypes": []
240
+ },
241
+ {
242
+ "text": "'getApkInfo'",
243
+ "complexTypes": []
244
+ },
245
+ {
246
+ "text": "'listApkContents'",
247
+ "complexTypes": []
248
+ },
249
+ {
250
+ "text": "'extractFile'",
251
+ "complexTypes": []
252
+ },
253
+ {
254
+ "text": "'replaceFile'",
255
+ "complexTypes": []
256
+ },
257
+ {
258
+ "text": "'addFile'",
259
+ "complexTypes": []
260
+ },
261
+ {
262
+ "text": "'deleteFile'",
263
+ "complexTypes": []
264
+ },
265
+ {
266
+ "text": "'repackApk'",
267
+ "complexTypes": []
268
+ },
269
+ {
270
+ "text": "'signApk'",
271
+ "complexTypes": []
272
+ },
273
+ {
274
+ "text": "'signApkWithTestKey'",
275
+ "complexTypes": []
276
+ },
277
+ {
278
+ "text": "'getApkSignature'",
279
+ "complexTypes": []
280
+ },
281
+ {
282
+ "text": "'getSessionDexFiles'",
283
+ "complexTypes": []
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "name": "Record",
289
+ "slug": "record",
290
+ "docs": "Construct a type with a set of properties K of type T",
291
+ "types": [
292
+ {
293
+ "text": "{\r\n [P in K]: T;\r\n}",
294
+ "complexTypes": [
295
+ "K",
296
+ "T"
297
+ ]
298
+ }
299
+ ]
300
+ }
301
+ ],
302
+ "pluginConfigs": []
303
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * DEX编辑器插件 - 通用执行器接口
3
+ * 通过 action 参数调用 dexlib2 的全部功能
4
+ */
5
+ export interface DexEditorPluginPlugin {
6
+ /**
7
+ * 通用执行器 - 调用任意 dexlib2 功能
8
+ * @param options.action 操作名称
9
+ * @param options.params 操作参数
10
+ */
11
+ execute(options: DexExecuteOptions): Promise<DexExecuteResult>;
12
+ }
13
+ export interface DexExecuteOptions {
14
+ action: DexAction;
15
+ params?: Record<string, any>;
16
+ }
17
+ export interface DexExecuteResult {
18
+ success: boolean;
19
+ data?: any;
20
+ error?: string;
21
+ }
22
+ /**
23
+ * 支持的操作类型
24
+ */
25
+ export type DexAction = 'loadDex' | 'saveDex' | 'closeDex' | 'getDexInfo' | 'getClasses' | 'getClassInfo' | 'addClass' | 'removeClass' | 'renameClass' | 'getMethods' | 'getMethodInfo' | 'getMethodSmali' | 'setMethodSmali' | 'addMethod' | 'removeMethod' | 'getFields' | 'getFieldInfo' | 'addField' | 'removeField' | 'classToSmali' | 'smaliToClass' | 'disassemble' | 'assemble' | 'searchString' | 'searchCode' | 'searchMethod' | 'searchField' | 'fixDex' | 'mergeDex' | 'splitDex' | 'getStrings' | 'modifyString' | 'openApk' | 'closeApk' | 'getApkInfo' | 'listApkContents' | 'extractFile' | 'replaceFile' | 'addFile' | 'deleteFile' | 'repackApk' | 'signApk' | 'signApkWithTestKey' | 'getApkSignature' | 'getSessionDexFiles';
26
+ /**
27
+ * 常用参数类型定义
28
+ */
29
+ export interface LoadDexParams {
30
+ path: string;
31
+ sessionId?: string;
32
+ }
33
+ export interface SaveDexParams {
34
+ sessionId: string;
35
+ outputPath: string;
36
+ }
37
+ export interface ClassInfoParams {
38
+ sessionId: string;
39
+ className: string;
40
+ }
41
+ export interface MethodSmaliParams {
42
+ sessionId: string;
43
+ className: string;
44
+ methodName: string;
45
+ methodSignature: string;
46
+ }
47
+ export interface SetMethodSmaliParams extends MethodSmaliParams {
48
+ smaliCode: string;
49
+ }
50
+ export interface SearchParams {
51
+ sessionId: string;
52
+ query: string;
53
+ regex?: boolean;
54
+ caseSensitive?: boolean;
55
+ }
56
+ export interface DisassembleParams {
57
+ sessionId: string;
58
+ outputDir: string;
59
+ }
60
+ export interface AssembleParams {
61
+ smaliDir: string;
62
+ outputPath: string;
63
+ }
64
+ export interface OpenApkParams {
65
+ apkPath: string;
66
+ extractDir?: string;
67
+ }
68
+ export interface ApkInfoParams {
69
+ apkPath: string;
70
+ }
71
+ export interface ExtractFileParams {
72
+ apkPath: string;
73
+ entryName: string;
74
+ outputPath: string;
75
+ }
76
+ export interface ReplaceFileParams {
77
+ sessionId: string;
78
+ entryName: string;
79
+ newFilePath: string;
80
+ }
81
+ export interface RepackApkParams {
82
+ sessionId: string;
83
+ outputPath: string;
84
+ }
85
+ export interface SignApkParams {
86
+ apkPath: string;
87
+ outputPath: string;
88
+ keystorePath: string;
89
+ keystorePassword: string;
90
+ keyAlias: string;
91
+ keyPassword: string;
92
+ }
93
+ export interface SignApkTestParams {
94
+ apkPath: string;
95
+ outputPath: string;
96
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * DEX编辑器插件 - 通用执行器接口\n * 通过 action 参数调用 dexlib2 的全部功能\n */\nexport interface DexEditorPluginPlugin {\n /**\n * 通用执行器 - 调用任意 dexlib2 功能\n * @param options.action 操作名称\n * @param options.params 操作参数\n */\n execute(options: DexExecuteOptions): Promise<DexExecuteResult>;\n}\n\nexport interface DexExecuteOptions {\n action: DexAction;\n params?: Record<string, any>;\n}\n\nexport interface DexExecuteResult {\n success: boolean;\n data?: any;\n error?: string;\n}\n\n/**\n * 支持的操作类型\n */\nexport type DexAction =\n // DEX文件操作\n | 'loadDex' // 加载DEX文件\n | 'saveDex' // 保存DEX文件\n | 'closeDex' // 关闭DEX文件\n | 'getDexInfo' // 获取DEX文件信息\n \n // 类操作\n | 'getClasses' // 获取所有类列表\n | 'getClassInfo' // 获取类详细信息\n | 'addClass' // 添加类\n | 'removeClass' // 删除类\n | 'renameClass' // 重命名类\n \n // 方法操作\n | 'getMethods' // 获取类的所有方法\n | 'getMethodInfo' // 获取方法详细信息\n | 'getMethodSmali' // 获取方法的Smali代码\n | 'setMethodSmali' // 设置方法的Smali代码\n | 'addMethod' // 添加方法\n | 'removeMethod' // 删除方法\n \n // 字段操作\n | 'getFields' // 获取类的所有字段\n | 'getFieldInfo' // 获取字段详细信息\n | 'addField' // 添加字段\n | 'removeField' // 删除字段\n \n // Smali操作\n | 'classToSmali' // 将类转换为Smali代码\n | 'smaliToClass' // 将Smali代码编译为类\n | 'disassemble' // 反汇编整个DEX\n | 'assemble' // 汇编Smali目录为DEX\n \n // 搜索操作\n | 'searchString' // 搜索字符串\n | 'searchCode' // 搜索代码\n | 'searchMethod' // 搜索方法\n | 'searchField' // 搜索字段\n \n // 工具操作\n | 'fixDex' // 修复DEX文件\n | 'mergeDex' // 合并多个DEX\n | 'splitDex' // 拆分DEX\n | 'getStrings' // 获取字符串常量池\n | 'modifyString' // 修改字符串\n \n // APK操作\n | 'openApk' // 打开APK文件(解压)\n | 'closeApk' // 关闭APK会话\n | 'getApkInfo' // 获取APK信息\n | 'listApkContents' // 列出APK内容\n | 'extractFile' // 提取APK中的文件\n | 'replaceFile' // 替换APK中的文件\n | 'addFile' // 添加文件到APK\n | 'deleteFile' // 删除APK中的文件\n | 'repackApk' // 重新打包APK\n | 'signApk' // 签名APK\n | 'signApkWithTestKey'// 使用测试密钥签名\n | 'getApkSignature' // 获取APK签名信息\n | 'getSessionDexFiles';// 获取会话中的DEX文件\n\n/**\n * 常用参数类型定义\n */\nexport interface LoadDexParams {\n path: string; // DEX文件路径\n sessionId?: string; // 可选的会话ID\n}\n\nexport interface SaveDexParams {\n sessionId: string; // 会话ID\n outputPath: string; // 输出路径\n}\n\nexport interface ClassInfoParams {\n sessionId: string;\n className: string; // 类名 (如 Lcom/example/Test;)\n}\n\nexport interface MethodSmaliParams {\n sessionId: string;\n className: string;\n methodName: string;\n methodSignature: string; // 方法签名 (如 (I)V)\n}\n\nexport interface SetMethodSmaliParams extends MethodSmaliParams {\n smaliCode: string; // 新的Smali代码\n}\n\nexport interface SearchParams {\n sessionId: string;\n query: string;\n regex?: boolean; // 是否使用正则表达式\n caseSensitive?: boolean;\n}\n\nexport interface DisassembleParams {\n sessionId: string;\n outputDir: string; // 输出Smali目录\n}\n\nexport interface AssembleParams {\n smaliDir: string; // Smali目录\n outputPath: string; // 输出DEX路径\n}\n\n// ============ APK 操作参数 ============\n\nexport interface OpenApkParams {\n apkPath: string; // APK文件路径\n extractDir?: string; // 解压目录(可选)\n}\n\nexport interface ApkInfoParams {\n apkPath: string;\n}\n\nexport interface ExtractFileParams {\n apkPath: string;\n entryName: string; // ZIP内文件路径\n outputPath: string;\n}\n\nexport interface ReplaceFileParams {\n sessionId: string;\n entryName: string; // ZIP内文件路径\n newFilePath: string; // 新文件路径\n}\n\nexport interface RepackApkParams {\n sessionId: string;\n outputPath: string; // 输出APK路径\n}\n\nexport interface SignApkParams {\n apkPath: string;\n outputPath: string;\n keystorePath: string; // 密钥库路径\n keystorePassword: string;\n keyAlias: string; // 密钥别名\n keyPassword: string;\n}\n\nexport interface SignApkTestParams {\n apkPath: string;\n outputPath: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { DexEditorPluginPlugin } from './definitions';
2
+ declare const DexEditorPlugin: DexEditorPluginPlugin;
3
+ export * from './definitions';
4
+ export { DexEditorPlugin };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const DexEditorPlugin = registerPlugin('DexEditorPlugin', {
3
+ web: () => import('./web').then((m) => new m.DexEditorPluginWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { DexEditorPlugin };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,eAAe,GAAG,cAAc,CAAwB,iBAAiB,EAAE;IAC/E,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;CACnE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { DexEditorPluginPlugin } from './definitions';\n\nconst DexEditorPlugin = registerPlugin<DexEditorPluginPlugin>('DexEditorPlugin', {\n web: () => import('./web').then((m) => new m.DexEditorPluginWeb()),\n});\n\nexport * from './definitions';\nexport { DexEditorPlugin };\n"]}
@@ -0,0 +1,8 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { DexEditorPluginPlugin, DexExecuteOptions, DexExecuteResult } from './definitions';
3
+ /**
4
+ * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)
5
+ */
6
+ export declare class DexEditorPluginWeb extends WebPlugin implements DexEditorPluginPlugin {
7
+ execute(options: DexExecuteOptions): Promise<DexExecuteResult>;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ /**
3
+ * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)
4
+ */
5
+ export class DexEditorPluginWeb extends WebPlugin {
6
+ async execute(options) {
7
+ console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');
8
+ console.log('Action:', options.action, 'Params:', options.params);
9
+ return {
10
+ success: false,
11
+ error: 'DEX editing is only available on Android platform'
12
+ };
13
+ }
14
+ }
15
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,KAAK,CAAC,OAAO,CAAC,OAA0B;QACtC,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAElE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,mDAAmD;SAC3D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { DexEditorPluginPlugin, DexExecuteOptions, DexExecuteResult } from './definitions';\n\n/**\n * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)\n */\nexport class DexEditorPluginWeb extends WebPlugin implements DexEditorPluginPlugin {\n async execute(options: DexExecuteOptions): Promise<DexExecuteResult> {\n console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');\n console.log('Action:', options.action, 'Params:', options.params);\n \n return {\n success: false,\n error: 'DEX editing is only available on Android platform'\n };\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ const DexEditorPlugin = core.registerPlugin('DexEditorPlugin', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.DexEditorPluginWeb()),
7
+ });
8
+
9
+ /**
10
+ * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)
11
+ */
12
+ class DexEditorPluginWeb extends core.WebPlugin {
13
+ async execute(options) {
14
+ console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');
15
+ console.log('Action:', options.action, 'Params:', options.params);
16
+ return {
17
+ success: false,
18
+ error: 'DEX editing is only available on Android platform'
19
+ };
20
+ }
21
+ }
22
+
23
+ var web = /*#__PURE__*/Object.freeze({
24
+ __proto__: null,
25
+ DexEditorPluginWeb: DexEditorPluginWeb
26
+ });
27
+
28
+ exports.DexEditorPlugin = DexEditorPlugin;
29
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst DexEditorPlugin = registerPlugin('DexEditorPlugin', {\n web: () => import('./web').then((m) => new m.DexEditorPluginWeb()),\n});\nexport * from './definitions';\nexport { DexEditorPlugin };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\n/**\n * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)\n */\nexport class DexEditorPluginWeb extends WebPlugin {\n async execute(options) {\n console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');\n console.log('Action:', options.action, 'Params:', options.params);\n return {\n success: false,\n error: 'DEX editing is only available on Android platform'\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFD;AACA;AACA;AACO,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;AAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC;AACtF,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC;AACzE,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,YAAY,KAAK,EAAE;AACnB,SAAS;AACT,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,32 @@
1
+ var capacitorDexEditorPlugin = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const DexEditorPlugin = core.registerPlugin('DexEditorPlugin', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.DexEditorPluginWeb()),
6
+ });
7
+
8
+ /**
9
+ * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)
10
+ */
11
+ class DexEditorPluginWeb extends core.WebPlugin {
12
+ async execute(options) {
13
+ console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');
14
+ console.log('Action:', options.action, 'Params:', options.params);
15
+ return {
16
+ success: false,
17
+ error: 'DEX editing is only available on Android platform'
18
+ };
19
+ }
20
+ }
21
+
22
+ var web = /*#__PURE__*/Object.freeze({
23
+ __proto__: null,
24
+ DexEditorPluginWeb: DexEditorPluginWeb
25
+ });
26
+
27
+ exports.DexEditorPlugin = DexEditorPlugin;
28
+
29
+ return exports;
30
+
31
+ })({}, capacitorExports);
32
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst DexEditorPlugin = registerPlugin('DexEditorPlugin', {\n web: () => import('./web').then((m) => new m.DexEditorPluginWeb()),\n});\nexport * from './definitions';\nexport { DexEditorPlugin };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\n/**\n * Web 平台实现(仅用于开发调试,实际功能需要 Android 原生)\n */\nexport class DexEditorPluginWeb extends WebPlugin {\n async execute(options) {\n console.warn('DexEditorPlugin: Web platform is not supported for DEX editing');\n console.log('Action:', options.action, 'Params:', options.params);\n return {\n success: false,\n error: 'DEX editing is only available on Android platform'\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,eAAe,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACtE,CAAC;;ICFD;IACA;IACA;IACO,MAAM,kBAAkB,SAASC,cAAS,CAAC;IAClD,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC;IACtF,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC;IACzE,QAAQ,OAAO;IACf,YAAY,OAAO,EAAE,KAAK;IAC1B,YAAY,KAAK,EAAE;IACnB,SAAS;IACT,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ import Foundation
2
+
3
+ @objc public class DexEditorPlugin: NSObject {
4
+ @objc public func echo(_ value: String) -> String {
5
+ print(value)
6
+ return value
7
+ }
8
+ }
@@ -0,0 +1,23 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ /**
5
+ * Please read the Capacitor iOS Plugin Development Guide
6
+ * here: https://capacitorjs.com/docs/plugins/ios
7
+ */
8
+ @objc(DexEditorPluginPlugin)
9
+ public class DexEditorPluginPlugin: CAPPlugin, CAPBridgedPlugin {
10
+ public let identifier = "DexEditorPluginPlugin"
11
+ public let jsName = "DexEditorPlugin"
12
+ public let pluginMethods: [CAPPluginMethod] = [
13
+ CAPPluginMethod(name: "echo", returnType: CAPPluginReturnPromise)
14
+ ]
15
+ private let implementation = DexEditorPlugin()
16
+
17
+ @objc func echo(_ call: CAPPluginCall) {
18
+ let value = call.getString("value") ?? ""
19
+ call.resolve([
20
+ "value": implementation.echo(value)
21
+ ])
22
+ }
23
+ }
@@ -0,0 +1,15 @@
1
+ import XCTest
2
+ @testable import DexEditorPluginPlugin
3
+
4
+ class DexEditorPluginTests: XCTestCase {
5
+ func testEcho() {
6
+ // This is an example of a functional test case for a plugin.
7
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
8
+
9
+ let implementation = DexEditorPlugin()
10
+ let value = "Hello, World!"
11
+ let result = implementation.echo(value)
12
+
13
+ XCTAssertEqual(value, result)
14
+ }
15
+ }
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "capacitor-dex-editor",
3
+ "version": "0.0.1",
4
+ "description": "Capacitor-plugin-for-editing-DEX-files-in-APK",
5
+ "main": "dist/plugin.cjs.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "unpkg": "dist/plugin.js",
9
+ "files": [
10
+ "android/src/main/",
11
+ "android/build.gradle",
12
+ "dist/",
13
+ "ios/Sources",
14
+ "ios/Tests",
15
+ "Package.swift",
16
+ "CapacitorDexEditor.podspec"
17
+ ],
18
+ "author": "1600822305",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/q1600822305/capacitor-dex-editor.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/q1600822305/capacitor-dex-editor/issues"
26
+ },
27
+ "keywords": [
28
+ "capacitor",
29
+ "plugin",
30
+ "native"
31
+ ],
32
+ "scripts": {
33
+ "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
34
+ "verify:ios": "xcodebuild -scheme CapacitorDexEditor -destination generic/platform=iOS",
35
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
36
+ "verify:web": "npm run build",
37
+ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
38
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
39
+ "eslint": "eslint . --ext ts",
40
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
41
+ "swiftlint": "node-swiftlint",
42
+ "docgen": "docgen --api DexEditorPluginPlugin --output-readme README.md --output-json dist/docs.json",
43
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
44
+ "clean": "rimraf ./dist",
45
+ "watch": "tsc --watch",
46
+ "prepublishOnly": "npm run build"
47
+ },
48
+ "devDependencies": {
49
+ "@capacitor/android": "^7.0.0",
50
+ "@capacitor/core": "^7.0.0",
51
+ "@capacitor/docgen": "^0.3.0",
52
+ "@capacitor/ios": "^7.0.0",
53
+ "@ionic/eslint-config": "^0.4.0",
54
+ "@ionic/prettier-config": "^4.0.0",
55
+ "@ionic/swiftlint-config": "^2.0.0",
56
+ "eslint": "^8.57.0",
57
+ "prettier": "^3.4.2",
58
+ "prettier-plugin-java": "^2.6.6",
59
+ "rimraf": "^6.0.1",
60
+ "rollup": "^4.30.1",
61
+ "swiftlint": "^2.0.0",
62
+ "typescript": "^5.9.3"
63
+ },
64
+ "peerDependencies": {
65
+ "@capacitor/core": ">=7.0.0"
66
+ },
67
+ "prettier": "@ionic/prettier-config",
68
+ "swiftlint": "@ionic/swiftlint-config",
69
+ "eslintConfig": {
70
+ "extends": "@ionic/eslint-config/recommended"
71
+ },
72
+ "capacitor": {
73
+ "ios": {
74
+ "src": "ios"
75
+ },
76
+ "android": {
77
+ "src": "android"
78
+ }
79
+ }
80
+ }