From 6966f75011add8c99524795fc87583681084f1d5 Mon Sep 17 00:00:00 2001 From: Niklas Higi Date: Sat, 17 Apr 2021 19:37:40 +0200 Subject: [PATCH] Drop support for Node.js 10 --- .github/workflows/ci.yml | 2 +- README.md | 2 +- package.json | 4 ++-- src/tasks/check-prerequisites.ts | 2 +- src/tasks/smali/parse-head.ts | 4 +--- src/utils/match-all.ts | 17 ----------------- yarn.lock | 8 ++++---- 7 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 src/utils/match-all.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff762b6..4a3be7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: name: E2E Test / ${{ matrix.os.name }} / Node.js ${{ matrix.node }} strategy: matrix: - node: [10, 14] + node: [14] os: - name: Linux runner: ubuntu-latest diff --git a/README.md b/README.md index def258c..cc83e01 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can also use `apk-mitm` to [patch apps using Android App Bundle](#patching-a ## Usage -If you have an up-to-date version of [Node.js][node] (10+) and [Java][java] (8+), you can run this command to patch an app: +If you have an up-to-date version of [Node.js][node] (14+) and [Java][java] (8+), you can run this command to patch an app: ```shell $ npx apk-mitm diff --git a/package.json b/package.json index 462fdf8..a80479f 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dist" ], "engines": { - "node": ">=10" + "node": ">=14" }, "dependencies": { "@tybys/cross-zip": "^3.1.0", @@ -45,7 +45,7 @@ "devDependencies": { "@types/follow-redirects": "^1.13.0", "@types/listr": "^0.14.2", - "@types/node": "10", + "@types/node": "14.14.41", "@types/yargs-parser": "^15.0.0", "prettier": "^2.2.1", "typescript": "^4.1.2" diff --git a/src/tasks/check-prerequisites.ts b/src/tasks/check-prerequisites.ts index 0e0db78..3ff9459 100644 --- a/src/tasks/check-prerequisites.ts +++ b/src/tasks/check-prerequisites.ts @@ -4,7 +4,7 @@ import { TaskOptions } from '../cli' import getJavaVersion from '../utils/get-java-version' import downloadTools from './download-tools' -const MIN_NODE_VERSION = 10 +const MIN_NODE_VERSION = 14 const MIN_JAVA_VERSION = 8 export default function checkPrerequisites(options: TaskOptions) { diff --git a/src/tasks/smali/parse-head.ts b/src/tasks/smali/parse-head.ts index 2cb9936..e02c15e 100644 --- a/src/tasks/smali/parse-head.ts +++ b/src/tasks/smali/parse-head.ts @@ -1,5 +1,3 @@ -import matchAll from '../../utils/match-all' - const CLASS_PATTERN = /\.class(?.+)? L(?[^\s]+);/ const IMPLEMENTS_PATTERN = /\.implements L(?[^\s]+);/g @@ -27,7 +25,7 @@ export default function parseSmaliHead(contents: string): SmaliHead { return { name, - implements: Array.from(matchAll(contents, IMPLEMENTS_PATTERN)).map( + implements: Array.from(contents.matchAll(IMPLEMENTS_PATTERN)).map( match => match.groups!.name, ), isInterface: keywords?.trim().split(' ').includes('interface') ?? false, diff --git a/src/utils/match-all.ts b/src/utils/match-all.ts deleted file mode 100644 index d14ed2f..0000000 --- a/src/utils/match-all.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * [Ponyfill](https://ponyfill.com/) for `String.prototype.matchAll` - * that can be removed once support for Node.js 10 is dropped. - */ -export default function matchAll( - input: string, - pattern: RegExp, -): RegExpMatchArray[] { - const matches = [] - - let currentMatch = null - while ((currentMatch = pattern.exec(input))) { - matches.push(currentMatch) - } - - return matches -} diff --git a/yarn.lock b/yarn.lock index b6117ae..ef4fcd9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,10 +63,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== -"@types/node@10": - version "10.17.51" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.51.tgz#639538575befbcf3d3861f95c41de8e47124d674" - integrity sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg== +"@types/node@14.14.41": + version "14.14.41" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.41.tgz#d0b939d94c1d7bd53d04824af45f1139b8c45615" + integrity sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g== "@types/yargs-parser@^15.0.0": version "15.0.0"