From 89f9eaebadaa139b1dd65f80878d7a749590aa73 Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Tue, 15 Oct 2013 15:56:00 +0900 Subject: [PATCH] fixed checking condition of decyprtion for preload and download. [Issue#] N/A [Problem] can't decrypt resource when launch encypted prealod app. [Cause] there was wrong condition about checking preload or download. [Solution] Change checking condition to using package manager api. (pkgmgrinfo_pkginfo_is_preload and pkgmgrinfo_pkginfo_is_update) [SCMRequest] N/A Change-Id: Icf4037160795c1ae5a69bf01f6313e3170b3b263 --- packaging/wrt.spec | 1 + src/view/webkit/injected-bundle/CMakeLists.txt | 1 + .../injected_bundle_decryption_support.cpp | 28 ++++++++++++++++------ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 014273e..fc21315 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -65,6 +65,7 @@ Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: pkgconfig(libsmack) BuildRequires: pkgconfig(efl-assist) +BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: libss-client-devel BuildRequires: gettext BuildRequires: edje-tools diff --git a/src/view/webkit/injected-bundle/CMakeLists.txt b/src/view/webkit/injected-bundle/CMakeLists.txt index 099c9ef..949bd0b 100644 --- a/src/view/webkit/injected-bundle/CMakeLists.txt +++ b/src/view/webkit/injected-bundle/CMakeLists.txt @@ -30,6 +30,7 @@ PKG_CHECK_MODULES(INJECTED_BUNDLE_DEP libpcrecpp wrt-plugins-ipc-message wrt-dispatch-event + pkgmgr-info REQUIRED ) diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp index fd98bc7..6a62357 100644 --- a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp +++ b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp @@ -35,10 +35,10 @@ #include #include #include -#include #include #include +#include namespace InjectedBundle { namespace { @@ -173,6 +173,7 @@ class DecryptionSupportImplementation void initialize(WrtDB::TizenAppId appId) { _D("called"); + m_initialized = true; m_appId = appId; WrtDB::WidgetDAOReadOnly dao(m_appId); @@ -183,15 +184,28 @@ class DecryptionSupportImplementation } m_pkgId = dao.getTzPkgId(); - std::string installedPath = - DPL::ToUTF8String(*dao.getWidgetInstalledPath()); - std::string preloadPath(WrtDB::GlobalConfig::GetUserPreloadedWidgetPath()); - if (0 == installedPath.compare(0, preloadPath.length(), preloadPath)) { + bool isPreload = false; + bool isUpdate = false; + pkgmgrinfo_pkginfo_h handle = NULL; + std::string tzPkgId = DPL::ToUTF8String(dao.getTizenPkgId()); + + if (PMINFO_R_OK != pkgmgrinfo_pkginfo_get_pkginfo(tzPkgId.c_str(), &handle)) { + _E("Can't get package information : %s", tzPkgId.c_str()); + return; + } + if (PMINFO_R_OK != pkgmgrinfo_pkginfo_is_preload(handle, &isPreload)) { + _E("Can't get package information : %s", tzPkgId.c_str()); + return; + } + if (PMINFO_R_OK != pkgmgrinfo_pkginfo_is_update(handle, &isUpdate)) { + _E("Can't get package information : %s", tzPkgId.c_str()); + return; + } + + if (isPreload && !isUpdate) { m_isPreload = true; _D("preload application"); } - - m_initialized = true; } void deinitialize(void) -- 2.7.4