mirror of
https://gitee.com/openharmony/developtools_hiperf
synced 2024-11-23 07:29:42 +00:00
judge developer mode
Change-Id: Iaa718d298322053c47a2311b0506b7a296dc4b78 Signed-off-by: leiguangyu <leiguangyu@huawei.com>
This commit is contained in:
parent
3784c605bf
commit
fb2085d678
@ -336,6 +336,7 @@ void CollectPidsByAppname(std::set<pid_t> &pids, const std::string &appPackage);
|
||||
bool CheckAppIsRunning (std::vector<pid_t> &selectPids, const std::string &appPackage, int checkAppMs);
|
||||
bool IsSupportNonDebuggableApp();
|
||||
const std::string GetUserType();
|
||||
bool GetDeveloperMode();
|
||||
bool IsArkJsFile(const std::string& filepath);
|
||||
std::string GetProcessName(int pid);
|
||||
bool NeedAdaptSandboxPath(char *filename, int pid, u16 &headerSize);
|
||||
|
@ -42,6 +42,11 @@ using namespace OHOS::Developtools::HiPerf;
|
||||
|
||||
int main(const int argc, const char *argv[])
|
||||
{
|
||||
if (!GetDeveloperMode()) {
|
||||
printf("error: not in developermode, exit");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (argc < 0 || argc > 128) { // 128 : max input argument counts
|
||||
printf("The number of input arguments exceeds the upper limit.\n");
|
||||
return -1;
|
||||
|
@ -674,6 +674,17 @@ const std::string GetUserType()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetDeveloperMode()
|
||||
{
|
||||
#if defined(is_ohos) && is_ohos
|
||||
bool developerMode = OHOS::system::GetBoolParameter("const.security.developermode.state", true);
|
||||
HLOGD("GetDeveloperMode: developerMode is %d", developerMode);
|
||||
return developerMode;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool LittleMemory()
|
||||
{
|
||||
std::ifstream file("/proc/meminfo");
|
||||
|
Loading…
Reference in New Issue
Block a user