| 4 | #include "MaaUtils/Uuid.h" |
| 5 | |
| 6 | MAA_CTRL_UNIT_NS_BEGIN |
| 7 | |
| 8 | bool 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 | |
| 25 | std::optional<std::string> DeviceInfo::request_uuid() |
| 26 | { |
nothing calls this directly
no outgoing calls
no test coverage detected