Fix adding steps using default steps
[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/configuration/step_fail.h>
9 #include <common/step/filesystem/step_create_storage_directories.h>
10 #include <common/step/filesystem/step_delta_patch.h>
11 #include <common/step/security/step_privilege_compatibility.h>
12 #include <common/step/security/step_recover_privilege_compatibility.h>
13
14 #include <tpk/step/filesystem/step_create_tpk_symbolic_link.h>
15 #include <tpk/step/filesystem/step_tpk_patch_icons.h>
16 #include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
17 #include <tpk/step/filesystem/step_tpk_update_package_directory.h>
18 #include <tpk/step/pkgmgr/step_manifest_adjustment.h>
19 #include <tpk/step/security/step_tpk_recover_signature.h>
20
21 #include "hybrid/hybrid_backend_data.h"
22 #include "hybrid/shared_dirs.h"
23 #include "hybrid/step/configuration/step_merge_tpk_config.h"
24 #include "hybrid/step/configuration/step_merge_tpk_privileges.h"
25 #include "hybrid/step/configuration/step_set_mainapp.h"
26 #include "hybrid/step/configuration/step_stash_tpk_config.h"
27 #include "hybrid/step/encryption/step_encrypt_hybrid_resources.h"
28 #include "hybrid/step/pkgmgr/step_merge_xml.h"
29 #include "wgt/step/configuration/step_parse.h"
30 #include "wgt/step/configuration/step_set_old_signature_files_location.h"
31 #include "wgt/step/encryption/step_remove_encryption_data.h"
32 #include "wgt/step/filesystem/step_copy_preview_icons.h"
33 #include "wgt/step/filesystem/step_create_wgt_symbolic_link.h"
34 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
35 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
36 #include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
37 #include "wgt/step/pkgmgr/step_generate_xml.h"
38 #include "wgt/step/security/step_check_settings_level.h"
39 #include "wgt/step/security/step_check_wgt_background_category.h"
40 #include "wgt/step/security/step_check_wgt_notification_category.h"
41 #include "wgt/step/security/step_check_wgt_ime_privilege.h"
42
43 namespace ci = common_installer;
44
45 namespace hybrid {
46
47 HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
48     : AppInstaller("wgt", pkgmgr) {
49   context_->cross_app_rules.set(true);
50   context_->backend_data.set(new HybridBackendData());
51 }
52
53 void HybridInstaller::InstallSteps() {
54   AppInstaller::InstallSteps();
55   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckInstallable");
56   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
57       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
58   AddStepAfter<wgt::security::StepCheckSettingsLevel>("Signature");
59   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
60       "CheckSettingsLevel");
61   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
62       "CheckWgtBackgroundCategory");
63   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
64       "CheckWgtNotificationCategory");
65   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
66       "CheckWgtImePrivilege");
67   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
68   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
69   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
70   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
71   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
72       "CreateWgtSymbolicLink");
73   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
74   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
75   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
76   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
77   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
78   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
79       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
80   ReplaceStep<ci::filesystem::StepCreateStorageDirectories>(
81       "CreateStorageDirectories",
82       wgt::filesystem::HybridAdditionalSharedDirs);
83   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
84       "CreateStorageDirectories");
85 }
86
87 void HybridInstaller::UpdateSteps() {
88   AppInstaller::UpdateSteps();
89   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
90   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
91       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
92   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
93   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
94       "CheckSettingsLevel");
95   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
96       "CheckWgtBackgroundCategory");
97   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
98       "CheckWgtNotificationCategory");
99   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
100       "CheckWgtImePrivilege");
101   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
102   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
103   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
104   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
105   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
106       "CreateWgtSymbolicLink");
107   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
108   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
109   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
110   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
111   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
112   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
113       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
114   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
115       "CopyStorageDirectories");
116 }
117
118 void HybridInstaller::UninstallSteps() {
119   AppInstaller::UninstallSteps();
120   AddStepAfter<wgt::encryption::StepRemoveEncryptionData>(
121       "RemovePerUserStorageDirectories");
122 }
123
124 void HybridInstaller::ReinstallSteps() {
125   // RDS is not supported for hybrid apps
126   AddStep<ci::configuration::StepFail>();
127 }
128
129 void HybridInstaller::DeltaSteps() {
130   AppInstaller::DeltaSteps();
131   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
132   AddStepAfter<wgt::filesystem::StepWgtUndoPatchStorageDirectories>(
133       "EnableExternalMount");
134   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
135       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, false);
136   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
137   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
138       "CheckSettingsLevel");
139   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
140       "CheckWgtBackgroundCategory");
141   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
142       "CheckWgtNotificationCategory");
143   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
144       "CheckWgtImePrivilege");
145   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
146   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
147   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
148   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
149   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
150       "CreateWgtSymbolicLink");
151   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
152   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
153   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
154   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
155   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
156   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
157       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
158   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
159       "CopyStorageDirectories");
160 }
161
162 void HybridInstaller::RecoverySteps() {
163   AppInstaller::RecoverySteps();
164   AddStepAfter<tpk::security::StepTpkRecoverSignature>("MountRecover");
165   AddStepAfter<ci::security::StepRecoverPrivilegeCompatibility>(
166       "TpkRecoverSignature",
167       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
168 }
169
170 void HybridInstaller::MountInstallSteps() {
171   AppInstaller::MountInstallSteps();
172   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckInstallable");
173   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
174       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
175   AddStepAfter<wgt::security::StepCheckSettingsLevel>("Signature");
176   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
177       "CheckSettingsLevel");
178   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
179       "CheckWgtBackgroundCategory");
180   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
181       "CheckWgtNotificationCategory");
182   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
183       "CheckWgtImePrivilege");
184   AddStepAfter<tpk::filesystem::StepTpkPreparePackageDirectory>("MountInstall");
185   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
186   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
187   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
188   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
189   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
190       "CreateWgtSymbolicLink");
191   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
192   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
193   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
194   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
195   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
196   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
197       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
198   ReplaceStep<ci::filesystem::StepCreateStorageDirectories>(
199       "CreateStorageDirectories",
200       wgt::filesystem::HybridAdditionalSharedDirs);
201   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
202       "CreateStorageDirectories");
203 }
204
205 void HybridInstaller::MountUpdateSteps() {
206   AppInstaller::MountUpdateSteps();
207   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
208   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
209       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
210   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
211   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
212       "CheckSettingsLevel");
213   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
214       "CheckWgtBackgroundCategory");
215   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
216       "CheckWgtNotificationCategory");
217   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
218       "CheckWgtImePrivilege");
219   AddStepAfter<tpk::filesystem::StepTpkUpdatePackageDirectory>("MountUpdate");
220   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
221   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
222   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
223   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
224   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
225       "CreateWgtSymbolicLink");
226   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
227   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
228   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
229   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
230   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
231   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
232       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
233   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
234       "UpdateStorageDirectories");
235 }
236
237 void HybridInstaller::ManifestDirectInstallSteps() {
238   AppInstaller::ManifestDirectInstallSteps();
239   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckInstallable");
240   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
241       wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
242   AddStepAfter<wgt::security::StepCheckSettingsLevel>("Signature");
243   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
244       "CheckSettingsLevel");
245   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
246       "CheckWgtBackgroundCategory");
247   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
248       "CheckWgtNotificationCategory");
249   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>(
250       "RemoveGlobalAppSymlinks");
251   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
252   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("WgtPatchIcons");
253   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
254       "CreateWgtSymbolicLink");
255   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
256   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
257   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
258   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
259   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
260   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
261       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
262   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
263   ReplaceStep<ci::filesystem::StepCreateStorageDirectories>(
264       "CreateStorageDirectories",
265       wgt::filesystem::HybridAdditionalSharedDirs);
266 }
267
268 void HybridInstaller::ManifestDirectUpdateSteps() {
269   AppInstaller::ManifestDirectUpdateSteps();
270   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
271   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
272       wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
273   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
274   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
275       "CheckSettingsLevel");
276   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
277       "CheckWgtBackgroundCategory");
278   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
279       "CheckWgtNotificationCategory");
280   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>(
281       "RemoveGlobalAppSymlinks");
282   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
283   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("WgtPatchIcons");
284   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
285       "CreateWgtSymbolicLink");
286   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
287   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
288   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
289   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
290   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
291   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
292       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
293   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
294 }
295
296 void HybridInstaller::ManifestPartialInstallSteps() {
297   AppInstaller::ManifestPartialInstallSteps();
298   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("ParseManifest");
299   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
300       wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
301   AddStepAfter<wgt::security::StepCheckSettingsLevel>("Signature");
302   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
303       "CheckSettingsLevel");
304   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
305       "CheckWgtBackgroundCategory");
306   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
307       "CheckWgtNotificationCategory");
308   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("RemoveGlobalAppSymlinks",
309       false);
310   ReplaceStep<ci::filesystem::StepCreateStorageDirectories>(
311       "CreateStorageDirectories",
312       wgt::filesystem::HybridAdditionalSharedDirs);
313   AddStepBefore<hybrid::configuration::StepMergeTpkConfig>(
314       "RegisterApplication");
315   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
316   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
317       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
318   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
319 }
320
321 void HybridInstaller::ManifestPartialUpdateSteps() {
322   AppInstaller::ManifestPartialUpdateSteps();
323   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("ParseManifest");
324   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
325       wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
326   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
327   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
328       "CheckSettingsLevel");
329   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
330       "CheckWgtBackgroundCategory");
331   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
332       "CheckWgtNotificationCategory");
333   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("RemoveGlobalAppSymlinks",
334       false);
335   AddStepBefore<hybrid::configuration::StepMergeTpkConfig>("UpdateApplication");
336   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
337   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
338       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
339   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
340 }
341
342 void HybridInstaller::PartialUninstallSteps() {
343   AppInstaller::PartialUninstallSteps();
344   AddStepAfter<wgt::encryption::StepRemoveEncryptionData>(
345       "RemovePerUserStorageDirectories");
346 }
347
348 void HybridInstaller::ReadonlyUpdateInstallSteps() {
349   AppInstaller::ReadonlyUpdateInstallSteps();
350   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
351   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
352       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
353   AddStepAfter<wgt::security::StepCheckSettingsLevel>("CheckOldCertificate");
354   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
355       "CheckSettingsLevel");
356   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
357       "CheckWgtBackgroundCategory");
358   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
359       "CheckWgtNotificationCategory");
360   AddStepAfter<hybrid::encryption::StepEncryptHybridResources>(
361       "CheckWgtImePrivilege");
362   AddStepAfter<tpk::filesystem::StepTpkPatchIcons>("CreateIcons");
363   AddStepAfter<wgt::filesystem::StepWgtPatchIcons>("TpkPatchIcons", true);
364   AddStepAfter<wgt::filesystem::StepCopyPreviewIcons>("WgtPatchIcons");
365   AddStepAfter<wgt::filesystem::StepCreateWgtSymbolicLink>("CopyPreviewIcons");
366   AddStepAfter<tpk::filesystem::StepCreateTpkSymbolicLink>(
367       "CreateWgtSymbolicLink");
368   AddStepAfter<wgt::pkgmgr::StepGenerateXml>("CreateTpkSymbolicLink");
369   AddStepAfter<hybrid::pkgmgr::StepMergeXml>("GenerateXml");
370   AddStepAfter<tpk::pkgmgr::StepManifestAdjustment>("MergeXml");
371   AddStepAfter<hybrid::configuration::StepMergeTpkConfig>("ManifestAdjustment");
372   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
373   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
374       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
375   AddStepAfter<wgt::filesystem::StepWgtPatchStorageDirectories>(
376       "CreateStorageDirectories");
377 }
378
379 void HybridInstaller::ReadonlyUpdateUninstallSteps() {
380   AppInstaller::ReadonlyUpdateUninstallSteps();
381   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckUpgradable");
382   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
383       wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
384   AddStepAfter<wgt::security::StepCheckSettingsLevel>("Signature");
385   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
386       "CheckSettingsLevel");
387   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
388       "CheckWgtBackgroundCategory");
389   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
390       "CheckWgtNotificationCategory");
391   AddStepBefore<hybrid::configuration::StepMergeTpkConfig>("UpdateApplication");
392   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
393   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
394       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
395   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
396 }
397
398 void HybridInstaller::EnablePkgSteps() {
399   AppInstaller::EnablePkgSteps();
400 }
401
402 void HybridInstaller::DisablePkgSteps() {
403   AppInstaller::DisablePkgSteps();
404 }
405
406 void HybridInstaller::MigrateExtImgSteps() {
407   AppInstaller::MigrateExtImgSteps();
408 }
409
410 void HybridInstaller::RecoverDBSteps() {
411   AppInstaller::RecoverDBSteps();
412   AddStepAfter<hybrid::configuration::StepStashTpkConfig>("CheckInstallable");
413   AddStepAfter<wgt::configuration::StepParse>("StashTpkConfig",
414       wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
415   AddStepAfter<wgt::security::StepCheckSettingsLevel>("GetPrivilegeLevel");
416   AddStepAfter<wgt::security::StepCheckWgtBackgroundCategory>(
417       "CheckSettingsLevel");
418   AddStepAfter<wgt::security::StepCheckWgtNotificationCategory>(
419       "CheckWgtBackgroundCategory");
420   AddStepAfter<wgt::security::StepCheckWgtImePrivilege>(
421       "CheckWgtNotificationCategory");
422   AddStepBefore<hybrid::configuration::StepMergeTpkConfig>(
423       "RegisterApplication");
424   AddStepAfter<hybrid::configuration::StepMergeTpkPrivileges>("MergeTpkConfig");
425   AddStepAfter<ci::security::StepPrivilegeCompatibility>("MergeTpkPrivileges",
426       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
427   AddStepAfter<hybrid::configuration::StepSetMainapp>("PrivilegeCompatibility");
428 }
429
430 }  // namespace hybrid
431