UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

25 lines 899 B
"use strict"; 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_KEYVAL = /^\[([\s\S]*?)\]: \[([\s\S]*?)\]\r?$/gm; class GetPropertiesCommand extends command_1.default { async execute() { this.sendCommand('shell:getprop'); await this.readOKAY(); const data = await this.parser.readAll(); return this._parseProperties(data.toString()); } _parseProperties(value) { const properties = {}; let match; while ((match = RE_KEYVAL.exec(value))) { properties[match[1]] = match[2]; } return properties; } } exports.default = GetPropertiesCommand; //# sourceMappingURL=getproperties.js.map