MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / main

Function main

hooks/modify-java-files.js:7–497  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5main();
6
7async function main() {
8 const patchVersion = '2';
9 const flagFile = path.resolve(__dirname, '../platforms/android/.flag_done');
10 if (fs.existsSync(flagFile)) {
11 const appliedVersion = fs.readFileSync(flagFile, 'utf8').trim();
12 if (appliedVersion === patchVersion) {
13 return;
14 }
15 }
16
17 const base = path.resolve(__dirname, `../platforms/android/CordovaLib/src/org/apache/cordova`);
18 const files = {
19 'SystemWebView.java': `${base}/engine/SystemWebView.java`,
20 'SystemWebViewEngine.java': `${base}/engine/SystemWebViewEngine.java`,
21 'CordovaWebViewEngine.java': `${base}/CordovaWebViewEngine.java`,
22 'CordovaWebView.java': `${base}/CordovaWebView.java`,
23 'CordovaWebViewImpl.java': `${base}/CordovaWebViewImpl.java`,
24 };
25
26 const interfaceMethod = {
27 name: 'setInputType',
28 modifier: 'public',
29 returnType: 'void',
30 params: [
31 {
32 type: 'int',
33 name: 'type',
34 }
35 ],
36 };
37
38 const nativeContextMenuInterfaceMethod = {
39 name: 'setNativeContextMenuDisabled',
40 modifier: 'public',
41 returnType: 'void',
42 params: [
43 {
44 type: 'boolean',
45 name: 'disabled',
46 }
47 ],
48 };
49
50 const setInputTypeMethod = {
51 name: 'setInputType',
52 modifier: 'public',
53 returnType: 'void',
54 params: [
55 {
56 type: 'int',
57 name: 'type',
58 }
59 ],
60 body: ['webView.setInputType(type);'],
61 };
62
63 const setNativeContextMenuDisabledMethod = {
64 name: 'setNativeContextMenuDisabled',

Callers 1

Calls 11

removeCommentsFunction · 0.85
getFieldStringFunction · 0.85
getMethodStringFunction · 0.85
isInterfaceFunction · 0.85
getConstructorRegexFunction · 0.85
getClassDeclarationRegexFunction · 0.85
logMethod · 0.80
exitMethod · 0.80
formatFunction · 0.70
writeFileMethod · 0.45

Tested by

no test coverage detected