#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130328.1]"
+#define OSP_INSTALLER_VERSION "version=[20130328.2]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
apiVersion = pContext->__apiVersion;
String versionInfoFile;
versionInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), VERSION_INFO_FILE);
- CreateInfoFile(versionInfoFile, &apiVersion);
+ InstallerUtil::CreateInfoFile(versionInfoFile, &apiVersion);
if (pContext->__isOspCompat == true)
{
String compatInfoFile;
compatInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), COMPAT_INFO_FILE);
- CreateInfoFile(compatInfoFile, null);
+ InstallerUtil::CreateInfoFile(compatInfoFile, null);
}
String webServicePrivilege(TIZEN_PRIVILEGE_WEB_SERVICE);
String webServiceInfoFile;
webServiceInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), WEBSERVICE_INFO_FILE);
- CreateInfoFile(webServiceInfoFile, null);
+ InstallerUtil::CreateInfoFile(webServiceInfoFile, null);
}
IListT<AppData*>* pAppDataList = pContext->__pAppDataList;
String uiScalabilityInfoFile;
uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE);
- CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
+ InstallerUtil::CreateInfoFile(uiScalabilityInfoFile, &uiScalability);
int categoryType = pAppData->__feature;
if (categoryType != CATEGORY_TYPE_NONE)
String typeInfoFile;
typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE);
- CreateInfoFile(typeInfoFile, &typeInfo);
+ InstallerUtil::CreateInfoFile(typeInfoFile, &typeInfo);
}
}
else if (appType == L"ServiceApp")
// InstallerUtil::Remove(desktopPath);
// }
//
-// CreateInfoFile(desktopPath, &desktop);
+// InstallerUtil::CreateInfoFile(desktopPath, &desktop);
// }
// }
//
}
bool
-ConfigurationManager::CreateInfoFile(const String& filePath, const String* pContext)
-{
- result r = E_SUCCESS;
- File file;
-
- r = file.Construct(filePath, "w");
- TryReturn(!IsFailed(r), false, "file.Construct() failed, filePath=[%ls]", filePath.GetPointer());
-
- AppLog("------------------------------------------");
- AppLog("CreateInfoFile(), filePath = [%ls]", filePath.GetPointer());
-
- if (pContext)
- {
- r = file.Write(*pContext);
- TryReturn(!IsFailed(r), false, "file.Write() failed, filePath=[%ls]", filePath.GetPointer());
- AppLog("string = [%ls]", pContext->GetPointer());
- }
- AppLog("------------------------------------------");
-
- return true;
-}
-
-bool
ConfigurationManager::CreateImeSymlink(const String& binaryPath, const String& appId)
{
bool res = true;
// bool CreateHybridServiceDesktopFile(InstallationContext* pContext);
bool MergeToSystemXmlFile(const Tizen::Base::String& systemXmlPath, const Tizen::Base::String& webXmlPath,const Tizen::Base::String& serviceXmlPath);
- bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext);
bool CreateImeSymlink(const Tizen::Base::String& binaryPath, const Tizen::Base::String& packageName);
bool FindPrivilege(InstallationContext* pContext, const Tizen::Base::String& privilege) const;
bool SetCertHashValue(void* pHandle, Tizen::Security::Cert::X509CertificatePath* pCertPath, int certType) const;
TryReturn(__pContext, false, "__pContext is null");
int res = 0;
- String script("/usr/bin/smackload-app.sh");
- bool exist = File::IsFileExist(script);
-
- script.Append(L" ");
- script.Append(packageId);
std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
TryReturn(pPackageId, false, "pPackageId is null.");
- std::unique_ptr<char[]> pScript(_StringConverter::CopyToCharArrayN(script));
- TryReturn(pScript, false, "pScript is null.");
-
int count = __pContext->__pPrivilegeList->GetCount();
const char** pList = new (std::nothrow) const char*[count+1];
res = AddPermissions(pPackageId.get(), pList);
- if (exist == true)
- {
- res = system(pScript.get());
- AppLog("[smack] system(%s), result = [%d]", pScript.get(), res);
- }
- else
- {
- AppLog("[%ls] not found", script.GetPointer());
- }
+ String smackFile(L"/etc/smack/accesses2.d/");
+ smackFile.Append(packageId);
+ smackFile.Append(L"-temp.rule");
+
+ String smackContext(packageId);
+ smackContext.Append(L" all.rule include");
+
+ InstallerUtil::CreateInfoFile(smackFile, &smackContext);
for (int i = 0; pList[i] != null; i++)
{
}
bool
+InstallerUtil::CreateInfoFile(const String& filePath, const String* pContext)
+{
+ result r = E_SUCCESS;
+ File file;
+
+ r = file.Construct(filePath, "w");
+ TryReturn(!IsFailed(r), false, "file.Construct() failed, filePath=[%ls]", filePath.GetPointer());
+
+ AppLog("------------------------------------------");
+ AppLog("CreateInfoFile(), filePath = [%ls]", filePath.GetPointer());
+
+ if (pContext)
+ {
+ r = file.Write(*pContext);
+ TryReturn(!IsFailed(r), false, "file.Write() failed, filePath=[%ls]", filePath.GetPointer());
+ AppLog("string = [%ls]", pContext->GetPointer());
+ }
+ AppLog("------------------------------------------");
+
+ return true;
+}
+
+bool
InstallerUtil::DumpLog(const char* pBuf)
{
char temp[4096] = {0};
static int GetCategoryType(char* pCategory);
static bool CreateSymlinkForAppDirectory(const Tizen::Base::String& inPath, Tizen::Base::String& outPath);
+ static bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext);
static bool DumpLog(const char* pBuf);
static bool DumpLogData(char *pData, int dataLen);