diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cf08a2..5ce7a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ promise-android-tools versioning started at 1.0.0, but this changelog was not ad ### New - Adb: add getprop() and getSystemImageCapability() ([#61](https://github.com/ubports/promise-android-tools/pull/61)) + +### Changed + - Update dependencies ([6d47250c40bdf9dc1a24d748e72b13f8d50ae36d](https://github.com/ubports/promise-android-tools/commit/6d47250c40bdf9dc1a24d748e72b13f8d50ae36d)) ## [4.0.8] - 2022-03-10 diff --git a/package-lock.json b/package-lock.json index 8e398f8..d159063 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "promise-android-tools", - "version": "4.0.9", + "version": "4.0.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "promise-android-tools", - "version": "4.0.9", + "version": "4.0.10", "license": "GPL-3.0", "dependencies": { "android-tools-bin": "^1.0.6", @@ -1009,9 +1009,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", "dev": true }, "node_modules/@types/prettier": { @@ -1676,9 +1676,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.88", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.88.tgz", - "integrity": "sha512-oA7mzccefkvTNi9u7DXmT0LqvhnOiN2BhSrKerta7HeUC1cLoIwtbf2wL+Ah2ozh5KQd3/1njrGrwDBXx6d14Q==", + "version": "1.4.91", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.91.tgz", + "integrity": "sha512-Z7Jkc4+ouEg8F6RrrgLOs0kkJjI0cnyFQmnGVpln8pPifuKBNbUr37GMgJsCTSwy6Z9TK7oTwW33Oe+3aERYew==", "dev": true }, "node_modules/emittery": { @@ -3029,13 +3029,10 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -3274,12 +3271,6 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -5109,9 +5100,9 @@ "dev": true }, "@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", "dev": true }, "@types/prettier": { @@ -5624,9 +5615,9 @@ } }, "electron-to-chromium": { - "version": "1.4.88", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.88.tgz", - "integrity": "sha512-oA7mzccefkvTNi9u7DXmT0LqvhnOiN2BhSrKerta7HeUC1cLoIwtbf2wL+Ah2ozh5KQd3/1njrGrwDBXx6d14Q==", + "version": "1.4.91", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.91.tgz", + "integrity": "sha512-Z7Jkc4+ouEg8F6RrrgLOs0kkJjI0cnyFQmnGVpln8pPifuKBNbUr37GMgJsCTSwy6Z9TK7oTwW33Oe+3aERYew==", "dev": true }, "emittery": { @@ -6655,13 +6646,10 @@ "dev": true }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true }, "jsonfile": { "version": "6.1.0", @@ -6843,12 +6831,6 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", diff --git a/package.json b/package.json index ed5d902..08be556 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "promise-android-tools", - "version": "4.0.9", + "version": "4.0.10", "description": "A wrapper for adb, fastboot, and heimdall that returns convenient promises.", "main": "./lib/module.cjs", "type": "module", diff --git a/src/adb.js b/src/adb.js index e5fd292..ce37ea8 100644 --- a/src/adb.js +++ b/src/adb.js @@ -59,7 +59,11 @@ export class Adb extends Tool { stderr?.includes("error: device still authorizing") ) { return "unauthorized"; - } else if (stderr?.includes("error: device offline")) { + } else if ( + stderr?.includes("error: device offline") || + stderr?.includes("error: protocol fault") || + stderr?.includes("connection reset") + ) { return "device offline"; } else if ( stderr?.includes("no devices/emulators found") || diff --git a/tests/test-data/known_errors.js b/tests/test-data/known_errors.js index 61b8ec7..41ecf79 100644 --- a/tests/test-data/known_errors.js +++ b/tests/test-data/known_errors.js @@ -56,6 +56,15 @@ export const adbErrors = [ error: { killed: false, code: 1, signal: null, cmd: "command" }, stdout: "", stderr: "error: error: device offline\n" + }, + { + expectedReturn: "device offline", + error: { + message: + "Command failed: adb.exe -P 5037 shell getprop ro.product.device\nerror: protocol fault (couldn't read status): connection reset", + code: 1 + }, + stderr: "error: protocol fault (couldn't read status): connection reset" } ];