VerifyChain() is added for preloaded app.
authorDuyoung Jang <duyoung.jang@samsung.com>
Thu, 28 Mar 2013 01:14:43 +0000 (10:14 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Thu, 28 Mar 2013 01:14:43 +0000 (10:14 +0900)
Change-Id: Ifb2bae07ff3db7df9a703d9e8cb4cf8eb9f78173
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
inc/InstallerDefs.h
src/Context/InstallationContextData.cpp
src/Context/InstallationContextData.h
src/Manager/DatabaseManager.cpp
src/Step/PackageCheckStep.cpp
src/Step/UnpackStep.cpp

index e7478a5..428c35f 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130326.2]"
+#define OSP_INSTALLER_VERSION "version=[20130328.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index b93f160..26d4819 100755 (executable)
@@ -436,9 +436,9 @@ AppData::AppData()
 ,__pSubModeAppControlDataList(null)
 ,__pNameList(null)
 ,__pFeatureList(null)
-,__pLaunchConditionList(null)
 ,__pNotificationMap(null)
 ,__pMetadataMap(null)
+,__pLaunchConditionList(null)
 ,__feature(0)
 ,__isSubMode(false)
 ,__legacyAppControls(false)
@@ -497,12 +497,6 @@ AppData::~AppData()
                delete __pFeatureList;
        }
 
-       if (__pLaunchConditionList)
-       {
-               __pLaunchConditionList->RemoveAll();
-               delete __pLaunchConditionList;
-       }
-
        if (__pNotificationMap)
        {
                __pNotificationMap->RemoveAll();
@@ -514,6 +508,12 @@ AppData::~AppData()
                __pMetadataMap->RemoveAll();
                delete __pMetadataMap;
        }
+
+       if (__pLaunchConditionList)
+       {
+               __pLaunchConditionList->RemoveAll();
+               delete __pLaunchConditionList;
+       }
 }
 
 InstallerError
@@ -549,11 +549,6 @@ AppData::Construct(void)
        r = __pFeatureList->Construct();
        TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList->Construct() failed.");
 
-       __pLaunchConditionList = new (std::nothrow) HashMap(SingleObjectDeleter);
-       TryReturn(__pLaunchConditionList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList is null.");
-       r = __pLaunchConditionList->Construct();
-       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
-
        __pNotificationMap = new (std::nothrow) HashMap(SingleObjectDeleter);
        TryReturn(__pNotificationMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap is null.");
        r = __pNotificationMap->Construct();
@@ -564,5 +559,10 @@ AppData::Construct(void)
        r = __pMetadataMap->Construct();
        TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap->Construct() failed.");
 
+       __pLaunchConditionList = new (std::nothrow) MultiHashMap(SingleObjectDeleter);
+       TryReturn(__pLaunchConditionList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList is null.");
+       r = __pLaunchConditionList->Construct();
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
+
        return INSTALLER_ERROR_NONE;
 }
index 58508a4..ec8fddc 100755 (executable)
@@ -268,10 +268,11 @@ public:
 
        Tizen::Base::Collection::HashMap* __pNameList;
        Tizen::Base::Collection::HashMap* __pFeatureList;
-       Tizen::Base::Collection::HashMap* __pLaunchConditionList;
        Tizen::Base::Collection::HashMap* __pNotificationMap;
        Tizen::Base::Collection::HashMap* __pMetadataMap;
 
+       Tizen::Base::Collection::MultiHashMap* __pLaunchConditionList;
+
        int __feature;
 
        bool __isSubMode;
index a1253ff..32db552 100755 (executable)
@@ -285,7 +285,7 @@ DatabaseManager::RegisterLaunchConditionList(AppData* pAppData, Database& db) co
        TryReturn(pAppData->__pLaunchConditionList, E_SYSTEM, "__pLaunchConditionList is null.");
 
        result r = E_SUCCESS;
-       HashMap* pList = pAppData->__pLaunchConditionList;
+       MultiHashMap* pList = pAppData->__pLaunchConditionList;
 
        std::unique_ptr< IMapEnumerator > pEnum(pList->GetMapEnumeratorN());
        TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
index 839be4c..f913133 100755 (executable)
@@ -91,6 +91,7 @@ InstallerError
 PackageCheckStep::OnStatePackageCheck(void)
 {
        InstallerError error = INSTALLER_ERROR_NONE;
+       result r = E_SUCCESS;
        String tempDir;
 
        if (__pContext->__storage == INSTALLATION_STORAGE_INTERNAL)
@@ -106,7 +107,6 @@ PackageCheckStep::OnStatePackageCheck(void)
 
        if (File::IsFileExist(DIR_OSP_APPLICATIONS_TEMP) == false)
        {
-               result r = E_SUCCESS;
                r = Directory::Create(DIR_OSP_APPLICATIONS_TEMP, false);
                TryReturn(!IsFailed(r), INSTALLER_ERROR_INTERNAL_STATE, "Directory::Create() failed");
        }
@@ -123,9 +123,16 @@ PackageCheckStep::OnStatePackageCheck(void)
        unzipper.Construct(packagePath);
 
        AppLog("UnzipTo(manifest.xml) - START");
-       unzipper.UnzipTo(tempDir, L"info/manifest.xml");
-       unzipper.UnzipTo(tempDir, L"signature1.xml");
-       unzipper.UnzipTo(tempDir, L"author-signature.xml");
+
+       r = unzipper.UnzipTo(tempDir, L"info/manifest.xml");
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(manifest.xml) failed.");
+
+       r = unzipper.UnzipTo(tempDir, L"signature1.xml");
+       //TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(signature1.xml) failed.");
+
+       r = unzipper.UnzipTo(tempDir, L"author-signature.xml");
+       //TryReturn(!IsFailed(r), INSTALLER_ERROR_PACKAGE_INVALID, "UnzipTo(author-signature.xml) failed.");
+
        AppLog("UnzipTo(manifest.xml) - END");
 
        if ((File::IsFileExist(__pContext->GetSignatureXmlPath()) == true) &&
index 31e3aaa..65afb79 100755 (executable)
@@ -179,7 +179,8 @@ UnpackStep::OnUnzip(void)
        }
 
        AppLog("UnzipTo - START");
-       unzipper.UnzipTo(newInstallPath);
+       r = unzipper.UnzipTo(newInstallPath);
+       TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_STORAGE, "UnzipTo(%ls) failed.", newInstallPath.GetPointer());
        AppLog("UnzipTo - END");
 
        // GoNextState();