# Set required packages
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control app-checker rua glib-2.0 ecore-x ecore-input evas vconf pkgmgr-info app2sd)
+pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control app-checker rua glib-2.0 ecore-x ecore-input evas vconf pkgmgr-info app2sd privacy-manager-client)
pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime app-checker libsmack)
PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 gio-2.0 dlog bundle)
_AI_MULTI,
_AI_HWACC,
_AI_PERM,
+ _AI_PKGID,
_AI_MAX,
};
#define _AI_START _AI_NAME /* start index */
[_AI_MULTI] = { "Multiple", AIT_MULTI, },
[_AI_HWACC] = { "Hwacceleration", AIT_HWACC, },
[_AI_PERM] = { "PermissionType", AIT_PERM, },
+ [_AI_PKGID] = { "PackageId", AIT_PKGID, },
};
struct appinfo {
char *exec;
char *type;
char *appid;
+ char *pkgid;
bool multiple;
bool onboot;
bool restart;
c->val[_AI_PERM] = strdup("normal");
}
+ r = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
+ c->val[_AI_PKGID] = strdup(pkgid);
+
_D("%s : %s : %s", c->val[_AI_FILE], c->val[_AI_COMP], c->val[_AI_TYPE]);
g_hash_table_insert(cf->tbl, c->val[_AI_FILE], c);
AIT_MULTI,
AIT_HWACC,
AIT_PERM,
+ AIT_PKGID,
};
int appinfo_init(struct appinfomgr **cf);
#include <app2ext_interface.h>
#include <sys/prctl.h>
#include <pkgmgr-info.h>
+#include <privacy_manager_client.h>
#include "amd_config.h"
#include "amd_launch.h"
char tmp_pid[MAX_PID_STR_BUFSZ];
const char *hwacc;
const char *permission;
+ const char *pkgid;
char caller_appid[256];
pkgmgrinfo_cert_compare_result_type_e compare_result;
+ bool consented = true;
int location = -1;
app2ext_handle *app2_handle = NULL;
ai = appinfo_find(_laf, appid);
+ if(ai == NULL) {
+ __real_send(fd, -1);
+ return -1;
+ }
+
+ pkgid = appinfo_get_value(ai, AIT_PKGID);
+
+ if(bundle_get_val(kb, AUL_K_PRIVACY_APPID)){
+ bundle_del(kb, AUL_K_PRIVACY_APPID);
+ } else {
+ privacy_manager_client_check_user_consented(pkgid, &consented);
+
+ _D("consented : %d", consented);
+
+ if(consented == false) {
+ _D("appid : %s", appid);
+ bundle_add(kb, AUL_K_PRIVACY_APPID, appid);
+ appid = PRIVACY_POPUP;
+ bundle_del(kb, AUL_K_PKG_NAME);
+ bundle_add(kb, AUL_K_PKG_NAME, appid);
+ ai = appinfo_find(_laf, appid);
+ }
+ }
+
componet = appinfo_get_value(ai, AIT_COMP);
app_path = appinfo_get_value(ai, AIT_EXEC);
pkg_type = appinfo_get_value(ai, AIT_TYPE);
permission = appinfo_get_value(ai, AIT_PERM);
+ pkgid = appinfo_get_value(ai, AIT_PKGID);
if(permission && strncmp(permission, "signature", 9) == 0 ) {
if(caller_uid != 0 && (cmd == APP_START || cmd == APP_START_RES)){
_E("unkown application");
}
- location = app2ext_get_app_location(appid);
+ location = app2ext_get_app_location(pkgid);
if (location == APP2EXT_SD_CARD)
{
app2_handle = app2ext_init(APP2EXT_SD_CARD);
return -1;
}
- ret = app2_handle->interface.enable(appid);
+ ret = app2_handle->interface.enable(pkgid);
if (ret) {
_E("app2_handle : app enable API fail Reason %d", ret);
}
/** AUL public key - To support Media key */
#define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
+/** AUL public bundle value */
+#define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
+
+
/** AUL public bundle value - To support Media key*/
#define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
/** AUL public bundle value - To support Media key*/
/** AUL internal private key */
#define AUL_K_PID "__AUL_PID__"
+#define PRIVACY_POPUP "tizenprv00.privacy-popup"
+
/**
__set_oom();
/* SET PRIVILEGES*/
- _D("pkg_name : %s / pkg_type : %s / app_path : %s ", pkg_name, menu_info->pkg_type, app_path);
- if ((ret = __set_access(pkg_name, menu_info->pkg_type, app_path)) < 0) {
- _D("fail to set privileges - check your package's credential : %d\n", ret);
- return -1;
+ if(bundle_get_val(kb, AUL_K_PRIVACY_APPID) == NULL) {
+ _D("pkg_name : %s / pkg_type : %s / app_path : %s ", pkg_name, menu_info->pkg_type, app_path);
+ if ((ret = __set_access(pkg_name, menu_info->pkg_type, app_path)) < 0) {
+ _D("fail to set privileges - check your package's credential : %d\n", ret);
+ return -1;
+ }
}
/* SET DUMPABLE - for coredump*/
prctl(PR_SET_DUMPABLE, 1);
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(app2sd)
+BuildRequires: pkgconfig(privacy-manager-client)
%description