Obtain root on the device when initializing the plugin

Summary: This allows `adb b2g-info` command to get more detailed data and not just the amount of free memory

Reviewed By: jknoxville

Differential Revision: D19348298

fbshipit-source-id: ecb705c328c53f2d8c643496f0ed4204a31a745e
This commit is contained in:
Alexander Putilin
2020-01-13 10:47:14 -08:00
committed by Facebook Github Bot
parent f1787d5bb2
commit 850bc3fe76
3 changed files with 24 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import {
} from 'recharts';
import adb from 'adbkit';
import {exec} from 'promisify-child-process';
const PALETTE = [
'#FFD700',
@@ -78,6 +79,14 @@ export default class KaiOSGraphs extends FlipperDevicePlugin<State, any, any> {
return device instanceof KaiOSDevice;
}
async init() {
try {
await exec('adb root');
} catch (e) {
console.error('Error obtaining root on the device', e);
}
}
teardown() {
this.onStopMonitor();
}

View File

@@ -10,6 +10,7 @@
"url": "https://fb.workplace.com/groups/wa.kaios/"
},
"dependencies": {
"promisify-child-process": "^3.1.3",
"recharts": "1.7.1"
},
"devDependencies": {

View File

@@ -9,6 +9,13 @@
dependencies:
regenerator-runtime "^0.13.2"
"@babel/runtime@^7.1.5":
version "7.7.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf"
integrity sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==
dependencies:
regenerator-runtime "^0.13.2"
"@types/d3-path@*":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-1.0.8.tgz#48e6945a8ff43ee0a1ce85c8cfa2337de85c7c79"
@@ -185,6 +192,13 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
promisify-child-process@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/promisify-child-process/-/promisify-child-process-3.1.3.tgz#52a3b66638ae101fa2e68f9a2cbd101846042e33"
integrity sha512-qVox3vW2hqbktVw+IN7YZ/kgGA+u426ekmiZxiofNe9O4GSewjROwRQ4MQ6IbvhpeYSLqiLS0kMn+FWCz6ENlg==
dependencies:
"@babel/runtime" "^7.1.5"
prop-types@^15.6.0, prop-types@^15.6.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"