#include <common/app_installer.h>
#include <common/paths.h>
#include <common/installer_context.h>
+#include <common/pkgmgr_query.h>
#include <common/privileges.h>
#include <common/step/step.h>
#include <common/utils/glist_range.h>
#include "wgt/wgt_backend_data.h"
namespace bf = boost::filesystem;
+namespace ci = common_installer;
namespace {
manifest->installlocation = strdup("auto");
}
+ // set update true if package is updated preload package
+ ci::RequestType req_type = context_->request_type.get();
+ if (req_type == ci::RequestType::ReadonlyUpdateInstall)
+ manifest->update = strdup("true");
+ else if (req_type == ci::RequestType::ReadonlyUpdateUninstall)
+ manifest->update = strdup("false");
+ else if (ci::QueryIsUpdatedReadonlyPackage(context_->pkgid.get(),
+ context_->uid.get()))
+ manifest->update = strdup("true");
+ else
+ manifest->update = strdup("false");
+
return true;
}
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include <wgt/step/configuration/step_set_old_signature_files_location.h>
+
+#include <boost/filesystem/path.hpp>
+
+#include <common/installer_context.h>
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+const char kWgtPath[] = "res/wgt";
+
+} // namespace
+
+namespace wgt {
+namespace configuration {
+
+ci::Step::Status StepSetOldSignatureFilesLocation::process() {
+ // This step is required for checking signature files at StepCheckSignature.
+ // StepCheckSignature gets path of signature files from unpacked_dir from
+ // unpacked_dir, which is root directory of package, but signature files
+ // are not at root directory.
+ bf::path oldpath = context_->unpacked_dir_path.get();
+ bf::path newpath = oldpath / kWgtPath;
+ context_->unpacked_dir_path.set(newpath);
+ return Status::OK;
+}
+
+} // namespace configuration
+} // namespace wgt
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_CONFIGURATION_STEP_SET_OLD_SIGNATURE_FILES_LOCATION_H_
+#define WGT_STEP_CONFIGURATION_STEP_SET_OLD_SIGNATURE_FILES_LOCATION_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/step/step.h>
+
+namespace wgt {
+namespace configuration {
+
+class StepSetOldSignatureFilesLocation : public common_installer::Step {
+ public:
+ using Step::Step;
+
+ Status process() override;
+ Status clean() override { return Status::OK; }
+ Status undo() override { return Status::OK; }
+ Status precheck() override { return Status::OK; }
+
+ STEP_NAME(SetOldSignatureFilesLocation)
+};
+
+} // namespace configuration
+} // namespace wgt
+
+#endif // WGT_STEP_CONFIGURATION_STEP_SET_OLD_SIGNATURE_FILES_LOCATION_H_
#include <common/step/configuration/step_fail.h>
#include <common/step/configuration/step_parse_manifest.h>
#include <common/step/configuration/step_parse_preload.h>
+#include <common/step/configuration/step_switch_readonly_mode.h>
#include <common/step/filesystem/step_acquire_external_storage.h>
#include <common/step/filesystem/step_optional_acquire_external_storage.h>
#include <common/step/filesystem/step_change_owner.h>
#include "wgt/step/configuration/step_check_rds_manifest.h"
#include "wgt/step/configuration/step_check_start_files.h"
#include "wgt/step/configuration/step_parse.h"
+#include "wgt/step/configuration/step_set_old_signature_files_location.h"
#include "wgt/step/encryption/step_encrypt_resources.h"
#include "wgt/step/encryption/step_remove_encryption_data.h"
#include "wgt/step/filesystem/step_copy_preview_icons.h"
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
break;
}
+ case ci::RequestType::ReadonlyUpdateInstall: {
+ AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+ AddStep<ci::filesystem::StepUnzip>();
+ AddStep<wgt::configuration::StepParse>(
+ wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
+ AddStep<ci::configuration::StepParsePreload>();
+ AddStep<ci::configuration::StepCheckTizenVersion>();
+ AddStep<ci::security::StepCheckSignature>();
+ AddStep<ci::security::StepPrivilegeCompatibility>(
+ ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+ AddStep<wgt::security::StepCheckSettingsLevel>();
+ AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+ AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+ AddStep<wgt::security::StepCheckWgtImePrivilege>();
+ AddStep<ci::security::StepCheckOldCertificate>();
+ AddStep<wgt::encryption::StepEncryptResources>();
+ AddStep<wgt::filesystem::StepWgtResourceDirectory>();
+ AddStep<ci::security::StepRollbackInstallationSecurity>();
+ AddStep<ci::configuration::StepSwitchReadonlyMode>();
+ AddStep<ci::configuration::StepParseManifest>(
+ ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+ ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+ AddStep<ci::configuration::StepSwitchReadonlyMode>();
+ AddStep<ci::configuration::StepBlockCrossUpdate>();
+ AddStep<ci::pkgmgr::StepKillApps>();
+ AddStep<ci::filesystem::StepCopy>();
+ AddStep<ci::filesystem::StepCopyTep>();
+ AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+ AddStep<ci::filesystem::StepCreateStorageDirectories>();
+ AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+ AddStep<wgt::filesystem::StepWgtPatchIcons>();
+ AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+ AddStep<wgt::security::StepCheckExtensionPrivileges>();
+ AddStep<wgt::pkgmgr::StepGenerateXml>();
+ AddStep<ci::pkgmgr::StepUpdateApplication>();
+ AddStep<ci::security::StepUpdateSecurity>();
+ AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+ AddStep<ci::filesystem::StepChangeOwner>();
+ AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+ break;
+ }
+ case ci::RequestType::ReadonlyUpdateUninstall: {
+ AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+ AddStep<ci::pkgmgr::StepCheckRestriction>();
+ AddStep<ci::pkgmgr::StepCheckRemovable>();
+ AddStep<ci::configuration::StepParseManifest>(
+ ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+ ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+ AddStep<ci::configuration::StepSwitchReadonlyMode>();
+ AddStep<ci::configuration::StepParseManifest>(
+ ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+ ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+ AddStep<wgt::configuration::StepSetOldSignatureFilesLocation>();
+ AddStep<ci::security::StepCheckSignature>();
+ AddStep<ci::configuration::StepSwitchReadonlyMode>();
+ AddStep<ci::pkgmgr::StepKillApps>();
+ AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+ AddStep<ci::filesystem::StepRemoveTep>();
+ AddStep<ci::filesystem::StepRemoveFiles>();
+ AddStep<ci::filesystem::StepRemoveZipImage>();
+ AddStep<ci::pkgmgr::StepUpdateApplication>();
+ AddStep<ci::security::StepUpdateSecurity>();
+ AddStep<ci::pkgmgr::StepRemoveManifest>();
+ AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+ break;
+ }
case ci::RequestType::Move: {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(