src/Installer/PreloadedInstaller.cpp
src/Installer/RestorationInstaller.cpp
src/Manager/ConfigurationManager.cpp
+ src/Manager/DatabaseManager.cpp
src/Manager/InstallerManager.cpp
src/Manager/PermissionManager.cpp
src/Manager/SignatureManager.cpp
#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130205.2]"
+#define OSP_INSTALLER_VERSION "version=[20130214.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
#include <dirent.h>
#include <package-manager-plugin.h>
+#include <FAppTypes.h>
#include <FBaseString.h>
#include <FIoDirectory.h>
#include <FAppPkg_PackageInfoImpl.h>
#include "UninstallStep.h"
#include "UnpackStep.h"
-#include <FAppPkg_PackageInfoImpl.h>
-
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
using namespace Tizen::Security::Cert;
using namespace Tizen::App;
-using namespace Tizen::App::Package;
InstallationContext::InstallationContext(void)
:__pStep(null)
,__state(INSTALLER_STATE_RUNNING)
,__stepChanged(true)
,__continue(true)
-,__pPackageData(null)
,__pAppDataList(null)
-,__isSubMode(false)
,__isOspCompat(false)
,__isPreloaded(false)
,__isHybridService(false)
,__pContentDataList(null)
,__pAuthorCertPath(null)
,__pDistributorCertPath(null)
-,__pPackageInfoImpl(null)
+,__certType(0)
{
}
__pLiveboxDataList = null;
}
- if (__pPackageData)
- {
- delete __pPackageData;
- __pPackageData = null;
- }
-
if (__pAppDataList)
{
__pAppDataList->RemoveAll();
InstallerError
InstallationContext::Construct(void)
{
- __pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl();
- TryReturn(__pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "__pPackageInfoImpl is null.");
-
- __pPackageData = new (std::nothrow) PackageData;
- TryReturn(__pPackageData, INSTALLER_ERROR_OUT_OF_MEMORY, "__pPackageData is null");
-
__pAppDataList = new (std::nothrow) ArrayListT<AppData*>;
TryReturn(__pAppDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppDataList is null");
__continue = cont;
}
-const PackageId&
-InstallationContext::GetId(void) const
-{
- return __packageId;
-}
-
-void
-InstallationContext::SetId(const PackageId& packageId)
-{
- __packageId = packageId;
-}
-
String
InstallationContext::GetSignatureXmlPath(void)
{
{
__pDistributorCertPath = pDistributorCertPath;
}
-
-_PackageInfoImpl*
-InstallationContext::GetPackageInfoImpl(void) const
-{
- return __pPackageInfoImpl;
-}
#ifndef _INSTALLATION_CONTEXT_H_
#define _INSTALLATION_CONTEXT_H_
-// #include <app2ext_interface.h>
#include <FAppTypes.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FSecCertX509CertificatePath.h>
#include "InstallerDefs.h"
Tizen::Base::String GetSignatureXmlPath(void);
Tizen::Base::String GetAuthorSignatureXmlPath(void);
- const Tizen::App::PackageId& GetId(void) const;
- void SetId(const Tizen::App::PackageId& packageId);
-
const Tizen::Base::Collection::ArrayList* GetPrivilegeList(void) const;
void SetPrivilegeList(Tizen::Base::Collection::ArrayList* privilegeList);
Tizen::Security::Cert::X509CertificatePath* GetDistributorCertPath(void) const;
void SetDistributorCertPath(Tizen::Security::Cert::X509CertificatePath* pDistributorCertPath);
- Tizen::App::Package::_PackageInfoImpl* GetPackageInfoImpl(void) const;
-
private:
InstallationContext(const InstallationContext& value);
InstallationContext& operator =(const InstallationContext& source);
bool __continue;
public:
- PackageData* __pPackageData;
Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
- bool __isSubMode;
bool __isOspCompat;
bool __isPreloaded;
Tizen::Base::Collection::ArrayList* __pContentDataList;
Tizen::Security::Cert::X509CertificatePath* __pAuthorCertPath;
Tizen::Security::Cert::X509CertificatePath* __pDistributorCertPath;
- Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
- Tizen::Base::String __subModeAppName;
Tizen::Base::String __coreXmlPath;
Tizen::Base::String __inputPath;
Tizen::Base::String __packagePath;
Tizen::Base::String __installDir;
Tizen::Base::String __workingDir;
Tizen::App::PackageId __packageId;
- Tizen::Base::String __appVersion;
- Tizen::Base::String __appRootPath;
+ Tizen::Base::String __version;
+ Tizen::Base::String __rootPath;
Tizen::Base::String __mainAppName;
+ Tizen::Base::String __apiVersion;
+ Tizen::Base::String __displayName;
+ Tizen::Base::String __privileges;
+ Tizen::Base::String __hmacPrivileges;
+ Tizen::Base::String __author;
+ Tizen::Base::String __url;
+ Tizen::Base::String __description;
+
+ int __certType;
}; // InstallationContext
using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
using namespace Tizen::Security::Cert;
-using namespace Tizen::App::Package;
AppControlData::AppControlData()
return __pSizeList;
}
+
+_AppControlResolutionInfo::_AppControlResolutionInfo(void)
+ : __pUriScheme(null)
+ , __pMimeType(null)
+{
+
+}
+
+_AppControlResolutionInfo::~_AppControlResolutionInfo(void)
+{
+ delete __pUriScheme;
+ delete __pMimeType;
+}
+
+String*
+_AppControlResolutionInfo::GetUriScheme(void) const
+{
+ return __pUriScheme;
+}
+
+result
+_AppControlResolutionInfo::SetUriScheme(String* pUriScheme)
+{
+ __pUriScheme = pUriScheme;
+ return E_SUCCESS;
+}
+
+String*
+_AppControlResolutionInfo::GetMimeType(void) const
+{
+ return __pMimeType;
+}
+
+result
+_AppControlResolutionInfo::SetMimeType(String* pMimeType)
+{
+ __pMimeType = pMimeType;
+ return E_SUCCESS;
+}
+
+_AppControlCapabilityInfo::_AppControlCapabilityInfo(void)
+ : __appControlId(0)
+ ,__pResolutionList(null)
+{
+ __pResolutionList = new (std::nothrow) ArrayList;
+ TryReturnVoidResult(__pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
+ __pResolutionList->Construct();
+}
+
+_AppControlCapabilityInfo::~_AppControlCapabilityInfo(void)
+{
+ __pResolutionList->RemoveAll(true);
+ delete __pResolutionList;
+}
+
+int
+_AppControlCapabilityInfo::GetAppControlId(void) const
+{
+ return __appControlId;
+}
+
+result
+_AppControlCapabilityInfo::SetAppControlId(int appControlId)
+{
+ __appControlId = appControlId;
+ return E_SUCCESS;
+}
+
+const String&
+_AppControlCapabilityInfo::GetOperationId(void) const
+{
+ return __operationId;
+}
+
+result
+_AppControlCapabilityInfo::SetOperationId(const String& operationId)
+{
+ __operationId = operationId;
+ return E_SUCCESS;
+}
+
+ArrayList*
+_AppControlCapabilityInfo::GetResolutionList(void) const
+{
+ return __pResolutionList;
+}
+
+result
+_AppControlCapabilityInfo::AddResolution(_AppControlResolutionInfo* pResolutionImpl)
+{
+ result r = E_SUCCESS;
+ r = __pResolutionList->Add(*pResolutionImpl);
+ TryReturn(!IsFailed(r), r, "__pResolutionList->Add() is failed.");
+
+ return r;
+}
+
+_AppControlInfo::_AppControlInfo(void)
+ : __pCapabilityList(null)
+{
+ __pCapabilityList = new (std::nothrow) ArrayList;
+ TryReturnVoidResult(__pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
+ __pCapabilityList->Construct();
+}
+
+_AppControlInfo::~_AppControlInfo(void)
+{
+ __pCapabilityList->RemoveAll(true);
+ delete __pCapabilityList;
+}
+
+const String&
+_AppControlInfo::GetProviderId(void) const
+{
+ return __providerId;
+}
+
+result
+_AppControlInfo::SetProviderId(const String& providerId)
+{
+ __providerId = providerId;
+ return E_SUCCESS;
+}
+
+const String&
+_AppControlInfo::GetCategory(void) const
+{
+ return __category;
+}
+
+result
+_AppControlInfo::SetCategory(const String& category)
+{
+ __category = category;
+ return E_SUCCESS;
+}
+
+ArrayList*
+_AppControlInfo::GetCapabilityList(void) const
+{
+ return __pCapabilityList;
+}
+
+result
+_AppControlInfo::AddCapability(_AppControlCapabilityInfo* pCapability)
+{
+ result r = E_SUCCESS;
+ r = __pCapabilityList->Add(*pCapability);
+ TryReturn(!IsFailed(r), r, "__pCapabilityList->Add() is failed.");
+
+ return r;
+}
+
+
+DataControlType::DataControlType(void)
+{
+
+}
+
+DataControlType::~DataControlType(void)
+{
+
+}
+
+
+DataControlInfo::DataControlInfo(void)
+ : __pControlTypeList(null)
+{
+ __pControlTypeList = new (std::nothrow) ArrayListT<DataControlType*>;
+ TryReturnVoidResult(__pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
+}
+
+DataControlInfo::~DataControlInfo(void)
+{
+ __pControlTypeList->RemoveAll();
+ delete __pControlTypeList;
+}
+
+
ContentData::ContentData(void)
:__pNameList(null)
{
:__pCategoryList(null)
,__pAccountDataList(null)
,__pAppControlDataList(null)
+,__feature(0)
+,__isSubMode(false)
,__legacyAppControls(false)
,__isSystemService(false)
{
- __pCategoryList = new (std::nothrow) ArrayListT<String*>;
- __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
- __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
}
AppData::~AppData()
{
- __pCategoryList->RemoveAll();
- delete __pCategoryList;
+ if (__pCategoryList)
+ {
+ __pCategoryList->RemoveAll();
+ delete __pCategoryList;
+ }
+
+ if (__pAccountDataList)
+ {
+ __pAccountDataList->RemoveAll();
+ delete __pAccountDataList;
+ }
+
+ if (__pAppControlDataList)
+ {
+ __pAppControlDataList->RemoveAll();
+ delete __pAppControlDataList;
+ }
+
+ if (__pAppControlImplList)
+ {
+ __pAppControlImplList->RemoveAll();
+ delete __pAppControlImplList;
+ }
+
+ if (__pDataControlList)
+ {
+ __pDataControlList->RemoveAll();
+ delete __pDataControlList;
+ }
+
+ if (__pSubModeAppControlDataList)
+ {
+ __pSubModeAppControlDataList->RemoveAll();
+ delete __pSubModeAppControlDataList;
+ }
+
+ if (__pNameList)
+ {
+ __pNameList->RemoveAll();
+ delete __pNameList;
+ }
+
+ if (__pFeatureList)
+ {
+ __pFeatureList->RemoveAll();
+ delete __pFeatureList;
+ }
+
+ if (__pLaunchConditionList)
+ {
+ __pLaunchConditionList->RemoveAll();
+ delete __pLaunchConditionList;
+ }
+}
+
+InstallerError
+AppData::Construct(void)
+{
+ result r = E_SUCCESS;
+
+ __pCategoryList = new (std::nothrow) ArrayListT<String*>;
+ TryReturn(__pCategoryList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pCategoryList is null.");
+
+ __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
+ TryReturn(__pAccountDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAccountDataList is null.");
+
+ __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
+ TryReturn(__pAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlDataList is null.");
+
+ __pAppControlImplList = new (std::nothrow) ArrayListT<_AppControlInfo*>;
+ TryReturn(__pAppControlImplList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlImplList is null.");
+
+ __pDataControlList = new (std::nothrow) ArrayListT<DataControlInfo*>;
+ TryReturn(__pDataControlList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pDataControlList is null.");
+
+ __pSubModeAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
+ TryReturn(__pSubModeAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pSubModeAppControlDataList is null.");
+
+ __pNameList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ TryReturn(__pNameList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList is null.");
+ r = __pNameList->Construct();
+ TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList->Construct() failed.");
+
+ __pFeatureList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ TryReturn(__pFeatureList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList is null.");
+ r = __pFeatureList->Construct();
+ TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList->Construct() failed.");
- __pAccountDataList->RemoveAll();
- delete __pAccountDataList;
+ __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.");
- __pAppControlDataList->RemoveAll();
- delete __pAppControlDataList;
+ return INSTALLER_ERROR_NONE;
}
#ifndef _INSTALLATION_CONTEXT_DATA_H_
#define _INSTALLATION_CONTEXT_DATA_H_
-#include <FAppPkg_PackageInfoImpl.h>
#include <FSecCertX509CertificatePath.h>
#include "InstallerDefs.h"
};
+class _AppControlResolutionInfo
+ : public Tizen::Base::Object
+{
+public:
+ _AppControlResolutionInfo(void);
+ virtual ~_AppControlResolutionInfo(void);
+
+ Tizen::Base::String* GetUriScheme(void) const;
+ result SetUriScheme(Tizen::Base::String* pUriScheme);
+
+ Tizen::Base::String* GetMimeType(void) const;
+ result SetMimeType(Tizen::Base::String* pMimeType);
+
+private:
+ _AppControlResolutionInfo(const _AppControlResolutionInfo& value);
+ _AppControlResolutionInfo& operator =(const _AppControlResolutionInfo& source);
+
+ Tizen::Base::String* __pUriScheme;
+ Tizen::Base::String* __pMimeType;
+
+};
+
+
+class _AppControlCapabilityInfo
+ : public Tizen::Base::Object
+{
+public:
+ _AppControlCapabilityInfo(void);
+ virtual ~_AppControlCapabilityInfo(void);
+
+ int GetAppControlId(void) const;
+ result SetAppControlId(int uniqueId);
+
+ const Tizen::Base::String& GetOperationId(void) const;
+ result SetOperationId(const Tizen::Base::String& operationId);
+
+ Tizen::Base::Collection::ArrayList* GetResolutionList(void) const;
+ result AddResolution(_AppControlResolutionInfo* pResolution);
+
+private:
+ _AppControlCapabilityInfo(const _AppControlCapabilityInfo& value);
+ _AppControlCapabilityInfo& operator =(const _AppControlCapabilityInfo& source);
+
+ int __appControlId;
+ Tizen::Base::String __operationId;
+ Tizen::Base::Collection::ArrayList* __pResolutionList;
+
+};
+
+
+class _AppControlInfo
+ : public Tizen::Base::Object
+{
+public:
+ _AppControlInfo(void);
+ virtual ~_AppControlInfo(void);
+
+ const Tizen::Base::String& GetProviderId(void) const;
+ result SetProviderId(const Tizen::Base::String& providerId);
+
+ const Tizen::Base::String& GetCategory(void) const;
+ result SetCategory(const Tizen::Base::String& category);
+
+ Tizen::Base::Collection::ArrayList* GetCapabilityList(void) const;
+ result AddCapability(_AppControlCapabilityInfo* pCapability);
+
+private:
+ _AppControlInfo(const _AppControlInfo& value);
+ _AppControlInfo& operator =(const _AppControlInfo& source);
+
+ Tizen::Base::String __providerId;
+ Tizen::Base::String __category;
+ Tizen::Base::Collection::ArrayList* __pCapabilityList;
+
+};
+
+
+class DataControlType
+ : public Tizen::Base::Object
+{
+public:
+ DataControlType(void);
+ virtual ~DataControlType(void);
+
+ Tizen::Base::String __type;
+ Tizen::Base::String __access;
+
+private:
+ DataControlType(const DataControlType& value);
+ DataControlType& operator =(const DataControlType& source);
+
+};
+
+
+class DataControlInfo
+ : public Tizen::Base::Object
+{
+public:
+ DataControlInfo(void);
+ virtual ~DataControlInfo(void);
+
+ Tizen::Base::String __providerId;
+ Tizen::Base::Collection::IListT<DataControlType*>* __pControlTypeList;
+
+private:
+ DataControlInfo(const DataControlInfo& value);
+ DataControlInfo& operator =(const DataControlInfo& source);
+
+};
+
+
class ContentData
: public Tizen::Base::Object
{
public:
AppData();
virtual ~AppData();
+ InstallerError Construct(void);
- Tizen::Base::String name;
+ Tizen::Base::String __main;
+ Tizen::Base::String __name;
Tizen::Base::String __appId;
+ Tizen::Base::String __displayName;
+ Tizen::Base::String __mainmenuIcon;
+ Tizen::Base::String __settingIcon;
+ Tizen::Base::String __notificationIcon;
+ Tizen::Base::String __type;
+ Tizen::Base::String __subModeAppName;
+
Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList;
Tizen::Base::Collection::IListT<AppControlData*>* __pAppControlDataList;
+ Tizen::Base::Collection::IListT<_AppControlInfo*>* __pAppControlImplList;
+ Tizen::Base::Collection::IListT<DataControlInfo*>* __pDataControlList;
+ Tizen::Base::Collection::IListT<AppControlData*>* __pSubModeAppControlDataList;
+
+ Tizen::Base::Collection::HashMap* __pNameList;
+ Tizen::Base::Collection::HashMap* __pFeatureList;
+ Tizen::Base::Collection::HashMap* __pLaunchConditionList;
+
+ int __feature;
+ bool __isSubMode;
bool __legacyAppControls;
bool __isSystemService;
+ bool __mainmenuVisible;
private:
};
-
-class PackageData
- : public Tizen::Base::Object
-{
-public:
- PackageData(){};
- virtual ~PackageData(){};
-};
-
-
#endif // _INSTALLATION_CONTEXT_DATA_H_
#include <FIoFile.h>
#include <FIoDirectory.h>
#include <FIo_FileImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include "DirectoryInstaller.h"
#include "InstallerUtil.h"
-using namespace Tizen::App::Package;
using namespace Tizen::Base;
using namespace Tizen::Io;
String newInstallPath;
InstallerUtil::CreateSymlinkForAppDirectory(installPath, newInstallPath);
pContext->__installDir = newInstallPath;
-
- _PackageInfoImpl *pPackageInfoImpl = null;
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- pPackageInfoImpl->SetAppRootPath(newInstallPath);
+ pContext->__rootPath = newInstallPath;
// remove in /info/*.info files
RemoveInfoFiles();
int res = false;
String appid;
String path;
-
- _PackageInfoImpl* pPackageInfoImpl = null;
InstallationContext* pContext = null;
pContext = GetContext();
TryCatch(pContext, res = false, "pContext is null");
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- TryCatch(pPackageInfoImpl, res = false, "pPackageInfoImpl is null");
-
- path = pPackageInfoImpl->GetAppRootPath() + DIR_INFO;
+ path = pContext->__rootPath + DIR_INFO;
pDir = new (std::nothrow) Directory; // Allocate %Directory instance
TryCatch(pDir, res = false, "pDir is null");
#include <FIoFile.h>
#include <FIoDirectory.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
#include "Installer.h"
#include "PermissionManager.h"
#include "ConfigurationManager.h"
+#include "DatabaseManager.h"
#include "InstallerUtil.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
Installer::Installer(void)
InstallerOperation operation = pContext->GetInstallerOperation();
- _PackageManagerImpl *pManagerImpl = null;
- pManagerImpl = pManagerImpl->GetInstance();
- TryReturn(pManagerImpl, INSTALLER_ERROR_INTERNAL_STATE, "pManagerImpl is null");
+ DatabaseManager databaseManager;
if (operation == INSTALLER_OPERATION_INSTALL)
{
- pManagerImpl->UnregisterPackageInfo(pContext->GetId());
- pManagerImpl->RegisterPackageInfo(*pContext->GetPackageInfoImpl());
+ databaseManager.UnregisterPackageInfo(pContext);
+ databaseManager.RegisterPackageInfo(pContext);
}
else
{
- pManagerImpl->UnregisterPackageInfo(pContext->GetId());
+ databaseManager.UnregisterPackageInfo(pContext);
}
AppLog("Installer::OnRegister() - END");
AppLog("------------------------------------------");
#include <FIoDirectory.h>
#include <FSecCertX509CertificatePath.h>
#include <FApp_Aul.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
#include <FBase_StringConverter.h>
#include "ConfigurationManager.h"
using namespace Tizen::Base::Utility;
using namespace Tizen::Security::Cert;
using namespace Tizen::App;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
ConfigurationManager::ConfigurationManager(void)
{
int err = 0;
- _PackageInfoImpl *pPackageInfoImpl = null;
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
-
String rootPath;
- rootPath = pPackageInfoImpl->GetAppRootPath();
+ rootPath = pContext->__rootPath;
String apiVersion;
- apiVersion = pPackageInfoImpl->GetAppApiVersion();
+ apiVersion = pContext->__apiVersion;
String versionInfoFile;
versionInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), VERSION_INFO_FILE);
CreateInfoFile(versionInfoFile, &apiVersion);
IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
TryReturn(pAppDataList, false, "pAppDataList is null");
- // legacy
- _PackageAppInfoImpl* pAppInfoImpl = null;
- ArrayList* pAppList = null;
- pAppList = pPackageInfoImpl->GetAppInfoList();
- for (int i = 0 ; i < pAppList->GetCount(); i++)
+ for (int i = 0 ; i < pAppDataList->GetCount(); i++)
{
AppData* pAppData = null;
pAppDataList->GetAt(i, pAppData);
TryReturn(pAppData, false, "pAppData is null");
- pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
- if (pAppInfoImpl)
+ String appName = pAppData->__name;
+ String appType = pAppData->__type;
+ AppId appId = pAppData->__appId;
+
+ String binaryPath;
+ binaryPath.Format(1024, L"%ls%ls/%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer());
+
+ if (File::IsFileExist(binaryPath) == true)
+ {
+ InstallerUtil::Remove(binaryPath);
+ }
+
+ if (appType == L"UiApp")
{
- String appName = pAppInfoImpl->GetName();
- String appType = pAppInfoImpl->GetType();
- String appId = pAppData->__appId;
+ //err = symlink(UIAPP_LOADER_PATH, pBinaryPath);
- String binaryPath;
- binaryPath.Format(1024, L"%ls%ls/%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer());
+ AppLog("copy ui app loader");
+ InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryPath);
- if (File::IsFileExist(binaryPath) == true)
- {
- InstallerUtil::Remove(binaryPath);
- }
+ HashMap* pFeatureList = pAppData->__pFeatureList;
+ TryReturn(pFeatureList, false, "pFeatureList is null");
- if (appType == L"UiApp")
+ String coordinateSystem;
+ String baseScreenSize;
+ String logicalCoordinate;
+
+ std::unique_ptr< IMapEnumerator > pEnum(pFeatureList->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
{
- //err = symlink(UIAPP_LOADER_PATH, pBinaryPath);
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
- AppLog("copy ui app loader");
- InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryPath);
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
- ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
- TryReturn(pFeatureList, false, "pFeatureList is null");
+ if ((*pKey) == L"CoordinateSystem")
+ {
+ coordinateSystem = (*pValue);
+ }
- String coordinateSystem;
- String baseScreenSize;
- String logicalCoordinate;
+ if ((*pKey) == L"BaseScreenSize")
+ {
+ baseScreenSize = (*pValue);
+ }
- for (int j = 0; j < pFeatureList->GetCount(); j++)
+ if ((*pKey) == L"LogicalCoordinate")
{
- _AppFeatureInfoImpl* pAppFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(j));
-
- if (pAppFeature != null)
- {
- if (pAppFeature->GetName() == L"CoordinateSystem")
- {
- coordinateSystem = pAppFeature->GetValue();
- }
-
- if (pAppFeature->GetName() == L"BaseScreenSize")
- {
- baseScreenSize = pAppFeature->GetValue();
- }
-
- if (pAppFeature->GetName() == L"LogicalCoordinate")
- {
- logicalCoordinate = pAppFeature->GetValue();
- }
- }
+ logicalCoordinate = (*pValue);
}
+ }
- String uiScalability;
- uiScalability.Format(1024, UISCALABILITY_INFO, coordinateSystem.GetPointer(), baseScreenSize.GetPointer(), logicalCoordinate.GetPointer());
+ String uiScalability;
+ uiScalability.Format(1024, UISCALABILITY_INFO, coordinateSystem.GetPointer(), baseScreenSize.GetPointer(), logicalCoordinate.GetPointer());
- String uiScalabilityInfoFile;
- uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE);
+ String uiScalabilityInfoFile;
+ uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE);
- CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
+ CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
- int categoryType = pAppInfoImpl->GetAppFeature();
- if (categoryType != CATEGORY_TYPE_NONE)
- {
- String category = InstallerUtil::GetCategory(categoryType);
- category.ToLowerCase();
+ int categoryType = pAppData->__feature;
+ if (categoryType != CATEGORY_TYPE_NONE)
+ {
+ String category = InstallerUtil::GetCategory(categoryType);
+ category.ToLowerCase();
- int type = _Aul::GetAppType(category);
+ int type = _Aul::GetAppType(category);
- if (category == L"ime")
- {
- CreateImeSymlink(binaryPath, appId);
- }
+ if (category == L"ime")
+ {
+ CreateImeSymlink(binaryPath, appId);
+ }
- String typeInfo;
- typeInfo.Format(1024, L"%d", type);
+ String typeInfo;
+ typeInfo.Format(1024, L"%d", type);
- String typeInfoFile;
- typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE);
+ String typeInfoFile;
+ typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE);
- CreateInfoFile(typeInfoFile, &typeInfo);
- }
+ CreateInfoFile(typeInfoFile, &typeInfo);
}
- else if (appType == L"ServiceApp")
+ }
+ else if (appType == L"ServiceApp")
+ {
+ if (pContext->__isPreloaded == true || pAppData->__isSystemService == true)
{
- if (pContext->__isPreloaded == true || pAppData->__isSystemService == true)
- {
- AppLog("copy system service loader");
- InstallerUtil::Copy(SYSTEMSERIVCE_LOADER_PATH, binaryPath);
- }
- else
- {
- AppLog("copy service app loader");
- InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, binaryPath);
- }
+ AppLog("copy system service loader");
+ InstallerUtil::Copy(SYSTEMSERIVCE_LOADER_PATH, binaryPath);
+ }
+ else
+ {
+ AppLog("copy service app loader");
+ InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, binaryPath);
}
-
- InstallerUtil::ChangeMode(binaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
}
+
+ InstallerUtil::ChangeMode(binaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
}
ArrayList* pContentDataList = pContext->GetContentDataList();
}
String newPath = SLP_FONT_PATH;
- newPath += L"/" + pContext->GetId();
+ newPath += L"/" + pContext->__packageId;
Directory::Create(newPath, false);
InstallerUtil::ChangeMode(newPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
if (pContext->__isPreloaded == true)
{
- pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+ pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
}
else
{
- pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+ pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
}
std::unique_ptr<char[]> pXmlPath(_StringConverter::CopyToCharArrayN(pContext->__coreXmlPath));
{
if (pContext->__isPreloaded == true)
{
- pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+ pContext->__coreXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
}
else
{
- pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->GetId().GetPointer());
+ pContext->__coreXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
}
std::unique_ptr<char[]> pXmlPath(_StringConverter::CopyToCharArrayN(pContext->__coreXmlPath));
int res = 0;
bool result = true;
pkgmgr_instcertinfo_h handle = null;
- String appId = pContext->GetId();
+ String appId = pContext->__packageId;
X509CertificatePath* pAuthorCertPath = pContext->GetAuthorCertPath();
X509CertificatePath* pDistributorCertPath = pContext->GetDistributorCertPath();
AppLog("UnregisterCertInfo - START");
int res = 0;
bool result = true;
- String appId = pContext->GetId();
+ String appId = pContext->__packageId;
char* pAppId = _StringConverter::CopyToCharArrayN(appId);
TryCatch(pAppId, result = false, "pAppId is null");
app2ext_handle* pHandle = (app2ext_handle*)pContext->__pApp2ExtHandle;
if (pHandle)
{
- String appId = pContext->GetId();
+ String appId = pContext->__packageId;
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
TryReturn(pAppId, false, "pAppId is null");
app2ext_handle* pHandle = (app2ext_handle*)pContext->__pApp2ExtHandle;
if (pHandle)
{
- String appId = pContext->GetId();
+ String appId = pContext->__packageId;
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
TryReturn(pAppId, false, "pAppId is null");
#ifndef _CONFIGURATION_MANAGER_H_
#define _CONFIGURATION_MANAGER_H_
-#include <FAppPkg_PackageAppInfoImpl.h>
-
#include "InstallationContext.h"
-
/**
* @class ConfigurationManager
* @brief This class represents the class of ConfigurationManager.
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file DatabaseManager.cpp
+ * @brief This is the implementation file for %DatabaseManager class.
+ */
+
+#include <unique_ptr.h>
+
+#include <FIoDatabase.h>
+#include <FIoDbStatement.h>
+#include <FIoDbEnumerator.h>
+#include <FIoFile.h>
+
+#include <FAppPkg_PackageManagerImpl.h>
+
+#include "DatabaseManager.h"
+
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Io;
+
+DatabaseManager::DatabaseManager(void)
+{
+ CreatePackageTables();
+}
+
+DatabaseManager::~DatabaseManager(void)
+{
+}
+
+bool
+DatabaseManager::RegisterPackageInfo(InstallationContext* pContext) const
+{
+ bool res = true;
+ Database db;
+ String query;
+
+ result r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r+");
+ TryReturn(r == E_SUCCESS, false, "db.Construct failed. [%s]", GetErrorMessage(r));
+
+ query.Format(1024, L"INSERT INTO PkgInfo "
+ "(PKG_ID, PKG_SECRET, PKG_VERSION, PKG_TYPE, PKG_MIMETYPE, PKG_APIVERSION, PKG_NAME, PKG_VENDOR, PKG_DESCRIPTION, PKG_URL, PKG_CID, PKG_READONLY_SIZE, PKG_DATA_SIZE, PKG_PARENT_ID,"
+ " PKG_ATTRIBUTE, PKG_ROOTPATH, PKG_STORAGE_TYPE, PKG_INSTALLATION_DATE, PKG_STATE, PKG_INITIATOR) "
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ PackageId packageId = pContext->__packageId;
+ String version = pContext->__version;
+ String apiVersion = pContext->__apiVersion;
+ String name = pContext->__displayName;
+ String rootPath = pContext->__rootPath;
+
+ if (!packageId.IsEmpty())
+ {
+ r = pStmt.get()->BindString(0, packageId);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!version.IsEmpty())
+ {
+ r = pStmt->BindString(2, version);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!apiVersion.IsEmpty())
+ {
+ r = pStmt->BindString(5, apiVersion);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!name.IsEmpty())
+ {
+ r = pStmt->BindString(6, name);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!rootPath.IsEmpty())
+ {
+ r = pStmt->BindString(15, rootPath);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ res = RegisterPrivilegeInfo(pContext, db);
+ TryReturn(res == true, false, "RegisterPrivilegeInfo() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ res = RegisterAppInfoList(pContext, db);
+ TryReturn(res == true, false, "RegisterAppInfoList() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ return true;
+}
+
+bool
+DatabaseManager::RegisterPrivilegeInfo(InstallationContext* pContext, Database& db) const
+{
+ result r = E_SUCCESS;
+ String query;
+ PackageId packageId = pContext->__packageId;
+
+ query.Format(1024, L"INSERT INTO PkgPrivileges (ID, PRIVILEGES, HMAC_PPRIVILEGES, CERTIFICATE_TYPE) "
+ "VALUES ((SELECT PkgInfo.UNIQUE_ID FROM PkgInfo WHERE PkgInfo.PKG_ID = '%ls'), ?, ?, ?)", packageId.GetPointer());
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String privileges = pContext->__privileges;
+ String hmacPrivileges = pContext->__hmacPrivileges;
+ int certType = pContext->__certType;
+
+ if (!privileges.IsEmpty())
+ {
+ r = pStmt->BindString(0, privileges);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!hmacPrivileges.IsEmpty())
+ {
+ r = pStmt->BindString(1, hmacPrivileges);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (certType != 0)
+ {
+ r = pStmt->BindInt(2, certType);
+ TryReturn(r == E_SUCCESS, false, "BindInt() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ return true;
+}
+
+bool
+DatabaseManager::RegisterAppInfoList(InstallationContext* pContext, Database& db) const
+{
+ result r = E_SUCCESS;
+ bool res = true;
+ String query;
+
+ IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "pAppDataList is null");
+
+ int count = pAppDataList->GetCount();
+
+ for (int i = 0; i < count; i++)
+ {
+ AppData* pAppData = null;
+ pAppDataList->GetAt(i, pAppData);
+
+ if (pAppData)
+ {
+ String name = pAppData->__name;
+ String main = pAppData->__main;
+ String mainmenuIcon = pAppData->__mainmenuIcon;
+ String settingIcon = pAppData->__settingIcon;
+ String notificationIcon = pAppData->__notificationIcon;
+ int feature = pAppData->__feature;
+ String appId = pAppData->__appId;
+ String type = pAppData->__type;
+
+ query.Format(1024, L"INSERT INTO AppInfo "
+ "(ID, APP_NAME, APP_DEFAULT, APP_MAINMENU_ICON, APP_SETTING_ICON, APP_TICKER_ICON, APP_QUICKPANEL_ICON, APP_LAUNCHIMAGE_ICON, APP_FEATURE, PACKAGE_NAME, APP_TYPE) "
+ "VALUES ((SELECT PkgInfo.UNIQUE_ID FROM PkgInfo WHERE PkgInfo.PKG_ID = '%ls'),?,?,?,?,?,?,?,?,?,?)", pContext->__packageId.GetPointer());
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if (!name.IsEmpty())
+ {
+ r = pStmt->BindString(0, name);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!main.IsEmpty())
+ {
+ r = pStmt->BindString(1, main);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!mainmenuIcon.IsEmpty())
+ {
+ r = pStmt->BindString(2, mainmenuIcon);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!settingIcon.IsEmpty())
+ {
+ r = pStmt->BindString(3, settingIcon);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!notificationIcon.IsEmpty())
+ {
+ r = pStmt->BindString(5, notificationIcon);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (feature != 0)
+ {
+ r = pStmt->BindInt(7, feature);
+ TryReturn(r == E_SUCCESS, false, "BindInt() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!appId.IsEmpty())
+ {
+ r = pStmt->BindString(8, appId);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!type.IsEmpty())
+ {
+ r = pStmt->BindString(9, type);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if (pAppData->__pLaunchConditionList)
+ {
+ res = RegisterLaunchConditionList(pAppData, db);
+ TryReturn(res == true, false, "RegisterLaunchConditionList() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (pAppData->__pFeatureList)
+ {
+ res = RegisterAppFeatureList(pAppData, db);
+ TryReturn(res == true, false, "RegisterAppFeatureList() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (pAppData->__pDataControlList)
+ {
+ res = RegisterDataControlList(pAppData, db);
+ TryReturn(res == true, false, "RegisterDataControlList() failed. [%s]", GetErrorMessage(r));
+ }
+ }
+ }
+
+ return true;
+}
+
+bool
+DatabaseManager::RegisterLaunchConditionList(AppData* pAppData, Database& db) const
+{
+ TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+ TryReturn(pAppData->__pLaunchConditionList, E_SYSTEM, "__pLaunchConditionList is null.");
+
+ result r = E_SUCCESS;
+ HashMap* pList = pAppData->__pLaunchConditionList;
+
+ std::unique_ptr< IMapEnumerator > pEnum(pList->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String query;
+ query.Format(1024, L"INSERT INTO LaunchCondition (ID, NAME, VALUE) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?)", pAppData->__appId.GetPointer());
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if (!(pKey->IsEmpty()))
+ {
+ r = pStmt->BindString(0, *pKey);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!(pValue->IsEmpty()))
+ {
+ r = pStmt->BindString(1, *pValue);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+ }
+
+ return true;
+}
+
+bool
+DatabaseManager::RegisterAppFeatureList(AppData* pAppData, Database& db) const
+{
+ TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+ TryReturn(pAppData->__pFeatureList, E_SYSTEM, "__pFeatureList is null.");
+
+ result r = E_SUCCESS;
+ HashMap* pList = pAppData->__pFeatureList;
+
+ std::unique_ptr< IMapEnumerator > pEnum(pList->GetMapEnumeratorN());
+ TryReturn(pEnum, false, "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, false, "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ TryReturn(pEnum, false, "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ String query;
+ query.Format(1024, L"INSERT INTO AppFeature (ID, NAME, VALUE) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?)", pAppData->__appId.GetPointer());
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if (!(pKey->IsEmpty()))
+ {
+ r = pStmt->BindString(0, *pKey);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!(pValue->IsEmpty()))
+ {
+ r = pStmt->BindString(1, *pValue);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+ }
+
+ return true;
+}
+
+bool
+DatabaseManager::RegisterDataControlList(AppData* pAppData, Database& db) const
+{
+ TryReturn(pAppData, E_SYSTEM, "pAppData is null.");
+ TryReturn(pAppData->__pDataControlList, E_SYSTEM, "__pDataControlList is null.");
+
+ result r = E_SUCCESS;
+
+ IListT<DataControlInfo*>* pDataControlList = pAppData->__pDataControlList;
+ TryReturn(pDataControlList, false, "pDataControlList is null.");
+
+ for (int i = 0; i < pDataControlList->GetCount(); i++)
+ {
+ DataControlInfo* pDataControlInfo = null;
+ pDataControlList->GetAt(i, pDataControlInfo);
+ TryReturn(pDataControlInfo, false, "pDataControlInfo is null.");
+
+ String providerId = pDataControlInfo->__providerId;
+ IListT<DataControlType*>* pTypeList = pDataControlInfo->__pControlTypeList;
+ TryReturn(pTypeList, false, "pTypeList is null.");
+
+ for (int j = 0; j < pTypeList->GetCount(); j++)
+ {
+ DataControlType* pDataControlType = null;
+ pTypeList->GetAt(j, pDataControlType);
+ TryReturn(pDataControlType, false, "pDataControlType is null.");
+
+ String access = pDataControlType->__access;
+ String type = pDataControlType->__type;
+
+ String query;
+ query.Format(1024, L"INSERT INTO DataControl (ID, PROVIDER_ID, TYPE, ACCESS) VALUES ((SELECT AppInfo.UNIQUE_ID FROM AppInfo WHERE AppInfo.PACKAGE_NAME = '%ls'),?,?,?)", pAppData->__appId.GetPointer());
+
+ std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
+ TryReturn(pStmt, false, "CreateStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if (!providerId.IsEmpty())
+ {
+ r = pStmt->BindString(0, providerId);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!type.IsEmpty())
+ {
+ r = pStmt->BindString(1, type);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ if (!access.IsEmpty())
+ {
+ r = pStmt->BindString(2, access);
+ TryReturn(r == E_SUCCESS, false, "BindString() failed. [%s]", GetErrorMessage(r));
+ }
+
+ std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
+ TryReturn(!IsFailed(GetLastResult()), false, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
+ }
+ }
+
+ return true;
+}
+
+bool
+DatabaseManager::UnregisterPackageInfo(InstallationContext* pContext) const
+{
+ Database db;
+ String query;
+ PackageId packageId = pContext->__packageId;
+
+ result r = db.Construct(L"/opt/usr/dbspace/.app-package.db", "r+");
+ TryReturn(r == E_SUCCESS, false, "db.Construct failed. [%s]", GetErrorMessage(r));
+
+ // DataControl
+ query.Format(1024, L"DELETE FROM DataControl WHERE DataControl.ID IN "
+ "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+ "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // LaunchCondition
+ query.Format(1024, L"DELETE FROM LaunchCondition WHERE LaunchCondition.ID IN "
+ "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+ "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // Notification
+ query.Format(1024, L"DELETE FROM Notification WHERE Notification.ID IN "
+ "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+ "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // AppFeature
+ query.Format(1024, L"DELETE FROM AppFeature WHERE AppFeature.ID IN "
+ "(SELECT AppInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+ "WHERE AppInfo.ID = PkgInfo.UNIQUE_ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // AppInfo
+ query.Format(1024, L"DELETE FROM AppInfo WHERE AppInfo.ID IN "
+ "(SELECT PkgInfo.UNIQUE_ID FROM PkgInfo, AppInfo "
+ "WHERE PkgInfo.UNIQUE_ID = AppInfo.ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // PkgPrivileges
+ query.Format(1024, L"DELETE FROM PkgPrivileges WHERE PkgPrivileges.ID IN "
+ "(SELECT PkgInfo.UNIQUE_ID FROM PkgInfo, PkgPrivileges "
+ "WHERE PkgInfo.UNIQUE_ID = PkgPrivileges.ID and PkgInfo.PKG_ID = '%ls')", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ // PkgInfo
+ query.Format(1024, L"DELETE FROM PkgInfo WHERE PKG_ID = '%ls'", packageId.GetPointer());
+ r = db.ExecuteSql(query, true);
+ if (r != E_SUCCESS)
+ {
+ AppLog("ExecuteSql() failed. [%ls][%s]", query.GetPointer(), GetErrorMessage(r));
+ }
+ query.Clear();
+
+ return true;
+}
+
+bool
+DatabaseManager::CreatePackageTables(void) const
+{
+ if (File::IsFileExist(PACKAGE_DATABASE_FILE_NAME) == true)
+ {
+ return true;
+ }
+
+ result r = E_SUCCESS;
+ Database db;
+ String createQuery;
+
+ r = db.Construct(PACKAGE_DATABASE_FILE_NAME, true);
+ TryReturn(r == E_SUCCESS, false, "db.Construct is failed. [%s]", GetErrorMessage(r));
+
+ // PkgInfo
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgInfo"
+ "( UNIQUE_ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "PKG_ID TEXT,"
+ "PKG_SECRET TEXT,"
+ "PKG_VERSION TEXT,"
+ "PKG_TYPE TEXT,"
+ "PKG_MIMETYPE TEXT,"
+ "PKG_APIVERSION TEXT,"
+ "PKG_NAME TEXT,"
+ "PKG_VENDOR TEXT,"
+ "PKG_DESCRIPTION TEXT,"
+ "PKG_URL TEXT,"
+ "PKG_CID TEXT,"
+ "PKG_READONLY_SIZE INTEGER,"
+ "PKG_DATA_SIZE INTEGER,"
+ "PKG_PARENT_ID TEXT,"
+ "PKG_ATTRIBUTE INTEGER,"
+ "PKG_ROOTPATH TEXT,"
+ "PKG_STORAGE_TYPE INTEGER,"
+ "PKG_INSTALLATION_DATE TEXT,"
+ "PKG_STATE INTEGER,"
+ "PKG_INITIATOR INTEGER )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // PkgPrivileges
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgPrivileges"
+ "( ID INTEGER,"
+ "PRIVILEGES TEXT,"
+ "HMAC_PPRIVILEGES TEXT,"
+ "CERTIFICATE_TYPE INTEGER )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // PkgIntegrity
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS PkgIntegrity"
+ "( ID INTEGER,"
+ "HMAC_APPID TEXT,"
+ "HMAC_APPSECRET TEXT,"
+ "HMAC_HTB TEXT,"
+ "SLOT_NUM INTEGER )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // AppInfo
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppInfo"
+ "( UNIQUE_ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "ID INTEGER,"
+ "APP_NAME TEXT,"
+ "APP_TYPE TEXT,"
+ "APP_DEFAULT TEXT,"
+ "APP_MAINMENU_ICON TEXT,"
+ "APP_SETTING_ICON TEXT,"
+ "APP_TICKER_ICON TEXT,"
+ "APP_QUICKPANEL_ICON TEXT,"
+ "APP_LAUNCHIMAGE_ICON TEXT,"
+ "APP_FEATURE INTEGER,"
+ "PACKAGE_NAME TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // Notification
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS Notification"
+ "( ID INTEGER,"
+ "NAME TEXT,"
+ "VALUE TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // AppFeature
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppFeature"
+ "( ID INTEGER,"
+ "NAME TEXT,"
+ "VALUE TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // LaunchCondition
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS LaunchCondition"
+ "( ID INTEGER,"
+ "NAME TEXT,"
+ "VALUE TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // DataControl
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS DataControl"
+ "( ID INTEGER,"
+ "PROVIDER_ID TEXT,"
+ "TYPE TEXT,"
+ "ACCESS TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // Capability
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS Capability"
+ "( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "OPERATION_ID TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // ResolutionUriScheme
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS ResolutionUriScheme"
+ "( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "URI_SCHEME TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // ResolutionMimeType
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS ResolutionMimeType"
+ "( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "MIME_TYPE TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // AppControl
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppControl"
+ "( ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ "PROVIDER_ID TEXT,"
+ "CATEGORY TEXT )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ // AppInfoLookup
+ createQuery.Format(1024, L"CREATE TABLE IF NOT EXISTS AppInfoLookup"
+ "( AppInfoID INTEGER,"
+ "CapabilityID INTEGER,"
+ "ResolutionUriSchemeID INTEGER,"
+ "ResolutionMimeTypeID INTEGER,"
+ "AppControlID INTEGER )");
+ r = db.ExecuteSql(createQuery, true);
+ TryReturn(r == E_SUCCESS, false, "db.ExecuteSql is failed. [%s]", GetErrorMessage(r));
+ createQuery.Clear();
+
+ return r;
+}
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file DatabaseManager.h
+ * @brief This is the header file for the %DatabaseManager class.
+ *
+ * This header file contains the declarations of the %DatabaseManager class.
+ */
+#ifndef _DATABASE_MANAGER_H_
+#define _DATABASE_MANAGER_H_
+
+#include "InstallationContext.h"
+
+namespace Tizen { namespace Io
+{
+class Database;
+}}
+
+class DatabaseManager
+{
+public:
+ DatabaseManager(void);
+ virtual ~DatabaseManager(void);
+
+ bool RegisterPackageInfo(InstallationContext* pContext) const;
+ bool UnregisterPackageInfo(InstallationContext* pContext) const;
+
+private:
+ bool RegisterPrivilegeInfo(InstallationContext* pContext, Tizen::Io::Database& db) const;
+ bool RegisterAppInfoList(InstallationContext* pContext, Tizen::Io::Database& db) const;
+ bool RegisterLaunchConditionList(AppData* pAppData, Tizen::Io::Database& db) const;
+ bool RegisterAppFeatureList(AppData* pAppData, Tizen::Io::Database& db) const;
+ bool RegisterDataControlList(AppData* pAppData, Tizen::Io::Database& db) const;
+
+ bool CreatePackageTables(void) const;
+
+}; // DatabaseManager
+
+#endif // _DATABASE_MANAGER_H_
AppLog("operation is INSTALLER_OPERATION_UNINSTALL");
__pContext->SetCurrentInstallationStep(INSTALLER_STEP_INIT_UNINSTALL);
- __pContext->SetId(newPath);
+ __pContext->__packageId = newPath;
}
__pContext->SetInstallerOperation(operation);
}
void
-InstallerManager::PrintPackageInfo(const char* appId)
-{
- _PackageInfoImpl* pPackageInfoImpl = null;
- ArrayList* pAppList = null;
- int totalCount = 0;
-
- pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl;
- if (pPackageInfoImpl == null)
- {
- return;
- }
-
- pPackageInfoImpl->Construct(appId);
-
- AppLog("------------------------------------------");
- AppLog("PackageInfo");
- AppLog("------------------------------------------");
- AppLog("# id = [%S]", pPackageInfoImpl->GetId().GetPointer());
- AppLog("# version = [%S]", pPackageInfoImpl->GetAppVersion().GetPointer());
- AppLog("# name = [%S]", pPackageInfoImpl->GetAppName().GetPointer());
- AppLog("# vendor = [%S]", pPackageInfoImpl->GetAppVendor().GetPointer());
- AppLog("# description = [%S]", pPackageInfoImpl->GetAppDescription().GetPointer());
- AppLog("# mimeType = [%S]", pPackageInfoImpl->GetAppMimeType().GetPointer());
- AppLog("# api version = [%S]", pPackageInfoImpl->GetAppApiVersion().GetPointer());
- AppLog("# uri = [%S]", pPackageInfoImpl->GetAppUrl().GetPointer());
- AppLog("# cid = [%S]", pPackageInfoImpl->GetAppCid().GetPointer());
- AppLog("# installationDate = [%S]", pPackageInfoImpl->GetAppInstallationTime().ToString().GetPointer());
- AppLog("# rootpath = [%S]", pPackageInfoImpl->GetAppRootPath().GetPointer());
- AppLog("# storageType = [%d]", pPackageInfoImpl->GetAppStorageType());
- AppLog("------------------------------------------");
-
- pAppList = pPackageInfoImpl->GetAppInfoListN();
- if (pAppList == null)
- {
- delete pPackageInfoImpl;
- return;
- }
-
- totalCount = pAppList->GetCount();
-
- for (int i = 0; i < totalCount; i++)
- {
- _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
-
- AppLog("------------------------------------------");
- AppLog("AppInfo(%d/%d)", i+1, totalCount);
- AppLog("------------------------------------------");
- AppLog("# default = [%S]", pAppInfoImpl->GetDefault().GetPointer());
- AppLog("# appname = [%S]", pAppInfoImpl->GetName().GetPointer());
- AppLog("# packagename = [%S]", pAppInfoImpl->GetPackageName().GetPointer());
- AppLog("# mainmenu icon = [%S]", pAppInfoImpl->GetMainmenuIcon().GetPointer());
- AppLog("# setting icon = [%S]", pAppInfoImpl->GetSettingIcon().GetPointer());
- AppLog("# quickpanel icon = [%S]", pAppInfoImpl->GetQuickpanelIcon().GetPointer());
- AppLog("------------------------------------------");
- }
-
- pAppList->RemoveAll();
- delete pAppList;
- pAppList = null;
-
- delete pPackageInfoImpl;
-}
-
-void
InstallerManager::PrintResult(void)
{
int errorType = GetErrorType();
(operation == INSTALLER_OPERATION_INSTALL)? (pOperation = "Install"): (pOperation = "Uninstall");
const wchar_t* pPackageId = L"Unknown";
- if (__pContext && !__pContext->GetId().IsEmpty())
+ if (__pContext && !__pContext->__packageId.IsEmpty())
{
- pPackageId = __pContext->GetId().GetPointer();
+ pPackageId = __pContext->__packageId.GetPointer();
}
const wchar_t* pMainAppName = L"Unknown";
pContext = pInstallManager->GetContext();
TryCatch(pContext, errorType = INSTALLER_ERROR_INTERNAL_STATE, "pInstallManager->GetContext failed.");
- packageId = pContext->GetId();
+ packageId = pContext->__packageId;
CATCH:
pInstallManager->SetErrorType(errorType);
bool RemoveGarbage(const Tizen::Base::String& filePath);
- void PrintPackageInfo(const char* appId);
void PrintResult(void);
void PrintError(int errorType);
#include <FIoDirectory.h>
#include <FBase_StringConverter.h>
#include <FIo_FileImpl.h>
-#include <FAppPkg_PackageManagerImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
#include "PermissionManager.h"
#include "InstallerUtil.h"
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
using namespace Tizen::Io;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
PermissionManager::PermissionManager(void)
{
String destPath;
String appRootPath;
- _PackageInfoImpl *pPackageInfoImpl = null;
FileAttributes attribute;
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- appRootPath = pPackageInfoImpl->GetAppRootPath();
+ appRootPath = pContext->__rootPath;
// appRoot
// InstallerUtil::ChangeOwner(appRootPath);
r = File::GetAttributes(destPath, attribute);
if (r == E_SUCCESS)
{
- String appVersion = pPackageInfoImpl->GetVersion();
+ String appVersion = pContext->__version;
String srcPath;
String settingXmlPath;
}
InstallerUtil::ChangeDirectoryPermission(destPath, PERM_BASE, true);
- String appId = pContext->GetId();
- String apiVersion = pPackageInfoImpl->GetAppApiVersion();
+ PackageId packageId = pContext->__packageId;
+ String apiVersion = pContext->__apiVersion;
AppLog("------------------------------------------");
AppLog("[Tizen::Io] # path = [%ls]", appRootPath.GetPointer());
- AppLog("[Tizen::Io] # appId = [%ls]", appId.GetPointer());
+ AppLog("[Tizen::Io] # packageId = [%ls]", packageId.GetPointer());
AppLog("[Tizen::Io] # apiVersion = [%ls]", apiVersion.GetPointer());
if (pContext->__isOspCompat == true)
{
AppLog("[Tizen::Io] OSP 2.0 application");
- if (_FileImpl::PrepareDataCaging(appRootPath, appId) == false)
+ if (_FileImpl::PrepareDataCaging(appRootPath, packageId) == false)
{
AppLog("[Tizen::Io] _FileImpl::PrepareDataCaging() failed");
return false;
{
AppLog("[Tizen::Io] apiVersion is equal to or greater than Tizen 2.0");
- if (_FileImpl::CreateOspApplicationDirectories(appRootPath, appId) == false)
+ if (_FileImpl::CreateOspApplicationDirectories(appRootPath, packageId) == false)
{
AppLog("[Tizen::Io] _FileImpl::CreateOspApplicationDirectories() failed");
return false;
}
AppLog("------------------------------------------");
- // Create AppId.ExecutableName directory
- // This will be removed.
- // CreateSystemDirectory(pContext, appRootPath);
-
return true;
}
PermissionManager::SetFile(InstallationContext* pContext)
{
String destPath;
+ String appRootPath = pContext->__rootPath;
- _PackageInfoImpl *pPackageInfoImpl = null;
- _PackageAppInfoImpl* pAppInfoImpl = null;
- ArrayList* pAppList = null;
-
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
+ IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "pAppDataList is null");
- String appRootPath;
- appRootPath = pPackageInfoImpl->GetAppRootPath();
-
- pAppList = pPackageInfoImpl->GetAppInfoList();
- for (int i = 0 ; i < pAppList->GetCount(); i++)
+ for (int i = 0 ; i < pAppDataList->GetCount(); i++)
{
- pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
- if (pAppInfoImpl)
- {
- // set permission(755) to bin file.
- destPath = appRootPath + DIR_BIN + L"/" + pAppInfoImpl->GetName() + L".exe";
- InstallerUtil::ChangeMode(destPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
- }
- }
-
- return true;
-}
-
-bool
-PermissionManager::CreateSystemDirectory(InstallationContext* pContext, const Tizen::Base::String& rootpath)
-{
- _PackageInfoImpl *pPackageInfoImpl = null;
- _PackageAppInfoImpl* pAppInfoImpl = null;
- ArrayList* pAppList = null;
-
- pPackageInfoImpl = pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, false, "pPackageInfoImpl is null.");
+ AppData* pAppData = null;
+ pAppDataList->GetAt(i, pAppData);
+ TryReturn(pAppData, false, "pAppData is null");
- pAppList = pPackageInfoImpl->GetAppInfoList();
- TryReturn(pAppList, false, "pAppList is null.");
-
- for (int i = 0 ; i < pAppList->GetCount(); i++)
- {
- pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
- if (pAppInfoImpl)
+ // set permission(755) to bin file.
+ destPath = appRootPath + DIR_BIN + L"/" + pAppData->__name + L".exe";
+ if (File::IsFileExist(destPath) == true)
{
- String destPath = SLP_APP_PATH;
- destPath += L"/" + pAppInfoImpl->GetPackageName();
-
- InstallerUtil::Remove(destPath);
- InstallerUtil::CreateSymlink(pPackageInfoImpl->GetAppRootPath(), destPath);
+ InstallerUtil::ChangeMode(destPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
}
}
{
String oldPath;
String newPath;
-
- _PackageInfoImpl* pPackageInfoImpl = pContext->GetPackageInfoImpl();
- String appRootPath = pPackageInfoImpl->GetAppRootPath();
+ String appRootPath = pContext->__rootPath;
#if 0
oldPath = appRootPath + DIR_RES;
static bool SetFile(InstallationContext* pContext);
private:
- static bool CreateSystemDirectory(InstallationContext* pContext, const Tizen::Base::String& rootpath);
static bool SetSymLink(InstallationContext* pContext);
static bool PrepareDataCaging(InstallationContext* pContext);
#include <FIoFile.h>
#include <FBase_StringConverter.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include "InstallationContext.h"
#include "ManifestHandler.h"
#include "ManifestXmlStep.h"
using namespace Tizen::Base;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
ManifestXmlStep::ManifestXmlStep(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
bool ret = false;
- _PackageInfoImpl *pPackageInfoImpl = null;
String manifestXmlPath;
result r = E_SUCCESS;
ret = manifestHandler.Parse(pFilepath.get());
TryReturn(ret == true, INSTALLER_ERROR_MANIFEST_INVALID, "manifestHandler.Parse() failed");
- pPackageInfoImpl = __pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, error = INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
- __pContext->SetId(pPackageInfoImpl->GetId());
-
GoNextState();
return error;
*/
#include <FIoFile.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "InstallationContext.h"
#include "SignatureHandler.h"
#include "SignatureStep.h"
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
const ArrayList* pPrivilegeList = __pContext->GetPrivilegeList();
RootCertificateType certType = __pContext->__rootCertType;
- _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
- String appId = pPackageInfoImpl->GetId();
+ PackageId packageId = __pContext->__packageId;
int apiVisibility = GetApiVisibility(certType);
- AppLog("AppId = [%ls], CertType = [%d], ApiVisibility = [%d]", appId.GetPointer(), certType, apiVisibility);
+ AppLog("PackageId = [%ls], CertType = [%d], ApiVisibility = [%d]", packageId.GetPointer(), certType, apiVisibility);
- r = PrivilegeHandler::GenerateCipherPrivilege(appId, *pPrivilegeList, apiVisibility, privileges, hmacPrivileges);
+ r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *pPrivilegeList, apiVisibility, privileges, hmacPrivileges);
TryCatch(!IsFailed(r), error = INSTALLER_ERROR_PRIVILEGE_INVALID, "privMgr.GeneratePrivilegeString() failed");
- pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
- pPackageInfoImpl->SetCertType(apiVisibility);
+ __pContext->__privileges = privileges;
+ __pContext->__hmacPrivileges = hmacPrivileges;
+ __pContext->__certType = apiVisibility;
CATCH:
GoNextState();
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
using namespace Tizen::App::Package;
using namespace Tizen::Io;
UninstallStep::OnStateGetPackageInfo(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
- String appId = __pContext->GetId();
+ PackageId packageId = __pContext->__packageId;
- _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
+ std::unique_ptr< _PackageInfoImpl > pPackageInfoImpl(new (std::nothrow) _PackageInfoImpl());
+ TryReturn(pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "pPackageInfoImpl is null.");
- AppLog("appId = %ls", appId.GetPointer());
- pPackageInfoImpl->Construct(appId);
+ AppLog("packageId = %ls", packageId.GetPointer());
+ pPackageInfoImpl->Construct(packageId);
- String rootPath = pPackageInfoImpl->GetAppRootPath();
- if (rootPath.StartsWith(PATH_USR_APPS, 0) == true)
+ __pContext->__rootPath = pPackageInfoImpl->GetAppRootPath();
+ if (__pContext->__rootPath.StartsWith(PATH_USR_APPS, 0) == true)
{
__pContext->__isPreloaded = true;
}
int res = 0;
app2ext_handle* pHandle = null;
- std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
- TryReturn(pAppId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
+ std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
+ TryReturn(pPackageId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
pHandle = app2ext_init(APP2EXT_SD_CARD);
TryReturn(pHandle, INSTALLER_ERROR_INTERNAL_STATE, "app2ext_init() failed");
- res = pHandle->interface.pre_uninstall(pAppId.get());
+ res = pHandle->interface.pre_uninstall(pPackageId.get());
TryReturn(res == 0, INSTALLER_ERROR_INTERNAL_STATE, "pHandle->interface.pre_uninstall() failed [%d]", res);
__pContext->__pApp2ExtHandle = (void*)pHandle;
- AppLog("[app2sd] pre_uninstall(%s)", pAppId.get());
+ AppLog("[app2sd] pre_uninstall(%s)", pPackageId.get());
}
ArrayList* pList = pPackageInfoImpl->GetAppInfoListN();
_PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pList->GetAt(i));
if (pAppInfoImpl)
{
- pPackageInfoImpl->AddAppInfo(*pAppInfoImpl);
- pAppInfoImpl = null;
+ AppData* pAppData = new (std::nothrow) AppData;
+ TryReturn(pAppData, INSTALLER_ERROR_OUT_OF_MEMORY, "pAppData is null");
+
+ error = pAppData->Construct();
+ TryReturn(error == INSTALLER_ERROR_NONE, INSTALLER_ERROR_INTERNAL_STATE, "pAppData->Construct() failed.");
+
+ pAppData->__appId = pAppInfoImpl->GetPackageName();
+ pAppData->__feature = pAppInfoImpl->GetAppFeature();
+
+ __pContext->__pAppDataList->Add(pAppData);
}
}
+ delete pList;
__state = STATE_DELETE_DIR;
{
InstallerError error = INSTALLER_ERROR_NONE;
- _PackageInfoImpl* pPackageInfoImpl = __pContext->GetPackageInfoImpl();
- TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl is null");
-
String rootPath;
- rootPath = pPackageInfoImpl->GetAppRootPath();
- AppLog("rootPath[%ls]", rootPath.GetPointer());
+ rootPath = __pContext->__rootPath;
+ AppLog("rootPath = [%ls]", rootPath.GetPointer());
String compatPath(rootPath);
compatPath.Append(L"/info/compat.info");
InstallerUtil::Remove(rootPath);
}
- _PackageAppInfoImpl* pAppInfoImpl = null;
- ArrayList* pAppList = null;
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, INSTALLER_ERROR_INTERNAL_STATE, "pAppDataList is null");
- pAppList = pPackageInfoImpl->GetAppInfoList();
- for (int i = 0 ; i < pAppList->GetCount(); i++)
+ int count = pAppDataList->GetCount();
+ for (int i = 0; i < count; i++)
{
- pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
- if (pAppInfoImpl)
- {
- String packageName = pAppInfoImpl->GetPackageName();
- String destPath;
- destPath.Format(1024, L"%S/%S", SLP_APP_PATH, packageName.GetPointer());
- InstallerUtil::Remove(destPath);
+ AppData* pAppData = null;
+ pAppDataList->GetAt(i, pAppData);
- if (pAppInfoImpl->GetAppFeature() == CATEGORY_TYPE_IME)
+ if (pAppData)
+ {
+ if (pAppData->__feature == CATEGORY_TYPE_IME)
{
String symlinkPath;
- symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, packageName.GetPointer());
+ symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, pAppData->__appId.GetPointer());
InstallerUtil::Remove(symlinkPath);
}
}
}
+
AppLog("Directory::Remove - END");
GoNextState();
#include <FIoDirectory.h>
#include <FBaseResult.h>
#include <FBaseUtilFileUnzipper.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "InstallationContext.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
using namespace Tizen::Io;
UnpackStep::UnpackStep(void)
UnpackStep::OnUnzip(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
- _PackageInfoImpl *pPackageInfoImpl = null;
String newInstallPath;
app2ext_handle* pHandle = null;
String installPath;
installPath = PATH_OPT_USR_APPS;
installPath += "/";
- installPath += __pContext->GetId();
+ installPath += __pContext->__packageId;
result r = E_SUCCESS;
FileUnzipper unzipper;
if (__pContext->__storage == INSTALLATION_STORAGE_EXTERNAL)
{
int res = 0;
- String appId = __pContext->GetId();
+ PackageId packageId = __pContext->__packageId;
- std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
- TryReturn(pAppId, INSTALLER_ERROR_INTERNAL_STATE, "pAppId is null");
+ std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
+ TryReturn(pPackageId, INSTALLER_ERROR_INTERNAL_STATE, "pPackageId is null");
GetUncompressedInfo(unzipper);
TryReturn((__pDirectoryList && (__uncompressedSize > 0)), INSTALLER_ERROR_INTERNAL_STATE, "GetUncompressedInfo() failed");
__pContext->__pApp2ExtHandle = (void*)pHandle;
- res = pHandle->interface.pre_install(pAppId.get(), __pDirectoryList, __uncompressedSize);
+ res = pHandle->interface.pre_install(pPackageId.get(), __pDirectoryList, __uncompressedSize);
TryReturn(res == 0, INSTALLER_ERROR_INTERNAL_STATE, "pHandle->interface.pre_install() failed [%d]", res);
- AppLog("[app2sd] pre_install(%s)", pAppId.get());
+ AppLog("[app2sd] pre_install(%s)", pPackageId.get());
}
if (File::IsFileExist(installPath) == false)
InstallerUtil::CreateSymlinkForAppDirectory(installPath, newInstallPath);
__pContext->__installDir = newInstallPath;
-
- pPackageInfoImpl = __pContext->GetPackageInfoImpl();
- pPackageInfoImpl->SetAppRootPath(newInstallPath);
+ __pContext->__rootPath = newInstallPath;
AppLog("UnzipTo - START");
unzipper.UnzipTo(newInstallPath);
* @brief This is the implementation file for %ManifestGenerator class.
*/
+#include <unique_ptr.h>
#include <sys/stat.h>
#include <FLclLocale.h>
#include <FApp_Aul.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FIoFile.h>
#include "ManifestGenerator.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::App;
-using namespace Tizen::App::Package;
using namespace Tizen::Locales;
using namespace Tizen::Io;
ManifestGenerator::ManifestGenerator(void)
:__pContext(null)
-,__pPackageInfoImpl(null)
,__pWriter(null)
{
}
ManifestGenerator::Construct(InstallationContext* pContext)
{
__pContext = pContext;
- __pPackageInfoImpl = pContext->GetPackageInfoImpl();
- TryReturn(__pPackageInfoImpl, false, "__pPackageInfoImpl is null.");
__pWriter = new (std::nothrow) XmlWriter;
TryReturn(__pWriter, false, "__pWriter is null.");
__pWriter->StartElement("manifest");
__pWriter->WriteAttribute("xmlns", "http://tizen.org/ns/packages");
- __pWriter->WriteAttribute("package", __pContext->GetId());
+ __pWriter->WriteAttribute("package", __pContext->__packageId);
__pWriter->WriteAttribute("type", "tpk");
- __pWriter->WriteAttribute("version", __pPackageInfoImpl->GetVersion());
+ __pWriter->WriteAttribute("version", __pContext->__version);
__pWriter->WriteAttribute("install-location", location);
__pWriter->StartElement("label");
- __pWriter->WriteString(__pPackageInfoImpl->GetDisplayName());
+ __pWriter->WriteString(__pContext->__displayName);
__pWriter->EndElement();
__pWriter->StartElement("author");
__pWriter->EndElement();
__pWriter->StartElement("description");
- __pWriter->WriteString(__pPackageInfoImpl->GetDescription());
+ __pWriter->WriteString(__pContext->__description);
__pWriter->EndElement();
- ArrayList* pAppList = __pPackageInfoImpl->GetAppInfoList();
- int appCount = pAppList->GetCount();
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "pAppDataList is null");
+
+ int appCount = pAppDataList->GetCount();
AppLog("Write(): appCount=%d", appCount);
for (int i = 0 ; i < appCount; i++)
{
- _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
- if (pAppInfoImpl)
+ AppData* pAppData = null;
+ pAppDataList->GetAt(i, pAppData);
+ TryReturn(pAppData, false, "pAppData is null");
+
+ WriteApp(i, pAppData);
+
+ if (pAppData->__isSubMode == true)
{
- WriteApp(i, pAppInfoImpl);
+ AppLog("Write(): pAppData->__isSubMode is detected");
+ WriteSubModeApp(i, pAppData);
}
}
- if (__pContext->__isSubMode == true)
- {
- AppLog("Write(): __pContext->__isSubMode is detected");
- WriteSubModeApp(appCount);
- }
-
__pWriter->EndElement();
return true;
}
-bool
-ManifestGenerator::FindFeatureValue(ArrayList* pFeatureList, const String& feature, const String& value) const
-{
- TryReturn(pFeatureList, false, "pFeatureList is null.");
-
- _AppFeatureInfoImpl* pFeature = null;
-
- for (int i = 0 ; i < pFeatureList->GetCount(); i++)
- {
- pFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(i));
- if (pFeature)
- {
- if ((pFeature->GetName() == feature) && (pFeature->GetValue() == value))
- {
- AppLog("Find - feature=[%ls], value=[%ls]", feature.GetPointer(), value.GetPointer());
- return true;
- }
- }
- }
-
- return false;
-}
-
String
-ManifestGenerator::GetGlFrameValue(ArrayList* pFeatureList) const
+ManifestGenerator::GetGlFrameValue(HashMap* pFeatureList) const
{
if (pFeatureList == null)
{
return "use-system-setting";
}
- _AppFeatureInfoImpl* pFeature = null;
- for (int i = 0 ; i < pFeatureList->GetCount(); i++)
+ std::unique_ptr< IMapEnumerator > pEnum(pFeatureList->GetMapEnumeratorN());
+ TryReturn(pEnum, "use-system-setting", "GetMapEnumeratorN() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ while (pEnum->MoveNext() == E_SUCCESS)
{
- pFeature = dynamic_cast<_AppFeatureInfoImpl*>(pFeatureList->GetAt(i));
- if (pFeature == null)
- {
- return "use-system-setting";
- }
+ String* pKey = static_cast< String* > (pEnum->GetKey());
+ TryReturn(pEnum, "use-system-setting", "GetKey() failed. [%s]", GetErrorMessage(GetLastResult()));
- if (pFeature->GetName() == L"HwAcceleration" || pFeature->GetName() == L"GlFrame")
+ if ((*pKey) == L"HwAcceleration" || (*pKey) == L"GlFrame")
{
- String value = pFeature->GetValue();
- if (value == L"On")
+ String* pValue = static_cast< String* > (pEnum->GetValue());
+ TryReturn(pEnum, "use-system-setting", "GetValue() failed. [%s]", GetErrorMessage(GetLastResult()));
+
+ if ((*pValue) == L"On")
{
return "use-GL";
}
- else if (value == L"Off")
+ else if ((*pValue) == L"Off")
{
return "not-use-GL";
}
}
bool
-ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const
+ManifestGenerator::WriteLiveboxes(AppData* pAppData) const
{
TryReturn(__pContext, false, "__pContext is null.");
TryReturn(__pWriter, false, "__pWriter is null.");
__pWriter->StartElement("livebox");
- __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName() + "." + pLiveboxData->GetProviderName());
+ __pWriter->WriteAttribute("appid", pAppData->__appId + "." + pLiveboxData->GetProviderName());
__pWriter->WriteAttribute("period", period);
__pWriter->WriteAttribute("pinup", "false");
WriteLanguageValue(pLiveboxNameList, label);
- String menuIcon = pAppInfoImpl->GetMainmenuIcon();
+ String menuIcon = pAppData->__mainmenuIcon;
if (menuIcon.IsEmpty() == false)
{
String menuIconPath;
- menuIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, menuIcon.GetPointer());
+ menuIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, menuIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteString(menuIconPath);
__pWriter->StartElement("box");
__pWriter->WriteAttribute("type", "buffer");
- previewDir.Format(1024, L"%ls%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES);
+ previewDir.Format(1024, L"%ls%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES);
WriteLiveboxSizeValue(pSizeList, "size", previewDir);
__pWriter->EndElement();
IMapEnumerator* pMapEnum = pList->GetMapEnumeratorN();
TryReturn(pMapEnum, true, "pMapEnum is null.");
- int count = 0;
while (pMapEnum->MoveNext() == E_SUCCESS)
{
String* pSize = static_cast<String*> (pMapEnum->GetKey());
}
bool
-ManifestGenerator::WriteAppControl(_PackageAppInfoImpl* pAppInfoImpl) const
+ManifestGenerator::WriteAppControl(AppData* pAppData) const
{
- TryReturn(pAppInfoImpl, false, "pAppInfoImpl is null.");
+ TryReturn(pAppData, false, "pAppData is null.");
- ArrayList* pAppControlImplList = pAppInfoImpl->GetAppControlList();
+ IListT<_AppControlInfo*>* pAppControlImplList = pAppData->__pAppControlImplList;
TryReturn(pAppControlImplList, false, "pAppControlImplList is null.");
- _AppControlInfoImpl* pAppControl = dynamic_cast<_AppControlInfoImpl*>(pAppControlImplList->GetAt(0));
+ _AppControlInfo* pAppControl = null;
+ pAppControlImplList->GetAt(0, pAppControl);
TryReturn(pAppControl, false, "pAppControl is null.");
ArrayList* pCapabilityList = pAppControl->GetCapabilityList();
int capaCount = pCapabilityList->GetCount();
for (int capaIndex = 0 ; capaIndex < capaCount; capaIndex++)
{
- _AppControlCapabilityInfoImpl* pCapability = dynamic_cast<_AppControlCapabilityInfoImpl*>(pCapabilityList->GetAt(capaIndex));
+ _AppControlCapabilityInfo* pCapability = dynamic_cast<_AppControlCapabilityInfo*>(pCapabilityList->GetAt(capaIndex));
if (pCapability == null) continue;
String operationId = pCapability->GetOperationId();
__pWriter->WriteAttribute("name", operationId);
__pWriter->EndElement();
- _AppControlResolutionInfoImpl* pResolution = dynamic_cast <_AppControlResolutionInfoImpl*>(pResolutionList->GetAt(resIndex));
+ _AppControlResolutionInfo* pResolution = dynamic_cast <_AppControlResolutionInfo*>(pResolutionList->GetAt(resIndex));
if (pResolution == null) continue;
String* pUriScheme = pResolution->GetUriScheme();
}
bool
-ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl)
+ManifestGenerator::WriteApp(int index, AppData* pAppData)
{
- IMap* pNameList = pAppInfoImpl->GetNameList();
+ IMap* pNameList = pAppData->__pNameList;
String label("label");
String type("c++app");
String binaryPath;
- binaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer());
+ binaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, pAppData->__name.GetPointer());
- if (pAppInfoImpl->GetDefault() == L"True")
+ if (pAppData->__main == L"True")
{
WriteLanguageValue(pNameList, label);
- if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+ if (pAppData->__mainmenuIcon.IsEmpty() == false)
{
String iconPath;
- iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+ iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteString(iconPath);
String category;
String mainapp("true");
- if (pAppInfoImpl->GetType() == L"UiApp")
+ if (pAppData->__type == L"UiApp")
{
taskmanage = L"true";
- if (pAppInfoImpl->IsMainmenuVisible() == true)
+ if (pAppData->__mainmenuVisible == true)
{
nodisplay = L"false";
taskmanage = L"true";
}
}
- if (pAppInfoImpl->GetDefault() != L"True")
+ if (pAppData->__main != L"True")
{
mainapp = L"false";
}
- ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
+ HashMap* pFeatureList = pAppData->__pFeatureList;
String glFrame = GetGlFrameValue(pFeatureList);
__pWriter->StartElement("ui-application");
- __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
+ __pWriter->WriteAttribute("appid", pAppData->__appId);
__pWriter->WriteAttribute("exec", binaryPath);
__pWriter->WriteAttribute("nodisplay", nodisplay);
__pWriter->WriteAttribute("taskmanage", taskmanage);
WriteLanguageValue(pNameList, label);
- if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+ if (pAppData->__mainmenuIcon.IsEmpty() == false)
{
String iconPath;
- iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+ iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteString(iconPath);
__pWriter->EndElement();
}
- if (pAppInfoImpl->GetSettingIcon().IsEmpty() == false)
+ if (pAppData->__settingIcon.IsEmpty() == false)
{
String iconPath;
- iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetSettingIcon().GetPointer());
+ iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__settingIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteAttribute("section", "setting");
__pWriter->EndElement();
}
- if (pAppInfoImpl->GetQuickpanelIcon().IsEmpty() == false)
+ if (pAppData->__notificationIcon.IsEmpty() == false)
{
String iconPath;
- iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetQuickpanelIcon().GetPointer());
+ iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__notificationIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteAttribute("section", "notification");
__pWriter->EndElement();
}
- IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
- TryReturn(pAppDataList, false, "pAppDataList is null");
-
- AppData* pAppData = null;
- pAppDataList->GetAt(index, pAppData);
- TryReturn(pAppData, false, "pAppData is null");
-
if (pAppData->__legacyAppControls == true)
{
AppLog("Write(): AppControls spec is legacy");
- WriteAppControl(pAppInfoImpl);
+ WriteAppControl(pAppData);
}
else
{
__pWriter->EndElement();
- if (pAppInfoImpl->GetType() == L"ServiceApp")
+ if (pAppData->__type == L"ServiceApp")
{
- WriteLiveboxes(pAppInfoImpl);
+ WriteLiveboxes(pAppData);
}
WriteAccounts(index);
}
bool
-ManifestGenerator::WriteSubModeApp(int index)
+ManifestGenerator::WriteSubModeApp(int index, AppData* pAppData)
{
// SUB_MODE_APPCONTROL_NAME -> AppName
String subBinaryPath;
- subBinaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
+ subBinaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
String binaryPath;
- binaryPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, __pContext->__subModeAppName.GetPointer());
+ binaryPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_BIN, pAppData->__subModeAppName.GetPointer());
if (File::IsFileExist(subBinaryPath) == true)
{
}
InstallerUtil::CreateSymlink(binaryExecPath, subBinaryExecPath);
- IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
- TryReturn(pAppDataList, false, "pAppDataList is null");
-
- AppLog("WriteSubModeApp(): appCount=%d", pAppDataList->GetCount());
-
- AppData* pAppData = null;
- pAppDataList->GetAt(index, pAppData);
- TryReturn(pAppData, false, "pAppData is null");
-
- PackageId packageId = __pContext->GetId();
+ PackageId packageId = __pContext->__packageId;
AppId appId = packageId + L"." + SUB_MODE_APPCONTROL_NAME;
__pWriter->StartElement("ui-application");
__pWriter->WriteAttribute("type", "c++app");
__pWriter->StartElement("label");
- __pWriter->WriteString(__pPackageInfoImpl->GetDisplayName());
+ __pWriter->WriteString(__pContext->__displayName);
__pWriter->EndElement();
- ArrayList* pAppList = __pPackageInfoImpl->GetAppInfoList();
- _PackageAppInfoImpl* pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(0));
- if (pAppInfoImpl)
+ if (pAppData->__mainmenuIcon.IsEmpty() == false)
{
- if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
- {
- String iconPath;
- iconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+ String iconPath;
+ iconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, pAppData->__mainmenuIcon.GetPointer());
- __pWriter->StartElement("icon");
- __pWriter->WriteString(iconPath);
- __pWriter->EndElement();
- }
+ __pWriter->StartElement("icon");
+ __pWriter->WriteString(iconPath);
+ __pWriter->EndElement();
}
- WriteAppControl(index);
+ WriteAppControl(index, true);
__pWriter->EndElement(); // end of "ui-application"
}
bool
-ManifestGenerator::WriteAppControl(int index)
+ManifestGenerator::WriteAppControl(int index, bool subMode)
{
IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
TryReturn(pAppDataList, false, "pAppDataList is null");
pAppDataList->GetAt(index, pAppData);
TryReturn(pAppData, false, "pAppData is null");
- IListT<AppControlData*>* pAppControlDataList = pAppData->__pAppControlDataList;
- TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+ IListT<AppControlData*>* pAppControlDataList = null;
+
+ if (subMode == false)
+ {
+ pAppControlDataList = pAppData->__pAppControlDataList;
+ TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+ }
+ else
+ {
+ pAppControlDataList = pAppData->__pSubModeAppControlDataList;
+ TryReturn(pAppControlDataList, false, "pAppControlDataList is null");
+ }
for (int i = 0; i < pAppControlDataList->GetCount(); i++)
{
if (accountIcon.IsEmpty() == false)
{
String accountIconPath;
- accountIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountIcon.GetPointer());
+ accountIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, accountIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteAttribute("section", "account");
if (accountSmallIcon.IsEmpty() == false)
{
String accountSmallIconPath;
- accountSmallIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountSmallIcon.GetPointer());
+ accountSmallIconPath.Format(1024, L"%ls%ls/%ls", __pContext->__rootPath.GetPointer(), DIR_SHARED_RES, accountSmallIcon.GetPointer());
__pWriter->StartElement("icon");
__pWriter->WriteAttribute("section", "account-small");
#ifndef _MANIFEST_GENERATOR_H_
#define _MANIFEST_GENERATOR_H_
-#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
-
#include "InstallationContext.h"
#include "XmlWriter.h"
ManifestGenerator(const ManifestGenerator& value);
ManifestGenerator& operator =(const ManifestGenerator& source);
- bool FindFeatureValue(Tizen::Base::Collection::ArrayList* pFeatureList, const Tizen::Base::String& feature, const Tizen::Base::String& value) const;
bool WriteLanguageValue(Tizen::Base::Collection::IMap* pList, const Tizen::Base::String& label) const;
- bool WriteLiveboxes(Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl) const;
+ bool WriteLiveboxes(AppData* pAppData) const;
bool WriteLiveboxSizeValue(Tizen::Base::Collection::IMap* pList, const Tizen::Base::String& element, const Tizen::Base::String& previewDir) const;
- bool WriteAppControl(Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl) const;
- Tizen::Base::String GetGlFrameValue(Tizen::Base::Collection::ArrayList* pFeatureList) const;
+ bool WriteAppControl(AppData* pAppData) const;
+ Tizen::Base::String GetGlFrameValue(Tizen::Base::Collection::HashMap* pFeatureList) const;
bool WriteCategory(int index) const;
bool FindCategory(int index, const Tizen::Base::String& category) const;
- bool WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl);
- bool WriteSubModeApp(int index);
- bool WriteAppControl(int index);
+ bool WriteApp(int index, AppData* pAppData);
+ bool WriteSubModeApp(int index, AppData* pAppData);
+ bool WriteAppControl(int index, bool subMode = false);
bool WriteAccounts(int index);
private:
InstallationContext* __pContext;
- Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
XmlWriter* __pWriter;
}; // ManifestGenerator
#include <FIoFile.h>
#include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "ManifestHandler.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
+using namespace Tizen::App;
using namespace Tizen::Io;
using namespace Tizen::System;
:__pContext(null)
,__pPrivilegeList(null)
,__pContentDataList(null)
-,__pPackageInfoImpl(null)
-,__pPackageAppInfoImpl(null)
,__pAppControlInfoImpl(null)
,__pAppControlCapabilityInfoImpl(null)
,__pAppControlResolutionInfoImpl(null)
-,__pDataControlInfoImpl(null)
-,__pDataControlTypeImpl(null)
-,__pLaunchConditionImpl(null)
-,__pNotificationImpl(null)
+,__pDataControlInfo(null)
+,__pDataControlType(null)
,__pContentData(null)
,__pDefaultIconType(null)
,__isDefaultMainmenu(false)
,__isDefaultName(false)
,__isDefaultAppDetected(false)
,__pAppData(null)
-,__pSubModeAppControlDataList(null)
,__isParserMode(false)
+,__pParser(null)
{
}
{
delete[] __pDefaultIconType;
__pDefaultIconType = null;
-
- if (__pPackageAppInfoImpl)
- {
- delete __pPackageAppInfoImpl;
- __pPackageAppInfoImpl = null;
- }
}
bool
ManifestHandler::Construct(InstallationContext* pContext)
{
__pContext = pContext;
- __pPackageInfoImpl = pContext->GetPackageInfoImpl();
return true;
}
{
status = OnDataControlTypeEndElement();
}
- else if (strcasecmp(pName, "Condition") == 0)
- {
- status = OnConditionEndElement();
- }
- else if (strcasecmp(pName, "Notification") == 0)
- {
- status = OnNotificationEndElement();
- }
else if (strcasecmp(pName, "Apps") == 0)
{
status = OnAppsEndElement();
bool
ManifestHandler::OnUiAppStartElement(void)
{
- __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
- TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null");
-
__pAppData = new (std::nothrow) AppData;
TryReturn(__pAppData, false, "__pAppData is null");
+ InstallerError error = __pAppData->Construct();
+ TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
+
AppLog("<UiApp>");
XmlAttribute *pAttr = GetAttribute();
bool
ManifestHandler::OnServiceAppStartElement(void)
{
- __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
- TryReturn(__pPackageAppInfoImpl, false, "__pPackageAppInfoImpl is null");
-
__pAppData = new (std::nothrow) AppData;
TryReturn(__pAppData, false, "__pAppData is null");
+ InstallerError error = __pAppData->Construct();
+ TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
+
AppLog("<ServiceApp>");
XmlAttribute *pAttr = GetAttribute();
ManifestHandler::OnUiScalabilityStartElement(void)
{
XmlAttribute *pAttr = null;
- char *pCoordinateSystem = null;
- char *pBaseScreenSize = null;
- char *pLogicalCoordinate = null;
+ char* pCoordinateSystem = null;
+ char* pBaseScreenSize = null;
+ char* pLogicalCoordinate = null;
AppLog("<UiScalability>");
pCoordinateSystem = pAttr->Find("CoordinateSystem");
if (pCoordinateSystem)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName("CoordinateSystem");
- pAppFeatureInfo->SetValue(pCoordinateSystem);
-
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String("CoordinateSystem");
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pCoordinateSystem);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
AppLog("<CoordinateSystem=%s>", pCoordinateSystem);
}
pBaseScreenSize = pAttr->Find("BaseScreenSize");
if (pBaseScreenSize)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName("BaseScreenSize");
- pAppFeatureInfo->SetValue(pBaseScreenSize);
-
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String("BaseScreenSize");
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pBaseScreenSize);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
AppLog("<BaseScreenSize=%s>", pBaseScreenSize);
}
pLogicalCoordinate = pAttr->Find("LogicalCoordinate");
if (pLogicalCoordinate)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName("LogicalCoordinate");
- pAppFeatureInfo->SetValue(pLogicalCoordinate);
-
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String("LogicalCoordinate");
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pLogicalCoordinate);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
AppLog("<LogicalCoordinate=%s>", pLogicalCoordinate);
}
pSystemTheme = pAttr->Find("SystemTheme");
if (pSystemTheme)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName("SystemTheme");
- pAppFeatureInfo->SetValue(pSystemTheme);
-
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String("SystemTheme");
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pSystemTheme);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
AppLog("<SystemTheme=%s>", pSystemTheme);
}
pUserDefinedTheme = pAttr->Find("UserDefinedTheme");
if (pUserDefinedTheme)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName("UserDefinedTheme");
- pAppFeatureInfo->SetValue(pUserDefinedTheme);
-
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String("UserDefinedTheme");
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pUserDefinedTheme);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
AppLog("<UserDefinedTheme=%s>", pUserDefinedTheme);
}
return true;
}
-
bool
ManifestHandler::OnDataControlStartElement(void)
{
- XmlAttribute *pAttr = null;
- char *pProviderId = null;
+ XmlAttribute* pAttr = null;
+ char* pProviderId = null;
pAttr = GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
pProviderId = pAttr->Find("ProviderId");
TryReturn(pProviderId, true, "pProviderId is null");
- __pDataControlInfoImpl = new (std::nothrow) _DataControlInfoImpl;
- TryReturn(__pDataControlInfoImpl, false, "__pDataControlInfoImpl is null");
+ __pDataControlInfo = new (std::nothrow) DataControlInfo;
+ TryReturn(__pDataControlInfo, false, "__pDataControlInfo is null");
- __pDataControlInfoImpl->SetProviderId(pProviderId);
+ __pDataControlInfo->__providerId = pProviderId;
AppLog("<DataControl ProviderId=\"%s\">", pProviderId);
result r = E_SUCCESS;
String privileges;
String hmacPrivileges;
- String appId = __pPackageInfoImpl->GetId();
- r = PrivilegeHandler::GenerateCipherPrivilege(appId, *__pPrivilegeList, privileges, hmacPrivileges);
+ PackageId packageId = __pContext->__packageId;
+ r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *__pPrivilegeList, privileges, hmacPrivileges);
TryReturn(!IsFailed(r), false, "privMgr.GeneratePrivilegeString() failed");
- __pPackageInfoImpl->SetPrivilegesValue(privileges, hmacPrivileges);
+ __pContext->__privileges = privileges;
+ __pContext->__hmacPrivileges = hmacPrivileges;
}
__pContext->SetPrivilegeList(__pPrivilegeList);
bool
ManifestHandler::OnUiAppEndElement(void)
{
- if (__pContext->__isSubMode == true)
+ if (__pAppData->__isSubMode == true)
{
- __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
+ __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
__pAppData->__pAppControlDataList = null;
- __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
+ __pAppData->__subModeAppName = __pAppData->__name;
}
- __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
- __pPackageAppInfoImpl = null;
-
__isDefaultName = false;
__pContext->__pAppDataList->Add(__pAppData);
bool
ManifestHandler::OnServiceAppEndElement(void)
{
- if (__pContext->__isSubMode == true)
+ if (__pAppData->__isSubMode == true)
{
- __pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
+ __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
__pAppData->__pAppControlDataList = null;
- __pContext->__subModeAppName = __pPackageAppInfoImpl->GetName();
+ __pAppData->__subModeAppName = __pAppData->__name;
}
- __pPackageInfoImpl->AddAppInfo(*__pPackageAppInfoImpl);
- __pPackageAppInfoImpl = null;
-
__isDefaultName = false;
__pContext->__pAppDataList->Add(__pAppData);
bool
ManifestHandler::OnAppsEndElement(void)
{
- if (__pContext->__isSubMode == true)
- {
- __pAppData = new (std::nothrow) AppData;
- TryReturn(__pAppData, false, "__pAppData is null");
-
- __pAppData->__pAppControlDataList = __pSubModeAppControlDataList;
- __pSubModeAppControlDataList = null;
-
- __pContext->__pAppDataList->Add(__pAppData);
- }
-
AppLog("</Apps>");
return true;
bool
ManifestHandler::OnDataControlEndElement(void)
{
- __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl);
- __pDataControlInfoImpl = null;
+ __pAppData->__pDataControlList->Add(__pDataControlInfo);
+ __pDataControlInfo = null;
AppLog("</DataControl>");
return true;
bool
ManifestHandler::OnDataControlTypeEndElement(void)
{
- __pDataControlInfoImpl->AddControlType(__pDataControlTypeImpl);
- __pDataControlTypeImpl = null;
+ __pDataControlInfo->__pControlTypeList->Add(__pDataControlType);
+ __pDataControlType = null;
AppLog("</DataControlType>");
return true;
}
bool
-ManifestHandler::OnConditionEndElement(void)
-{
- __pPackageAppInfoImpl->AddLaunchCondition(*__pLaunchConditionImpl);
- __pLaunchConditionImpl = null;
- AppLog("</Condition>");
-
- return true;
-}
-
-bool
-ManifestHandler::OnNotificationEndElement(void)
-{
- __pPackageAppInfoImpl->AddNotification(*__pNotificationImpl);
- __pNotificationImpl = null;
- AppLog("</Notification>");
-
- return true;
-}
-
-bool
ManifestHandler::OnContentsEndElement(void)
{
__pContext->SetContentDataList(__pContentDataList);
ManifestHandler::OnIdValue(const char *pCharacters)
{
AppLog("<Id>%s</Id>", pCharacters);
- __pPackageInfoImpl->SetId(pCharacters);
+ __pContext->__packageId = pCharacters;
return true;
}
ManifestHandler::OnVersionValue(const char *pCharacters)
{
AppLog("<Version>%s</Version>", pCharacters);
- __pPackageInfoImpl->SetVersion(pCharacters);
+ __pContext->__version = pCharacters;
return true;
}
ManifestHandler::OnTypeValue(const char *pCharacters)
{
AppLog("<Type>%s</Type>", pCharacters);
- //__pPackageInfoImpl->SetAppType(pCharacters);
if (strcasecmp(pCharacters, "Contents") == 0)
{
- __pPackageInfoImpl->SetAppApiVersion("3.0");
+ __pContext->__apiVersion = L"3.0";
}
return true;
bool
ManifestHandler::OnAuthorValue(const char *pCharacters)
{
-// XmlAttribute *pAttr = 0;
-// char *pAttrValue = 0;
-//
-// pAttr = GetAttribute();
-// TryReturn(pAttr, true, "pAttr is null");
-//
-// pAttrValue = pAttr->Find("Locale");
-// TryReturn(pAttrValue, true, "pAttrValue is null");
-//
-// if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
-// {
-// // Set default name
-// __pPackageInfoImpl->SetAppVendor(pCharacters);
-// }
-
AppLog("<Author>%s</Author>", pCharacters);
- __pPackageInfoImpl->SetAuthor(pCharacters);
+ __pContext->__author = pCharacters;
return true;
}
bool
ManifestHandler::OnUrlValue(const char *pCharacters)
{
- __pPackageInfoImpl->SetUrl(pCharacters);
+ __pContext->__url = pCharacters;
AppLog("<Url>%s</Url>", pCharacters);
return true;
bool
ManifestHandler::OnApiVersionValue(const char *pCharacters)
{
- __pPackageInfoImpl->SetAppApiVersion(pCharacters);
+ __pContext->__apiVersion = pCharacters;
AppLog("<ApiVersion>%s</ApiVersion>", pCharacters);
XmlAttribute *pAttr = GetAttribute();
{
if (strcasecmp(pSection, "MainMenu") == 0)
{
- __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath);
+ __pAppData->__mainmenuIcon = iconRelPath;
}
else if (strcasecmp(pSection, "Setting") == 0)
{
- __pPackageAppInfoImpl->SetSettingIcon(iconRelPath);
+ __pAppData->__settingIcon = iconRelPath;
}
else if (strcasecmp(pSection, "Notification") == 0)
{
- __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath);
+ __pAppData->__notificationIcon = iconRelPath;
}
}
else // legacy
{
if (__isDefaultMainmenu == false)
{
- __pPackageAppInfoImpl->SetMainmenuIcon(iconRelPath);
+ __pAppData->__mainmenuIcon = iconRelPath;
}
if (strcasecmp(pType, __pDefaultIconType) == 0)
{
if (__isDefaultSetting == false)
{
- __pPackageAppInfoImpl->SetSettingIcon(iconRelPath);
+ __pAppData->__settingIcon = iconRelPath;
}
if (strcasecmp(pType, __pDefaultIconType) == 0)
{
if (__isDefaultQuickpanel == false)
{
- __pPackageAppInfoImpl->SetQuickpanelIcon(iconRelPath);
+ __pAppData->__notificationIcon = iconRelPath;
}
if (strcasecmp(pType, __pDefaultIconType) == 0)
{
if (__isDefaultName == true)
{
- __pPackageInfoImpl->SetDisplayName(pCharacters);
+ __pContext->__displayName = pCharacters;
}
}
- if (__pPackageAppInfoImpl)
- {
- String* pValue = new (std::nothrow) String;
- StringUtil::Utf8ToString(pCharacters, *pValue);
- __pPackageAppInfoImpl->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
- }
+ String* pValue = new (std::nothrow) String;
+ StringUtil::Utf8ToString(pCharacters, *pValue);
+
+ __pAppData->__pNameList->Add((new (std::nothrow) String(pAttrValue)), pValue);
}
AppLog("<DisplayName Locale=\"%s\">%s</DisplayName>", pAttrValue, pCharacters);
if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
{
- // Set default name
- __pPackageInfoImpl->SetDescription(pCharacters);
+ __pContext->__description = pCharacters;
}
AppLog("<Description Locale=\"%s\">%s</Description>", pAttrValue, pCharacters);
bool
ManifestHandler::OnDataControlTypeValue(const char *pCharacters)
{
- XmlAttribute *pAttr = null;
- char *pAccessValue = null;
+ XmlAttribute* pAttr = null;
+ char* pAccessValue = null;
pAttr = GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
pAccessValue = pAttr->Find("Access");
TryReturn(pAccessValue, true, "pAccessValue is null");
- __pDataControlTypeImpl = new (std::nothrow) _DataControlTypeImpl;
- TryReturn(__pDataControlTypeImpl, false, "__pDataControlTypeImpl is null");
+ __pDataControlType = new (std::nothrow) DataControlType;
+ TryReturn(__pDataControlType, false, "__pDataControlType is null");
- __pDataControlTypeImpl->SetType(pCharacters);
- __pDataControlTypeImpl->SetAccess(pAccessValue);
+ __pDataControlType->__type = pCharacters;
+ __pDataControlType->__access = pAccessValue;
AppLog("<DataControlType Access=\"%s\", Type=\"%s\">", pAccessValue, pCharacters);
pName = pAttr->Find("Name");
TryReturn(pName, true, "pName is null");
- __pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
- TryReturn(__pLaunchConditionImpl, false, "__pLaunchConditionImpl is null");
-
- __pLaunchConditionImpl->SetName(pName);
- __pLaunchConditionImpl->SetValue(pCharacters);
+ String* pKey = new (std::nothrow) String(pName);
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(pCharacters);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pLaunchConditionList->Add(pKey, pValue);
AppLog("<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters);
return true;
pName = pAttr->Find("Name");
TryReturn(pName, true, "pName is null");
- __pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
- TryReturn(__pNotificationImpl, false, "__pNotificationImpl is null");
-
- __pNotificationImpl->SetName(pName);
- __pNotificationImpl->SetValue(pCharacters);
-
AppLog("<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters);
return true;
{
AppLog("INSTALLATION_STORAGE = [EXTERNAL]");
__pContext->__storage = INSTALLATION_STORAGE_EXTERNAL;
- __pPackageInfoImpl->SetInstalledInExternalStorage(true);
}
return true;
if (strcasecmp(pCharacters, TIZEN_CATEGORY_IME) == 0)
{
- __pPackageAppInfoImpl->SetAppFeature(CATEGORY_TYPE_IME);
+ __pAppData->__feature = CATEGORY_TYPE_IME;
}
return true;
bool
ManifestHandler::AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value)
{
- _AppFeatureInfoImpl* pAppFeatureInfo = new (std::nothrow) _AppFeatureInfoImpl;
- TryReturn(pAppFeatureInfo, false, "pAppFeatureInfo is null");
-
- pAppFeatureInfo->SetName(name);
- pAppFeatureInfo->SetValue(value);
- __pPackageAppInfoImpl->AddAppFeature(*pAppFeatureInfo);
+ String* pKey = new (std::nothrow) String(name);
+ TryReturn(pKey, false, "pKey is null");
+ String* pValue = new (std::nothrow) String(value);
+ TryReturn(pValue, false, "pValue is null");
+ __pAppData->__pFeatureList->Add(pKey, pValue);
return true;
}
if (pName)
{
AppLog(" - Name=%s", pName);
- __pPackageAppInfoImpl->SetName(pName);
- __pAppData->__appId = __pPackageInfoImpl->GetId() + L"." + pName;
+ __pAppData->__name = pName;
+ __pAppData->__appId = __pContext->__packageId + L"." + pName;
}
char* pMain = pAttr->Find("Main");
if (pMain)
{
AppLog(" - Main=%s", pMain);
-
- __pPackageAppInfoImpl->SetDefault(pMain);
+ __pAppData->__main = pMain;
if (strcasecmp(pMain, "True") == 0)
{
}
else
{
- __pPackageAppInfoImpl->SetDefault("False");
+ __pAppData->__main = L"False";
}
char* pHwAcceleration = pAttr->Find("HwAcceleration");
}
int categoryType = InstallerUtil::GetCategoryType(pCategory);
- __pPackageAppInfoImpl->SetAppFeature(categoryType);
+ __pAppData->__feature = categoryType;
}
char* pSubMode = pAttr->Find("SubMode");
{
if (strcasecmp(pSubMode, "True") == 0)
{
- __pContext->__isSubMode = true;
+ __pAppData->__isSubMode = true;
AppLog(" - SubMode=%s", pSubMode);
}
}
if (isUiApp == true)
{
- __pPackageAppInfoImpl->SetType("UiApp");
+ __pAppData->__type = L"UiApp";
char* pMenuIconVisible = pAttr->Find("MenuIconVisible");
if (pMenuIconVisible == null)
{
if (strcasecmp(pMenuIconVisible, "True") == 0)
{
- __pPackageAppInfoImpl->SetMainmenuVisible(true);
+ __pAppData->__mainmenuVisible = true;
}
else
{
- __pPackageAppInfoImpl->SetMainmenuVisible(false);
+ __pAppData->__mainmenuVisible = false;
}
AddAppFeature("MenuIconVisible", pMenuIconVisible);
}
else
{
- __pPackageAppInfoImpl->SetType("ServiceApp");
- __pPackageAppInfoImpl->SetMainmenuVisible(false);
+ __pAppData->__type = L"ServiceApp";
+ __pAppData->__mainmenuVisible = false;
char *pUseUi = pAttr->Find("UseUi");
if (pUseUi)
}
}
- String appId;
- appId.Format(1024, PACKAGE_NAME_RULE, __pPackageInfoImpl->GetId().GetPointer(), pName);
- __pPackageAppInfoImpl->SetPackageName(appId);
-
- AppLog(" - appId=%ls", appId.GetPointer());
+ AppLog(" - appId=%ls", __pAppData->__appId.GetPointer());
return true;
}
#ifndef _MANIFEST_HANDLER_H_
#define _MANIFEST_HANDLER_H_
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBaseString.h>
#include "XmlHandler.h"
bool OnDataControlEndElement(void);
bool OnDataControlTypeEndElement(void);
- bool OnConditionEndElement(void);
- bool OnNotificationEndElement(void);
bool OnContentsEndElement(void);
bool OnContentEndElement(void);
InstallationContext* __pContext;
Tizen::Base::Collection::ArrayList* __pPrivilegeList;
Tizen::Base::Collection::ArrayList* __pContentDataList;
- Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
- Tizen::App::Package::_PackageAppInfoImpl* __pPackageAppInfoImpl;
- Tizen::App::Package::_AppControlInfoImpl* __pAppControlInfoImpl;
- Tizen::App::Package::_AppControlCapabilityInfoImpl* __pAppControlCapabilityInfoImpl;
- Tizen::App::Package::_AppControlResolutionInfoImpl* __pAppControlResolutionInfoImpl;
- Tizen::App::Package::_DataControlInfoImpl* __pDataControlInfoImpl;
- Tizen::App::Package::_DataControlTypeImpl* __pDataControlTypeImpl;
- Tizen::App::Package::_LaunchConditionInfoImpl* __pLaunchConditionImpl;
- Tizen::App::Package::_NotificationInfoImpl* __pNotificationImpl;
+
+ _AppControlInfo* __pAppControlInfoImpl;
+ _AppControlCapabilityInfo* __pAppControlCapabilityInfoImpl;
+ _AppControlResolutionInfo* __pAppControlResolutionInfoImpl;
+
+ DataControlInfo* __pDataControlInfo;
+ DataControlType* __pDataControlType;
ContentData* __pContentData;
char* __pDefaultIconType;
bool __isDefaultAppDetected;
AppData* __pAppData;
- Tizen::Base::Collection::IListT<AppControlData*>* __pSubModeAppControlDataList;
bool __isParserMode;
ManifestParser* __pParser;
#include <FIoFile.h>
#include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "ManifestAccountsParser.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
using namespace Tizen::System;
#include <FBaseString.h>
-#include <FAppPkg_PackageInfoImpl.h>
-
#include "ManifestParser.h"
#include "InstallationContext.h"
#include <FIoFile.h>
#include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "ManifestAppControlsParser.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
using namespace Tizen::System;
return true;
}
- pHandler->__pAppControlInfoImpl = new (std::nothrow) _AppControlInfoImpl;
+ pHandler->__pAppControlInfoImpl = new (std::nothrow) _AppControlInfo;
TryReturn(pHandler->__pAppControlInfoImpl, false, "pHandler->__pAppControlInfoImpl is null");
char* pProviderId = pAttr->Find("ProviderId");
{
AppLog(" - OperationId=%s", pOperationId);
- pHandler->__pAppControlCapabilityInfoImpl = new (std::nothrow) _AppControlCapabilityInfoImpl;
+ pHandler->__pAppControlCapabilityInfoImpl = new (std::nothrow) _AppControlCapabilityInfo;
TryReturn(pHandler->__pAppControlCapabilityInfoImpl, false, "pHandler->__pAppControlCapabilityInfoImpl is null");
pHandler->__pAppControlCapabilityInfoImpl->SetOperationId(pOperationId);
XmlAttribute *pAttr = pHandler->GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
- pHandler->__pAppControlResolutionInfoImpl = new (std::nothrow) _AppControlResolutionInfoImpl;
+ pHandler->__pAppControlResolutionInfoImpl = new (std::nothrow) _AppControlResolutionInfo;
TryReturn(pHandler->__pAppControlResolutionInfoImpl, false, "pHandler->__pAppControlResolutionInfoImpl is null");
AppLog(" <Resolution>");
if (__legacyAppControls == true)
{
- pHandler->__pPackageAppInfoImpl->AddAppControl(pHandler->__pAppControlInfoImpl);
+ pAppData->__pAppControlImplList->Add(pHandler->__pAppControlInfoImpl);
pHandler->__pAppControlInfoImpl = null;
}
else
#include <FBaseString.h>
-#include <FAppPkg_PackageInfoImpl.h>
-
#include "ManifestParser.h"
#include "InstallationContext.h"
#include <FIoFile.h>
#include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "ManifestLiveboxesParser.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
using namespace Tizen::System;
#include <FBaseString.h>
-#include <FAppPkg_PackageInfoImpl.h>
-
#include "ManifestParser.h"
#include "InstallationContext.h"
#include <FIoFile.h>
#include <FSys_SystemInfoImpl.h>
-#include <FAppPkg_PackageInfoImpl.h>
#include <FBase_StringConverter.h>
#include "ManifestParser.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
using namespace Tizen::Io;
using namespace Tizen::System;
#include <FBaseString.h>
-#include <FAppPkg_PackageInfoImpl.h>
-
#include "InstallationContext.h"
class ManifestHandler;