#include <dlog.h>
#include <vconf.h>
+#include <appinfo.h>
#undef LOG_TAG
#define LOG_TAG "ENV_CONFIG"
static const char _OSP_COMPAT_SHARED_PATH[] = "/opt/usr/share/.osp-compat/\0";
static const char _EXT_OSP_HOME_PATH[] = "/opt/storage/sdcard/osp/\0";
-static const char OSP_COMPAT_LIB[] = "/usr/lib/osp/libosp-compat.so.1";
+static const char OSP_COMPAT_LIB[] = "/usr/lib/osp/libosp-compat.so";
struct _path_info
{
char src_path[PATH_MAX];
- char dest_path[PATH_MAX];
+ const char dest_path[PATH_MAX];
};
struct _dir_info
return app_rootpath;
}
-static void
-get_package_id_from_app_rootpath(const char* app_rootpath, char* package_id)
-{
- const char* p = NULL;
- if (strncmp(app_rootpath, "/opt/apps/org.tizen.", 19) == 0)
- {
- p = strrchr(app_rootpath, '.') + 1;
- }
- else
- {
- p = strrchr(app_rootpath, '/') + 1;
- }
- strncpy(package_id, p, _MAX_PACKAGEID_LENGTH);
- package_id[_MAX_PACKAGEID_LENGTH] = '\0';
- _SECURE_LOGI("package id: %s", package_id);
-}
-
-#if 0
-static void
-get_package_id_from_package_name(const char* package_name, char* package_id)
-{
- char* tmpbuf = NULL;
-
- if (strncmp(package_name, "com", 3) == 0)
- { // in case of com.samsung.#osp#[package_id]#[serviceid]
- tmpbuf = strstr(package_name, "#osp#");
- if (tmpbuf != NULL)
- {
- strncpy(package_id, tmpbuf + 5, _MAX_PACKAGEID_LENGTH);
- }
- }
- else if (strncmp(package_name, "osp", 3) == 0)
- { // in case of osp.[package_id].#osp#[serviceid]
- tmpbuf = strstr(package_name, "osp.");
- if (tmpbuf != NULL)
- {
- strncpy(package_id, tmpbuf + 4, _MAX_PACKAGEID_LENGTH);
- }
- }
- else if (strncmp(package_name, "org.tizen", 9) == 0)
- {
- // in case of org.tizen.[package_id]#[serviceid]
- tmpbuf = strstr(package_name, "org.tizen.");
- if (tmpbuf != NULL)
- {
- strncpy(package_id, tmpbuf + 10, _MAX_PACKAGEID_LENGTH);
- }
- }
- else if (strlen(package_name) == 10)
- {
- strncpy(package_id, package_name, _MAX_PACKAGEID_LENGTH);
- }
- else
- {
- LOGE("package name is invalid (%s)", package_name);
- }
-
- package_id[_MAX_PACKAGEID_LENGTH] = '\0';
- _SECURE_LOGI("package_id: %s", package_id);
-}
-#endif
static int
internal_is_mounted(const char* pkgid)
char* app_rootpath = NULL;
char app_compat_path[PATH_MAX] = { 0, };
const char app_compat_file[] = "/info/compat.info\0";
- char package_id[_MAX_PACKAGEID_LENGTH + 1] = { 0, };
char osp_app_data_path[PATH_MAX] = { 0, };
int osp_compat = 0;
osp_compat = 1;
}
- get_package_id_from_app_rootpath(app_rootpath, package_id);
+ appinfo_init(package_name, 0);
+ appinfo_set_compat(osp_compat);
+
+ const char* package_id = appinfo_get_packageid();
_SECURE_LOGI("package id: %s, binary path: %s, OSP compat: %d", package_id, bin_path, osp_compat);
free(app_rootpath);
return -1;
}
+