UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

19 lines 638 B
import Command from '../../command.js'; const RE_FEATURE = /^feature:(.*?)(?:=(.*?))?\r?$/gm; export default class GetFeaturesCommand extends Command { async execute() { this.sendCommand('shell:pm list features 2>/dev/null'); await this.readOKAY(); const data = await this.parser.readAll(); return this._parseFeatures(data.toString()); } _parseFeatures(value) { const features = {}; let match; while ((match = RE_FEATURE.exec(value))) { features[match[1]] = match[2] || true; } return features; } } //# sourceMappingURL=getfeatures.js.map