<!-- Widget Configuration Document Extensions XSD For TIZEN -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tizen="http://tizen.org/ns/widgets" targetNamespace="http://tizen.org/ns/widgets">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
-
<xs:simpleType name="data.boolean">
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:restriction base="xs:token">
<xs:enumeration value="portrait"/>
<xs:enumeration value="landscape"/>
+ <xs:enumeration value="auto-rotation"/>
</xs:restriction>
</xs:simpleType>
</xs:complexType>
</xs:element>
+ <xs:element name="privilege">
+ <xs:complexType>
+ <xs:attribute name="name" use="required" type="xs:anyURI"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="content-security-policy" type="xs:string"/>
+ <xs:element name="content-security-policy-report-only" type="xs:string"/>
+ <xs:element name="allow-navigation" type="xs:string"/>
+
<xs:element name="app-widget">
<xs:complexType mixed="true">
<xs:all>
<xs:attribute name="primary" type="tizen:data.boolean" use="required"/>
<xs:attribute name="auto-launch" type="tizen:data.boolean" use="optional"/>
<xs:attribute name="update-period" type="tizen:updatePeriodType" use="optional"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="privilege">
- <xs:complexType>
- <xs:attribute name="name" use="required" type="xs:anyURI"/>
+ <xs:attribute name="type" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:attribute name="src" use="required" type="xs:anyURI"/>
<xs:attribute name="width" use="required" type="xs:int"/>
<xs:attribute name="height" use="required" type="xs:int"/>
+ <xs:attribute name="fast-open" use="optional" type="tizen:data.boolean"/>
</xs:complexType>
</xs:element>
<xs:attribute ref="xml:lang"/>
</xs:complexType>
</xs:element>
-
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" version="2.0 Beta" viewmodes="fullscreen" id="http://tizen.org/cert">
- <feature name="http://tizen.org/privilege/accelerometer" />
- <feature name="http://tizen.org/privilege/account" />
- <feature name="http://tizen.org/privilege/application" />
- <feature name="http://tizen.org/privilege/callHistory.read" />
- <feature name="http://tizen.org/privilege/callHistory.write" />
- <feature name="http://tizen.org/privilege/deviceapis" />
- <feature name="http://tizen.org/privilege/deviceinteraction" />
- <feature name="http://tizen.org/privilege/gallery" />
- <feature name="http://tizen.org/privilege/gyroscope" />
- <feature name="http://tizen.org/privilege/intel-messaging" />
- <feature name="http://tizen.org/privilege/messaging" />
- <feature name="http://tizen.org/privilege/messaging.send" />
- <feature name="http://tizen.org/privilege/messaging.read" />
- <feature name="http://tizen.org/privilege/messaging.write" />
- <feature name="http://tizen.org/privilege/pim" />
- <feature name="http://tizen.org/privilege/orientation" />
- <feature name="http://tizen.org/privilege/systeminfo" />
- <feature name="http://tizen.org/privilege/waclog" />
- <name> hello </name>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" version="0.0.1" viewmodes="fullscreen">
+ <name>hello</name>
<icon src="icon.png" />
- <!-- tizen appservice element -->
- <tizen:appservice src="index.html" operation="http://tizen.org/appsvc/operation/edit" mime="image/jpeg"/>
- <tizen:appservice src="index2.html" operation="http://tizen.org/appsvc/operation/view" mime="image/jpeg"/>
- <tizen:appservice src="index2.html" operation="http://tizen.org/appsvc/operation/test" mime="image/jpeg"/>
-
<!-- tizen application element -->
- <tizen:application id="Ea31aD3a23" required_version="1.0"/>
+ <tizen:application id="GfeI4eyhBG.Test" package="GfeI4eyhBG" required_version="2.1"/>
<!-- tizen setting element -->
- <tizen:setting screen-orientation="portrait" />
- <tizen:setting contextmenu="disable" />
- <tizen:setting nodisplay="false" />
+ <tizen:setting screen-orientation="landscape" context-menu="disable" background-support="enable" encryption="enable" install-location="internal-only"/>
+
+ <!-- tizen app-control element -->
+ <tizen:app-control>
+ <tizen:src name="index.html"/>
+ <tizen:operation name="http://tizen.org/appcontrol/operation/default"/>
+ <tizen:uri name="http"/>
+ <tizen:mime name="html"/>
+ </tizen:app-control>
+
+ <!-- tizen content-security-policy element -->
+ <tizen:content-security-policy>"img-src http://test.com 'unsafe-inline'; script-src 'unsafe-inline';"</tizen:content-security-policy>
+ <tizen:content-security-policy-report-only>img-src http://test.com 'unsafe-inline'; script-src 'unsafe-inline';</tizen:content-security-policy-report-only>
+
+ <!-- tizen allow-navigation element -->
+ <tizen:allow-navigation>test.com</tizen:allow-navigation>
</widget>
<xs:element ref="tizen:setting" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:application" minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:content" minOccurs="1" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
- <xs:element ref="tizen:app-widget" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:privilege" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+ <xs:element ref="tizen:content-security-policy" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+ <xs:element ref="tizen:content-security-policy-report-only" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+ <xs:element ref="tizen:allow-navigation" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
+ <xs:element ref="tizen:app-widget" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
<xs:element ref="tizen:account" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>\r
- </xs:choice>\r
+ </xs:choice>\r
<xs:attribute ref="xml:lang"/>\r
<xs:attribute name="id" type="xs:anyURI"/>\r
<xs:attribute name="version" type="widgets:data.versionNumber"/>\r
-#git:framework/web/wrt-installer wrt-installer 0.1.49
+#git:framework/web/wrt-installer wrt-installer_0.1.53
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.49
+Version: 0.1.53
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
BuildRequires: pkgconfig(pkgmgr-installer)
BuildRequires: pkgconfig(pkgmgr-parser)
BuildRequires: pkgconfig(pkgmgr-types)
+BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(cert-svc)
BuildRequires: pkgconfig(osp-appfw)
BuildRequires: osp-appfw-internal-devel
Requires: osp-appfw
+Requires: osp-installer
Requires: xmlsec1
%description
${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp
${INSTALLER_JOBS}/widget_install/wac_security.cpp
${INSTALLER_JOBS}/widget_install/widget_update_info.cpp
+ ${INSTALLER_JOBS}/widget_install/directory_api.cpp
${INSTALLER_JOBS}/widget_uninstall/job_widget_uninstall.cpp
${INSTALLER_JOBS}/widget_uninstall/task_check.cpp
${INSTALLER_JOBS}/widget_uninstall/task_remove_files.cpp
wrt-plugins-types
pkgmgr-installer
pkgmgr-parser
+ pkgmgr-info
web-provider
osp-appfw
REQUIRED
{
INSTALL_LOCATION_TYPE_UNKNOWN = 0,
INSTALL_LOCATION_TYPE_NOMAL,
- INSTALL_LOCATION_TYPE_PRELOAD,
INSTALL_LOCATION_TYPE_EXTERNAL
};
--- /dev/null
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 wrt_install_mode.h
+ * @author Jihoon Chung (jihoon.chung@samgsung.com)
+ * @version
+ * @brief Definition file of widget install mode class
+ */
+
+#ifndef WRT_INSTALL_MODE_H
+#define WRT_INSTALL_MODE_H
+
+class InstallMode
+{
+ public:
+ enum class Command
+ {
+ INSTALL,
+ REINSTALL
+ };
+ enum class Location
+ {
+ INTERNAL,
+ EXTERNAL
+ };
+ enum class RootPath
+ {
+ RW,
+ RO
+ };
+ enum class ExtensionType
+ {
+ WGT,
+ DIR
+ };
+ enum class InstallTime
+ {
+ NORMAL,
+ PRELOAD
+ };
+
+ InstallMode(Command cmd = Command::INSTALL,
+ Location lo = Location::INTERNAL,
+ RootPath root = RootPath::RW,
+ ExtensionType extensionType = ExtensionType::WGT,
+ InstallTime time = InstallTime::NORMAL) :
+ command(cmd),
+ location(lo),
+ rootPath(root),
+ extension(extensionType),
+ installTime(time)
+ {};
+
+ Command command;
+ Location location;
+ RootPath rootPath;
+ ExtensionType extension;
+ InstallTime installTime;
+};
+
+#endif // WRT_INSTALL_MODE_H
+
};
const char* const ApplicationParser::REGEXP_PACKAGE = "[0-9A-Za-z]{10}";
-const char* const ApplicationParser::REGEXP_ID = "([0-9A-Za-z]{10})\\..{2,52}";
+const char* const ApplicationParser::REGEXP_ID = "([0-9A-Za-z]{10})\\.[0-9A-Za-z]{2,52}";
const char* const ApplicationParser::REGEXP_VERSION = "\\d+\\.\\d+(\\.\\d+)?";
class SplashParser : public ElementParser
ProgressDescription const &description)
{
m_progresPercent =
- ((static_cast<ProgressPercent>(step) + 1.0) /
+ ((static_cast<ProgressPercent>(step)) /
static_cast<ProgressPercent>(lastElement)) * 100;
m_progresDescription = description;
}
ErrorPackageNotFound, ///<
ErrorPackageInvalid, ///< invalid widget package
ErrorPackageLowerVersion, ///< given version is lower
- ///< than existing version
- ErrorManifestNotFound, ///<
+ ErrorPackageExecutableNotFound,
+
+ ErrorManifestNotFound = 11, ///<
ErrorManifestInvalid, ///<
ErrorConfigNotFound, ///< couldn't find config.xml
- ///< in package.
ErrorConfigInvalid, ///< invalid config.xml
- ErrorSignatureNotFound, ///< signature file not exist.
+
+ ErrorSignatureNotFound = 21, ///< signature file not exist.
ErrorSignatureInvalid, ///< invalid signature file
ErrorSignatureVerificationFailed, ///< failure in verificate
///< signature
- ErrorRootCertificateNotFound, ///< couldn't find root
- ///< certificate.
+ ErrorRootCertificateNotFound = 31, ///< couldn't find root
ErrorCertificationInvaid, ///< invalid certification
ErrorCertificateChainVerificationFailed, ///< failure in verificate
- ///< certification chain.
ErrorCertificateExpired, ///< expire cerification.
- ErrorInvalidPrivilege, ///< invalid privilege.
- ErrorMenuIconNotFound, ///<
- ErrorFatalError, ///< failure in db operation
- ///< or file opertion..
- ErrorOutOfStorage, ///< failure in shortage of
- ///< memory
+
+ ErrorInvalidPrivilege = 41, ///< invalid privilege.
+ ErrorPrivilegeLevelViolation,
+
+ ErrorMenuIconNotFound = 51, ///<
+
+ ErrorFatalError = 61, ///< failure in db operation
+ ErrorOutOfStorage, ///< failure in shortage of memory
ErrorOutOfMemory, ///< failure in shortage of RAM
+ ErrorArgumentInvalid,
/* wrt-installer error */
/* 121-140 : reserved for Web installer */
delete[] certData;
return retval == ACE_OK;
}
+bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle)
+{
+ using namespace WrtDB;
+ LogDebug("Updating Ace database from Widget DB");
+ struct widget_info wi;
+ DPL::OptionalString os;
+ WrtDB::WidgetCertificateDataList certList;
+
+ Try {
+ WidgetDAOReadOnly dao(widgetHandle);
+
+ WidgetType type = dao.getWidgetType();
+ if (type == WrtDB::APP_TYPE_WAC20) {
+ wi.type = WAC20;
+ } else if (type == WrtDB::APP_TYPE_TIZENWEBAPP) {
+ wi.type = Tizen;
+ } else {
+ LogError("Unknown application type");
+ return false;
+ }
+
+ wi.id = toAceString(dao.getGUID());
+ wi.version = toAceString(dao.getVersion());
+ wi.author = toAceString(dao.getAuthorName());
+ wi.shareHerf = strdup(dao.getShareHref().c_str());
+ LogDebug("Basic data converted. Certificates begin.");
+ certList = dao.getCertificateDataList();
+ }
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
+ LogError("Widget does not exist");
+ return false;
+ }
+
+ //one more element for NULL termination
+ LogDebug("Found: " << certList.size() << " certificates");
+ ace_certificate_data** certData = new ace_certificate_data *
+ [certList.size() + 1];
+ certData[certList.size()] = NULL; // last element set to NULL
+
+ int i = 0;
+ FOREACH(it, certList)
+ {
+ certData[i] = new ace_certificate_data;
+ switch (it->owner) {
+ case WrtDB::WidgetCertificateData::AUTHOR:
+ certData[i]->owner = AUTHOR;
+ break;
+ case WrtDB::WidgetCertificateData::DISTRIBUTOR:
+ certData[i]->owner = DISTRIBUTOR;
+ break;
+ default:
+ LogDebug("Unknown owner type of cert");
+ certData[i]->owner = UNKNOWN;
+ break;
+ }
+ switch (it->type) {
+ case WrtDB::WidgetCertificateData::ENDENTITY:
+ certData[i]->type = ENDENTITY;
+ break;
+ case WrtDB::WidgetCertificateData::ROOT:
+ certData[i]->type = ROOT;
+ break;
+ default:
+ LogError("Unknown type of cert");
+ certData[i]->type = ENDENTITY;
+ break;
+ }
+ certData[i]->chain_id = it->chainId;
+
+ certData[i]->md5_fp = toAceString(it->strMD5Fingerprint);
+ certData[i]->sha1_fp = toAceString(it->strSHA1Fingerprint);
+ certData[i]->common_name =
+ toAceString(DPL::ToUTF8String(it->strCommonName));
+ ++i;
+ }
+
+ LogDebug("Registerign widget in ace");
+ ace_return_t retval = ace_register_widget(
+ static_cast<ace_widget_handle_t>(widgetHandle), &wi, certData);
+
+ //clean up - WidgetInfo
+ free(wi.author);
+ free(wi.id);
+ free(wi.shareHerf);
+ free(wi.version);
+
+ //free cert list
+ i = 0;
+ while (certData[i] != NULL) {
+ free(certData[i]->common_name);
+ free(certData[i]->md5_fp);
+ free(certData[i]->sha1_fp);
+ delete certData[i];
+ ++i;
+ }
+ delete[] certData;
+ return retval == ACE_OK;
+}
}
bool registerAceWidget(const WrtDB::DbWidgetHandle& widgetHandle,
const WrtDB::WidgetRegisterInfo& widgetConfig,
const WrtDB::WidgetCertificateDataList& certList);
+bool registerAceWidgetFromDB(const WrtDB::DbWidgetHandle& widgetHandle);
}
#endif /* WRT_SRC_INSTALLER_CORE_ACE_REGISTRATION_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 directory_api.cpp
+ * @author Soyoung Kim(sy037.kim@samsung.com)
+ * @version 1.0
+ * @brief directory api - implementation file
+ */
+
+#include <directory_api.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fstream>
+#include <dpl/log/log.h>
+#include <dpl/foreach.h>
+#include <dpl/utils/wrt_utility.h>
+
+namespace DirectoryApi {
+bool DirectoryCopy(std::string source, std::string dest)
+{
+ DIR* dir = opendir(source.c_str());
+ if (NULL == dir) {
+ return false;
+ }
+
+ struct dirent dEntry;
+ struct dirent *dEntryResult;
+ int return_code;
+
+ do {
+ struct stat statInfo;
+ return_code = readdir_r(dir, &dEntry, &dEntryResult);
+ if (dEntryResult != NULL && return_code == 0) {
+ std::string fileName = dEntry.d_name;
+ std::string fullName = source + "/" + fileName;
+
+ if (stat(fullName.c_str(), &statInfo) != 0) {
+ closedir(dir);
+ return false;
+ }
+
+ if (S_ISDIR(statInfo.st_mode)) {
+ if (("." == fileName) || (".." == fileName)) {
+ continue;
+ }
+ std::string destFolder = dest + "/" + fileName;
+ WrtUtilMakeDir(destFolder);
+
+ if (!DirectoryCopy(fullName, destFolder)) {
+ closedir(dir);
+ return false;
+ }
+ }
+
+ std::string destFile = dest + "/" + fileName;
+ std::ifstream infile(fullName);
+ std::ofstream outfile(destFile);
+ outfile << infile.rdbuf();
+ outfile.close();
+ infile.close();
+ }
+ } while (dEntryResult != NULL && return_code == 0);
+ closedir(dir);
+ return true;
+}
+}
--- /dev/null
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 directory_api.h
+ * @author Soyoung Kim(sy037.kim@samsung.com)
+ * @version 1.0
+ * @brief directory api - header file
+ */
+#ifndef WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_
+#define WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_
+
+#include<string>
+
+namespace DirectoryApi {
+bool DirectoryCopy(std::string source, std::string dest);
+}
+
+#endif /* WRT_SRC_INSTALLER_CORE_DIRECTORY_API_H_ */
+
JobContextBase<WidgetInstallationStruct>(installerStruct),
m_exceptionCaught(Jobs::Exceptions::Success)
{
+ m_installerContext.mode = m_jobStruct.m_installMode;
ConfigureResult result = PrePareInstallation(widgetPath);
if (result == ConfigureResult::Ok) {
LogInfo("Widget Update");
m_installerContext.job->SetProgressFlag(true);
- if (m_jobStruct.m_installMode ==
- InstallMode::REINSTALL_MODE_DIRECTORY)
+ if (m_installerContext.mode.command ==
+ InstallMode::Command::REINSTALL)
{
AddTask(new TaskPrepareReinstall(m_installerContext));
}
WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
{
AddTask(new TaskUpdateFiles(m_installerContext));
+ AddTask(new TaskFileManipulation(m_installerContext));
}
AddTask(new TaskManifestFile(m_installerContext));
{
AddTask(new TaskInstallOspsvc(m_installerContext));
}
- if (m_installerContext.widgetConfig.packagingType !=
- WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
- {
- AddTask(new TaskRemoveBackupFiles(m_installerContext));
- }
+ AddTask(new TaskCertificates(m_installerContext));
AddTask(new TaskDatabase(m_installerContext));
AddTask(new TaskAceCheck(m_installerContext));
//TODO: remove widgetHandle from this task and move before database task
// by now widget handle is needed in ace check
// Any error in acecheck while update will break widget
AddTask(new TaskSmack(m_installerContext));
+ AddTask(new TaskRemoveBackupFiles(m_installerContext));
} else if (result == ConfigureResult::Deferred) {
// Installation is deferred
LogInfo("Configure installation deferred");
Try
{
std::string tempDir;
- if (m_jobStruct.m_installMode ==
- InstallMode::REINSTALL_MODE_DIRECTORY)
- {
+ if (m_installerContext.mode.extension == InstallMode::ExtensionType::DIR) {
std::ostringstream tempPathBuilder;
tempPathBuilder << WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
tempPathBuilder << WrtDB::GlobalConfig::GetTmpDirPath();
} else {
tempDir =
Jobs::WidgetInstall::createTempPath(
- m_jobStruct.m_installMode ==
- InstallMode::INSTALL_MODE_PRELOAD);
+ m_installerContext.mode.rootPath ==
+ InstallMode::RootPath::RO);
}
m_isDRM = isDRMWidget(widgetPath);
tempDir,
m_installerContext.widgetConfig.packagingType,
m_isDRM,
- m_jobStruct.m_installMode ==
- InstallMode::REINSTALL_MODE_DIRECTORY);
+ m_installerContext.mode.command == InstallMode::Command::REINSTALL);
LogDebug("widget packaging type : " <<
m_installerContext.widgetConfig.packagingType.pkgType);
void JobWidgetInstall::configureWidgetLocation(const std::string & widgetPath,
const std::string& tempPath)
{
- if (m_jobStruct.m_installMode ==
- InstallMode::REINSTALL_MODE_DIRECTORY)
- {
- // replace widget path to installed path
- m_installerContext.locations =
- WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
- tzPkgid),
- widgetPath, tempPath,
- m_installerContext.widgetConfig.packagingType,
- m_installerContext.locationType);
- } else {
- m_installerContext.locations =
- WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
- tzPkgid),
- widgetPath, tempPath,
- m_installerContext.widgetConfig.packagingType,
- m_installerContext.locationType);
- }
+ m_installerContext.locations =
+ WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
+ tzPkgid),
+ widgetPath, tempPath,
+ m_installerContext.widgetConfig.packagingType,
+ m_installerContext.mode.rootPath ==
+ InstallMode::RootPath::RO);
m_installerContext.locations->registerAppid(
DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid));
ConfigureResult JobWidgetInstall::checkWidgetUpdate(
const WidgetUpdateInfo &update)
{
- LogInfo("incoming version = '" << update.incomingVersion);
- LogInfo("Tizen AppID = " << update.tzAppId);
-
if (update.existingVersion.IsNull() || update.incomingVersion.IsNull()) {
return ConfigureResult::Failed;
}
+ LogInfo("existing version = '" << update.existingVersion);
+ LogInfo("incoming version = '" << update.incomingVersion);
+ LogInfo("Tizen AppID = " << update.tzAppId);
+
// Check running state
bool isRunning = false;
int ret =
m_installerContext.widgetConfig.tzAppid = update.tzAppId;
- if (isUpperVersion(update.existingVersion, update.incomingVersion) ||
- (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY) ||
- (m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY))
- {
- LogInfo("Whether widget policy allow proceed ok");
+ if (!!update.existingVersion ||
+ m_installerContext.mode.extension ==
+ InstallMode::ExtensionType::DIR) {
return ConfigureResult::Updated;
- } else {
- return ConfigureResult::Failed_LowerVersion;
}
return ConfigureResult::Failed;
}
-bool JobWidgetInstall::isUpperVersion(
- const OptionalWidgetVersion &existingVersion,
- const OptionalWidgetVersion &incomingVersion)
-{
- LogInfo("Existing version = '" << *existingVersion);
- LogInfo("Incoming version = '" << *incomingVersion);
-
- if (!existingVersion && !incomingVersion) {
- return false;
- } else if (!existingVersion && !!incomingVersion) {
- return false;
- } else if (!!existingVersion && !incomingVersion) {
- return true;
- } else {
- if (!existingVersion->IsWac() || !incomingVersion->IsWac()) {
- return false;
- } else {
- if (*incomingVersion == *existingVersion) {
- return false;
- } else if (*incomingVersion > *existingVersion) {
- return true;
- } else {
- return false;
- }
- }
- }
-}
-
ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
const std::string &widgetSource,
const std::string &tempPath,
const std::string &tempPath)
{
// Check installation type (direcotory/ or config.xml or widget.wgt)
- if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY ||
- m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY)
- {
+ if (m_installerContext.mode.extension == InstallMode::ExtensionType::DIR) {
LogDebug("Install directly from directory");
return PKG_TYPE_DIRECTORY_WEB_APP;
}
}
void JobWidgetInstall::setInstallLocationType(
- const
- WrtDB::ConfigParserData &
- configData)
+ const WrtDB::ConfigParserData & configData)
{
m_installerContext.locationType = INSTALL_LOCATION_TYPE_NOMAL;
-
- if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_PRELOAD) {
- m_installerContext.locationType =
- INSTALL_LOCATION_TYPE_PRELOAD;
- } else {
- FOREACH(it, configData.settingsList)
- {
+ if (m_installerContext.mode.installTime != InstallMode::InstallTime::PRELOAD) {
+ FOREACH(it, configData.settingsList) {
if (it->m_name == SETTING_VALUE_INSTALLTOEXT_NAME &&
it->m_value ==
SETTING_VALUE_INSTALLTOEXT_PREPER_EXT)
static WidgetUpdateInfo detectWidgetUpdate(
const WrtDB::ConfigParserData &configInfo,
const WrtDB::TizenAppId &tizenId);
- bool isUpperVersion(
- const OptionalWidgetVersion &existingVersion,
- const OptionalWidgetVersion &incomingVersion);
void setTizenId(const WrtDB::ConfigParserData &configInfo);
void displayWidgetInfo();
void configureWidgetLocation(const std::string & widgetPath,
ace_policy_result_t policyResult = ACE_DENY;
//TODO: remove dao.getHandle()
- if (m_context.job->getInstallerStruct().m_installMode
- == InstallMode::INSTALL_MODE_PRELOAD)
- {
+ if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
LogDebug("This widget is prealoaded. So ace check will be skiped");
policyResult = ACE_PERMIT;
} else {
if (m_context.featureLogic->isRejected()) {
LogError("Installation failure. Some devCap was not accepted by ACE.");
ThrowMsg(
- Exceptions::AceCheckFailed,
+ Exceptions::PrivilegeLevelViolation,
"Instalation failure. "
"Some deviceCap was not accepted by ACE.");
}
result = validator.check(data, widgetPath);
- if (m_contextData.widgetConfig.packagingType
- == WrtDB::PKG_TYPE_DIRECTORY_WEB_APP ||
- m_contextData.job->getInstallerStruct().m_installMode
- == InstallMode::INSTALL_MODE_PRELOAD)
+ if (m_contextData.mode.installTime
+ == InstallMode::InstallTime::PRELOAD)
{
- // In directory installation mode, the validation is skipped.
-
result = WrtSignatureValidator::SIGNATURE_VERIFIED;
}
namespace WidgetInstall {
//TODO make directory like jobs common?
-std::string createTempPath(bool preload = false);
+std::string createTempPath(bool isReadOnly = false);
void createTempPath(const std::string& path);
} // WidgetInstall
} // Jobs
AddStep(&TaskDatabase::StepLiveboxDBInsert);
AddAbortStep(&TaskDatabase::StepAbortDBInsert);
+ AddAbortStep(&TaskDatabase::StepAbortAceDBInsert);
}
void TaskDatabase::StepWrtDBInsert()
{
m_handleToRemove = WidgetDAOReadOnly::getHandle(
m_context.widgetConfig.tzAppid);
+
+ std::string makeAppid =
+ DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + "." +
+ "backup";
+ m_backAppId = DPL::FromUTF8String(makeAppid);
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
ThrowMsg(Exceptions::DatabaseFailure,
"Given tizenId not found for update installation");
}
- WidgetDAO::registerOrUpdateWidget(
+
+ WidgetDAO::backupAndUpdateWidget(
+ m_backAppId,
m_context.widgetConfig.tzAppid,
m_context.widgetConfig,
m_context.wacSecurity);
WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage(
m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
vconfData[
+ WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage(
+ m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_ON;
+ vconfData[
WrtDB::VconfConfig::GetVconfKeyMemorySavingMode(
m_context.widgetConfig.tzAppid)] = WrtDB::SETTINGS_TYPE_OFF;
LogWarning("[DB Update Task] Aborting... (DB Clean)");
Try
{
- WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
+ WidgetDAO::restoreUpdateWidget(m_backAppId,
+ m_context.widgetConfig.tzAppid);
LogDebug("Cleaning DB successful!");
}
Catch(DPL::DB::SqlConnection::Exception::Base)
{
LogError("Failed to handle StepAbortDBClean!");
}
+}
+
+void TaskDatabase::StepAbortAceDBInsert()
+{
+ LogWarning("[DB Update Task] ACE DB Aborting... (DB Clean)");
ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
// Remove also old one. If it was already updated nothing wrong will happen,
if (INVALID_WIDGET_HANDLE != m_handleToRemove) {
ace_unregister_widget(static_cast<ace_widget_handle_t>(m_handle));
}
+
+ if (!AceApi::registerAceWidgetFromDB(m_handleToRemove))
+ {
+ LogError("ace database restore failed");
+ }
+ LogDebug("Ace data inserted");
}
void TaskDatabase::StepLiveboxDBInsert()
//of widget handle
WrtDB::DbWidgetHandle m_handleToRemove;
WrtDB::DbWidgetHandle m_handle;
+ WrtDB::TizenAppId m_backAppId;
void StepRegisterExternalFiles();
void StepWrtDBInsert();
void StepLiveboxDBInsert();
void StepAbortDBInsert();
+ void StepAbortAceDBInsert();
public:
TaskDatabase(InstallerContext& context);
#include <widget_install/job_widget_install.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
+#include <widget_install/directory_api.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/foreach.h>
#include <dpl/log/log.h>
m_context.locationType)
{
AddStep(&TaskFileManipulation::StepCreateDirs);
- AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
if (m_context.widgetConfig.packagingType !=
WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
{
AddStep(&TaskFileManipulation::StepRenamePath);
AddAbortStep(&TaskFileManipulation::StepAbortRenamePath);
}
+ AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
AddStep(&TaskFileManipulation::StepLinkForPreload);
} else {
LogDebug("Create resource directory");
WrtUtilMakeDir(widgetBinPath);
WrtUtilMakeDir(widgetSrcPath);
- if (m_context.job->getInstallerStruct().m_installMode
- == InstallMode::INSTALL_MODE_PRELOAD)
- {
+ if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
std::string userWidgetDir = m_context.locations->getUserDataRootDir();
WrtUtilMakeDir(userWidgetDir);
}
std::string storagePath = m_context.locations->getPrivateStorageDir();
LogDebug("Create private storage directory : " <<
m_context.locations->getPrivateStorageDir());
+
+ if (m_context.isUpdateMode) { //update
+ std::string backData = m_context.locations->getBackupPrivateDir();
+ LogDebug("copy private storage " << backData << " to " << storagePath);
+ WrtUtilMakeDir(storagePath);
+ if (!DirectoryApi::DirectoryCopy(backData, storagePath)) {
+ LogError("Failed to rename " << backData << " to " << storagePath);
+ ThrowMsg(Exceptions::BackupFailed,
+ "Error occurs copy private strage files");
+ }
+ }
changeOwnerForDirectory(storagePath);
}
void TaskFileManipulation::StepLinkForPreload()
{
- if (m_context.job->getInstallerStruct().m_installMode
- == InstallMode::INSTALL_MODE_PRELOAD)
- {
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
std::string srcDir = m_context.locations->getUserDataRootDir() +
WrtDB::GlobalConfig::GetWidgetSrcPath();
#include <unistd.h>
#include <string>
+#include <pkgmgr/pkgmgr_parser.h>
+#include <pkgmgr-info.h>
+#include <fstream>
#include <dpl/log/log.h>
#include <dpl/errno_string.h>
#include <dpl/foreach.h>
m_context(context)
{
AddStep(&TaskInstallOspsvc::StepInstallOspService);
+ AddStep(&TaskInstallOspsvc::StepUpdateManifestFile);
}
void TaskInstallOspsvc::StepInstallOspService()
InstallerContext::INSTALL_INSTALL_OSPSVC,
"Installed Osp servcie");
}
+
+void TaskInstallOspsvc::StepUpdateManifestFile()
+{
+ std::string pkgid = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
+ pkgmgrinfo_pkginfo_h handle;
+
+ int ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid.c_str(), &handle);
+ if (ret != PMINFO_R_OK) {
+ LogDebug("StepUpdateManifestFile");
+ std::ostringstream manifest_file;
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
+ manifest_file << "/usr/share/packages/"; //TODO constant with path
+ } else {
+ manifest_file << "/opt/share/packages/"; //TODO constant with path
+ }
+ manifest_file << pkgid;
+ manifest_file << ".xml";
+ LogDebug("manifest file : " << manifest_file.str());
+
+ int ret = pkgmgr_parser_parse_manifest_for_uninstallation(
+ manifest_file.str().c_str(), NULL);
+
+ if (ret != 0) {
+ LogError("Manifest parser error: " << ret);
+ }
+
+ int code = pkgmgr_parser_parse_manifest_for_installation(
+ manifest_file.str().c_str(), NULL);
+
+ if (code != 0) {
+ LogError("Manifest parser error: " << code);
+ }
+ }
+}
} //namespace WidgetInstall
} //namespace Jobs
InstallerContext &m_context;
void StepInstallOspService();
+ void StepUpdateManifestFile();
void StepAbortInstall();
// for widget update.
AddStep(&TaskManifestFile::stepBackupIconFiles);
AddStep(&TaskManifestFile::stepCopyIconFiles);
+ AddStep(&TaskManifestFile::stepCreateExecFile);
AddStep(&TaskManifestFile::stepGenerateManifest);
AddStep(&TaskManifestFile::stepParseUpgradedManifest);
AddStep(&TaskManifestFile::stepUpdateFinalize);
{
LogDebug("Backup Icon Files");
- backup_dir << m_context.locations->getPackageInstallationDir();
- backup_dir << "/" << "backup" << "/";
+ backup_dir << m_context.locations->getBackupDir() << "/";
backupIconFiles();
void TaskManifestFile::stepParseUpgradedManifest()
{
- int code = pkgmgr_parser_parse_manifest_for_upgrade(
- DPL::ToUTF8String(manifest_file).c_str(), NULL);
+ if (m_context.widgetConfig.packagingType !=
+ PKG_TYPE_HYBRID_WEB_APP)
+ {
+ int code = pkgmgr_parser_parse_manifest_for_upgrade(
+ DPL::ToUTF8String(manifest_file).c_str(), NULL);
- if (code != 0) {
- LogError("Manifest parser error: " << code);
- ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
- }
+ if (code != 0) {
+ LogError("Manifest parser error: " << code);
+ ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
+ }
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_CREATE_MANIFEST,
- "Widget Manifest Parsing Finished");
- LogDebug("Manifest parsed");
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_CREATE_MANIFEST,
+ "Widget Manifest Parsing Finished");
+ LogDebug("Manifest parsed");
+ }
}
void TaskManifestFile::commitManifest()
LogDebug("Commiting manifest file : " << manifest_file);
std::ostringstream destFile;
- if (m_context.job->getInstallerStruct().m_installMode
- == InstallMode::INSTALL_MODE_PRELOAD)
- {
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
destFile << "/usr/share/packages" << "/"; //TODO constant with path
} else {
destFile << "/opt/share/packages" << "/"; //TODO constant with path
void verifyFile(const std::string &filePath)
{
if (access(filePath.c_str(), F_OK) != 0) {
- ThrowMsg(Exceptions::AceCheckFailed, "File is missed " << filePath);
+ ThrowMsg(Exceptions::RDSDeltaFailure, "File is missed " << filePath);
}
}
}
#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/utils/wrt_utility.h>
+#include <dpl/wrt-dao-rw/widget_dao.h>
#include <widget_install/job_widget_install.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
DPL::TaskDecl<TaskRemoveBackupFiles>(this),
m_context(context)
{
- AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles);
+ if (m_context.widgetConfig.packagingType !=
+ WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
+ {
+ AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles);
+ }
+ AddStep(&TaskRemoveBackupFiles::StepDeleteBackupDB);
}
void TaskRemoveBackupFiles::StepRemoveBackupFiles()
LogDebug("Success to remove temp directory : " << tmp);
} else {
LogError("Failed to remove temp directory : " << tmp);
- ThrowMsg(Exceptions::RemoveBackupFailed,
- "Error occurs during removing existing folder");
}
+}
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_REMOVE_BACKUP_FILE,
- "Backup widget file delete Finished");
+void TaskRemoveBackupFiles::StepDeleteBackupDB()
+{
+ LogDebug("StepDeleteBackupDB");
+ std::string oldAppid =
+ DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + ".backup";
+
+ Try
+ {
+ WidgetDAO::unregisterWidget(DPL::FromUTF8String(oldAppid));
+ }
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ LogError("Fail to delete old version db information");
+ }
}
+
} //namespace WidgetInstall
} //namespace Jobs
InstallerContext& m_context;
void StepRemoveBackupFiles();
+ void StepDeleteBackupDB();
public:
TaskRemoveBackupFiles(InstallerContext& context);
namespace {
const int MAX_BUF_SIZE = 128;
+#ifdef WRT_SMACK_ENABLED
const char* SMACK_RULE_STR = "/usr/bin/smackload-app.sh";
+#endif
}
namespace Jobs {
const char* perm_list[0];
perm_list[0] = NULL;
#endif
- if (m_context.job->getInstallerStruct().m_installMode
- != InstallMode::INSTALL_MODE_PRELOAD)
- {
+ if (m_context.mode.installTime != InstallMode::InstallTime::PRELOAD) {
int result = app_add_permissions(
DPL::ToUTF8String(tzPkgid).c_str(), perm_list);
if (PC_OPERATION_SUCCESS != result) {
#endif
}
-void TaskSmack::SetEndofInstallation()
+void TaskSmack::SetEndofInstallation()
{
m_context.job->UpdateProgress(
InstallerContext::INSTALL_END,
#include <widget_install/widget_install_context.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/job_widget_install.h>
+#include <widget_install/directory_api.h>
#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/exception.h>
DPL::TaskDecl<TaskUpdateFiles>(this),
m_context(context)
{
- AddStep(&TaskUpdateFiles::StepCreateBackupFolder);
- AddStep(&TaskUpdateFiles::StepResourceFilesBackup);
- AddStep(&TaskUpdateFiles::StepExecFileBackup);
+ AddStep(&TaskUpdateFiles::StepBackupDirectory);
- AddAbortStep(&TaskUpdateFiles::StepAbortCreateBackupFolder);
- AddAbortStep(&TaskUpdateFiles::StepAbortExecFileBackup);
- AddAbortStep(&TaskUpdateFiles::StepAbortResourceFilesBackup);
+ AddAbortStep(&TaskUpdateFiles::StepAbortBackupDirectory);
}
-void TaskUpdateFiles::StepCreateBackupFolder()
+void TaskUpdateFiles::StepBackupDirectory()
{
LogDebug("StepCreateBackupFolder");
- std::string srcBuPath = m_context.locations->getBackupSourceDir();
- LogDebug("backup resource directory path : " << srcBuPath);
- if (!WrtUtilMakeDir(srcBuPath)) {
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during create \
- backup directory.");
- }
-
- std::string binBuPath = m_context.locations->getBackupBinaryDir();
- LogDebug("backup execution directory path : " << binBuPath);
- if (!WrtUtilMakeDir(binBuPath)) {
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during create backup \
- directory.");
- }
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_CREATE_BACKUP_DIR,
- "Backup directory created for update");
-}
-
-void TaskUpdateFiles::ReadDirList(std::string dirPath, ExistFileList &list,
- size_t subLen)
-{
- DIR* pkgDir = opendir(dirPath.c_str());
- if (!pkgDir) {
- LogError("Package directory " << dirPath << " doesn't exist");
- ThrowMsg(Exceptions::BackupFailed,
- "Error occurs during read \
- directory");
- }
-
- struct stat statInfo;
- struct dirent dirent;
- struct dirent *result;
- int return_code;
- errno = 0;
- for (return_code = readdir_r(pkgDir, &dirent, &result);
- result != NULL && return_code == 0;
- return_code = readdir_r(pkgDir, &dirent, &result))
- {
- std::string dirName = dirent.d_name;
- std::string absFileName = dirPath + "/" + dirName;
- if (stat(absFileName.c_str(), &statInfo) != 0) {
- ThrowMsg(Exceptions::BackupFailed, "Error occurs read file");
- }
-
- if (S_ISDIR(statInfo.st_mode)) {
- if (strcmp(dirent.d_name, ".") == 0 || strcmp(dirent.d_name,
- "..") == 0)
- {
- continue;
- }
- ReadDirList(absFileName, list, subLen);
- }
-
- list.insert(absFileName.substr(subLen));
- }
- if (return_code != 0 || errno != 0) {
- LogError("readdir_r() failed with " << DPL::GetErrnoString());
- }
- errno = 0;
- //closing the directory
- if (-1 == TEMP_FAILURE_RETRY(closedir(pkgDir))) {
- LogError("Failed to close dir: " << dirPath << " with error: "
- << DPL::GetErrnoString());
- }
-}
-
-void TaskUpdateFiles::StepResourceFilesBackup()
-{
- LogDebug("StepCopyFiles");
-
- ExistFileList resList;
- ExistFileList tempList;
-
- std::string pkgSrc = m_context.locations->getSourceDir();
- ReadDirList(pkgSrc, resList, strlen(pkgSrc.c_str()) + 1);
-
- std::string tempSrc = m_context.locations->getTemporaryPackageDir();
- ReadDirList(tempSrc, tempList, strlen(tempSrc.c_str()) + 1);
-
- FOREACH(it, tempList) {
- std::set<std::string>::iterator res;
- res = resList.find(*it);
- std::string resFile = pkgSrc + "/" + (*it);
- std::string newFile = tempSrc + "/" + (*it);
-
- if (res != resList.end()) {
- std::string backupFile =
- m_context.locations->getBackupSourceDir() +
- "/" + (*it);
-
- struct stat sInfo;
- if (stat(resFile.c_str(), &sInfo) != 0) {
- ThrowMsg(Exceptions::BackupFailed, "Error occurs read file");
- }
-
- if (S_ISDIR(sInfo.st_mode)) {
- LogDebug(resFile << " is a directory. so create a folder : " <<
- backupFile);
- WrtUtilMakeDir(backupFile);
- } else {
- if ((rename(resFile.c_str(), backupFile.c_str())) != 0) {
- LogError(
- "Failed to rename " << resFile << " to " <<
- backupFile);
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during \
- rename file");
- }
-
- LogDebug("backup : " << resFile << " to " << backupFile);
+ std::string backPath = m_context.locations->getBackupDir();
+ LogDebug("backup resource directory path : " << backPath);
+ std::string pkgPath = m_context.locations->getPackageInstallationDir();
- if ((rename(newFile.c_str(), resFile.c_str())) != 0) {
- LogError(
- "Failed to rename " << newFile << " to " << resFile);
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during \
- rename file");
- }
- LogDebug("copy : " << newFile << " to " << resFile);
- }
- resList.erase(res);
- } else {
- if ((rename(newFile.c_str(), resFile.c_str())) != 0) {
- LogError("Failed to rename " << newFile << " to " << resFile);
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during \
- rename file");
- }
- LogDebug("only copy : " << newFile << " to " << resFile);
- }
- }
-
- if (resList.empty() != 0) {
- FOREACH(remain, resList) {
- std::string pkgFile = pkgSrc + "/" + (*remain);
- std::string backFile = tempSrc + "/" + (*remain);
- if ((rename(pkgFile.c_str(), backFile.c_str())) != 0) {
- LogError("Failed to backup : " << pkgFile << " to " << backFile);
- ThrowMsg(
- Exceptions::BackupFailed,
- "Error occurs during \
- rename file");
- }
- LogDebug("only backup : " << pkgFile << " to " << backFile);
- }
- }
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_BACKUP_RES_FILES,
- "Backup resource file for update");
-}
-
-void TaskUpdateFiles::StepExecFileBackup()
-{
- std::string execFile = m_context.locations->getExecFile();
-
- LogDebug(" source : " << execFile);
-
- std::string tempSource = m_context.locations->getBackupExecFile();
- LogDebug(" source : " << tempSource);
-
- if ((rename(execFile.c_str(), tempSource.c_str())) != 0) {
- LogError("Failed to rename " << execFile << " to " <<
- tempSource);
+ LogDebug("copy : " << pkgPath << " to " << backPath);
+ if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {
+ LogError("Failed to rename " << pkgPath << " to " << backPath);
ThrowMsg(Exceptions::BackupFailed,
- "Error occurs during \
- rename file");
+ "Error occurs during rename file");
}
- LogDebug("Backup : " << execFile << " to " << tempSource);
- std::string clientPath = GlobalConfig::GetWrtClientExec();
+ WrtUtilMakeDir(pkgPath);
- LogInfo("link -s " << clientPath << " " << execFile);
-
- errno = 0;
- if( symlink(clientPath.c_str(), execFile.c_str()) != 0 )
- {
- int error = errno;
- if(error)
- LogPedantic("Failed to make a symbolic name for a file "
- << "[" << DPL::GetErrnoString(error) << "]");
- ThrowMsg(Exceptions::BackupFailed,
- "Error occurs during rename file");
- }
m_context.job->UpdateProgress(
- InstallerContext::INSTALL_BACKUP_EXEC,
- "Backup execution file for update");
+ InstallerContext::INSTALL_CREATE_BACKUP_DIR,
+ "Backup directory created for update");
}
-void TaskUpdateFiles::StepAbortResourceFilesBackup()
+void TaskUpdateFiles::StepAbortBackupDirectory()
{
LogDebug("StepAbortCopyFiles");
- std::string srcPath = m_context.locations->getSourceDir();
- std::string srcBuPath = m_context.locations->getBackupSourceDir();
-
- LogDebug("Backup Folder " << srcBuPath << " to " << srcPath);
-
- if (!WrtUtilRemove(srcPath)) {
- LogError("Failed to remove " << srcPath);
- }
-
- if (rename(srcBuPath.c_str(), srcPath.c_str()) != 0) {
- LogError("Failed to rename " << srcBuPath << " to " << srcPath);
- }
-}
-void TaskUpdateFiles::StepAbortExecFileBackup()
-{
- LogDebug("StepAbortExecFileBackup");
- std::string binPath = m_context.locations->getBinaryDir();
+ std::string backPath = m_context.locations->getBackupDir();
+ std::string pkgPath = m_context.locations->getPackageInstallationDir();
- if (!WrtUtilRemove(binPath)) {
- LogError("Failed to remove " << binPath);
- }
+ LogDebug("Backup Folder " << backPath << " to " << pkgPath);
- std::string binBuPath = m_context.locations->getBackupBinaryDir();
- if (rename(binBuPath.c_str(), binPath.c_str()) != 0) {
- LogError("Failed to rename " << binBuPath << " to " << binPath);
+ if (!WrtUtilRemove(pkgPath)) {
+ LogError("Failed to remove " << pkgPath);
}
- LogDebug("Backup Folder " << binBuPath << "move to " << binPath);
-}
-
-void TaskUpdateFiles::StepAbortCreateBackupFolder()
-{
- LogDebug("StepAbortCreateBackupFolder");
- std::ostringstream path;
- path << m_context.locations->getBackupDir();
- LogDebug("Remove backup directory : " << path.str());
- if (!WrtUtilRemove(path.str())) {
- LogError("Failed to remove " << path);
+ if (rename(backPath.c_str(), pkgPath.c_str()) != 0) {
+ LogError("Failed to rename " << backPath << " to " << pkgPath);
}
}
} //namespace WidgetInstall
private:
InstallerContext& m_context;
- /* TODO : md5 check */
- void StepCreateBackupFolder();
- void StepResourceFilesBackup();
- void StepExecFileBackup();
+ void StepBackupDirectory();
- void ReadDirList(std::string dirPath, ExistFileList &list, size_t subLen);
-
- void StepAbortResourceFilesBackup();
- void StepAbortCreateBackupFolder();
- void StepAbortExecFileBackup();
+ void StepAbortBackupDirectory();
public:
TaskUpdateFiles(InstallerContext& context);
#include <feature_logic.h>
#include <widget_install/widget_update_info.h>
#include <widget_location.h>
+#include <wrt_install_mode.h>
namespace Jobs {
namespace WidgetInstall {
std::string installInfo; ///<For recovery>
InstallLocationType locationType;
bool isUpdateMode;
+ InstallMode mode;
};
#endif // INSTALLER_CONTEXT_H
DECLARE_JOB_EXCEPTION(Base, AceCheckFailed, ErrorAceCheckFailed)
DECLARE_JOB_EXCEPTION(Base, EncryptionFailed, ErrorEncryptionFailed)
DECLARE_JOB_EXCEPTION(Base, InstallOspsvcFailed, ErrorInstallOspServcie)
+DECLARE_JOB_EXCEPTION(Base, PrivilegeLevelViolation, ErrorPrivilegeLevelViolation)
} //namespace
} //namespace
} //namespace
#include <job_base.h>
#include <job.h>
#include <widget_install/widget_install_errors.h>
+#include <wrt_install_mode.h>
#include <wrt_common_types.h>
#include <pkgmgr_signal_interface.h>
#include <memory>
ProgressPercent percent,
const ProgressDescription &);
-namespace InstallMode {
-enum Type
-{
- WRONG_INSTALL_MODE = -1,
- INSTALL_MODE_WGT,
- INSTALL_MODE_DIRECTORY,
- INSTALL_MODE_PRELOAD,
- REINSTALL_MODE_DIRECTORY
-};
-}
-
//TODO into namespace
//InstallationStruct
typedef Jobs::JobCallbacksBase<InstallerFinishedCallback,
//Widget Installation Struct
struct WidgetInstallationStruct : public WidgetInstallCallbackBase
{
- InstallMode::Type m_installMode;
+ InstallMode m_installMode;
std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrInterface;
// It must be empty-constructible as a parameter of generic event
- WidgetInstallationStruct() :
- m_installMode(InstallMode::Type::INSTALL_MODE_WGT)
- {}
-
+ WidgetInstallationStruct() {};
WidgetInstallationStruct(
InstallerFinishedCallback finished,
InstallerProgressCallback progress,
void *param,
- InstallMode::Type mode,
+ InstallMode mode,
std::shared_ptr<PackageManager::IPkgmgrSignal>
_pkgmgrInterface
) :
#include <dpl/log/log.h>
#include <dpl/sstream.h>
#include <dpl/localization/localization_utils.h>
-
#include <widget_install/task_commons.h>
-WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isPreload) :
- m_dirpath(Jobs::WidgetInstall::createTempPath(isPreload))
+WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isReadOnly) :
+ m_dirpath(Jobs::WidgetInstall::createTempPath(isReadOnly))
{}
WidgetLocation::DirectoryDeletor::DirectoryDeletor(std::string tempPath) :
WidgetLocation::WidgetLocation(const std::string & widgetname,
std::string sourcePath,
WrtDB::PackagingType t,
- InstallLocationType locationType) :
+ bool isReadonly) :
m_pkgid(widgetname),
m_widgetSource(sourcePath),
m_type(t),
m_temp(
- new WidgetLocation::DirectoryDeletor(
- INSTALL_LOCATION_TYPE_PRELOAD == locationType))
+ new WidgetLocation::DirectoryDeletor(isReadonly))
{
- if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
+ if (isReadonly) {
m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
std::string sourcePath,
std::string dirPath,
WrtDB::PackagingType t,
- InstallLocationType locationType) :
+ bool isReadonly) :
m_pkgid(widgetname),
m_widgetSource(sourcePath),
m_type(t),
- m_temp(new
- WidgetLocation::DirectoryDeletor(dirPath))
+ m_temp(new WidgetLocation::DirectoryDeletor(dirPath))
{
- if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
+ if (isReadonly) {
m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
std::string WidgetLocation::getBackupDir() const
{
- return getPackageInstallationDir() + "/backup";
+ return getPackageInstallationDir() + ".backup";
}
std::string WidgetLocation::getBackupSourceDir() const
return getBackupBinaryDir() + "/" + m_appid;
}
+std::string WidgetLocation::getBackupPrivateDir() const
+{
+ return getBackupDir() + "/" +
+ WrtDB::GlobalConfig::GetWidgetPrivateStoragePath();
+}
+
std::string WidgetLocation::getUserDataRootDir() const
{
return std::string(WrtDB::GlobalConfig::GetWidgetUserDataPath()) +
*/
WidgetLocation(const std::string & widgetname, std::string sourcePath,
WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP,
- InstallLocationType ltype =
- INSTALL_LOCATION_TYPE_NOMAL);
+ bool isReadonly = false);
WidgetLocation(const std::string & widgetname, std::string sourcePath,
std::string dirPath,
WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP,
- InstallLocationType ltype =
- INSTALL_LOCATION_TYPE_NOMAL);
+ bool isReadonly = false);
~WidgetLocation();
std::string getBinaryDir() const; // /opt/apps/[package]/bin or /usr/apps/[package]/bin
std::string getUserBinaryDir() const; // /opt/apps/[package]/bin
std::string getExecFile() const; // /opt/apps/[package]/bin/[package]
- std::string getBackupDir() const; // /opt/apps/[package]/backup
- std::string getBackupSourceDir() const; // /opt/apps/[pkg]/backup/res/wgt
- std::string getBackupBinaryDir() const; // /opt/apps/[pkg]/backup/bin
- std::string getBackupExecFile() const; // /opt/apps/[pkg]/backup/bin/[pkg]
+ std::string getBackupDir() const; // /opt/apps/[package].backup
+ std::string getBackupSourceDir() const; // /opt/apps/[pkg].backup/res/wgt
+ std::string getBackupBinaryDir() const; // /opt/apps/[pkg].backup/bin
+ std::string getBackupExecFile() const; // /opt/apps/[pkg].backup/bin/[pkg]
+ std::string getBackupPrivateDir() const; // /opt/apps/[pkg].backup/data
std::string getUserDataRootDir() const; // /opt/usr/apps/[package]
std::string getPrivateStorageDir() const; // /opt/usr/apps/[package]/data
PKG_VALUE_STRING_LEN_MAX - 1);
}
- GList *privilege_list = pkg_detail_info->privilege_list;
+ pkg_detail_info->privilege_list = NULL;
FOREACH(it, configInfo.featuresList) {
std::string featureInfo = DPL::ToUTF8String(it->name);
LogDebug("privilege : " << featureInfo);
int length = featureInfo.size();
char *privilege = (char*) calloc(1, (sizeof(char) * (length + 1)));
snprintf(privilege, length + 1, "%s", featureInfo.c_str());
- privilege_list = g_list_append(privilege_list, &privilege);
+ pkg_detail_info->privilege_list =
+ g_list_append(pkg_detail_info->privilege_list, privilege);
}
std::string icon_name;
LogError("Failed to get package detail info ");
return NULL;
}
- return &pkg_detail_info;
+ return reinterpret_cast<pkgmgr_info*>(pkg_detail_info);
}
__attribute__ ((visibility("default")))
errorStatus = WRT_INSTALLER_ERROR_PACKAGE_NOT_FOUND;
break;
+ case Jobs::Exceptions::ErrorPackageInvalid:
+ errorStatus = WRT_INSTALLER_ERROR_PACKAGE_INVALID;
+ break;
+
case Jobs::Exceptions::ErrorPackageLowerVersion:
errorStatus = WRT_INSTALLER_ERROR_PACKAGE_LOWER_VERSION;
break;
+ case Jobs::Exceptions::ErrorPackageExecutableNotFound:
+ errorStatus = WRT_INSTALLER_ERROR_PACKAGE_EXCUTABLE_NOT_FOUND;
+ break;
+
case Jobs::Exceptions::ErrorManifestNotFound:
errorStatus = WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND;
break;
errorStatus = WRT_INSTALLER_ERROR_INVALID_PRIVILEGE;
break;
+ case Jobs::Exceptions::ErrorPrivilegeLevelViolation:
+ errorStatus = WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION;
+ break;
+
case Jobs::Exceptions::ErrorMenuIconNotFound:
errorStatus = WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND;
break;
errorStatus = WRT_INSTALLER_ERROR_OUT_OF_MEMORY;
break;
+ case Jobs::Exceptions::ErrorArgumentInvalid:
+ errorStatus = WRT_INSTALLER_ERROR_ARGUMENT_INVALID;
+ break;
+
case Jobs::Exceptions::ErrorPackageAlreadyInstalled:
errorStatus = WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED;
break;
WrtInstaller::WrtInstaller(int argc, char **argv) :
Application(argc, argv, "backend", false),
DPL::TaskDecl<WrtInstaller>(this),
- m_installMode(WRT_INSTALL_MODE_UNKNOWN),
m_packagePath(),
m_initialized(false),
m_numPluginsToInstall(0),
struct stat info;
if (-1 != stat(m_argv[2], &info) && S_ISDIR(info.st_mode)) {
LogInfo("Installing package directly from directory");
- m_installMode = WRT_INSTALL_MODE_INSTALL_DIRECTORY;
+ m_installMode.extension = InstallMode::ExtensionType::DIR;
} else {
LogInfo("Installing from regular location");
- m_installMode = WRT_INSTALL_MODE_INSTALL_WGT;
+ m_installMode.extension = InstallMode::ExtensionType::WGT;
}
m_packagePath = m_argv[2];
return showHelpAndQuit();
}
m_packagePath = m_argv[2];
- m_installMode = WRT_INSTALL_MODE_INSTALL_PRELOAD;
+ m_installMode.installTime = InstallMode::InstallTime::PRELOAD;
+ m_installMode.rootPath = InstallMode::RootPath::RO;
+ AddStep(&WrtInstaller::installStep);
+ } else if (arg == "-ipw" || arg == "--install-preload-writable") {
+ LogDebug("Install preload web application to writable storage");
+ if (m_argc != 3) {
+ return showHelpAndQuit();
+ }
+ m_packagePath = m_argv[2];
+ m_installMode.installTime = InstallMode::InstallTime::PRELOAD;
+ m_installMode.rootPath = InstallMode::RootPath::RW;
AddStep(&WrtInstaller::installStep);
} else if (arg == "-c" || arg == "--csc-update") {
// "path=/opt/system/csc/Ozq2iEG15R-2.0.0-arm.wgt:op=install:removable=true"
if (it->second == CSCConfiguration::VALUE_INSTALL) {
LogDebug("operation = " << it->second);
- m_installMode = WRT_INSTALL_MODE_INSTALL_WGT;
+ m_installMode.extension = InstallMode::ExtensionType::WGT;
it = m_CSCconfigurationMap.find(CSCConfiguration::KEY_PATH);
if (it == m_CSCconfigurationMap.end()) {
return showHelpAndQuit();
return showHelpAndQuit();
}
LogInfo("Installing package directly from directory");
- m_installMode = WRT_INSTALL_MODE_REINSTALL;
+ m_installMode.command = InstallMode::Command::REINSTALL;
+ m_installMode.extension = InstallMode::ExtensionType::DIR;
m_packagePath = m_argv[2];
AddStep(&WrtInstaller::installStep);
} else {
struct stat info;
if (-1 != stat(m_argv[4], &info) && S_ISDIR(info.st_mode)) {
LogInfo("Installing package directly from directory");
- m_installMode = WRT_INSTALL_MODE_INSTALL_DIRECTORY;
+ m_installMode.extension = InstallMode::ExtensionType::DIR;
} else {
LogInfo("Installing from regular location");
- m_installMode = WRT_INSTALL_MODE_INSTALL_WGT;
+ m_installMode.extension = InstallMode::ExtensionType::WGT;
}
AddStep(&WrtInstaller::installStep);
break;
break;
case PKGMGR_REQ_REINSTALL:
m_packagePath = m_argv[4];
- m_installMode = WRT_INSTALL_MODE_REINSTALL;
+ m_installMode.command = InstallMode::Command::REINSTALL;
+ m_installMode.extension = InstallMode::ExtensionType::DIR;
AddStep(&WrtInstaller::installStep);
break;
default:
void WrtInstaller::OnTerminate()
{
LogDebug("Wrt Shutdown now");
- PluginUtils::unlockPluginInstallation(m_installMode ==
- WRT_INSTALL_MODE_INSTALL_PRELOAD);
+ PluginUtils::unlockPluginInstallation(
+ m_installMode.installTime == InstallMode::InstallTime::PRELOAD);
if (m_initialized) {
wrt_installer_shutdown();
}
if (m_startupPluginInstallation) {
LogInfo("Plugin installation started because new plugin package found");
- } else if (!PluginUtils::lockPluginInstallation(m_installMode ==
- WRT_INSTALL_MODE_INSTALL_PRELOAD)) {
+ } else if (!PluginUtils::lockPluginInstallation(
+ m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
+ {
LogError("Failed to open plugin installation lock file"
" Plugins are currently installed by other process");
staticWrtPluginInstallationCallback(WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED,
tizenId.c_str(), printMsg.c_str());
break;
+ case WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "privilege level violation\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
case WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND:
This->m_returnStatus = 1; //this status is specific
fprintf(stderr, "## wrt-installer : %s %s has failed - "
tizenId.c_str(), printMsg.c_str());
break;
+ case WRT_INSTALLER_ERROR_ARGUMENT_INVALID:
+ This->m_returnStatus = 1; //this status is specific
+ fprintf(stderr, "## wrt-installer : %s %s has failed - "
+ "invalid argument\n",
+ tizenId.c_str(), printMsg.c_str());
+ break;
+
case WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED:
This->m_returnStatus = 1; //this status is specific
fprintf(stderr, "## wrt-installer : %s %s has failed - "
This->m_returnStatus = 0;
resultMsg += L" : " + DPL::FromUTF8String(PKGMGR_END_SUCCESS);
- if (This->m_installMode == WRT_INSTALL_MODE_INSTALL_PRELOAD &&
- !This->m_packagePath.empty()) {
+ if (This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD &&
+ !This->m_packagePath.empty())
+ {
LogDebug("This widget is preloaded so it will be removed : "
<< This->m_packagePath);
if (!WrtUtilRemove(This->m_packagePath)) {
}
//remove lock file
- if (!PluginUtils::unlockPluginInstallation(This->m_installMode ==
- WRT_INSTALL_MODE_INSTALL_PRELOAD)) {
+ if (!PluginUtils::unlockPluginInstallation(
+ This->m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
+ {
LogInfo("Failed to remove installation lock");
}
{
LogDebug("Install new plugins");
- if (!PluginUtils::lockPluginInstallation(m_installMode ==
- WRT_INSTALL_MODE_INSTALL_PRELOAD)) {
+ if (!PluginUtils::lockPluginInstallation(
+ m_installMode.installTime == InstallMode::InstallTime::PRELOAD))
+ {
LogInfo("Lock NOT created");
return;
}
if (!PluginUtils::checkPluginInstallationRequired()) {
LogDebug("Plugin installation not required");
- PluginUtils::unlockPluginInstallation(m_installMode ==
- WRT_INSTALL_MODE_INSTALL_PRELOAD);
+ PluginUtils::unlockPluginInstallation(
+ m_installMode.installTime == InstallMode::InstallTime::PRELOAD);
return;
}
CSCConfiguration::dataPair(string.substr(0, pos),
string.substr(pos+1)));
}
- return result;
+ free(buf);
+ return result;
}
int main(int argc, char *argv[])
#include <string>
#include <map>
#include <wrt_installer_api.h>
+#include <wrt_install_mode.h>
namespace WRTInstallerNS { //anonymous
DECLARE_GENERIC_EVENT_0(QuitEvent)
// Private data
std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
- WrtInstallMode m_installMode;
+ InstallMode m_installMode;
std::string m_packagePath;
std::string m_name;
bool m_initialized;
#include <dpl/wrt-dao-ro/WrtDatabase.h>
#include <vcore/VCore.h>
#include <installer_main_thread.h>
+#include <wrt_install_mode.h>
using namespace WrtDB;
-#ifdef __cplusplus
-
-#define EXPORT_API __attribute__((visibility("default")))
-extern "C"
-{
-#endif
-inline InstallMode::Type translateInstallMode(
- WrtInstallMode installMode)
-{
- if (WRT_INSTALL_MODE_INSTALL_WGT == installMode) {
- return InstallMode::INSTALL_MODE_WGT;
- } else if (WRT_INSTALL_MODE_INSTALL_DIRECTORY == installMode) {
- return InstallMode::INSTALL_MODE_DIRECTORY;
- } else if (WRT_INSTALL_MODE_INSTALL_PRELOAD == installMode) {
- return InstallMode::INSTALL_MODE_PRELOAD;
- } else if (WRT_INSTALL_MODE_REINSTALL == installMode) {
- return InstallMode::REINSTALL_MODE_DIRECTORY;
- }
- Assert(true && "wrong argument is inputed");
- return InstallMode::WRONG_INSTALL_MODE;
-}
-
static std::string cutOffFileName(const std::string& path)
{
size_t found = path.find_last_of("/");
return if_ok;
}
-EXPORT_API void wrt_installer_init(void *userdata,
+void wrt_installer_init(void *userdata,
WrtInstallerInitCallback callback)
{
// Set DPL/LOG MID
return;
}
-EXPORT_API void wrt_installer_shutdown()
+void wrt_installer_shutdown()
{
try {
LogInfo("[WRT-API] DEINITIALIZING WRT INSTALLER...");
}
}
-EXPORT_API void wrt_install_widget(
+void wrt_install_widget(
const char *path,
void* userdata,
WrtInstallerStatusCallback status_cb,
WrtProgressCallback progress_cb,
- WrtInstallMode installMode,
+ InstallMode installMode,
std::shared_ptr<PackageManager::
IPkgmgrSignal> pkgmgrInterface
)
{
UNHANDLED_EXCEPTION_HANDLER_BEGIN
{
- if ( WRT_INSTALL_MODE_INSTALL_PRELOAD == installMode) {
+ if (InstallMode::InstallTime::PRELOAD == installMode.installTime) {
DPL::Log::OldStyleLogProvider *oldStyleProvider =
new DPL::Log::OldStyleLogProvider(false, false, false, true,
false, true);
InstallerCallbacksTranslate::installProgressCallback,
new InstallerCallbacksTranslate::StatusCallbackStruct(
userdata, status_cb, progress_cb),
- translateInstallMode(installMode),
+ installMode,
pkgmgrInterface)));
}
UNHANDLED_EXCEPTION_HANDLER_END
}
-EXPORT_API void wrt_uninstall_widget(
+void wrt_uninstall_widget(
const char * const tzAppid,
void* userdata,
WrtInstallerStatusCallback status_cb,
UNHANDLED_EXCEPTION_HANDLER_END
}
-EXPORT_API void wrt_install_plugin(
+void wrt_install_plugin(
const char *pluginDir,
void *user_param,
WrtPluginInstallerStatusCallback status_cb,
}
UNHANDLED_EXCEPTION_HANDLER_END
}
-
-#ifdef __cplusplus
-}
-#endif
#include <stdbool.h>
#include <stddef.h>
#include <wrt_type.h>
+#include <wrt_install_mode.h>
#include <pkgmgr_signal_interface.h>
#include <memory>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef void (*WrtInstallerInitCallback)(WrtErrStatus status,
void *data);
typedef void (*WrtPluginInstallerStatusCallback)(WrtErrStatus status,
const char *description,
void *data);
-enum WrtInstallMode
-{
- WRT_INSTALL_MODE_UNKNOWN = 0,
- WRT_INSTALL_MODE_INSTALL_WGT,
- WRT_INSTALL_MODE_INSTALL_DIRECTORY,
- WRT_INSTALL_MODE_INSTALL_PRELOAD,
- WRT_INSTALL_MODE_REINSTALL
-};
-
void wrt_installer_init(
void *userdata,
WrtInstallerInitCallback callback);
void *user_parameter,
WrtInstallerStatusCallback status_callback,
WrtProgressCallback progress_callback,
- WrtInstallMode install_mode,
+ InstallMode install_mode,
std::shared_ptr<PackageManager::IPkgmgrSignal>
pkgmgrInterface
);
WrtPluginInstallerStatusCallback statusCallback,
WrtProgressCallback progressCallback);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* WRT_INSTALLER_API_H_ */
WRT_INSTALLER_ERROR_PACKAGE_NOT_FOUND, ///<
WRT_INSTALLER_ERROR_PACKAGE_INVALID, ///< invalid widget package
WRT_INSTALLER_ERROR_PACKAGE_LOWER_VERSION, ///< given version is lower than existing version
- WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND, ///<
+ WRT_INSTALLER_ERROR_PACKAGE_EXCUTABLE_NOT_FOUND,
+
+ WRT_INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11,///<
WRT_INSTALLER_ERROR_MANIFEST_INVALID, ///<
WRT_INSTALLER_CONFIG_NOT_FOUND, ///< couldn't find config.xml
///< in package.
WRT_INSTALLER_ERROR_CONFIG_INVALID, ///< invalid config.xml
- WRT_INSTALLER_ERROR_SIGNATURE_NOT_FOUND, ///< signature file not exist.
- WRT_INSTALLER_ERROR_SIGNATURE_INVALID, ///< invalid signature file
- WRT_INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED, ///< failure in verificate
- ///< signature
- WRT_INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND, ///< couldn't find root certificate.
- WRT_INSTALLER_ERROR_CERTIFICATION_INVAID, ///< invalid certification
- WRT_INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, ///< failure in verificate
- ///< certification chain.
- WRT_INSTALLER_ERROR_CERTIFICATE_EXPIRED, ///< expire cerification.
- WRT_INSTALLER_ERROR_INVALID_PRIVILEGE, ///< invalid privilege.
- WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND, ///<
- WRT_INSTALLER_ERROR_FATAL_ERROR, ///< failure in db operation or file opertion..
- WRT_INSTALLER_ERROR_OUT_OF_STORAGE, ///< failure in shortage of memory
- WRT_INSTALLER_ERROR_OUT_OF_MEMORY, ///< failure in shortage of RAM
+
+ WRT_INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21, ///< signature file not exist.
+ WRT_INSTALLER_ERROR_SIGNATURE_INVALID, ///< invalid signature file
+ WRT_INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED, ///< failure in verificate signature
+ WRT_INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31, ///< couldn't find root certificate.
+ WRT_INSTALLER_ERROR_CERTIFICATION_INVAID, ///< invalid certification
+ WRT_INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED, ///< failure in verificate certification chain.
+ WRT_INSTALLER_ERROR_CERTIFICATE_EXPIRED, ///< expire cerification.
+
+ WRT_INSTALLER_ERROR_INVALID_PRIVILEGE = 41, ///< invalid privilege.
+ WRT_INSTALLER_ERROR_PRIVILEGE_LEVEL_VIOLATION,
+
+ WRT_INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51, ///<
+
+ WRT_INSTALLER_ERROR_FATAL_ERROR = 61, ///< failure in db operation or file opertion..
+ WRT_INSTALLER_ERROR_OUT_OF_STORAGE, ///< failure in shortage of memory
+ WRT_INSTALLER_ERROR_OUT_OF_MEMORY, ///< failure in shortage of RAM
+ WRT_INSTALLER_ERROR_ARGUMENT_INVALID,
/* wrt-installer error */
/* 121-140 : reserved for Web installer */
/* installation */
WRT_INSTALLER_ERROR_PACKAGE_ALREADY_INSTALLED = 121,
WRT_INSTALLER_ERROR_ACE_CHECK_FAILED,
- WRT_INSTALLER_ERROR_MANIFEST_CREATE_FAILED, ///<
- WRT_INSTALLER_ERROR_ENCRYPTION_FAILED, ///< Failure in reousrce encrypttion
- WRT_INSTALLER_ERROR_INSTALL_OSP_SERVCIE, ///< Failure in installing osp service
+ WRT_INSTALLER_ERROR_MANIFEST_CREATE_FAILED, ///<
+ WRT_INSTALLER_ERROR_ENCRYPTION_FAILED, ///< Failure in reousrce encrypttion
+ WRT_INSTALLER_ERROR_INSTALL_OSP_SERVCIE, ///< Failure in installing osp service
WRT_INSTALLER_ERROR_PLUGIN_INSTALLATION_FAILED,
WRT_INSTALLER_ERROR_UNINSTALLATION_FAILED,
- WRT_INSTALLER_ERROR_UNKNOWN, ///< do not use this error code.
+ WRT_INSTALLER_ERROR_UNKNOWN = 140, ///< do not use this error code.
} WrtErrStatus;
${CMAKE_CURRENT_SOURCE_DIR}/BackgroundPageTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NonRootUserTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/NPluginsInstallTests.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/ParsingTizenAppserviceTests.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/ParsingTizenAppcontrolTests.cpp
)
SET(INSTALLER_TESTS_TARGET "wrt-installer-tests-general")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_2.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_3.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_4.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/appservice_dispos.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/app-control.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
const std::string params = "DPL_USE_OLD_STYLE_LOGS=0 "
"DPL_USE_OLD_STYLE_PEDANTIC_LOGS=0 WRT_TEST_MODE=1 ";
-const std::string installCmd = params + "wrt-installer -if ";
+const std::string installCmd = params + "wrt-installer -i ";
const std::string uninstallCmd = params + "wrt-installer -un ";
-const std::string uninstallByGuidCmd = params + "wrt-installer -ug \"";
const std::string redirection = " 2>&1";
const std::string INSTALLER_MESSAGE_ID_LINE =
"## wrt-installer : %s installation was successful.\n";
+const std::string INSTALLER_MESSAGE_ID_LINE_FAIL =
+ "## wrt-installer : %s installation has failed - package already installed";
const std::string INSTALLER_MESSSGE_START = "## wrt-installer : ";
std::string getAndCutInstallerLogLine(std::string &src)
if (!WIFEXITED(err)) {
return OtherError;
}
+
+ char* id = NULL;
+ std::string line;
+
if (0 != WEXITSTATUS(err)) {
+ while ((line = getAndCutInstallerLogLine(msg)) != "")
+ {
+ if(line.find("failed") != std::string::npos)
+ {
+ id = new char[line.length()];
+ int nr = sscanf(line.c_str(), INSTALLER_MESSAGE_ID_LINE_FAIL.c_str(), id);
+ if (1 != nr)
+ {
+ LogWarning("Can not read widget ID from message: " << line);
+ delete[] id;
+ return OtherError;
+ }
+ tizenId = id;
+ delete[] id;
+ }
+ }
+
if (1 == WEXITSTATUS(err)) {
return WrongWidgetPackage;
}
return OtherError;
}
- char* id = NULL;
- std::string line;
-
while ((line = getAndCutInstallerLogLine(msg)) != "")
{
if (line.find("successful") != std::string::npos)
return (system(cmd.c_str()) == EXIT_SUCCESS);
}
-bool uninstallByGuid(const std::string& guid)
-{
- std::string cmd = uninstallByGuidCmd + guid + "\" > /dev/null 2>/dev/null";
- LogDebug("executing: " << cmd);
- return (system(cmd.c_str()) == EXIT_SUCCESS);
-}
-
bool sigintWrtClients()
{
return (system("pkill -2 wrt-client") == 0);
std::string& tizenId,
const std::string& user = "");
bool uninstall(const std::string& tizenId);
-bool uninstallByGuid(const std::string& guid);
/**
* @brief killWrtClients kills processes that matches 'wrt-client'
* @return True if any client was killed
#include <dpl/test/test_runner.h>
#include <InstallerWrapper.h>
#include <ManifestFile.h>
+#include <dpl/log/log.h>
using namespace InstallerWrapper;
*/
RUNNER_TEST(creatingManifestFile)
{
- const char * manifestPath = "/opt/share/packages/manifest01.xml";
+ std::string manifestPath = "/opt/share/packages/";
/* This widget removal should stay here in case previous test run failed
* (so widget has not been uninstalled) */
- uninstallByGuid("http://test.samsung.com/widget/manifestTest");
std::string tizenId;
- RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
- == InstallerWrapper::Success);
- RUNNER_ASSERT(WrtUtilFileExists(manifestPath));
+
+ if(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
+ != InstallerWrapper::Success)
+ {
+ uninstall(tizenId);
+ RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/manifest.wgt", tizenId)
+ == InstallerWrapper::Success);
+ }
+
+ RUNNER_ASSERT(WrtUtilFileExists(manifestPath.append(tizenId.substr(0,10)).append(".xml")));
ManifestFile mf(manifestPath);
Try
{
+ LogDebug("Package " << mf.getValueByXpath("/p:manifest/@package"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@package")
- == "manifest01");
+ == tizenId.substr(0,10));
+ LogDebug("type " << mf.getValueByXpath("/p:manifest/@type"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@type")
== "wgt");
+ LogDebug("version " << mf.getValueByXpath("/p:manifest/@version"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/@version")
== "1.0");
+ LogDebug("label " << mf.getValueByXpath("/p:manifest/p:label"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:label")
== "Manifest Example");
+ LogDebug("email " << mf.getValueByXpath("/p:manifest/p:author/@email"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@email")
== "manifest@misc.test.create.desktop.com");
+ LogDebug("href " << mf.getValueByXpath("/p:manifest/p:author/@href"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author/@href")
== "http://misc.test.create.desktop.com");
+ LogDebug("author " << mf.getValueByXpath("/p:manifest/p:author"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:author")
== "Manifest");
+ LogDebug("appid " << mf.getValueByXpath("/p:manifest/p:ui-application/@appid"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@appid")
- == "manifest01");
+ == tizenId);
+ LogDebug("nodisplay " << mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@nodisplay")
== "false");
+ LogDebug("type " << mf.getValueByXpath("/p:manifest/p:ui-application/@type"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@type")
== "webapp");
+ LogDebug("extraid " << mf.getValueByXpath("/p:manifest/p:ui-application/@extraid"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@extraid")
== "http://test.samsung.com/widget/manifestTest");
+ LogDebug("taskmanage " << mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/@taskmanage")
== "true");
+ LogDebug("icon " << mf.getValueByXpath("/p:manifest/p:ui-application/p:icon"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:icon")
- == "manifest01.png");
+ == (tizenId + ".png"));
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[not(@xml:lang)]")
== "Manifest Example");
- RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de_DE']")
+ RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='de-de']")
== "Manifest Beispiel");
- RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en_US']")
+ RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='en-us']")
== "Manifest Example");
RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pl']")
== "Przykład Manifest");
- RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt_PT']")
+ RUNNER_ASSERT(mf.getValueByXpath("/p:manifest/p:ui-application/p:label[@xml:lang='pt-pt']")
== "Exemplo manifesto");
}
Catch(ManifestFile::ManifestParseError)
}
/*
-Name: emptyPluginsDir
-Description: Tests installation with empty 'plugins' directory
-Expected: widget should be not installed
-*/
-RUNNER_TEST(emptyPluginsDir)
-{
- std::string tizenId;
- if(install(miscWidgetsStuff + "widgets/inst_nplug_2.wgt",
- tizenId) == InstallerWrapper::Success) {
- uninstall(tizenId);
- RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
- }
-}
-
-/*
Name: pluginFileAndOtherFile
Description: Tests installation with plugins directory and data files
Expected: widget should be installed
+ "widgets/inst_nplug_3.wgt", tizenId) == InstallerWrapper::Success);
uninstall(tizenId);
}
-
-/*
-Name: pluginFileAndSubdir
-Description: Tests installation with 'plugins' directory and subdirectories
- inside plugin directory
-Expected: widget should be not installed
-*/
-RUNNER_TEST(pluginFileAndSubdir)
-{
- std::string tizenId;
- if(install(miscWidgetsStuff + "widgets/inst_nplug_4.wgt",
- tizenId) == InstallerWrapper::Success) {
- uninstall(tizenId);
- RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
- }
-}
* @author Karol Pawlowski (k.pawlowski@samsung.com)
* @author Andrzej Surdej (a.surdej@samsung.com)
* @version 1.0
- * @brief Parsing Tizen Appservice test's bodies
+ * @brief Parsing Tizen app-control test's bodies
*/
#include <string>
////////////////////////////////////////////////////////////////////////////////
-RUNNER_TEST_GROUP_INIT(ParsingTizenAppservice)
+RUNNER_TEST_GROUP_INIT(ParsingTizenAppcontrol)
/*
-Name: correct_csp_policy
-Description: Tests if widget policy is correctly parsed from config file
- and stored into database
-Expected: widget should be installed and policy should mach
+Name: tizen_app-contro
+Description: Tests if widget app-control tag is correctly parsed
+Expected: widget should be installed
*/
-RUNNER_TEST(tizen_appservice_disposition)
+RUNNER_TEST(tizen_app_control)
{
std::string tizenId;
- RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/appservice_dispos.wgt",
+ RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/app-control.wgt",
tizenId) == InstallerWrapper::Success);
WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId));
- WrtDB::WidgetAppControlList appsvcList;
- dao.getAppControlList(appsvcList);
+ WrtDB::WidgetAppControlList appcontrolList;
+ dao.getAppControlList(appcontrolList);
uninstall(tizenId);
- LogDebug("Actual size" << appsvcList.size());
- RUNNER_ASSERT_MSG(appsvcList.size() == 4, "Incorrect list size");
+ LogDebug("Actual size" << appcontrolList.size());
+ RUNNER_ASSERT_MSG(appcontrolList.size() == 4, "Incorrect list size");
WrtDB::WidgetAppControl s;
s.src = DPL::FromUTF8String("edit1.html");
- s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/edit");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/edit");
s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */
s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
+
RUNNER_ASSERT_MSG(
- std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
"Unable to find service #");
s.src = DPL::FromUTF8String("edit2.html");
- s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/view");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/view");
s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */
s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
+
RUNNER_ASSERT_MSG(
- std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
"Unable to find service ##");
s.src = DPL::FromUTF8String("edit3.html");
- s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/call");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/call");
s.mime = DPL::FromUTF8String("image/png"); /* mime type */
- s.disposition = WrtDB::WidgetAppControl::Disposition::INLINE;
+ s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
+
RUNNER_ASSERT_MSG(
- std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
"Unable to find service ###");
s.src = DPL::FromUTF8String("edit4.html");
- s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/send");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/send");
s.mime = DPL::FromUTF8String("text/css"); /* mime type */
s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
+
RUNNER_ASSERT_MSG(
- std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
"Unable to find service ####");
}
--- /dev/null
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
+ id="http://test.samsung.com/widget/wac/tizen_appcontrol"
+ version="1.0.0"
+ min-version="1.0">
+ <name short="AppControl">app-control</name>
+ <icon src="icon.png" height="75" width="75"/>
+ <tizen:app-control>
+ <tizen:src name="edit1.html"/>
+ <tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
+ <tizen:mime name="image/jpg" />
+ </tizen:app-control>
+ <tizen:app-control>
+ <tizen:src name="edit2.html"/>
+ <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
+ <tizen:mime name="audio/ogg" />
+ </tizen:app-control>
+ <tizen:app-control>
+ <tizen:src name="edit3.html"/>
+ <tizen:operation name="http://tizen.org/appcontrol/operation/call"/>
+ <tizen:mime name="image/png" />
+ </tizen:app-control>
+ <tizen:app-control>
+ <tizen:src name="edit4.html"/>
+ <tizen:operation name="http://tizen.org/appcontrol/operation/send"/>
+ <tizen:mime name="text/css" />
+ </tizen:app-control>
+ <content src="index.html" />
+</widget>
+++ /dev/null
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
- id="http://test.samsung.com/widget/wac/tizen_appservice"
- version="1.0.0"
- min-version="1.0">
- <name short="Disposition">Disposition_attribute</name>
- <icon src="icon.png" height="75" width="75"/>
- <tizen:appservice src="edit1.html" operation="http://tizen.org/appsvc/operation/edit" mime="image/jpg" />
- <tizen:appservice src="edit2.html" operation="http://tizen.org/appsvc/operation/view" mime="audio/ogg" disposition="window"/>
- <tizen:appservice src="edit3.html" operation="http://tizen.org/appsvc/operation/call" mime="image/png" disposition="inline"/>
- <tizen:appservice src="edit4.html" operation="http://tizen.org/appsvc/operation/send" mime="text/css" disposition="wrongone"/>
- <content src="index.html" />
-</widget>