--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\r
+<properties>\r
+ <entry key="http://tizen.org/feature/network.push"/>\r
+ <entry key="http://tizen.org/feature/network.bluetooth"/>\r
+ <entry key="http://tizen.org/feature/network.telephony"/>\r
+ <entry key="http://tizen.org/feature/network.telephony.mms"/>\r
+ <entry key="http://tizen.org/feature/network.nfc"/>\r
+ <entry key="http://tizen.org/feature/network.secure_element"/>\r
+ <entry key="http://tizen.org/feature/network.wifi"/>\r
+\r
+ <entry key="http://tizen.org/feature/camera"/>\r
+ <entry key="http://tizen.org/feature/microphone"/>\r
+ <entry key="http://tizen.org/feature/location.gps"/>\r
+ <entry key="http://tizen.org/feature/sensor.accelerometer"/>\r
+ <entry key="http://tizen.org/feature/sensor.gyroscope"/>\r
+ <entry key="http://tizen.org/feature/sensor.magnetometer"/>\r
+\r
+ <entry key="http://tizen.org/feature/screen.size.normal"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.720.1280"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.240.400"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.320.480"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.480.800"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.540.960"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.600.1024"/>\r
+ <entry key="http://tizen.org/feature/screen.size.normal.1080.1920"/>\r
+\r
+</properties>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\r
+<properties>\r
+ <entry key="http://tizen.org/privilege/location"/>\r
+ <entry key="http://tizen.org/privilege/notification"/>\r
+ <entry key="http://tizen.org/privilege/mediacapture"/>\r
+ <entry key="http://tizen.org/privilege/fullscreen"/>\r
+ <entry key="http://tizen.org/privilege/unlimitedstorage"/>\r
+</properties>\r
#git:framework/web/wrt-installer
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.110
+Version: 0.1.114
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
BuildRequires: pkgconfig(wrt-plugins-types)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(shortcut)
-BuildRequires: pkgconfig(dpl-encryption)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(app2sd)
BuildRequires: pkgconfig(web-provider)
%endif
%build
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+%endif
export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
${INSTALLER_JOBS}/widget_install/task_update_files.cpp
${INSTALLER_JOBS}/widget_install/task_remove_backup.cpp
${INSTALLER_JOBS}/widget_install/task_encrypt_resource.cpp
- ${INSTALLER_JOBS}/widget_install/task_certificates.cpp
${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp
+ ${INSTALLER_JOBS}/widget_install/task_pkg_info_update.cpp
${INSTALLER_JOBS}/widget_install/widget_security.cpp
${INSTALLER_JOBS}/widget_install/widget_update_info.cpp
${INSTALLER_JOBS}/widget_install/directory_api.cpp
#include <widget_install/task_database.h>
#include <widget_install/task_remove_backup.h>
#include <widget_install/task_encrypt_resource.h>
-#include <widget_install/task_certificates.h>
+#include <widget_install/task_pkg_info_update.h>
#include <widget_install/task_commons.h>
#include <widget_install/task_prepare_reinstall.h>
{
AddTask(new TaskInstallOspsvc(m_installerContext));
}
- AddTask(new TaskCertificates(m_installerContext));
AddTask(new TaskDatabase(m_installerContext));
AddTask(new TaskAceCheck(m_installerContext));
AddTask(new TaskSmack(m_installerContext));
+ AddTask(new TaskPkgInfoUpdate(m_installerContext));
} else if (result == ConfigureResult::Updated) {
LogDebug("Configure installation updated");
LogDebug("Widget Update");
{
AddTask(new TaskInstallOspsvc(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
// Any error in acecheck while update will break widget
AddTask(new TaskSmack(m_installerContext));
AddTask(new TaskRemoveBackupFiles(m_installerContext));
+ AddTask(new TaskPkgInfoUpdate(m_installerContext));
} else {
// Installation is not allowed to proceed due to widget update policy
LogWarning("Configure installation failed!");
DPL::TaskDecl<TaskAceCheck>(this),
m_context(context)
{
+ AddStep(&TaskAceCheck::StartStep);
AddStep(&TaskAceCheck::StepPrepareForAce);
AddStep(&TaskAceCheck::StepAceCheck);
AddStep(&TaskAceCheck::StepProcessAceResponse);
AddStep(&TaskAceCheck::StepCheckAceResponse);
+ AddStep(&TaskAceCheck::EndStep);
}
void TaskAceCheck::StepPrepareForAce()
}
}
LogDebug("Installation continues...");
+}
+
+void TaskAceCheck::StartStep()
+{
+ LogDebug("--------- <TaskAceCheck> : START ----------");
+}
+void TaskAceCheck::EndStep()
+{
m_context.job->UpdateProgress(
InstallerContext::INSTALL_ACE_CHECK,
"Widget Access Control Check Finished");
+
+ LogDebug("--------- <TaskAceCheck> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
void StepProcessAceResponse();
void StepCheckAceResponse();
+ void StartStep();
+ void EndStep();
+
public:
TaskAceCheck(InstallerContext& context);
};
DPL::TaskDecl<TaskCertify>(this),
m_contextData(inCont)
{
+ AddStep(&TaskCertify::StartStep);
AddStep(&TaskCertify::stepSignature);
// certi comparison determines whether the update.
if (true == m_contextData.isUpdateMode) {
AddStep(&TaskCertify::stepVerifyUpdate);
}
- AddStep(&TaskCertify::stepFinalize);
+ AddStep(&TaskCertify::EndStep);
}
void TaskCertify::processDistributorSignature(const SignatureData &data)
"Widget Signature checked");
}
-void TaskCertify::stepFinalize()
-{
- LogDebug("Step: <<CERTYFYING DONE>>");
-
- m_contextData.job->UpdateProgress(
- InstallerContext::INSTALL_CERT_CHECK,
- "Widget Certification Check Finished");
-}
-
bool TaskCertify::isTizenWebApp() const
{
bool ret = FALSE;
}
}
}
+
+void TaskCertify::StartStep()
+{
+ LogDebug("--------- <TaskCertify> : START ----------");
+}
+
+void TaskCertify::EndStep()
+{
+ LogDebug("Step: <<CERTYFYING DONE>>");
+
+ m_contextData.job->UpdateProgress(
+ InstallerContext::INSTALL_CERT_CHECK,
+ "Widget Certification Check Finished");
+
+ LogDebug("--------- <TaskCertify> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
//steps
void stepSignature();
void stepVerifyUpdate();
- void stepFinalize();
+
+ void StartStep();
+ void EndStep();
void processDistributorSignature(const ValidationCore::SignatureData &data);
void processAuthorSignature(const ValidationCore::SignatureData &data);
DPL::TaskDecl<TaskCertifyLevel>(this),
m_contextData(inCont)
{
+ AddStep(&TaskCertifyLevel::StartStep);
AddStep(&TaskCertifyLevel::stepCertifyLevel);
+ AddStep(&TaskCertifyLevel::EndStep);
}
void TaskCertifyLevel::stepCertifyLevel()
ThrowMsg(Exceptions::PrivilegeLevelViolation, "setting level violate");
}
LogDebug("================ Step: <<Certify Level>> DONE ================");
-
- m_contextData.job->UpdateProgress(
- InstallerContext::INSTALL_CERTIFY_LEVEL_CHECK,
- "Application Certificate level check Finished");
}
void TaskCertifyLevel::getSignatureFiles(const std::string& path,
return Level::UNKNOWN;
}
+void TaskCertifyLevel::StartStep()
+{
+ LogDebug("--------- <TaskCertifyLevel> : START ----------");
+}
+
+void TaskCertifyLevel::EndStep()
+{
+ LogDebug("--------- <TaskCertifyLevel> : END ----------");
+
+ m_contextData.job->UpdateProgress(
+ InstallerContext::INSTALL_CERTIFY_LEVEL_CHECK,
+ "Application Certificate level check Finished");
+}
} //namespace WidgetInstall
} //namespace Jobs
//steps
void stepCertifyLevel();
+ void StartStep();
+ void EndStep();
//util
void getSignatureFiles(const std::string& path,
m_handleToRemove(INVALID_WIDGET_HANDLE),
m_handle(INVALID_WIDGET_HANDLE)
{
+ AddStep(&TaskDatabase::StartStep);
AddStep(&TaskDatabase::StepRegisterExternalFiles);
AddStep(&TaskDatabase::StepWrtDBInsert);
AddStep(&TaskDatabase::StepAceDBInsert);
AddStep(&TaskDatabase::StepSecurityOriginDBInsert);
AddStep(&TaskDatabase::StepRemoveExternalFiles);
AddStep(&TaskDatabase::StepLiveboxDBInsert);
+ AddStep(&TaskDatabase::EndStep);
AddAbortStep(&TaskDatabase::StepAbortDBInsert);
AddAbortStep(&TaskDatabase::StepAbortAceDBInsert);
"Given tizenId not found for update installation");
}
- WidgetDAO::backupAndUpdateWidget(
- m_backAppId,
- m_context.widgetConfig.tzAppid,
- m_context.widgetConfig,
- m_context.widgetSecurity);
- m_handle = WidgetDAOReadOnly::getHandle(
- m_context.widgetConfig.tzAppid);
+ WidgetDAO::updateTizenAppId(m_context.widgetConfig.tzAppid,
+ m_backAppId);
+ WidgetDAO::registerWidget(m_context.widgetConfig.tzAppid,
+ m_context.widgetConfig,
+ m_context.widgetSecurity);
+ m_handle =
+ WidgetDAOReadOnly::getHandle(m_context.widgetConfig.tzAppid);
} else { //new installation
LogDebug("Registering widget...");
WidgetDAO::registerWidget(
}
}
}
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_NEW_DB_INSERT,
- "New Widget DB UPDATE Finished");
}
void TaskDatabase::StepRegisterExternalFiles()
Try
{
if (m_context.isUpdateMode) {
- WidgetDAO::restoreUpdateWidget(m_backAppId,
- m_context.widgetConfig.tzAppid);
+ WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
+ WidgetDAO::updateTizenAppId(m_backAppId,
+ m_context.widgetConfig.tzAppid);
} else {
WidgetDAO::unregisterWidget(m_context.widgetConfig.tzAppid);
}
autoLaunch, mouseEvent, pdFastOpen);
}
}
+
+void TaskDatabase::StartStep()
+{
+ LogDebug("--------- <TaskDatabase> : START ----------");
+}
+
+void TaskDatabase::EndStep()
+{
+ LogDebug("--------- <TaskDatabase> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepAbortDBInsert();
void StepAbortAceDBInsert();
+ void StartStep();
+ void EndStep();
+
public:
TaskDatabase(InstallerContext& context);
};
DPL::TaskDecl<TaskEncryptResource>(this),
m_context(context)
{
+ AddStep(&TaskEncryptResource::StartStep);
AddStep(&TaskEncryptResource::StepEncryptResource);
+ AddStep(&TaskEncryptResource::EndStep);
}
void TaskEncryptResource::StepEncryptResource()
LogDebug("Step Encrypt resource");
EncryptDirectory(m_context.locations->getTemporaryRootDir());
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_ECRYPTION_FILES,
- "Ecrypt resource files");
}
void TaskEncryptResource::EncryptDirectory(std::string path)
m_context.widgetConfig.encryptedFiles.insert(fileInfo);
}
+void TaskEncryptResource::StartStep()
+{
+ LogDebug("--------- <TaskEncryptResource> : START ----------");
+}
+
+void TaskEncryptResource::EndStep()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_ECRYPTION_FILES,
+ "Ecrypt resource files");
+
+ LogDebug("--------- <TaskEncryptResource> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepEncryptResource();
+ void StartStep();
+ void EndStep();
+
void EncryptDirectory(std::string path);
void EncryptFile(const std::string &fileName);
m_context(context),
m_extHandle(NULL)
{
+ AddStep(&TaskFileManipulation::StartStep);
if (INSTALL_LOCATION_TYPE_EXTERNAL !=
m_context.locationType)
{
AddAbortStep(&TaskFileManipulation::StepAbortCreateExternalDir);
}
+ AddStep(&TaskFileManipulation::EndStep);
}
void TaskFileManipulation::StepCreateDirs()
SHARED_STORAGE_MODE);
}
}
+
+void TaskFileManipulation::StartStep()
+{
+ LogDebug("--------- <TaskFileManipulation> : START ----------");
+}
+
+void TaskFileManipulation::EndStep()
+{
+ LogDebug("--------- <TaskFileManipulation> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepFinishExternalInstallation();
void StepAbortCreateExternalDir();
+ void StartStep();
+ void EndStep();
+
public:
TaskFileManipulation(InstallerContext& context);
};
DPL::TaskDecl<TaskInstallOspsvc>(this),
m_context(context)
{
+ AddStep(&TaskInstallOspsvc::StartStep);
AddStep(&TaskInstallOspsvc::StepInstallOspService);
- AddStep(&TaskInstallOspsvc::StepUpdateManifestFile);
+ AddStep(&TaskInstallOspsvc::EndStep);
}
void TaskInstallOspsvc::StepInstallOspService()
}
pclose(fd);
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_INSTALL_OSPSVC,
- "Installed Osp servcie");
}
-void TaskInstallOspsvc::StepUpdateManifestFile()
+void TaskInstallOspsvc::StartStep()
{
- std::string pkgid = DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
- pkgmgrinfo_pkginfo_h handle;
-
- 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());
+ LogDebug("--------- <TaskInstallOspsvc> : START ----------");
+}
- int code = pkgmgr_parser_parse_manifest_for_upgrade(
- manifest_file.str().c_str(), NULL);
+void TaskInstallOspsvc::EndStep()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_INSTALL_OSPSVC,
+ "Installed Osp servcie");
- if (code != 0) {
- LogError("Manifest parser error: " << code);
- }
+ LogDebug("--------- <TaskInstallOspsvc> : END ----------");
}
} //namespace WidgetInstall
} //namespace Jobs
InstallerContext &m_context;
void StepInstallOspService();
- void StepUpdateManifestFile();
void StepAbortInstall();
+ void StartStep();
+ void EndStep();
+
// return callback
static int StatusCallback(
int req_id, const char *pkg_type, const char *pkg_name,
AddStep(&TaskManifestFile::stepCopyLiveboxFiles);
AddStep(&TaskManifestFile::stepCreateExecFile);
AddStep(&TaskManifestFile::stepGenerateManifest);
- AddStep(&TaskManifestFile::stepParseManifest);
AddAbortStep(&TaskManifestFile::stepAbortIconFiles);
} else {
AddStep(&TaskManifestFile::stepCopyLiveboxFiles);
AddStep(&TaskManifestFile::stepCreateExecFile);
AddStep(&TaskManifestFile::stepGenerateManifest);
- AddStep(&TaskManifestFile::stepParseManifest);
-
- AddAbortStep(&TaskManifestFile::stepAbortParseManifest);
}
}
commit_manifest = destFile.str();
LogDebug("Commiting manifest file : " << commit_manifest);
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_CREATE_MANIFEST,
- "Widget Manifest Creation Finished");
-}
-
-void TaskManifestFile::stepParseManifest()
-{
- int code = 0;
- char* updateTags[3] = {NULL, };
-
- if (!m_context.mode.removable) {
- updateTags[0] = "preload=false";
- updateTags[1] = "removable=false";
- updateTags[2] = NULL;
-
- }
-
commitManifest();
- if (m_context.isUpdateMode || (
- m_context.mode.rootPath == InstallMode::RootPath::RO
- && m_context.mode.installTime == InstallMode::InstallTime::PRELOAD
- && m_context.mode.extension == InstallMode::ExtensionType::DIR)) {
-
- if (m_context.widgetConfig.packagingType != PKG_TYPE_HYBRID_WEB_APP) {
- code = pkgmgr_parser_parse_manifest_for_upgrade(
- commit_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
-
- if (code != 0) {
- LogError("Manifest parser error: " << code);
- ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
- }
- }
- } else {
- code = pkgmgr_parser_parse_manifest_for_installation(
- commit_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
-
- 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");
+ InstallerContext::INSTALL_CREATE_MANIFEST,
+ "Widget Manifest Creation Finished");
}
void TaskManifestFile::commitManifest()
}
}
-void TaskManifestFile::stepAbortParseManifest()
-{
- LogError("[Parse Manifest] Abroting....");
-
- int code = pkgmgr_parser_parse_manifest_for_uninstallation(
- DPL::ToUTF8String(manifest_file).c_str(), NULL);
-
- if (0 != code) {
- LogWarning("Manifest parser error: " << code);
- ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
- }
- int ret = unlink(DPL::ToUTF8String(manifest_file).c_str());
- if (0 != ret) {
- LogWarning("No manifest file found: " << manifest_file);
- }
-}
-
void TaskManifestFile::setLiveBoxInfo(Manifest& manifest)
{
FOREACH(it, m_context.widgetConfig.configInfo.m_livebox) {
return;
}
if (account.m_multiAccountSupport) {
- provider.multiAccount = L"ture";
+ provider.multiAccount = L"true";
} else {
provider.multiAccount = L"false";
}
manifest.addPrivileges(privilege);
}
+void TaskManifestFile::StartStep()
+{
+
+}
+
+void TaskManifestFile::EndStep()
+{
+
+}
} //namespace WidgetInstall
} //namespace Jobs
void stepCopyIconFiles();
void stepCopyLiveboxFiles();
void stepGenerateManifest();
- void stepParseManifest();
- void stepParseUpgradedManifest();
void stepAbortParseManifest();
//For widget update
void stepBackupIconFiles();
-
void stepAbortIconFiles();
+ void StartStep();
+ void EndStep();
+
//private data
std::list<std::string> icon_list; //TODO: this should be registered as
// external files
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * @file task_certificates.cpp
- * @author Leerang Song(leerang.song@samsung.com)
+/**
+ * @file task_pkg_info_update.cpp
+ * @author Soyoung Kim (sy037.kim@samsung.com)
* @version 1.0
- * @brief Implementation file for installer task certificates
+ * @brief Implementation file for installer task information about package
+ * update
*/
-#include <widget_install/task_certificates.h>
-#include <widget_install/widget_install_context.h>
-#include <widget_install/widget_install_errors.h>
-#include <widget_install/job_widget_install.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <pkgmgr_installer.h>
-#include <vcore/CryptoHash.h>
+#include "task_pkg_info_update.h"
+
+#include <unistd.h>
+#include <string>
+#include <fstream>
#include <dpl/log/log.h>
-#include <dlog.h>
-#include <sstream>
+#include <dpl/wrt-dao-ro/global_config.h>
#include <dpl/foreach.h>
#include <dpl/sstream.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <pkgmgr_installer.h>
+#include <pkgmgr/pkgmgr_parser.h>
+#include <pkgmgr-info.h>
+#include <vcore/CryptoHash.h>
+
+#include <widget_install/job_widget_install.h>
+#include <widget_install/widget_install_context.h>
+#include <widget_install/widget_install_errors.h>
using namespace WrtDB;
+namespace {
+}
+
namespace Jobs {
namespace WidgetInstall {
-TaskCertificates::TaskCertificates(InstallerContext& context) :
- DPL::TaskDecl<TaskCertificates>(this),
- m_context(context),
- m_pkgHandle(NULL)
+TaskPkgInfoUpdate::TaskPkgInfoUpdate(InstallerContext& context) :
+ DPL::TaskDecl<TaskPkgInfoUpdate>(this),
+ m_context(context)
+{
+ AddStep(&TaskPkgInfoUpdate::StartStep);
+ AddStep(&TaskPkgInfoUpdate::StepPkgInfo);
+ AddStep(&TaskPkgInfoUpdate::StepSetCertiInfo);
+ AddStep(&TaskPkgInfoUpdate::EndStep);
+ AddStep(&TaskPkgInfoUpdate::StepSetEndofInstallation);
+
+ AddAbortStep(&TaskPkgInfoUpdate::StepAbortCertiInfo);
+ AddAbortStep(&TaskPkgInfoUpdate::stepAbortParseManifest);
+}
+
+void TaskPkgInfoUpdate::StepPkgInfo()
{
- AddStep(&TaskCertificates::StepSetCertiInfo);
- AddAbortStep(&TaskCertificates::StepAbortCertiInfo);
+ int code = 0;
+ char* updateTags[3] = {NULL, };
+
+ if (!m_context.mode.removable) {
+ updateTags[0] = "preload=false";
+ updateTags[1] = "removable=false";
+ updateTags[2] = NULL;
+
+ }
+
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
+ m_manifest += "/usr/share/packages/";
+ } else {
+ m_manifest += "/opt/share/packages/";
+ }
+ m_manifest += DPL::ToUTF8String(m_context.widgetConfig.tzPkgid) + ".xml";
+ LogDebug("manifest file : " << m_manifest);
+
+ if (m_context.isUpdateMode || (
+ m_context.mode.rootPath == InstallMode::RootPath::RO
+ && m_context.mode.installTime == InstallMode::InstallTime::PRELOAD
+ && m_context.mode.extension == InstallMode::ExtensionType::DIR)) {
+
+ if (m_context.widgetConfig.packagingType != PKG_TYPE_HYBRID_WEB_APP) {
+ code = pkgmgr_parser_parse_manifest_for_upgrade(
+ m_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
+
+ if (code != 0) {
+ LogError("Manifest parser error: " << code);
+ ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
+ }
+ }
+ } else {
+ code = pkgmgr_parser_parse_manifest_for_installation(
+ m_manifest.c_str(), (updateTags[0] == NULL) ? NULL : updateTags);
+
+ if (code != 0) {
+ LogError("Manifest parser error: " << code);
+ ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
+ }
+ }
+
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_PKGINFO_UPDATE,
+ "Manifest Update Finished");
+ LogDebug("Manifest parsed");
}
-void TaskCertificates::StepSetCertiInfo()
+void TaskPkgInfoUpdate::StepSetCertiInfo()
{
LogDebug("StepSetCertiInfo");
if (pkgmgr_installer_destroy_certinfo_set_handle(m_pkgHandle) < 0) {
LogError("pkgmgrInstallerDestroyCertinfoSetHandle fail");
}
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_SET_CERTINFO,
- "Save certinfo to pkgmgr");
}
-void TaskCertificates::SetCertiInfo(CertificateSource source)
+void TaskPkgInfoUpdate::SetCertiInfo(int source)
{
LogDebug("Set CertiInfo to pkgmgr : " << source);
CertificateChainList certificateChainList;
- m_context.widgetSecurity.getCertificateChainList(certificateChainList, source);
+ m_context.widgetSecurity.getCertificateChainList(certificateChainList,
+ (CertificateSource)source);
FOREACH(it, certificateChainList)
{
}
}
-void TaskCertificates::StepAbortCertiInfo()
+void TaskPkgInfoUpdate::StepAbortCertiInfo()
{
if ((pkgmgr_installer_delete_certinfo(
const_cast<char*>(DPL::ToUTF8String(
LogError("pkgmgr_installer_delete_certinfo fail");
}
}
+
+void TaskPkgInfoUpdate::StartStep()
+{
+ LogDebug("--------- <TaskPkgInfoUpdate> : START ----------");
+}
+
+void TaskPkgInfoUpdate::EndStep()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_SET_CERTINFO,
+ "Save certinfo to pkgmgr");
+
+ LogDebug("--------- <TaskPkgInfoUpdate> : END ----------");
+}
+
+void TaskPkgInfoUpdate::stepAbortParseManifest()
+{
+ LogError("[Parse Manifest] Abroting....");
+
+ int code = pkgmgr_parser_parse_manifest_for_uninstallation(
+ m_manifest.c_str(), NULL);
+
+ if (0 != code) {
+ LogWarning("Manifest parser error: " << code);
+ ThrowMsg(Exceptions::ManifestInvalid, "Parser returncode: " << code);
+ }
+ int ret = unlink(m_manifest.c_str());
+ if (0 != ret) {
+ LogWarning("No manifest file found: " << m_manifest);
+ }
+}
+
+void TaskPkgInfoUpdate::StepSetEndofInstallation()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_END,
+ "End installation");
+}
+
} //namespace WidgetInstall
} //namespace Jobs
* limitations under the License.
*/
/*
- * @file task_certificates.h
- * @author Leerang Song(leerang.song@samsung.com)
- * @version 1.0
- * @brief Header file for installer task certificates
+ * @file task_pkg_info_update.h
+ * @author soyoung kim (sy037.kim@samsung.com)
+ * @version 1.0
*/
-#ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFICATES_H
-#define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFICATES_H
-#include <dpl/task.h>
-#include <dpl/event/inter_context_delegate.h>
-#include <dpl/foreach.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#ifndef SRC_JOBS_WIDGET_INSTALL_TASK_PKG_INFO_UPDATE_H_
+#define SRC_JOBS_WIDGET_INSTALL_TASK_PKG_INFO_UPDATE_H_
+#include <dpl/task.h>
+#include <string>
#include <pkgmgr_installer.h>
-using namespace WrtDB;
class InstallerContext;
namespace Jobs {
namespace WidgetInstall {
-class TaskCertificates :
- public DPL::TaskDecl<TaskCertificates>,
- public DPL::Event::ICDelegateSupport<TaskCertificates>
+class TaskPkgInfoUpdate : public DPL::TaskDecl<TaskPkgInfoUpdate>
{
private:
- InstallerContext& m_context;
+ // Installation context
+ InstallerContext &m_context;
+ void StepPkgInfo();
void StepSetCertiInfo();
+ void SetCertiInfo(int source);
+ void StepSetEndofInstallation();
+
+ void stepAbortParseManifest();
void StepAbortCertiInfo();
- void SetCertiInfo(CertificateSource source);
+
+ void StartStep();
+ void EndStep();
pkgmgr_instcertinfo_h m_pkgHandle;
+ std::string m_manifest;
public:
- TaskCertificates(InstallerContext& context);
+ explicit TaskPkgInfoUpdate(InstallerContext &installerContext);
};
-} //namespace WidgetInstall
-} //namespace Jobs
-
-#endif /* INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFICATES_H */
+} // namespace WidgetInstall
+} // namespace Jobs
+#endif /* SRC_JOBS_WIDGET_INSTALL_TASK_PKG_INFO_UPDATE_H_ */
DPL::TaskDecl<TaskPrepareFiles>(this),
m_installerContext(installerContext)
{
- // Install steps
+ AddStep(&TaskPrepareFiles::StartStep);
AddStep(&TaskPrepareFiles::StepCopyFiles);
+ AddStep(&TaskPrepareFiles::EndStep);
}
void TaskPrepareFiles::CopyFile(const std::string& source)
CopyFile(os.str());
}
}
+
+void TaskPrepareFiles::StartStep()
+{
+ LogDebug("--------- <TaskPrepareFiles> : START ----------");
+}
+
+void TaskPrepareFiles::EndStep()
+{
+ LogDebug("--------- <TaskPrepareFiles> : END ----------");
+}
} // namespace WidgetInstall
} // namespace Jobs
// Steps
void StepCopyFiles();
+ void StartStep();
+ void EndStep();
+
public:
explicit TaskPrepareFiles(InstallerContext &installerContext);
};
DPL::TaskDecl<TaskPrepareReinstall>(this),
m_context(context)
{
+ AddStep(&TaskPrepareReinstall::StartStep);
AddStep(&TaskPrepareReinstall::StepPrepare);
AddStep(&TaskPrepareReinstall::StepParseRDSDelta);
AddStep(&TaskPrepareReinstall::StepVerifyRDSDelta);
AddStep(&TaskPrepareReinstall::StepAddFile);
AddStep(&TaskPrepareReinstall::StepDeleteFile);
AddStep(&TaskPrepareReinstall::StepModifyFile);
+ AddStep(&TaskPrepareReinstall::EndStep);
}
void TaskPrepareReinstall::StepPrepare()
}
LogDebug("Replace " << newfile << " to " << destPath);
}
+}
+
+void TaskPrepareReinstall::StartStep()
+{
+ LogDebug("--------- <TaskPrepareReinstall> : START ----------");
+}
+
+void TaskPrepareReinstall::EndStep()
+{
m_context.job->UpdateProgress(
InstallerContext::INSTALL_RDS_PREPARE,
"RDS prepare finished");
+
+ LogDebug("--------- <TaskPrepareReinstall> : END ----------");
}
} //namespace WidgetInstall
void StepAbortPrepareReinstall();
+ void StartStep();
+ void EndStep();
+
InstallerContext& m_context;
// TODO : replace multimap
std::list<std::string> m_addFileList;
DPL::TaskDecl<TaskRecovery>(this),
m_context(context)
{
+ AddStep(&TaskRecovery::StartStep);
AddStep(&TaskRecovery::StepCreateCheckFile);
+ AddStep(&TaskRecovery::EndStep);
+}
+
+void TaskRecovery::StartStep()
+{
+ LogDebug("--------- <TaskRecovery> : START ----------");
+}
+
+void TaskRecovery::EndStep()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_CHECK_FILE,
+ "Create information file for recovery");
+
+ LogDebug("--------- <TaskRecovery> : END ----------");
}
void TaskRecovery::StepCreateCheckFile()
} else {
ThrowMsg(Exceptions::FileOperationFailed, "Fail to create file for recovery.");
}
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_CHECK_FILE,
- "Create information file for recovery");
}
} //namespace WidgetInstall
} //namespace Jobs
InstallerContext &m_context;
void StepCreateCheckFile();
+ void StartStep();
+ void EndStep();
public:
explicit TaskRecovery(InstallerContext &installerContext);
DPL::TaskDecl<TaskRemoveBackupFiles>(this),
m_context(context)
{
+ AddStep(&TaskRemoveBackupFiles::StartStep);
if (m_context.mode.extension != InstallMode::ExtensionType::DIR)
{
AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles);
}
AddStep(&TaskRemoveBackupFiles::StepDeleteBackupDB);
+ AddStep(&TaskRemoveBackupFiles::EndStep);
}
void TaskRemoveBackupFiles::StepRemoveBackupFiles()
}
}
+void TaskRemoveBackupFiles::StartStep()
+{
+ LogDebug("--------- <TaskRemoveBackupFiles> : START ----------");
+}
+
+void TaskRemoveBackupFiles::EndStep()
+{
+ LogDebug("--------- <TaskRemoveBackupFiles> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepRemoveBackupFiles();
void StepDeleteBackupDB();
+ void StartStep();
+ void EndStep();
+
public:
TaskRemoveBackupFiles(InstallerContext& context);
};
m_context(context),
m_pkgId(NULL)
{
+ AddStep(&TaskSmack::StartStep);
AddStep(&TaskSmack::StepSetInstall);
AddStep(&TaskSmack::StepSmackFolderLabeling);
AddStep(&TaskSmack::StepSmackPrivilege);
- AddStep(&TaskSmack::StepSetEndofInstallation);
+ AddStep(&TaskSmack::EndStep);
AddAbortStep(&TaskSmack::StepAbortSmack);
}
#endif
}
-void TaskSmack::StepSetEndofInstallation()
-{
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_END,
- "End installation");
-}
-
bool TaskSmack::setLabelForSharedDir(const char* pkgId)
{
/* /shared directory */
return true;
}
+
+void TaskSmack::StartStep()
+{
+ LogDebug("--------- <TaskSmack> : START ----------");
+}
+
+void TaskSmack::EndStep()
+{
+ LogDebug("--------- <TaskSmack> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepSmackFolderLabeling();
void StepSmackPrivilege();
void StepRevokeForUpdate();
- void StepSetEndofInstallation();
void StepAbortSmack();
bool setLabelForSharedDir(const char* pkgId);
+ void StartStep();
+ void EndStep();
+
public:
TaskSmack(InstallerContext& context);
};
DPL::TaskDecl<TaskUpdateFiles>(this),
m_context(context)
{
+ AddStep(&TaskUpdateFiles::StartStep);
AddStep(&TaskUpdateFiles::StepBackupDirectory);
+ AddStep(&TaskUpdateFiles::EndStep);
AddAbortStep(&TaskUpdateFiles::StepAbortBackupDirectory);
}
}
WrtUtilMakeDir(pkgPath);
-
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_CREATE_BACKUP_DIR,
- "Backup directory created for update");
}
void TaskUpdateFiles::StepAbortBackupDirectory()
LogError("Failed to rename " << backPath << " to " << pkgPath);
}
}
+
+void TaskUpdateFiles::StartStep()
+{
+ LogDebug("--------- <TaskUpdateFiles> : START ----------");
+}
+
+void TaskUpdateFiles::EndStep()
+{
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_CREATE_BACKUP_DIR,
+ "Backup directory created for update");
+
+ LogDebug("--------- <TaskUpdateFiles> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepAbortBackupDirectory();
+ void StartStep();
+ void EndStep();
+
public:
TaskUpdateFiles(InstallerContext& context);
};
DPL::TaskDecl<TaskWidgetConfig>(this),
m_installContext(installContext)
{
+ AddStep(&TaskWidgetConfig::StartStep);
AddStep(&TaskWidgetConfig::StepProcessConfigurationFile);
AddStep(&TaskWidgetConfig::ReadLocaleFolders);
AddStep(&TaskWidgetConfig::ProcessLocalizedStartFiles);
AddStep(&TaskWidgetConfig::ProcessSecurityModel);
AddStep(&TaskWidgetConfig::StepVerifyFeatures);
AddStep(&TaskWidgetConfig::StepCheckMinVersionInfo);
+ AddStep(&TaskWidgetConfig::EndStep);
}
void TaskWidgetConfig::StepProcessConfigurationFile()
ThrowMsg(Exception::ConfigParseFailed, path);
}
}
+
+void TaskWidgetConfig::StartStep()
+{
+ LogDebug("--------- <TaskWidgetConfig> : START ----------");
+}
+
+void TaskWidgetConfig::EndStep()
+{
+ LogDebug("--------- <TaskWidgetConfig> : END ----------");
+}
} //namespace WidgetInstall
} //namespace Jobs
template <typename Ex, const char* Msg>
void StepCancelInstallation();
+ void StartStep();
+ void EndStep();
+
DPL::String createAuthorWidgetInfo() const;
bool isFeatureAllowed(
WrtDB::AppType appType, DPL::String featureName);
INSTALL_CREATE_EXECFILE,
INSTALL_CREATE_MANIFEST,
INSTALL_INSTALL_OSPSVC,
- INSTALL_SET_CERTINFO,
INSTALL_NEW_DB_INSERT,
INSTALL_ACE_PREPARE,
INSTALL_ACE_CHECK,
INSTALL_SMACK_ENABLE,
+ INSTALL_PKGINFO_UPDATE,
+ INSTALL_SET_CERTINFO,
INSTALL_END
} InstallStep;
DPL::TaskDecl<TaskCheck>(this),
m_context(context)
{
+ AddStep(&TaskCheck::StartStep);
AddStep(&TaskCheck::StepUninstallPreCheck);
+ AddStep(&TaskCheck::EndStep);
}
TaskCheck::~TaskCheck()
{}
+void TaskCheck::StartStep()
+{
+ LogDebug("--------- <TaskCheck> : START ----------");
+}
+
+void TaskCheck::EndStep()
+{
+ m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_PRECHECK,
+ "Uninstall pre-checking Finished");
+ LogDebug("--------- <TaskCheck> : END ----------");
+}
+
void TaskCheck::StepUninstallPreCheck()
{
bool isRunning = false;
}
LogDebug("Widget Can be uninstalled. Pkgname : " << m_context.tzAppid);
- m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_PRECHECK,
- "Uninstall pre-checking Finished");
}
} //namespace WidgetUninstall
} //namespace Jobs
//steps
void StepUninstallPreCheck();
+ void StartStep();
+ void EndStep();
public:
TaskCheck(UninstallerContext& context);
DPL::TaskDecl<TaskDbUpdate>(this),
m_context(context)
{
+ AddStep(&TaskDbUpdate::StartStep);
AddStep(&TaskDbUpdate::StepDbUpdate);
AddStep(&TaskDbUpdate::StepLiveboxDBDelete);
+ AddStep(&TaskDbUpdate::EndStep);
}
TaskDbUpdate::~TaskDbUpdate()
ReThrowMsg(Exceptions::DatabaseFailure,
"Failed to handle StepDbUpdate!");
}
-
- m_context.job->UpdateProgress(
- UninstallerContext::UNINSTALL_DB_UPDATE,
- "Widget DB Update Finished");
}
void TaskDbUpdate::StepLiveboxDBDelete()
LogDebug("delete box info: " << m_context.tzAppid);
}
}
+
+void TaskDbUpdate::StartStep()
+{
+ LogDebug("--------- <TaskDbUpdate> : START ----------");
+}
+
+void TaskDbUpdate::EndStep()
+{
+ m_context.job->UpdateProgress(
+ UninstallerContext::UNINSTALL_DB_UPDATE,
+ "Widget DB Update Finished");
+
+ LogDebug("--------- <TaskDbUpdate> : END ----------");
+}
} //namespace WidgetUninstall
} //namespace Jobs
void StepDbUpdate();
void StepLiveboxDBDelete();
+ void StartStep();
+ void EndStep();
+
public:
TaskDbUpdate(UninstallerContext& context);
virtual ~TaskDbUpdate();
DPL::TaskDecl<TaskDeleteCertificates>(this),
m_context(context)
{
+ AddStep(&TaskDeleteCertificates::StartStep);
AddStep(&TaskDeleteCertificates::StepDeleteCertificates);
+ AddStep(&TaskDeleteCertificates::EndStep);
}
TaskDeleteCertificates::~TaskDeleteCertificates()
LogError("pkgmgr_installer_delete_certinfo fail");
}
}
+
+void TaskDeleteCertificates::StartStep()
+{
+ LogDebug("--------- <TaskDeleteCertificates> : START ----------");
+}
+
+void TaskDeleteCertificates::EndStep()
+{
+ LogDebug("--------- <TaskDeleteCertificates> : END ----------");
+}
} //namespace WidgetUninstall
} //namespace Jobs
private:
void StepDeleteCertificates();
+ void StartStep();
+ void EndStep();
+
public:
TaskDeleteCertificates(UninstallerContext& context);
virtual ~TaskDeleteCertificates();
DPL::TaskDecl<TaskRemoveCustomHandlers>(this),
m_context(context)
{
+ AddStep(&TaskRemoveCustomHandlers::StartStep);
AddStep(&TaskRemoveCustomHandlers::Step);
+ AddStep(&TaskRemoveCustomHandlers::EndStep);
}
void TaskRemoveCustomHandlers::Step()
handlersDao.removeWidgetContentHandlers();
CustomHandlerDB::Interface::detachDatabase();
}
+
+void TaskRemoveCustomHandlers::StartStep()
+{
+ LogDebug("--------- <TaskRemoveCustomHandlers> : START ----------");
+}
+
+void TaskRemoveCustomHandlers::EndStep()
+{
+ LogDebug("--------- <TaskRemoveCustomHandlers> : END ----------");
+}
} //namespace WidgetUninstall
} //namespace Jobs
void Step();
+ void StartStep();
+ void EndStep();
+
public:
TaskRemoveCustomHandlers(UninstallerContext& context);
};
DPL::TaskDecl<TaskRemoveFiles>(this),
m_context(context)
{
+ AddStep(&TaskRemoveFiles::StartStep);
AddStep(&TaskRemoveFiles::StepRemoveInstallationDirectory);
AddStep(&TaskRemoveFiles::StepRemoveManifest);
AddStep(&TaskRemoveFiles::StepRemoveExternalLocations);
AddStep(&TaskRemoveFiles::StepRemoveFinished);
+ AddStep(&TaskRemoveFiles::EndStep);
}
TaskRemoveFiles::~TaskRemoveFiles()
dao.unregisterAllExternalLocations();
}
}
+
+void TaskRemoveFiles::StartStep()
+{
+ LogDebug("--------- <TaskRemoveFiles> : START ----------");
+}
+
+void TaskRemoveFiles::EndStep()
+{
+ LogDebug("--------- <TaskRemoveFiles> : END ----------");
+}
} //namespace WidgetUninstall
} //namespace Jobs
void StepRemoveManifest();
void StepRemoveExternalLocations();
+ void StartStep();
+ void EndStep();
+
public:
explicit TaskRemoveFiles(UninstallerContext& context);
virtual ~TaskRemoveFiles();
DPL::TaskDecl<TaskSmack>(this),
m_context(context)
{
+ AddStep(&TaskSmack::StartStep);
AddStep(&TaskSmack::Step);
+ AddStep(&TaskSmack::EndStep);
}
void TaskSmack::Step()
if (PC_OPERATION_SUCCESS != app_uninstall(pkgId)) {
LogError("failure in removing smack rules file");
}
+#endif
+}
+
+void TaskSmack::StartStep()
+{
+ LogDebug("--------- <TaskSmack> : START ----------");
+}
+void TaskSmack::EndStep()
+{
m_context.job->UpdateProgress(
UninstallerContext::UNINSTALL_SMACK_DISABLE,
"Widget SMACK Disabled");
-#endif
+
+ LogDebug("--------- <TaskSmack> : END ----------");
}
} //namespace WidgetUninstall
} //namespace Jobs
void Step();
+ void StartStep();
+ void EndStep();
+
public:
TaskSmack(UninstallerContext& context);
};
DPL::TaskDecl<TaskUninstallOspsvc>(this),
m_context(context)
{
+ AddStep(&TaskUninstallOspsvc::StartStep);
AddStep(&TaskUninstallOspsvc::StepUninstallOspsvc);
+ AddStep(&TaskUninstallOspsvc::EndStep);
}
TaskUninstallOspsvc::~TaskUninstallOspsvc()
m_context.job->UpdateProgress(UninstallerContext::UNINSTALL_REMOVE_OSPSVC,
"Uninstall OSP service finished");
}
+
+void TaskUninstallOspsvc::StartStep()
+{
+ LogDebug("--------- <TaskUninstallOspsvc> : START ----------");
+}
+
+void TaskUninstallOspsvc::EndStep()
+{
+ LogDebug("--------- <TaskUninstallOspsvc> : END ----------");
+}
} //namespace WidgetUninstall
} //namespace Jobs
//steps
void StepUninstallOspsvc();
+ void StartStep();
+ void EndStep();
+
public:
TaskUninstallOspsvc(UninstallerContext& context);
virtual ~TaskUninstallOspsvc();
int WrtInstaller::getReturnStatus() const
{
- if (!m_returnStatus) {
- return RE_SUCCESS;
- } else {
- return RE_FAIL;
- }
+ return m_returnStatus;
}
void WrtInstaller::OnStop()
if (WRT_SUCCESS != status) {
// Failure
LogError("Step failed");
- This->m_returnStatus = 1;
+ This->m_returnStatus = status;
This->showErrorMsg(status, tizenId, printMsg);
if (WRT_SUCCESS != status) {
// Failure
LogError("Step failed");
- This->m_returnStatus = -1;
+ This->m_returnStatus = status;
This->DPL::Event::ControllerEventHandler<WRTInstallerNS::QuitEvent>
::PostEvent(WRTInstallerNS::QuitEvent());
const char* const VALUE_FALSE = "false";
}
-enum ReturnValue
-{
- RE_SUCCESS,
- RE_FAIL
-};
-
class WrtInstaller :
public DPL::Application,
private DPL::Event::Controller<DPL::TypeListDecl<