Name: app2sd
Summary: Application installation on external memory
-Version: 0.5.15
+Version: 0.5.18
Release: 1
Group: Application Framework/Application Installer
License: Apache-2.0
### Required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
+pkg_check_modules(pkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util pkgmgr-info)
+pkg_check_modules(libpkgs REQUIRED libssl dlog openssl db-util pkgmgr-info vconf)
FOREACH(flag ${libpkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#include <sys/types.h>
#include <sys/wait.h>
#include <pkgmgr-info.h>
+#include <vconf.h>
#define MAX_BUF_LEN 1024
#define APP2SD_TMP_PATH "/opt/usr/apps/tmp"
app2ext_move_type move_type)
{
int ret = 0;
- char device_path[MAX_BUF_LEN] = {'\0', };
- FILE* file = NULL;
- int fd = 0;
- char buf[MAX_BUF_LEN] = {'\0'};
/*Validate function arguments*/
if (pkgid == NULL || dir_list == NULL
}
END:
- snprintf(device_path, MAX_BUF_LEN, "%s/app2sd_%s", APP2SD_TMP_PATH, pkgid);
- file = fopen(device_path, "w");
- if (file == NULL) {
- app2ext_print("fopen failed\n");
- }
-
- snprintf(buf, MAX_BUF_LEN - 1, "%d\n", ret);
- fwrite(buf, 1, strlen(buf), file);
-
- if (file != NULL) {
- fflush(file);
- fd = fileno(file);
- fsync(fd);
- fclose(file);
- }
+ vconf_set_int(VCONFKEY_PKGMGR_STATUS, ret);
return ret;
}
char query[MAX_QUERY_LEN] = { 0, };
char *error_message = NULL;
- snprintf(query, MAX_QUERY_LEN, "insert into app2sd(pkgid,password)\
+ sqlite3_snprintf(MAX_QUERY_LEN, query, "insert into app2sd(pkgid,password)\
values ('%s','%s')", pkgid, passwd);
if (SQLITE_OK != sqlite3_exec(app2sd_db, query, NULL, NULL,
char query[MAX_QUERY_LEN] = { 0 };
char *error_message = NULL;
- snprintf(query, MAX_QUERY_LEN,
+ sqlite3_snprintf(MAX_QUERY_LEN, query,
"delete from app2sd where pkgid LIKE '%s'", pkgid);
app2ext_print("\n deletion querys is %s ", query);
int rc = 0;
char *passwd = NULL;
- snprintf(query, MAX_QUERY_LEN,
+ sqlite3_snprintf(MAX_QUERY_LEN, query,
"select * from app2sd where pkgid LIKE '%s'", pkgid);
app2ext_print("\n access querys is %s ", query);
/*check whether application is in external memory or not */
fp = fopen(app_mmc_path, "r");
- if (fp == NULL) {
- app2ext_print
- (" app path in external memory not accesible\n");
- } else {
+ if (fp != NULL) {
fclose(fp);
fp = NULL;
return APP2EXT_SD_CARD;
/*check whether application is in internal or not */
fp = fopen(app_dir_path, "r");
if (fp == NULL) {
- app2ext_print
- (" app path in internal memory not accesible\n");
return APP2EXT_NOT_INSTALLED;
} else {
fclose(fp);