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

Method parse

source/MaaAdbControlUnit/General/Activity.cpp:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "MaaUtils/Logger.h"
4
5MAA_CTRL_UNIT_NS_BEGIN
6
7bool Activity::parse(const json::value& config)
8{
9 static const json::array kDefaultStartAppArgv = {
10 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "monkey -p {INTENT} 1",
11 };
12 static const json::array kDefaultStartActivityArgv = {
13 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "am start -n {INTENT}",
14 };
15 static const json::array kDefaultStopAppArgv = {
16 "{ADB}", "-s", "{ADB_SERIAL}", "shell", "am force-stop {INTENT}",
17 };
18
19 return parse_command("StartApp", config, kDefaultStartAppArgv, start_app_argv_)
20 && parse_command("StartActivity", config, kDefaultStartActivityArgv, start_activity_argv_)
21 && parse_command("StopApp", config, kDefaultStopAppArgv, stop_app_argv_);
22}
23
24bool Activity::start_app(const std::string& intent)
25{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected