()
| 5 | main(); |
| 6 | |
| 7 | async 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', |
no test coverage detected