if (ret != AUL_R_OK)
return nullptr;
- return Get(app_id, getuid());
+ if (pid != getpid())
+ return Get(app_id, getuid());
+
+ char pkg_id[256] = { 0, };
+ ret = aul_app_get_appid_bypid(pid, pkg_id, sizeof(pkg_id));
+ if (ret != AUL_R_OK)
+ return Get(app_id, getuid());
+
+ const char* root_path = aul_get_preinit_root_path();
+ if (root_path == nullptr)
+ return Get(app_id, getuid());
+
+ return Builder().SetAppId(app_id).SetPkgId(pkg_id).SetRootPath(root_path);
}
AppInfo::AppInfo(std::string app_id, std::string pkg_id, std::string root_path)