use adbkit instead of adbkit-fb

Summary: Finally we are able to switch back from our adbkit-fb fork to the original `adbkit`. Replacing all imports

Reviewed By: jknoxville

Differential Revision: D17343236

fbshipit-source-id: e6dd328f1a956544e8be2ab768aa270972463c6b
This commit is contained in:
Daniel Büchele
2019-09-13 05:25:36 -07:00
committed by Facebook Github Bot
parent b3de081f68
commit e33f72bb21
12 changed files with 55 additions and 62 deletions

View File

@@ -35,7 +35,8 @@
] ]
}, },
"resolutions": { "resolutions": {
"@jest-runner/electron/electron": "5.0.8" "@jest-runner/electron/electron": "5.0.8",
"adbkit/adbkit-logcat": "2"
}, },
"jest": { "jest": {
"transform": { "transform": {
@@ -99,7 +100,8 @@
"@types/rsocket-tcp-server": "^0.0.2", "@types/rsocket-tcp-server": "^0.0.2",
"@types/which": "^1.3.1", "@types/which": "^1.3.1",
"JSONStream": "^1.3.1", "JSONStream": "^1.3.1",
"adbkit-fb": "2.10.1", "adbkit": "^2.11.1",
"adbkit-logcat": "^2.0.1",
"ansi-to-html": "^0.6.3", "ansi-to-html": "^0.6.3",
"async-mutex": "^0.1.3", "async-mutex": "^0.1.3",
"chalk": "^2.3.0", "chalk": "^2.3.0",

View File

@@ -5,11 +5,9 @@
* @format * @format
*/ */
import BaseDevice, {DeviceType, DeviceShell, LogLevel} from './BaseDevice'; import BaseDevice, {DeviceType, LogLevel} from './BaseDevice';
import adb, {Client as ADBClient} from 'adbkit-fb'; import adb, {Client as ADBClient} from 'adbkit';
import {Priority} from 'adbkit-logcat-fb'; import {Priority} from 'adbkit-logcat';
import child_process from 'child_process';
import {spawn} from 'promisify-child-process';
import ArchivedDevice from './ArchivedDevice'; import ArchivedDevice from './ArchivedDevice';
import {createWriteStream} from 'fs'; import {createWriteStream} from 'fs';

View File

@@ -15,7 +15,7 @@ import {getAdbClient} from '../utils/adbClient';
import {default as which} from 'which'; import {default as which} from 'which';
import {promisify} from 'util'; import {promisify} from 'util';
import {ServerPorts} from '../reducers/application'; import {ServerPorts} from '../reducers/application';
import {Client as ADBClient} from 'adbkit-fb'; import {Client as ADBClient} from 'adbkit';
function createDevice( function createDevice(
adbClient: ADBClient, adbClient: ADBClient,

View File

@@ -5,8 +5,8 @@
* @format * @format
*/ */
import {FlipperDevicePlugin, Device} from 'flipper'; import {FlipperDevicePlugin, Device, AndroidDevice} from 'flipper';
import adb from 'adbkit-fb'; import adb, {Client as ADBClient} from 'adbkit';
import TemperatureTable from './TemperatureTable'; import TemperatureTable from './TemperatureTable';
import { import {
@@ -23,10 +23,6 @@ import {
} from 'flipper'; } from 'flipper';
import React from 'react'; import React from 'react';
type ADBClient = any;
type AndroidDevice = {
adb: ADBClient;
};
type TableRows = any; type TableRows = any;
// we keep vairable name with underline for to physical path mappings on device // we keep vairable name with underline for to physical path mappings on device
@@ -131,7 +127,6 @@ export default class CPUFrequencyTable extends FlipperDevicePlugin<
any, any,
any any
> { > {
adbClient: ADBClient;
intervalID: NodeJS.Timer | null = null; intervalID: NodeJS.Timer | null = null;
state: CPUState = { state: CPUState = {
cpuCount: 0, cpuCount: 0,
@@ -150,9 +145,6 @@ export default class CPUFrequencyTable extends FlipperDevicePlugin<
} }
init() { init() {
const device = (this.device as any) as AndroidDevice;
this.adbClient = device.adb;
this.updateHardwareInfo(); this.updateHardwareInfo();
this.readThermalZones(); this.readThermalZones();
@@ -188,7 +180,7 @@ export default class CPUFrequencyTable extends FlipperDevicePlugin<
}, 'cat /sys/devices/system/cpu/possible'); }, 'cat /sys/devices/system/cpu/possible');
} }
executeShell = (callback: ShellCallBack, command: string) => { executeShell = (callback: ShellCallBack, command: string) => {
return this.adbClient return (this.device as AndroidDevice).adb
.shell(this.device.serial, command) .shell(this.device.serial, command)
.then(adb.util.readAll) .then(adb.util.readAll)
.then(function(output: {toString: () => {trim: () => string}}) { .then(function(output: {toString: () => {trim: () => string}}) {

View File

@@ -4,7 +4,7 @@
"main": "index.tsx", "main": "index.tsx",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"adbkit-fb": "2.10.1" "adbkit": "^2.11.1"
}, },
"title": "CPU", "title": "CPU",
"icon": "underline", "icon": "underline",

View File

@@ -2,23 +2,10 @@
# yarn lockfile v1 # yarn lockfile v1
adbkit-fb@2.10.1: adbkit-logcat@^1.1.0:
version "2.10.1"
resolved "https://registry.yarnpkg.com/adbkit-fb/-/adbkit-fb-2.10.1.tgz#accd6209d8da9388124ace97f4fc3047aead18cc"
integrity sha512-ERq2JXpDkr/tpSDYKwQ4SbBakozBWnWbz3Pjc8EQ1bGCzxD0XkAnUjTaW4ANX9ijrj/fWgrCqp3FDTNq8fIYDQ==
dependencies:
adbkit-logcat-fb "^1.1.0"
adbkit-monkey "~1.0.1"
bluebird "~2.9.24"
commander "^2.3.0"
debug "~2.6.3"
node-forge "^0.7.1"
split "~0.3.3"
adbkit-logcat-fb@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/adbkit-logcat-fb/-/adbkit-logcat-fb-1.1.0.tgz#af6416c7be95c18220a128a320276602881ec6b7" resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-1.1.0.tgz#01d7f9b0cef9093a30bcb3b007efff301508962f"
integrity sha512-4A4gpQk0Y+xryVvQRkXFTMiqRauwGDQU5CKujymtcS/CQP78oDWfHkbjtm2ryc7O9DqrMlnsGRch1q41ErXJlA== integrity sha1-Adf5sM75CTowvLOwB+//MBUIli8=
adbkit-monkey@~1.0.1: adbkit-monkey@~1.0.1:
version "1.0.1" version "1.0.1"
@@ -27,6 +14,19 @@ adbkit-monkey@~1.0.1:
dependencies: dependencies:
async "~0.2.9" async "~0.2.9"
adbkit@^2.11.1:
version "2.11.1"
resolved "https://registry.yarnpkg.com/adbkit/-/adbkit-2.11.1.tgz#7da847fe561254f3121088947bc1907ef053e894"
integrity sha512-hDTiRg9NX3HQt7WoDAPCplUpvzr4ZzQa2lq7BdTTJ/iOZ6O7YNAs6UYD8sFAiBEcYHDRIyq3cm9sZP6uZnhvXw==
dependencies:
adbkit-logcat "^1.1.0"
adbkit-monkey "~1.0.1"
bluebird "~2.9.24"
commander "^2.3.0"
debug "~2.6.3"
node-forge "^0.7.1"
split "~0.3.3"
async@~0.2.9: async@~0.2.9:
version "0.2.10" version "0.2.10"
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
@@ -38,9 +38,9 @@ bluebird@~2.9.24:
integrity sha1-L3tOyAIWMoqf3evfacjUlC/v99g= integrity sha1-L3tOyAIWMoqf3evfacjUlC/v99g=
commander@^2.3.0: commander@^2.3.0:
version "2.18.0" version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
debug@~2.6.3: debug@~2.6.3:
version "2.6.9" version "2.6.9"

View File

@@ -20,7 +20,7 @@ import {reportPlatformFailures} from './metrics';
import {getAdbClient} from './adbClient'; import {getAdbClient} from './adbClient';
import * as androidUtil from './androidContainerUtility'; import * as androidUtil from './androidContainerUtility';
import os from 'os'; import os from 'os';
import {Client as ADBClient} from 'adbkit-fb'; import {Client as ADBClient} from 'adbkit';
const tmpFile = promisify(tmp.file) as ( const tmpFile = promisify(tmp.file) as (
options?: FileOptions, options?: FileOptions,

View File

@@ -9,7 +9,7 @@ import {promisify} from 'util';
import child_process from 'child_process'; import child_process from 'child_process';
import promiseRetry from 'promise-retry'; import promiseRetry from 'promise-retry';
import adbConfig from '../utils/adbConfig'; import adbConfig from '../utils/adbConfig';
import adbkit, {Client} from 'adbkit-fb'; import adbkit, {Client} from 'adbkit';
const MAX_RETRIES = 5; const MAX_RETRIES = 5;
let instance: Promise<Client>; let instance: Promise<Client>;

View File

@@ -12,7 +12,7 @@
*/ */
import {getAdbClient} from './adbClient'; import {getAdbClient} from './adbClient';
import {UnsupportedError} from './metrics'; import {UnsupportedError} from './metrics';
import adbkit from 'adbkit-fb'; import adbkit from 'adbkit';
const allowedAppNameRegex = /^[a-zA-Z0-9._\-]+$/; const allowedAppNameRegex = /^[a-zA-Z0-9._\-]+$/;
const appNotDebuggableRegex = /debuggable/; const appNotDebuggableRegex = /debuggable/;

View File

@@ -8,7 +8,7 @@
// This module declaration is a stub! // This module declaration is a stub!
// Please extend this as needed. // Please extend this as needed.
declare module 'adbkit-logcat-fb' { declare module 'adbkit-logcat' {
type PriorityValue = number; type PriorityValue = number;
interface Reader extends NodeJS.EventEmitter { interface Reader extends NodeJS.EventEmitter {

View File

@@ -41,7 +41,7 @@ interface DeviceTracker extends NodeJS.EventEmitter {
on(event: 'end', listener: () => void): this; on(event: 'end', listener: () => void): this;
} }
declare module 'adbkit-fb' { declare module 'adbkit' {
const util: Util; const util: Util;
const adbkit: any; const adbkit: any;
export interface Client { export interface Client {
@@ -62,7 +62,8 @@ declare module 'adbkit-fb' {
options?: { options?: {
clear?: boolean; clear?: boolean;
}, },
) => Promise<import('adbkit-logcat-fb').Reader>; callback?: any,
) => Promise<import('adbkit-logcat').Reader>;
getProperties: (serial: string) => Promise<{[key: string]: string}>; getProperties: (serial: string) => Promise<{[key: string]: string}>;
trackDevices: () => Promise<DeviceTracker>; trackDevices: () => Promise<DeviceTracker>;
kill: () => Promise<boolean>; kill: () => Promise<boolean>;

View File

@@ -1434,23 +1434,10 @@ acorn@^7.0.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.0.0.tgz#26b8d1cd9a9b700350b71c0905546f64d1284e7a" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.0.0.tgz#26b8d1cd9a9b700350b71c0905546f64d1284e7a"
integrity sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ== integrity sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==
adbkit-fb@2.10.1: adbkit-logcat@2, adbkit-logcat@^1.1.0, adbkit-logcat@^2.0.1:
version "2.10.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/adbkit-fb/-/adbkit-fb-2.10.1.tgz#accd6209d8da9388124ace97f4fc3047aead18cc" resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-2.0.1.tgz#d4986b9fc7cfda42733389d46a52124abef43ca5"
integrity sha512-ERq2JXpDkr/tpSDYKwQ4SbBakozBWnWbz3Pjc8EQ1bGCzxD0XkAnUjTaW4ANX9ijrj/fWgrCqp3FDTNq8fIYDQ== integrity sha512-MznVzzEzcrWhIaIyblll+a0AL1TICJe/yuaia7HDYTAtiNabR/9amJkAnLt30U8/W7MVBc3mvU1jB/6MJ/TYHw==
dependencies:
adbkit-logcat-fb "^1.1.0"
adbkit-monkey "~1.0.1"
bluebird "~2.9.24"
commander "^2.3.0"
debug "~2.6.3"
node-forge "^0.7.1"
split "~0.3.3"
adbkit-logcat-fb@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/adbkit-logcat-fb/-/adbkit-logcat-fb-1.1.0.tgz#af6416c7be95c18220a128a320276602881ec6b7"
integrity sha512-4A4gpQk0Y+xryVvQRkXFTMiqRauwGDQU5CKujymtcS/CQP78oDWfHkbjtm2ryc7O9DqrMlnsGRch1q41ErXJlA==
adbkit-monkey@~1.0.1: adbkit-monkey@~1.0.1:
version "1.0.1" version "1.0.1"
@@ -1459,6 +1446,19 @@ adbkit-monkey@~1.0.1:
dependencies: dependencies:
async "~0.2.9" async "~0.2.9"
adbkit@^2.11.1:
version "2.11.1"
resolved "https://registry.yarnpkg.com/adbkit/-/adbkit-2.11.1.tgz#7da847fe561254f3121088947bc1907ef053e894"
integrity sha512-hDTiRg9NX3HQt7WoDAPCplUpvzr4ZzQa2lq7BdTTJ/iOZ6O7YNAs6UYD8sFAiBEcYHDRIyq3cm9sZP6uZnhvXw==
dependencies:
adbkit-logcat "^1.1.0"
adbkit-monkey "~1.0.1"
bluebird "~2.9.24"
commander "^2.3.0"
debug "~2.6.3"
node-forge "^0.7.1"
split "~0.3.3"
address@^1.0.1: address@^1.0.1:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/address/-/address-1.1.0.tgz#ef8e047847fcd2c5b6f50c16965f924fd99fe709" resolved "https://registry.yarnpkg.com/address/-/address-1.1.0.tgz#ef8e047847fcd2c5b6f50c16965f924fd99fe709"