From 41dc5915e984d6511b34624ec26f4171290aaa0b Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Tue, 1 Mar 2022 22:12:29 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=94=AF=E6=8C=81=E5=86=B7=E5=90=AF?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xionglei6 --- src/appspawn_server.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index 3f03a42a..6ff954a0 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -261,28 +261,28 @@ int AppSpawnServer::DoColdStartApp(ClientSocket::AppProperty *appProperty, int f APPSPAWN_LOGI("DoColdStartApp::appName %s", appProperty->processName); std::vector extractedCmds; extractedCmds.push_back(const_cast("/system/bin/appspawntools")); - std::string fdStr = std::to_string(fd); - APPSPAWN_LOGI("DoColdStartApp::fd %d %s", fd, fdStr.c_str()); - extractedCmds.push_back(const_cast(fdStr.c_str())); - std::string uidStr = std::to_string(appProperty->uid); - APPSPAWN_LOGI("DoColdStartApp::uid %d %s", appProperty->uid, uidStr.c_str()); - extractedCmds.push_back(const_cast(uidStr.c_str())); - extractedCmds.push_back(const_cast(std::string(std::to_string(appProperty->gid)).c_str())); + std::string tmp = std::to_string(fd); + APPSPAWN_LOGI("DoColdStartApp::fd %d %s", fd, tmp.c_str()); + extractedCmds.push_back(const_cast(tmp.c_str())); + std::string uid = std::to_string(appProperty->uid); + APPSPAWN_LOGI("DoColdStartApp::uid %d gid %d %s", appProperty->uid, appProperty->gid, uid.c_str()); + extractedCmds.push_back(const_cast(uid.c_str())); + std::string gid = std::to_string(appProperty->gid); + extractedCmds.push_back(const_cast(gid.c_str())); extractedCmds.push_back(const_cast(appProperty->processName)); extractedCmds.push_back(const_cast(appProperty->bundleName)); extractedCmds.push_back(const_cast(appProperty->soPath)); - std::string access = std::to_string(appProperty->accessTokenId); - APPSPAWN_LOGI("DoColdStartApp::accessTokenId %d %s", appProperty->accessTokenId, access.c_str()); - extractedCmds.push_back(const_cast(access.c_str())); + std::string accessTokenId = std::to_string(appProperty->accessTokenId); + APPSPAWN_LOGI("DoColdStartApp::accessTokenId %d %s", appProperty->accessTokenId, accessTokenId.c_str()); + extractedCmds.push_back(const_cast(accessTokenId.c_str())); extractedCmds.push_back(const_cast(appProperty->apl)); APPSPAWN_LOGI("DoColdStartApp renderCmd %s", appProperty->renderCmd); - if (strlen(appProperty->renderCmd) != 0) { - extractedCmds.push_back(const_cast(appProperty->renderCmd)); - } else { - extractedCmds.push_back(const_cast("")); - } - extractedCmds.push_back(const_cast(std::string(std::to_string(appProperty->flags)).c_str())); - extractedCmds.push_back(const_cast(std::string(std::to_string(appProperty->gidCount)).c_str())); + extractedCmds.push_back(const_cast(appProperty->renderCmd)); + std::string flags = std::to_string(appProperty->flags); + extractedCmds.push_back(const_cast(flags.c_str())); + std::string gidCount = std::to_string(appProperty->gidCount); + APPSPAWN_LOGI("DoColdStartApp gidCount %d %s", appProperty->gidCount, gidCount.c_str()); + extractedCmds.push_back(const_cast(gidCount.c_str())); for (uint32_t i = 0; i < appProperty->gidCount; i++) { extractedCmds.push_back(const_cast(std::string(std::to_string(appProperty->gidTable[i])).c_str())); }