@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
19 lines • 627 B
JavaScript
import Command from '../../command.js';
const RE_KEYVAL = /^\[([\s\S]*?)\]: \[([\s\S]*?)\]\r?$/gm;
export default class GetPropertiesCommand extends Command {
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;
}
}
//# sourceMappingURL=getproperties.js.map