@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
22 lines • 732 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __importDefault(require("../../command"));
const RE_OK = /restarting adbd as root/;
class RootCommand extends command_1.default {
async execute() {
await this._send('root:');
await this.readOKAY();
const value = await this.parser.readAll();
if (RE_OK.test(value.toString())) {
return true;
}
else {
throw new Error(value.toString().trim());
}
}
}
exports.default = RootCommand;
//# sourceMappingURL=root.js.map