Skip to content

Commit

Permalink
Add parser export (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- authored May 4, 2022
1 parent 8dfb748 commit c249c91
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 85 deletions.
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export { default } from './src/adb';
export { default as Adb } from './src/adb';

export { default as Parser } from './src/adb/parser';
export { Callback } from './src/Callback';
export { ClientOptions } from './src/ClientOptions';
export { CpuStats, Loads } from './src/CpuStats';
Expand Down
164 changes: 82 additions & 82 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
{
"name": "@devicefarmer/adbkit",
"version": "3.2.2",
"description": "A Typescript client for the Android Debug Bridge.",
"keywords": [
"adb",
"adbkit",
"android",
"logcat",
"typescript",
"monkey"
],
"bin": {
"adbkit": "./bin/adbkit"
},
"bugs": {
"url": "https://github.com/devicefarmer/adbkit/issues"
},
"license": "Apache-2.0",
"author": {
"name": "Device Farmer",
"email": "contact@devicefarmer.com",
"url": "https://devicefarmer.com/"
},
"contributors": [
{
"name": "uriel chemouni",
"email": "uchemouni@gmail.com",
"url": "https://urielch.github.io/urielch/"
}
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/devicefarmer/adbkit.git"
},
"scripts": {
"clean": "rimraf dist index.d.ts index.js",
"keycode": "node tasks/keycode.js",
"prepublish": "npm run clean && npm run compile && npm run test",
"compile": "tsc -p .",
"compile2": "tsc -p tsconfig-dist.json",
"lint": "eslint ./ --ext .ts",
"format": "eslint ./ --ext .ts --fix",
"testJS": "mocha --reporter spec --colors dist/test/**/*.js",
"test": "mocha -r ts-node/register --reporter spec --colors test/**/*.ts"
},
"dependencies": {
"@devicefarmer/adbkit-logcat": "^2.1.2",
"@devicefarmer/adbkit-monkey": "~1.2.0",
"bluebird": "~3.7",
"commander": "^9.1.0",
"debug": "~4.3.1",
"node-forge": "^1.3.1",
"split": "~1.0.1"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.10",
"@types/sinon-chai": "^3.2.5",
"@types/bluebird": "^3.5.33",
"@types/node-forge": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"bench": "~0.3.6",
"chai": "~4.3.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-progress": "0.0.1",
"mocha": "~8.3.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"sinon": "~13.0.1",
"sinon-chai": "~3.7.0",
"ts-node": "^10.4.0",
"typescript": "^4.1.3"
},
"engines": {
"node": ">= 0.10.4"
}
"name": "@devicefarmer/adbkit",
"version": "3.2.3",
"description": "A Typescript client for the Android Debug Bridge.",
"keywords": [
"adb",
"adbkit",
"android",
"logcat",
"typescript",
"monkey"
],
"bin": {
"adbkit": "./bin/adbkit"
},
"bugs": {
"url": "https://github.com/devicefarmer/adbkit/issues"
},
"license": "Apache-2.0",
"author": {
"name": "Device Farmer",
"email": "contact@devicefarmer.com",
"url": "https://devicefarmer.com/"
},
"contributors": [
{
"name": "uriel chemouni",
"email": "uchemouni@gmail.com",
"url": "https://urielch.github.io/urielch/"
}
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/devicefarmer/adbkit.git"
},
"scripts": {
"clean": "rimraf dist index.d.ts index.js",
"keycode": "node tasks/keycode.js",
"prepublish": "npm run clean && npm run compile && npm run test",
"compile": "tsc -p .",
"compile2": "tsc -p tsconfig-dist.json",
"lint": "eslint ./ --ext .ts",
"format": "eslint ./ --ext .ts --fix",
"testJS": "mocha --reporter spec --colors dist/test/**/*.js",
"test": "mocha -r ts-node/register --reporter spec --colors test/**/*.ts"
},
"dependencies": {
"@devicefarmer/adbkit-logcat": "^2.1.2",
"@devicefarmer/adbkit-monkey": "~1.2.0",
"bluebird": "~3.7",
"commander": "^9.1.0",
"debug": "~4.3.1",
"node-forge": "^1.3.1",
"split": "~1.0.1"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.10",
"@types/sinon-chai": "^3.2.5",
"@types/bluebird": "^3.5.33",
"@types/node-forge": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"bench": "~0.3.6",
"chai": "~4.3.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-progress": "0.0.1",
"mocha": "~8.3.1",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"sinon": "~13.0.1",
"sinon-chai": "~3.7.0",
"ts-node": "^10.4.0",
"typescript": "^4.1.3"
},
"engines": {
"node": ">= 0.10.4"
}
}
2 changes: 1 addition & 1 deletion src/adb/tcpusb/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class Packet {
) {}

public verifyChecksum(): boolean {
return this.check === Packet.checksum(this.data);
return this.check === 0 ? true : this.check === Packet.checksum(this.data);
}

public verifyMagic(): boolean {
Expand Down
4 changes: 2 additions & 2 deletions test/mock/duplex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default class MockDuplex extends Stream.Duplex {
this.push(null);
}

end(...args: any[]): this {
end(cb?: () => void): this {
this.causeEnd(); // In order to better emulate socket streams
return (Stream.Duplex.prototype.end as any).apply(this, args);
return (Stream.Duplex.prototype.end as any).apply(this, cb);
}
}

0 comments on commit c249c91

Please sign in to comment.