}
static int
-get_appid_executable_name_from_path(const char path[], char appid[], char executable_name[])
+get_packageid_executable_name_from_path(const char path[], char appid[], char executable_name[])
{
// path is "/opt/apps/[appid]/bin/[executable_name]"
print_args(argc, argv);
// convert package path to appId
- get_appid_executable_name_from_path(argv[0], appid, executable_name);
+ get_packageid_executable_name_from_path(argv[0], appid, executable_name);
LOGI("Osp appId %s.", appid);
}
static int
-get_appid_executable_name_from_path(const char path[], char appid[], char executable_name[])
+get_packageid_executable_name_from_path(const char path[], char appid[], char executable_name[])
{
// path is ".../[appid]/bin/[executable_name]"
print_args(argc, argv);
// convert package path to appId
- get_appid_executable_name_from_path(argv[0], appid, executable_name);
+ get_packageid_executable_name_from_path(argv[0], appid, executable_name);
LOGI("Osp appId %s.", appid);
}
static int
-get_appid_executable_name_from_path(const char path[], char appid[], char executable_name[])
+get_packageid_executable_name_from_path(const char path[], char appid[], char executable_name[])
{
// path is ".../[appid]/bin/[executable_name]"
}
-static int
-get_package_name_from_appid_executable_name(const char appid[], const char executable_name[], char package_name[])
-{
- // package name is "[appid]"
-
- snprintf(package_name, MAX_PACKAGE_NAME, "%s", appid);
-#ifdef _SECURE_LOG
- LOGI("Package is %s", package_name);
-#endif
-
- return 0;
-}
-
-
int
main(int argc, char* argv[])
{
void* handle = NULL;
char* errormsg = 0;
- char appid[MAX_APPID];
+ char packageid[MAX_APPID];
char executable_name[MAX_APP_EXECUTABLE_NAME];
char package_name[MAX_PACKAGE_NAME];
void (*pAppInfoInit)(const char*, const char*, int, char* [], int) = NULL;
int (*pRealMain)(int, char* []) = NULL;
- memset(appid, 0, sizeof(appid));
+ memset(packageid, 0, sizeof(packageid));
memset(executable_name, 0, sizeof(executable_name));
memset(package_name, 0, sizeof(package_name));
LOGI("Initializeing : argc %d, argv 0x%x.", argc, argv);
- print_args(argc, argv);
+ //print_args(argc, argv);
// convert package path to package name
- get_appid_executable_name_from_path(argv[0], appid, executable_name);
- get_package_name_from_appid_executable_name(appid, executable_name, package_name);
-#ifdef _SECURE_LOG
- LOGI("Osp package %s.", package_name);
-#endif
+ get_packageid_executable_name_from_path(argv[0], packageid, executable_name);
if (getuid() == 0)
{
osp_do_pre_exe(argv[0]);
// adjust privilege
- adjust_privilege(package_name);
+ adjust_privilege(packageid);
}
}
// actual initialization
- (*pAppInfoInit)(appid, executable_name, argc, argv, -1);
+ (*pAppInfoInit)(packageid, executable_name, argc, argv, -1);
(*pRealMain)(argc, argv);
LOGI("Osp application terminates.");