--- /dev/null
+// Copyright (c) 2015 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/step_remove_encryption_data.h"
+
+#include <web_app_enc.h>
+
+#include "common/utils/logging.h"
+
+
+namespace wgt {
+namespace encrypt {
+
+common_installer::Step::Status StepRemoveEncryptionData::process() {
+ // There is no check, if application was encrypted or not
+ // (it is not saved anywhere in tizen manifest)
+ // so, if WAE_ERROR_NO_KEY error, then application was not encrypted
+ int ret = wae_remove_app_dek(context_->pkgid.get().c_str());
+ if (WAE_ERROR_NONE == ret || WAE_ERROR_NO_KEY == ret) {
+ LOG(DEBUG) << "Encryption data removed (if existed)";
+ return common_installer::Step::Status::OK;
+ }
+
+ switch (ret) {
+ case WAE_ERROR_INVALID_PARAMETER:
+ LOG(ERROR) << "Error while removing encryption data: "
+ "WAE_ERROR_INVALID_PARAMETER";
+ break;
+ case WAE_ERROR_PERMISSION_DENIED:
+ LOG(ERROR) << "Error while removing encryption data: "
+ "WAE_ERROR_PERMISSION_DENIED";
+ break;
+ case WAE_ERROR_KEY_MANAGER:
+ LOG(ERROR) << "Error while removing encryption data: "
+ "WAE_ERROR_KEY_MANAGER";
+ break;
+ case WAE_ERROR_UNKNOWN:
+ LOG(ERROR) << "Error while removing encryption data: "
+ "WAE_ERROR_UNKNOWN";
+ break;
+ default:
+ LOG(ERROR) << "Error while removing encryption data: "
+ "UNKNOWN";
+ break;
+ }
+ return common_installer::Step::Status::ERROR;
+}
+
+} // namespace encrypt
+} // namespace wgt
--- /dev/null
+// Copyright (c) 2015 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_STEP_REMOVE_ENCRYPTION_DATA_H_
+#define WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_
+
+#include "common/step/step.h"
+#include "common/utils/logging.h"
+
+namespace wgt {
+namespace encrypt {
+
+class StepRemoveEncryptionData : 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; }
+
+ SCOPE_LOG_TAG(RemoveEncryptionData)
+};
+} // namespace encrypt
+} // namespace wgt
+#endif // WGT_STEP_STEP_REMOVE_ENCRYPTION_DATA_H_
#include "wgt/step/step_check_settings_level.h"
#include "wgt/step/step_encrypt_resources.h"
#include "wgt/step/step_parse.h"
+#include "wgt/step/step_remove_encryption_data.h"
#include "wgt/step/step_rds_parse.h"
#include "wgt/step/step_rds_modify.h"
#include "wgt/step/step_wgt_create_icons.h"
installer.AddStep<ci::filesystem::StepRemoveFiles>();
installer.AddStep<ci::filesystem::StepRemoveIcons>();
installer.AddStep<ci::security::StepRevokeSecurity>();
+ installer.AddStep<wgt::encrypt::StepRemoveEncryptionData>();
break;
}
case ci::PkgMgrInterface::Type::Reinstall: {