summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinc/InstallerDefs.h2
-rwxr-xr-xsrc/Context/InstallationContextData.h1
-rwxr-xr-xsrc/Manager/SmackManager.cpp17
-rwxr-xr-xsrc/XmlHandler/ManifestGenerator.cpp11
-rwxr-xr-xsrc/XmlHandler/ManifestHandler.cpp35
-rwxr-xr-xsrc/XmlHandler/ManifestHandler.h7
6 files changed, 66 insertions, 7 deletions
diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h
index 1fc6ddf..3f79eb0 100755
--- a/inc/InstallerDefs.h
+++ b/inc/InstallerDefs.h
@@ -23,7 +23,7 @@
#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130312.1]"
+#define OSP_INSTALLER_VERSION "version=[20130314.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
diff --git a/src/Context/InstallationContextData.h b/src/Context/InstallationContextData.h
index b780bd8..5e5dbf9 100755
--- a/src/Context/InstallationContextData.h
+++ b/src/Context/InstallationContextData.h
@@ -257,6 +257,7 @@ public:
Tizen::Base::String __type;
Tizen::Base::String __subModeAppName;
Tizen::Base::String __launchingHistoryVisible;
+ Tizen::Base::String __permissionType;
Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList;
diff --git a/src/Manager/SmackManager.cpp b/src/Manager/SmackManager.cpp
index 341f0ff..e68035e 100755
--- a/src/Manager/SmackManager.cpp
+++ b/src/Manager/SmackManager.cpp
@@ -22,6 +22,7 @@
#include <dlfcn.h>
#include <unique_ptr.h>
+#include <FIoFile.h>
#include <FIoRegistry.h>
#include <FSecCryptoSha1Hash.h>
#include <FBase_StringConverter.h>
@@ -176,7 +177,10 @@ SmackManager::AddPermissions(const PackageId& packageId)
int res = 0;
const char* pList[] = {"OSP", null};
- String script("/usr/bin/smackload-app.sh ");
+ 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));
@@ -187,8 +191,15 @@ SmackManager::AddPermissions(const PackageId& packageId)
res = AddPermissions(pPackageId.get(), pList);
- res = system(pScript.get());
- AppLog("[smack] system(%s), result = [%d]", pScript.get(), res);
+ if (exist == true)
+ {
+ res = system(pScript.get());
+ AppLog("[smack] system(%s), result = [%d]", pScript.get(), res);
+ }
+ else
+ {
+ AppLog("[%ls] not found", script.GetPointer());
+ }
return true;
}
diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp
index c79de8e..9013a9f 100755
--- a/src/XmlHandler/ManifestGenerator.cpp
+++ b/src/XmlHandler/ManifestGenerator.cpp
@@ -80,6 +80,7 @@ ManifestGenerator::Write()
__pWriter->WriteAttribute("type", "tpk");
__pWriter->WriteAttribute("version", __pContext->__version);
__pWriter->WriteAttribute("install-location", location);
+ __pWriter->WriteAttribute("root_path", __pContext->__rootPath);
__pWriter->StartElement("label");
__pWriter->WriteString(__pContext->__displayName);
@@ -557,6 +558,16 @@ ManifestGenerator::WriteApp(int index, AppData* pAppData)
__pWriter->WriteAttribute("hw-acceleration", glFrame);
__pWriter->WriteAttribute("mainapp", mainapp);
+ if (pAppData->__permissionType.IsEmpty() == false)
+ {
+ String type = pAppData->__permissionType;
+ type.ToLowerCase();
+
+ __pWriter->StartElement("permission");
+ __pWriter->WriteAttribute("type", type);
+ __pWriter->EndElement();
+ }
+
WriteCategory(index);
#if 0
diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp
index c7ae1d7..ccfdf25 100755
--- a/src/XmlHandler/ManifestHandler.cpp
+++ b/src/XmlHandler/ManifestHandler.cpp
@@ -159,6 +159,10 @@ ManifestHandler::OnStartElement(const char *pName)
{
status = OnAppControlsStartElement(pName);
}
+ else if (strcasecmp(pName, "Permission") == 0)
+ {
+ status = OnPermissionStartElement(pName);
+ }
if (!status)
{
@@ -626,6 +630,37 @@ ManifestHandler::OnAppControlsStartElement(const char *pName)
}
bool
+ManifestHandler::OnPermissionStartElement(const char* pName)
+{
+ XmlAttribute* pAttr = null;
+ char* pType = null;
+
+ pAttr = GetAttribute();
+ TryReturn(pAttr, true, "pAttr is null.");
+
+ pType = pAttr->Find("Type");
+ TryReturn(pType, true, "pType is null.");
+
+ if (__pAppData->__permissionType.IsEmpty() == true)
+ {
+ __pAppData->__permissionType = pType;
+ }
+ else
+ {
+ String type = pType;
+ if (__pAppData->__permissionType.Equals(type, true) == false)
+ {
+ AppLog("Invalid Permission Type [%ls][%ls]", __pAppData->__permissionType.GetPointer(), type.GetPointer());
+ return false;
+ }
+ }
+
+ AppLog("<Permission Type=\"%s\">", pType);
+
+ return true;
+}
+
+bool
ManifestHandler::OnPrivilegesEndElement(void)
{
if (__pContext->__isVerificationMode == false)
diff --git a/src/XmlHandler/ManifestHandler.h b/src/XmlHandler/ManifestHandler.h
index ba0b79e..edbb470 100755
--- a/src/XmlHandler/ManifestHandler.h
+++ b/src/XmlHandler/ManifestHandler.h
@@ -78,9 +78,10 @@ private:
bool OnContentStartElement(void);
// Parsers
- bool OnLiveboxesStartElement(const char *pName);
- bool OnAccountsStartElement(const char *pName);
- bool OnAppControlsStartElement(const char *pName);
+ bool OnLiveboxesStartElement(const char* pName);
+ bool OnAccountsStartElement(const char* pName);
+ bool OnAppControlsStartElement(const char* pName);
+ bool OnPermissionStartElement(const char* pName);
// EndElement
bool OnPrivilegesEndElement(void);