parameter change for getting certinfo from app-id to pkg-id
authorSangSoo Lee <constant.lee@samsung.com>
Fri, 1 Feb 2013 11:38:43 +0000 (20:38 +0900)
committerWonkyu Kwon <wonkyu.kwon@samsung.com>
Mon, 18 Feb 2013 01:59:46 +0000 (10:59 +0900)
Change-Id: I44b063885698d6fc5db9d76e3e29f40080b94eac

common/CMakeLists.txt
common/SignatureHelper.cpp
packaging/smartcard-service.spec

index 4b36681..c09217f 100644 (file)
@@ -15,7 +15,7 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS)
 #MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs_common REQUIRED dlog glib-2.0 aul libssl pkgmgr)
+pkg_check_modules(pkgs_common REQUIRED dlog glib-2.0 aul libssl pkgmgr pkgmgr-info)
 
 MESSAGE("${LIB_NAME} ld flag : ${pkgs_common_LDFLAGS}")
 
index ee3f52e..fd66ed2 100644 (file)
@@ -26,6 +26,7 @@
 
 /* SLP library header */
 #include "package-manager.h"
+#include "pkgmgr-info.h"
 #include "aul.h"
 
 /* local header */
@@ -83,13 +84,28 @@ namespace smartcard_service_api
                ByteArray result;
                int ret = 0;
                pkgmgr_certinfo_h handle = NULL;
+               pkgmgrinfo_appinfo_h handle_appinfo;
+               char *pkgid = NULL;
 
+               if(pkgmgrinfo_appinfo_get_appinfo(packageName, &handle_appinfo) != PMINFO_R_OK)
+               {
+                       SCARD_DEBUG_ERR("pkgmgrinfo_appinfo_get_appinfo fail");
+                       return result;
+               }
+
+               if(pkgmgrinfo_appinfo_get_pkgid(handle_appinfo, &pkgid) != PMINFO_R_OK)
+               {
+                       pkgmgrinfo_appinfo_destroy_appinfo(handle_appinfo);
+                       SCARD_DEBUG_ERR("pkgmgrinfo_appinfo_get_pkgid fail");
+                       return result;
+               }
+               pkgmgrinfo_appinfo_destroy_appinfo(handle_appinfo);
 
-               SCARD_DEBUG("package name : %s", packageName);
+               SCARD_DEBUG("package name : %s", pkgid);
 
                if ((ret = pkgmgr_pkginfo_create_certinfo(&handle)) == 0)
                {
-                       if ((ret = pkgmgr_pkginfo_load_certinfo(packageName, handle)) == 0)
+                       if ((ret = pkgmgr_pkginfo_load_certinfo(pkgid, handle)) == 0)
                        {
                                int type;
 
@@ -167,12 +183,28 @@ namespace smartcard_service_api
                bool result = false;
                int ret = 0;
                pkgmgr_certinfo_h handle = NULL;
+               pkgmgrinfo_appinfo_h handle_appinfo;
+               char *pkgid = NULL;
+
+               if(pkgmgrinfo_appinfo_get_appinfo(packageName, &handle_appinfo) != PMINFO_R_OK)
+               {
+                       SCARD_DEBUG_ERR("pkgmgrinfo_appinfo_get_appinfo fail");
+                       return result;
+               }
+
+               if(pkgmgrinfo_appinfo_get_pkgid(handle_appinfo, &pkgid) != PMINFO_R_OK)
+               {
+                       pkgmgrinfo_appinfo_destroy_appinfo(handle_appinfo);
+                       SCARD_DEBUG_ERR("pkgmgrinfo_appinfo_get_pkgid fail");
+                       return result;
+               }
+               pkgmgrinfo_appinfo_destroy_appinfo(handle_appinfo);
 
-               SCARD_DEBUG("package name : %s", packageName);
+               SCARD_DEBUG("package name : %s", pkgid);
 
                if ((ret = pkgmgr_pkginfo_create_certinfo(&handle)) == 0)
                {
-                       if ((ret = pkgmgr_pkginfo_load_certinfo(packageName, handle)) == 0)
+                       if ((ret = pkgmgr_pkginfo_load_certinfo(pkgid, handle)) == 0)
                        {
                                int type;
 
index 66032cf..72a0967 100644 (file)
@@ -1,6 +1,6 @@
 Name:       smartcard-service
 Summary:    Smartcard Service FW
-Version:    0.1.11
+Version:    0.1.12
 Release:    0
 Group:      libs
 License:    Apache License, Version 2.0
@@ -14,6 +14,7 @@ BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(libssl)
 BuildRequires: pkgconfig(dbus-glib-1)
 BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(vconf)
 BuildRequires: pkgconfig(aul)
 BuildRequires: cmake