#include <dlfcn.h>
#include <unique_ptr.h>
+#include <FAppPkgPackageInfo.h>
#include <FIoFile.h>
#include <FIoRegistry.h>
#include <FSecCryptoSha1Hash.h>
+#include <FAppPkg_PackageManagerImpl.h>
#include <FBase_StringConverter.h>
#include "SmackManager.h"
#include "InstallerUtil.h"
using namespace Tizen::App;
+using namespace Tizen::App::Package;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
if (dirPath.Contains(L"shared/data") == true)
{
- label = L"*";
- //label.Append("_shareddata");
+ label.Append("_shareddata");
+ AddSharedDirReaders(label);
+
+ return true;
}
else if (dirPath.Contains(L"shared/res") == true)
{
label = L"_";
- //label.Append("_sharedres");
}
else if (dirPath.Contains(L"shared/trusted") == true)
{
return true;
}
- //int AddSharedDirReaders(const char* pSharedLabel, const char** ppAppList);
+ TryReturn(__pContext, false, "__pContext is null");
+
+ int res = 0;
+
+ std::unique_ptr<char[]> pLabel(_StringConverter::CopyToCharArrayN(label));
+ TryReturn(pLabel, false, "pLabel is null.");
+
+ std::unique_ptr< IList > pPackageList(_PackageManagerImpl::GetInstance()->GetPackageInfoListN());
+ TryReturn(pPackageList, false, "pPackageList is null.");
+
+ int count = pPackageList->GetCount();
+
+ const char** pList = new (std::nothrow) const char*[count+1];
+ TryReturn(pList, false, "pList is null.");
+
+ for (int i = 0; i < count; i++)
+ {
+ PackageInfo* pPackageInfo = dynamic_cast < PackageInfo* >(pPackageList->GetAt(i));
+ if (pPackageInfo)
+ {
+ PackageId packageId = pPackageInfo->GetId();
+
+ char* pPackageId = _StringConverter::CopyToCharArrayN(packageId);
+ TryReturn(pPackageId, false, "pPackageId is null.");
+
+ pList[i] = pPackageId;
+ }
+ }
+
+ pList[count] = null;
+
+ res = AddSharedDirReaders(pLabel.get(), pList);
+
+ for (int i = 0; pList[i] != null; i++)
+ {
+ //AppLog("delete PackageId - [%s]", pList[i]);
+ delete[] pList[i];
+ }
+ delete[] pList;
return true;
}
location = L"auto";
}
- String appSettingPath = __pContext->__rootPath + DIR_SETTING;
- if (File::IsFileExist(appSettingPath) == true)
+ String appSettingXmlPath = __pContext->__rootPath + DIR_SETTING + L"/setting." + __pContext->__version + L".xml";
+ if (File::IsFileExist(appSettingXmlPath) == true)
{
__pContext->__isAppSetting = true;
appSetting = L"true";
__pWriter->WriteAttribute("install-location", location);
__pWriter->WriteAttribute("root_path", __pContext->__rootPath);
__pWriter->WriteAttribute("appsetting", appSetting);
+ __pWriter->WriteAttribute("storeclient-id", __pContext->__storeClientId);
__pWriter->StartElement("label");
__pWriter->WriteString(__pContext->__displayName);