judge developer mode except hiview

Change-Id: Id641097afa0e4c4b2063f2b59e33bab1ac8c188b
Signed-off-by: leiguangyu <leiguangyu@huawei.com>
This commit is contained in:
leiguangyu 2024-08-30 17:11:59 +08:00
parent fb2085d678
commit 8f95690103

View File

@ -42,7 +42,7 @@ using namespace OHOS::Developtools::HiPerf;
int main(const int argc, const char *argv[])
{
if (!GetDeveloperMode()) {
if (!IsAllowProfilingUid() && !GetDeveloperMode()) {
printf("error: not in developermode, exit");
return -1;
}
@ -68,6 +68,14 @@ int main(const int argc, const char *argv[])
args.push_back(argv[i]);
}
if (!GetDeveloperMode()) {
if (find(args.begin(), args.end(), "record") == args.end() ||
find(args.begin(), args.end(), "--pipe_output") == args.end())
printf("error: not in developermode, exit");
return -1;
}
if (args.empty()) {
printf("no command input.\n");
args.push_back("help"); // no cmd like help cmd