diff --git a/src/plugins/kaios-ram/index.tsx b/src/plugins/kaios-ram/index.tsx index b03eff3b5..83e984eb9 100644 --- a/src/plugins/kaios-ram/index.tsx +++ b/src/plugins/kaios-ram/index.tsx @@ -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 { 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(); } diff --git a/src/plugins/kaios-ram/package.json b/src/plugins/kaios-ram/package.json index 7b781ce3d..85779a159 100644 --- a/src/plugins/kaios-ram/package.json +++ b/src/plugins/kaios-ram/package.json @@ -10,6 +10,7 @@ "url": "https://fb.workplace.com/groups/wa.kaios/" }, "dependencies": { + "promisify-child-process": "^3.1.3", "recharts": "1.7.1" }, "devDependencies": { diff --git a/src/plugins/kaios-ram/yarn.lock b/src/plugins/kaios-ram/yarn.lock index fa8827273..707d1f85b 100644 --- a/src/plugins/kaios-ram/yarn.lock +++ b/src/plugins/kaios-ram/yarn.lock @@ -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"