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