MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / parse

Method parse

source/MaaAdbControlUnit/General/DeviceInfo.cpp:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "MaaUtils/Uuid.h"
5
6MAA_CTRL_UNIT_NS_BEGIN
7
8bool DeviceInfo::parse(const json::value& config)
9{
10 static const json::array kDefaultUuidArgv = {
11 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "settings get secure android_id",
12 };
13 static const json::array kDefaultResolutionArgv = {
14 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "dumpsys window displays | grep DisplayFrames | tail -n 1 | grep -o -E [0-9]+",
15 };
16 static const json::array kDefaultOrientationArgv = {
17 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "dumpsys input | grep SurfaceOrientation | tail -n 1 | grep -m 1 -o -E [0-9]",
18 };
19
20 return parse_command("UUID", config, kDefaultUuidArgv, uuid_argv_)
21 && parse_command("Resolution", config, kDefaultResolutionArgv, resolution_argv_)
22 && parse_command("Orientation", config, kDefaultOrientationArgv, orientation_argv_);
23}
24
25std::optional<std::string> DeviceInfo::request_uuid()
26{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected