Add patch icon steps at ManifestDirectInstall of hybrid installer
[platform/core/appfw/wgt-backend.git] / src / hybrid / hybrid_installer.cc
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #include "hybrid/hybrid_installer.h"
6
7 #include <common/privileges.h>
8 #include <common/step/backup/step_backup_icons.h>
9 #include <common/step/backup/step_backup_manifest.h>
10 #include <common/step/backup/step_copy_backup.h>
11 #include <common/step/configuration/step_block_cross_update.h>
12 #include <common/step/configuration/step_check_tizen_version.h>
13 #include <common/step/configuration/step_configure.h>
14 #include <common/step/configuration/step_fail.h>
15 #include <common/step/configuration/step_parse_manifest.h>
16 #include <common/step/configuration/step_parse_preload.h>
17 #include <common/step/filesystem/step_acquire_external_storage.h>
18 #include <common/step/filesystem/step_optional_acquire_external_storage.h>
19 #include <common/step/filesystem/step_change_ownership_and_permission.h>
20 #include <common/step/filesystem/step_copy.h>
21 #include <common/step/filesystem/step_copy_storage_directories.h>
22 #include <common/step/filesystem/step_copy_tep.h>
23 #include <common/step/filesystem/step_create_icons.h>
24 #include <common/step/filesystem/step_create_globalapp_symlinks.h>
25 #include <common/step/filesystem/step_create_per_user_storage_directories.h>
26 #include <common/step/filesystem/step_create_storage_directories.h>
27 #include <common/step/filesystem/step_delta_patch.h>
28 #include <common/step/filesystem/step_disable_external_mount.h>
29 #include <common/step/filesystem/step_enable_external_mount.h>
30 #include <common/step/filesystem/step_migrate_legacy_external_image.h>
31 #include <common/step/filesystem/step_recover_change_owner.h>
32 #include <common/step/filesystem/step_recover_files.h>
33 #include <common/step/filesystem/step_recover_icons.h>
34 #include <common/step/filesystem/step_recover_manifest.h>
35 #include <common/step/filesystem/step_recover_external_storage.h>
36 #include <common/step/filesystem/step_recover_storage_directories.h>
37 #include <common/step/filesystem/step_remove_files.h>
38 #include <common/step/filesystem/step_remove_icons.h>
39 #include <common/step/filesystem/step_remove_globalapp_symlinks.h>
40 #include <common/step/filesystem/step_remove_per_user_storage_directories.h>
41 #include <common/step/filesystem/step_remove_temporary_directory.h>
42 #include <common/step/filesystem/step_remove_zip_image.h>
43 #include <common/step/filesystem/step_remove_tep.h>
44 #include <common/step/filesystem/step_unzip.h>
45 #include <common/step/filesystem/step_update_per_user_storage_directories.h>
46 #include <common/step/filesystem/step_update_storage_directories.h>
47 #include <common/step/filesystem/step_update_tep.h>
48 #include <common/step/mount/step_mount_install.h>
49 #include <common/step/mount/step_mount_unpacked.h>
50 #include <common/step/mount/step_mount_recover.h>
51 #include <common/step/mount/step_mount_update.h>
52 #include <common/step/pkgmgr/step_check_force_clean.h>
53 #include <common/step/pkgmgr/step_check_installable.h>
54 #include <common/step/pkgmgr/step_check_removable.h>
55 #include <common/step/pkgmgr/step_check_restriction.h>
56 #include <common/step/pkgmgr/step_kill_apps.h>
57 #include <common/step/pkgmgr/step_recover_application.h>
58 #include <common/step/pkgmgr/step_register_app.h>
59 #include <common/step/pkgmgr/step_remove_manifest.h>
60 #include <common/step/pkgmgr/step_run_parser_plugins.h>
61 #include <common/step/pkgmgr/step_unregister_app.h>
62 #include <common/step/pkgmgr/step_update_app.h>
63 #include <common/step/pkgmgr/step_update_pkg_disable_info.h>
64 #include <common/step/recovery/step_open_recovery_file.h>
65 #include <common/step/security/step_check_signature.h>
66 #include <common/step/security/step_privacy_privilege.h>
67 #include <common/step/security/step_privilege_compatibility.h>
68 #include <common/step/security/step_recover_security.h>
69 #include <common/step/security/step_register_security.h>
70 #include <common/step/security/step_revoke_security.h>
71 #include <common/step/security/step_rollback_deinstallation_security.h>
72 #include <common/step/security/step_rollback_installation_security.h>
73 #include <common/step/security/step_update_security.h>
74 #include <common/step/security/step_register_trust_anchor.h>
75 #include <common/step/security/step_unregister_trust_anchor.h>
76
77 #include <tpk/step/filesystem/step_create_symbolic_link.h>
78 #include <tpk/step/filesystem/step_tpk_patch_icons.h>
79 #include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
80 #include <tpk/step/filesystem/step_tpk_update_package_directory.h>
81 #include <tpk/step/pkgmgr/step_manifest_adjustment.h>
82 #include <tpk/step/security/step_tpk_recover_signature.h>
83
84 #include "hybrid/hybrid_backend_data.h"
85 #include "hybrid/shared_dirs.h"
86 #include "hybrid/step/configuration/step_merge_tpk_config.h"
87 #include "hybrid/step/configuration/step_merge_tpk_privileges.h"
88 #include "hybrid/step/configuration/step_stash_tpk_config.h"
89 #include "hybrid/step/encryption/step_encrypt_resources.h"
90 #include "hybrid/step/pkgmgr/step_generate_xml.h"
91 #include "wgt/step/configuration/step_parse.h"
92 #include "wgt/step/encryption/step_remove_encryption_data.h"
93 #include "wgt/step/filesystem/step_copy_preview_icons.h"
94 #include "wgt/step/filesystem/step_create_symbolic_link.h"
95 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
96 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
97 #include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
98 #include "wgt/step/pkgmgr/step_generate_xml.h"
99 #include "wgt/step/security/step_check_settings_level.h"
100 #include "wgt/step/security/step_check_wgt_background_category.h"
101 #include "wgt/step/security/step_check_wgt_notification_category.h"
102 #include "wgt/step/security/step_check_wgt_ime_privilege.h"
103
104 namespace ci = common_installer;
105
106 namespace hybrid {
107
108 HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
109     : AppInstaller("wgt", pkgmgr) {
110   context_->cross_app_rules.set(true);
111   context_->backend_data.set(new HybridBackendData());
112
113   switch (pkgmgr_->GetRequestType()) {
114     case ci::RequestType::Install:
115       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
116       AddStep<ci::filesystem::StepUnzip>();
117       AddStep<ci::configuration::StepParseManifest>(
118           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
119           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
120       AddStep<ci::pkgmgr::StepCheckInstallable>();
121       AddStep<hybrid::configuration::StepStashTpkConfig>();
122       AddStep<wgt::configuration::StepParse>(
123           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
124       AddStep<ci::configuration::StepParsePreload>();
125       AddStep<ci::pkgmgr::StepCheckRestriction>();
126       AddStep<ci::configuration::StepCheckTizenVersion>();
127       AddStep<ci::security::StepCheckSignature>();
128       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
129       AddStep<ci::security::StepPrivilegeCompatibility>(
130           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
131       AddStep<wgt::security::StepCheckSettingsLevel>();
132       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
133       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
134       AddStep<wgt::security::StepCheckWgtImePrivilege>();
135       AddStep<hybrid::encryption::StepEncryptResources>();
136       AddStep<ci::security::StepRollbackInstallationSecurity>();
137       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
138       AddStep<ci::filesystem::StepAcquireExternalStorage>(false);
139       AddStep<ci::filesystem::StepCopy>();
140       AddStep<ci::filesystem::StepCopyTep>();
141       AddStep<tpk::filesystem::StepTpkPatchIcons>();
142       AddStep<wgt::filesystem::StepWgtPatchIcons>();
143       AddStep<ci::filesystem::StepCreateIcons>();
144       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
145       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
146       AddStep<ci::filesystem::StepCreateStorageDirectories>();
147       AddStep<wgt::pkgmgr::StepGenerateXml>();
148       AddStep<hybrid::pkgmgr::StepGenerateXml>();
149       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
150       AddStep<hybrid::configuration::StepMergeTpkConfig>();
151       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
152       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
153       AddStep<ci::pkgmgr::StepRegisterApplication>();
154       AddStep<ci::security::StepRegisterTrustAnchor>(
155           ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
156       AddStep<ci::security::StepPrivacyPrivilege>(
157           ci::security::StepPrivacyPrivilege::ActionType::Install);
158       AddStep<ci::security::StepRegisterSecurity>();
159       AddStep<ci::pkgmgr::StepRunParserPlugin>(
160           ci::Plugin::ActionType::Install);
161       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
162           wgt::filesystem::HybridAdditionalSharedDirs);
163       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
164       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
165       break;
166     case ci::RequestType::Update:
167       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
168       AddStep<ci::filesystem::StepUnzip>();
169       AddStep<ci::configuration::StepParseManifest>(
170           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
171           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
172       AddStep<hybrid::configuration::StepStashTpkConfig>();
173       AddStep<wgt::configuration::StepParse>(
174           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
175       AddStep<ci::configuration::StepParsePreload>();
176       AddStep<ci::configuration::StepCheckTizenVersion>();
177       AddStep<ci::security::StepCheckSignature>();
178       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
179       AddStep<ci::security::StepPrivilegeCompatibility>(
180           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
181       AddStep<wgt::security::StepCheckSettingsLevel>();
182       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
183       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
184       AddStep<wgt::security::StepCheckWgtImePrivilege>();
185       AddStep<hybrid::encryption::StepEncryptResources>();
186       AddStep<ci::configuration::StepParseManifest>(
187           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
188           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
189       AddStep<ci::configuration::StepBlockCrossUpdate>();
190       AddStep<ci::pkgmgr::StepKillApps>();
191       AddStep<ci::backup::StepBackupManifest>();
192       AddStep<ci::backup::StepBackupIcons>();
193       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
194       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
195       AddStep<ci::backup::StepCopyBackup>();
196       AddStep<ci::filesystem::StepUpdateTep>();
197       AddStep<ci::filesystem::StepUpdateStorageDirectories>();
198       AddStep<tpk::filesystem::StepTpkPatchIcons>();
199       AddStep<wgt::filesystem::StepWgtPatchIcons>();
200       AddStep<ci::filesystem::StepCreateIcons>();
201       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
202       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
203       AddStep<ci::filesystem::StepCopyStorageDirectories>();
204       AddStep<wgt::pkgmgr::StepGenerateXml>();
205       AddStep<hybrid::pkgmgr::StepGenerateXml>();
206       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
207       AddStep<hybrid::configuration::StepMergeTpkConfig>();
208       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
209       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
210       AddStep<ci::pkgmgr::StepUpdateApplication>();
211       AddStep<ci::security::StepRegisterTrustAnchor>(
212           ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
213       AddStep<ci::security::StepPrivacyPrivilege>(
214           ci::security::StepPrivacyPrivilege::ActionType::Update);
215       AddStep<ci::security::StepUpdateSecurity>();
216       AddStep<ci::pkgmgr::StepRunParserPlugin>(
217           ci::Plugin::ActionType::Upgrade);
218       AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
219       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
220       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
221       break;
222     case ci::RequestType::Uninstall:
223       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
224       AddStep<ci::pkgmgr::StepCheckRestriction>();
225       AddStep<ci::pkgmgr::StepCheckRemovable>();
226       AddStep<ci::pkgmgr::StepCheckForceClean>();
227       AddStep<ci::configuration::StepParseManifest>(
228           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
229           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
230       AddStep<ci::pkgmgr::StepRunParserPlugin>(
231           ci::Plugin::ActionType::Uninstall);
232       AddStep<ci::pkgmgr::StepKillApps>();
233       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
234       AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
235       AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
236       AddStep<ci::pkgmgr::StepUnregisterApplication>();
237       AddStep<ci::security::StepRollbackDeinstallationSecurity>();
238       AddStep<ci::filesystem::StepRemoveTep>();
239       AddStep<ci::filesystem::StepRemoveFiles>();
240       AddStep<ci::filesystem::StepRemoveZipImage>();
241       AddStep<ci::filesystem::StepRemoveIcons>();
242       AddStep<wgt::encryption::StepRemoveEncryptionData>();
243       AddStep<ci::security::StepUnregisterTrustAnchor>();
244       AddStep<ci::security::StepPrivacyPrivilege>(
245           ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
246       AddStep<ci::security::StepRevokeSecurity>();
247       AddStep<ci::pkgmgr::StepRemoveManifest>();
248       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
249       break;
250     case ci::RequestType::Reinstall:
251       // RDS is not supported for hybrid apps
252       AddStep<ci::configuration::StepFail>();
253       break;
254     case ci::RequestType::Delta:
255       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
256       AddStep<ci::filesystem::StepUnzip>();
257       AddStep<ci::configuration::StepParseManifest>(
258           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
259           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
260       AddStep<wgt::filesystem::StepWgtUndoPatchStorageDirectories>();
261       AddStep<hybrid::configuration::StepStashTpkConfig>();
262       AddStep<ci::configuration::StepParseManifest>(
263           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
264           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
265       AddStep<ci::filesystem::StepEnableExternalMount>();
266       AddStep<ci::filesystem::StepDeltaPatch>();
267       AddStep<ci::filesystem::StepDisableExternalMount>();
268       AddStep<wgt::configuration::StepParse>(
269           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
270       AddStep<ci::configuration::StepParsePreload>();
271       AddStep<ci::configuration::StepCheckTizenVersion>();
272       AddStep<ci::security::StepCheckSignature>();
273       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
274       AddStep<ci::security::StepPrivilegeCompatibility>(
275           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
276       AddStep<wgt::security::StepCheckSettingsLevel>();
277       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
278       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
279       AddStep<wgt::security::StepCheckWgtImePrivilege>();
280       AddStep<hybrid::encryption::StepEncryptResources>();
281       AddStep<ci::configuration::StepBlockCrossUpdate>();
282       AddStep<ci::pkgmgr::StepKillApps>();
283       AddStep<ci::backup::StepBackupManifest>();
284       AddStep<ci::backup::StepBackupIcons>();
285       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
286       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
287       AddStep<ci::backup::StepCopyBackup>();
288       AddStep<ci::filesystem::StepUpdateTep>();
289       AddStep<ci::filesystem::StepUpdateStorageDirectories>();
290       AddStep<tpk::filesystem::StepTpkPatchIcons>();
291       AddStep<wgt::filesystem::StepWgtPatchIcons>();
292       AddStep<ci::filesystem::StepCreateIcons>();
293       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
294       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
295       AddStep<ci::filesystem::StepCopyStorageDirectories>();
296       AddStep<wgt::pkgmgr::StepGenerateXml>();
297       AddStep<hybrid::pkgmgr::StepGenerateXml>();
298       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
299       AddStep<hybrid::configuration::StepMergeTpkConfig>();
300       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
301       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
302       AddStep<ci::security::StepRegisterTrustAnchor>(
303           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
304       AddStep<ci::security::StepPrivacyPrivilege>(
305           ci::security::StepPrivacyPrivilege::ActionType::Update);
306       AddStep<ci::pkgmgr::StepUpdateApplication>();
307       AddStep<ci::security::StepUpdateSecurity>();
308       AddStep<ci::pkgmgr::StepRunParserPlugin>(
309           ci::Plugin::ActionType::Upgrade);
310       AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
311       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
312       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
313       break;
314     case ci::RequestType::Recovery:
315       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
316       AddStep<ci::recovery::StepOpenRecoveryFile>();
317       AddStep<ci::configuration::StepParseManifest>(
318           ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
319           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
320       AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
321       AddStep<ci::filesystem::StepRecoverIcons>();
322       AddStep<ci::filesystem::StepRecoverManifest>();
323       AddStep<ci::filesystem::StepRecoverExternalStorage>();
324       AddStep<ci::filesystem::StepRecoverStorageDirectories>();
325       AddStep<ci::filesystem::StepRecoverFiles>();
326       AddStep<ci::mount::StepMountRecover>();
327       AddStep<tpk::security::StepTpkRecoverSignature>();
328       AddStep<ci::filesystem::StepRecoverChangeOwner>();
329       AddStep<ci::security::StepRecoverSecurity>();
330       AddStep<ci::pkgmgr::StepRecoverApplication>();
331       break;
332     case ci::RequestType::MountInstall:
333       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
334       AddStep<ci::mount::StepMountUnpacked>();
335       AddStep<ci::configuration::StepParseManifest>(
336           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
337           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
338       AddStep<ci::pkgmgr::StepCheckInstallable>();
339       AddStep<hybrid::configuration::StepStashTpkConfig>();
340       AddStep<wgt::configuration::StepParse>(
341           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
342       AddStep<ci::configuration::StepParsePreload>();
343       AddStep<ci::pkgmgr::StepCheckRestriction>();
344       AddStep<ci::configuration::StepCheckTizenVersion>();
345       AddStep<ci::security::StepCheckSignature>();
346       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
347       AddStep<ci::security::StepPrivilegeCompatibility>(
348           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
349       AddStep<wgt::security::StepCheckSettingsLevel>();
350       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
351       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
352       AddStep<wgt::security::StepCheckWgtImePrivilege>();
353       AddStep<hybrid::encryption::StepEncryptResources>();
354       AddStep<ci::security::StepRollbackInstallationSecurity>();
355       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
356       AddStep<ci::mount::StepMountInstall>();
357       AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
358       AddStep<ci::filesystem::StepCopyTep>();
359       AddStep<tpk::filesystem::StepTpkPatchIcons>();
360       AddStep<wgt::filesystem::StepWgtPatchIcons>();
361       AddStep<ci::filesystem::StepCreateIcons>();
362       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
363       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
364       AddStep<ci::filesystem::StepCreateStorageDirectories>();
365       AddStep<wgt::pkgmgr::StepGenerateXml>();
366       AddStep<hybrid::pkgmgr::StepGenerateXml>();
367       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
368       AddStep<hybrid::configuration::StepMergeTpkConfig>();
369       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
370       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
371       AddStep<ci::pkgmgr::StepRegisterApplication>();
372       AddStep<ci::security::StepRegisterTrustAnchor>(
373           ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
374       AddStep<ci::security::StepPrivacyPrivilege>(
375           ci::security::StepPrivacyPrivilege::ActionType::Install);
376       AddStep<ci::security::StepRegisterSecurity>();
377       AddStep<ci::pkgmgr::StepRunParserPlugin>(
378           ci::Plugin::ActionType::Install);
379       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
380           wgt::filesystem::HybridAdditionalSharedDirs);
381       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
382       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
383       break;
384     case ci::RequestType::MountUpdate:
385       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
386       AddStep<ci::mount::StepMountUnpacked>();
387       AddStep<ci::configuration::StepParseManifest>(
388           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
389           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
390       AddStep<hybrid::configuration::StepStashTpkConfig>();
391       AddStep<wgt::configuration::StepParse>(
392           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
393       AddStep<ci::configuration::StepParsePreload>();
394       AddStep<ci::configuration::StepCheckTizenVersion>();
395       AddStep<ci::security::StepCheckSignature>();
396       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
397       AddStep<ci::security::StepPrivilegeCompatibility>(
398           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
399       AddStep<wgt::security::StepCheckSettingsLevel>();
400       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
401       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
402       AddStep<wgt::security::StepCheckWgtImePrivilege>();
403       AddStep<hybrid::encryption::StepEncryptResources>();
404       AddStep<ci::configuration::StepParseManifest>(
405           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
406           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
407       AddStep<ci::configuration::StepBlockCrossUpdate>();
408       AddStep<ci::pkgmgr::StepKillApps>();
409       AddStep<ci::backup::StepBackupManifest>();
410       AddStep<ci::backup::StepBackupIcons>();
411       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
412       AddStep<ci::mount::StepMountUpdate>();
413       AddStep<tpk::filesystem::StepTpkUpdatePackageDirectory>();
414       AddStep<ci::filesystem::StepUpdateTep>();
415       AddStep<ci::filesystem::StepUpdateStorageDirectories>();
416       AddStep<tpk::filesystem::StepTpkPatchIcons>();
417       AddStep<wgt::filesystem::StepWgtPatchIcons>();
418       AddStep<ci::filesystem::StepCreateIcons>();
419       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
420       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
421       AddStep<wgt::pkgmgr::StepGenerateXml>();
422       AddStep<hybrid::pkgmgr::StepGenerateXml>();
423       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
424       AddStep<hybrid::configuration::StepMergeTpkConfig>();
425       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
426       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
427       AddStep<ci::pkgmgr::StepUpdateApplication>();
428       AddStep<ci::security::StepRegisterTrustAnchor>(
429           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
430       AddStep<ci::security::StepPrivacyPrivilege>(
431           ci::security::StepPrivacyPrivilege::ActionType::Update);
432       AddStep<ci::security::StepUpdateSecurity>();
433       AddStep<ci::pkgmgr::StepRunParserPlugin>(
434           ci::Plugin::ActionType::Upgrade);
435       AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
436       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
437       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
438       break;
439     case ci::RequestType::ManifestDirectInstall:
440       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
441       AddStep<ci::configuration::StepParseManifest>(
442           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
443           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
444       AddStep<ci::pkgmgr::StepCheckInstallable>();
445       AddStep<hybrid::configuration::StepStashTpkConfig>();
446       AddStep<wgt::configuration::StepParse>(
447           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
448       AddStep<ci::configuration::StepParsePreload>();
449       AddStep<ci::configuration::StepCheckTizenVersion>();
450       AddStep<ci::security::StepCheckSignature>();
451       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
452       AddStep<ci::security::StepPrivilegeCompatibility>(
453           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
454       AddStep<wgt::security::StepCheckSettingsLevel>();
455       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
456       AddStep<ci::security::StepRollbackInstallationSecurity>();
457       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
458       AddStep<tpk::filesystem::StepTpkPatchIcons>();
459       AddStep<wgt::filesystem::StepWgtPatchIcons>();
460       AddStep<wgt::pkgmgr::StepGenerateXml>();
461       AddStep<hybrid::pkgmgr::StepGenerateXml>();
462       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
463       AddStep<hybrid::configuration::StepMergeTpkConfig>();
464       AddStep<ci::pkgmgr::StepRegisterApplication>();
465       AddStep<ci::security::StepRegisterTrustAnchor>(
466           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
467       AddStep<ci::security::StepPrivacyPrivilege>(
468           ci::security::StepPrivacyPrivilege::ActionType::Install);
469       AddStep<ci::security::StepRegisterSecurity>();
470       AddStep<ci::pkgmgr::StepRunParserPlugin>(
471           ci::Plugin::ActionType::Install);
472       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
473           wgt::filesystem::HybridAdditionalSharedDirs);
474       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
475       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
476       break;
477     case ci::RequestType::ManifestDirectUpdate:
478       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
479       AddStep<ci::configuration::StepParseManifest>(
480           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
481           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
482       AddStep<hybrid::configuration::StepStashTpkConfig>();
483       AddStep<wgt::configuration::StepParse>(
484           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
485       AddStep<ci::configuration::StepParsePreload>();
486       AddStep<ci::configuration::StepCheckTizenVersion>();
487       AddStep<ci::security::StepCheckSignature>();
488       AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
489       AddStep<ci::security::StepPrivilegeCompatibility>(
490           ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
491       AddStep<wgt::security::StepCheckSettingsLevel>();
492       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
493       AddStep<ci::configuration::StepParseManifest>(
494           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
495           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
496       AddStep<ci::pkgmgr::StepKillApps>();
497       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
498       AddStep<tpk::filesystem::StepTpkPatchIcons>();
499       AddStep<wgt::filesystem::StepWgtPatchIcons>();
500       AddStep<wgt::pkgmgr::StepGenerateXml>();
501       AddStep<hybrid::pkgmgr::StepGenerateXml>();
502       AddStep<tpk::pkgmgr::StepManifestAdjustment>();
503       AddStep<hybrid::configuration::StepMergeTpkConfig>();
504       AddStep<ci::pkgmgr::StepUpdateApplication>();
505       AddStep<ci::security::StepRegisterTrustAnchor>(
506           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
507       AddStep<ci::security::StepPrivacyPrivilege>(
508           ci::security::StepPrivacyPrivilege::ActionType::Update);
509       AddStep<ci::security::StepUpdateSecurity>();
510       AddStep<ci::pkgmgr::StepRunParserPlugin>(
511           ci::Plugin::ActionType::Upgrade);
512       AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
513       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
514       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
515       break;
516     case ci::RequestType::ManifestPartialInstall: {
517       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
518       AddStep<ci::configuration::StepParseManifest>(
519           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
520           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
521       AddStep<hybrid::configuration::StepStashTpkConfig>();
522       AddStep<wgt::configuration::StepParse>(
523           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
524       AddStep<hybrid::configuration::StepMergeTpkConfig>();
525       AddStep<ci::configuration::StepParsePreload>();
526       AddStep<ci::security::StepCheckSignature>();
527       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
528       AddStep<ci::pkgmgr::StepRegisterApplication>();
529       AddStep<ci::security::StepRegisterTrustAnchor>(
530           ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
531       AddStep<ci::security::StepPrivacyPrivilege>(
532           ci::security::StepPrivacyPrivilege::ActionType::Install);
533       AddStep<ci::security::StepRegisterSecurity>();
534       AddStep<ci::pkgmgr::StepRunParserPlugin>(
535           ci::Plugin::ActionType::Install);
536       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
537           wgt::filesystem::HybridAdditionalSharedDirs);
538       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
539       break;
540     }
541     case ci::RequestType::ManifestPartialUpdate: {
542       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
543       AddStep<ci::configuration::StepParseManifest>(
544           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
545           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
546       AddStep<hybrid::configuration::StepStashTpkConfig>();
547       AddStep<wgt::configuration::StepParse>(
548           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
549       AddStep<hybrid::configuration::StepMergeTpkConfig>();
550       AddStep<ci::configuration::StepParsePreload>();
551       AddStep<ci::security::StepCheckSignature>();
552       AddStep<ci::configuration::StepParseManifest>(
553           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
554           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
555       AddStep<ci::pkgmgr::StepKillApps>();
556       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
557       AddStep<ci::pkgmgr::StepUpdateApplication>();
558       AddStep<ci::security::StepRegisterTrustAnchor>(
559           ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
560       AddStep<ci::security::StepPrivacyPrivilege>(
561           ci::security::StepPrivacyPrivilege::ActionType::Update);
562       AddStep<ci::security::StepUpdateSecurity>();
563       AddStep<ci::pkgmgr::StepRunParserPlugin>(
564           ci::Plugin::ActionType::Upgrade);
565       AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
566       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
567       break;
568     }
569     case ci::RequestType::PartialUninstall: {
570       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
571       AddStep<ci::pkgmgr::StepCheckRestriction>();
572       AddStep<ci::pkgmgr::StepCheckRemovable>();
573       AddStep<ci::pkgmgr::StepCheckForceClean>();
574       AddStep<ci::configuration::StepParseManifest>(
575           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
576           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
577       AddStep<ci::pkgmgr::StepRunParserPlugin>(
578           ci::Plugin::ActionType::Uninstall);
579       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
580       AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
581       AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
582       AddStep<ci::pkgmgr::StepUnregisterApplication>();
583       AddStep<wgt::encryption::StepRemoveEncryptionData>();
584       AddStep<ci::security::StepUnregisterTrustAnchor>();
585       AddStep<ci::security::StepPrivacyPrivilege>(
586           ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
587       AddStep<ci::security::StepRevokeSecurity>();
588       break;
589     }
590     case ci::RequestType::EnablePkg:
591       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
592       AddStep<ci::configuration::StepParseManifest>(
593           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
594           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
595       AddStep<ci::pkgmgr::StepKillApps>();
596       AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
597         ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
598       AddStep<ci::pkgmgr::StepRunParserPlugin>(
599         ci::Plugin::ActionType::Uninstall);
600       break;
601     case ci::RequestType::DisablePkg:
602       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
603       AddStep<ci::configuration::StepParseManifest>(
604           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
605           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
606       AddStep<ci::pkgmgr::StepKillApps>();
607       AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
608         ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
609       AddStep<ci::pkgmgr::StepRunParserPlugin>(
610         ci::Plugin::ActionType::Uninstall);
611       break;
612     case ci::RequestType::MigrateExtImg: {
613       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
614       AddStep<ci::security::StepMigrateLegacyExtImage>();
615       AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
616       break;
617     }
618     default:
619       AddStep<ci::configuration::StepFail>();
620       break;
621   }
622 }
623
624 }  // namespace hybrid
625