HYOKEUN Aegis Test 25/200025/1 tizen_4.0_da_fhub3.0
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 18 Feb 2019 07:18:06 +0000 (16:18 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Mon, 18 Feb 2019 07:18:51 +0000 (16:18 +0900)
Change-Id: I533d12abc93b54bcee1fee3ca8f322aa34ea0ee3

374 files changed:
.cproject [deleted file]
.exportMap [deleted file]
.project [deleted file]
.tproject [deleted file]
AUTHORS [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
LICENSE
WORKSPACE [deleted file]
aegis_test.c [deleted file]
cmake/Modules/ApplyPkgConfig.cmake [new file with mode: 0644]
complication-provider/.cproject [deleted file]
complication-provider/.exportMap [deleted file]
complication-provider/.project [deleted file]
complication-provider/.tproject [deleted file]
complication-provider/inc/complication-provider.h [deleted file]
complication-provider/project_def.prop [deleted file]
complication-provider/src/complication-provider.c [deleted file]
complication-provider/tizen-manifest.xml [deleted file]
data/CMakeLists.txt [new file with mode: 0644]
data/default.png [moved from complication-provider/shared/res/complication-provider.png with 100% similarity, mode: 0644]
inc/analog-watch.h [deleted file]
inc/app-log.h [deleted file]
inc/comp-manager.h [deleted file]
inc/data-provider.h [deleted file]
inc/utils.h [deleted file]
inc/view.h [deleted file]
packaging/wgt-backend-tests.manifest [new file with mode: 0644]
packaging/wgt-backend.manifest [new file with mode: 0644]
packaging/wgt-backend.spec [new file with mode: 0644]
project_def.prop [deleted file]
res/edje/color_classes.edc [deleted file]
res/edje/main.edc [deleted file]
res/images/battery/ref_battery_ic_01.png [deleted file]
res/images/battery/ref_battery_ic_02.png [deleted file]
res/images/battery/ref_battery_percent_01.png [deleted file]
res/images/battery/ref_battery_percent_02.png [deleted file]
res/images/battery/ref_com_bg.png [deleted file]
res/images/battery/ref_com_gauge_01.png [deleted file]
res/images/battery/ref_com_gauge_02.png [deleted file]
res/images/battery/ref_com_gauge_03.png [deleted file]
res/images/battery/ref_com_gauge_hands_01.png [deleted file]
res/images/battery/ref_com_gauge_hands_02.png [deleted file]
res/images/battery/ref_com_gauge_hands_03.png [deleted file]
res/images/dial/ref_dial_bg.png [deleted file]
res/images/dial/ref_dial_unit_01.png [deleted file]
res/images/dial/ref_dial_unit_02.png [deleted file]
res/images/dial/ref_dial_unit_03.png [deleted file]
res/images/dial/ref_dial_unit_04.png [deleted file]
res/images/dial/ref_dial_unit_05.png [deleted file]
res/images/hands/ref_hands_01_center_pivot.png [deleted file]
res/images/hands/ref_hands_01_hr_l.png [deleted file]
res/images/hands/ref_hands_01_hr_r.png [deleted file]
res/images/hands/ref_hands_01_hr_shadow.png [deleted file]
res/images/hands/ref_hands_01_min_l.png [deleted file]
res/images/hands/ref_hands_01_min_r.png [deleted file]
res/images/hands/ref_hands_01_min_shadow.png [deleted file]
res/images/hands/ref_hands_01_sec.png [deleted file]
res/images/hands/ref_hands_01_sec_shadow.png [deleted file]
res/images/hands/ref_hands_02_center_point.png [deleted file]
res/images/hands/ref_hands_02_hr.png [deleted file]
res/images/hands/ref_hands_02_hr_shadow.png [deleted file]
res/images/hands/ref_hands_02_min.png [deleted file]
res/images/hands/ref_hands_02_min_shadow.png [deleted file]
res/images/hands/ref_hands_02_sec.png [deleted file]
res/images/hands/ref_hands_02_sec_shadow.png [deleted file]
res/images/hands/ref_hands_03_hr.png [deleted file]
res/images/hands/ref_hands_03_hr_shadow.png [deleted file]
res/images/hands/ref_hands_03_min.png [deleted file]
res/images/hands/ref_hands_03_min_shadow.png [deleted file]
res/images/hands/ref_hands_03_sec.png [deleted file]
res/images/hands/ref_hands_03_sec_shadow.png [deleted file]
res/images/hands/ref_hands_04_hr_l.png [deleted file]
res/images/hands/ref_hands_04_hr_r.png [deleted file]
res/images/hands/ref_hands_04_hr_shadow.png [deleted file]
res/images/hands/ref_hands_04_min_l.png [deleted file]
res/images/hands/ref_hands_04_min_r.png [deleted file]
res/images/hands/ref_hands_04_min_shadow.png [deleted file]
res/images/hands/ref_hands_04_sec.png [deleted file]
res/images/hands/ref_hands_04_sec_shadow.png [deleted file]
res/images/hands/ref_hands_05_hr_l.png [deleted file]
res/images/hands/ref_hands_05_hr_r.png [deleted file]
res/images/hands/ref_hands_05_hr_shadow.png [deleted file]
res/images/hands/ref_hands_05_min_l.png [deleted file]
res/images/hands/ref_hands_05_min_r.png [deleted file]
res/images/hands/ref_hands_05_min_shadow.png [deleted file]
res/images/hands/ref_hands_05_sec.png [deleted file]
res/images/hands/ref_hands_05_sec_shadow.png [deleted file]
shared/res/analog-watch.png [deleted file]
src/CMakeLists.txt [new file with mode: 0644]
src/comp-manager.c [deleted file]
src/data-provider.c [deleted file]
src/hybrid/CMakeLists.txt [new file with mode: 0644]
src/hybrid/hybrid_backend_data.h [new file with mode: 0644]
src/hybrid/hybrid_installer.cc [new file with mode: 0644]
src/hybrid/hybrid_installer.h [new file with mode: 0644]
src/hybrid/shared_dirs.h [new file with mode: 0644]
src/hybrid/step/configuration/step_merge_tpk_config.cc [new file with mode: 0644]
src/hybrid/step/configuration/step_merge_tpk_config.h [new file with mode: 0644]
src/hybrid/step/configuration/step_merge_tpk_privileges.cc [new file with mode: 0644]
src/hybrid/step/configuration/step_merge_tpk_privileges.h [new file with mode: 0644]
src/hybrid/step/configuration/step_stash_tpk_config.cc [new file with mode: 0644]
src/hybrid/step/configuration/step_stash_tpk_config.h [new file with mode: 0644]
src/hybrid/step/encryption/step_encrypt_resources.cc [new file with mode: 0644]
src/hybrid/step/encryption/step_encrypt_resources.h [new file with mode: 0644]
src/hybrid/step/pkgmgr/step_generate_xml.cc [new file with mode: 0644]
src/hybrid/step/pkgmgr/step_generate_xml.h [new file with mode: 0644]
src/lib/CMakeLists.txt [new file with mode: 0644]
src/lib/wgt_archive_info.cc [new file with mode: 0644]
src/lib/wgt_archive_info.h [new file with mode: 0644]
src/lib/wgt_pkgmgr.cc [new file with mode: 0644]
src/main.c [deleted file]
src/unit_tests/CMakeLists.txt [new file with mode: 0644]
src/unit_tests/extensive_smoke_test.cc [new file with mode: 0644]
src/unit_tests/manifest_test.cc [new file with mode: 0644]
src/unit_tests/smoke_test.cc [new file with mode: 0644]
src/unit_tests/smoke_test_helper.cc [new file with mode: 0644]
src/unit_tests/smoke_utils.cc [new file with mode: 0644]
src/unit_tests/smoke_utils.h [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_InvalidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoURI/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_OverLength/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_MissingName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ValidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseValidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_InvalidNamespace/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_ManyNamespaces/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_MissingNamespace/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_Valid/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeinstallationMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeinstallationMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeinstallationMode_Preload.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/DisablePkg.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/EnablePkg.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallExternalMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_GoodSignature.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_Preload.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/InstallationMode_WrongSignature.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/bin/smokewgt40.ManifestDirectInstallMode [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/LICENSE.APLv2 [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/NOTICE [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/author-signature.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/css/style.css [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/icon.png [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/index.html [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/js/app.js [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/signature1.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/version.txt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/shared/res/smokewgt40.ManifestDirectInstallMode.png [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/tmp/sth [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/author-signature.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/service2 [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/smokehyb12.ManifestDirectInstallModeHybrid [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/lib/sth.txt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/LICENSE.APLv2 [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/NOTICE [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/css/style.css [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/icon.png [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/index.html [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/js/app.js [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/version.txt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/service2.png [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/smokehyb12.ManifestDirectInstallModeHybrid.png [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/signature1.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tizen-manifest.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tmp/sth.txt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MigrateLegacyExternalImageMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RDSMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ReadonlyUpdateInstallMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/ReadonlyUpdateUninstallMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForInstallation.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForMountInstall.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes24.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30Delta.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30Delta.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30Delta_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SharedRes30HybridDelta_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/SimpleEchoPrivilege.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Preload.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Preload2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt [new file with mode: 0644]
src/unit_tests/test_samples/smoke/delta_dir/.rds_delta [new file with mode: 0644]
src/unit_tests/test_samples/smoke/delta_dir/res/wgt/ADDED [new file with mode: 0644]
src/unit_tests/test_samples/smoke/delta_dir/res/wgt/MODIFIED [new file with mode: 0644]
src/unit_tests/test_samples/smoke/delta_dir/res/wgt/config.xml [new file with mode: 0644]
src/unit_tests/test_samples/smoke/legacy_extimage_dir/app2sd_migrate.db [new file with mode: 0644]
src/unit_tests/test_samples/smoke/legacy_extimage_dir/smokewgt36 [new file with mode: 0644]
src/utils.c [deleted file]
src/view.c [deleted file]
src/wgt/CMakeLists.txt [new file with mode: 0755]
src/wgt/extension_config_parser.cc [new file with mode: 0755]
src/wgt/extension_config_parser.h [new file with mode: 0755]
src/wgt/shared_dirs.h [new file with mode: 0644]
src/wgt/step/configuration/step_check_rds_manifest.cc [new file with mode: 0644]
src/wgt/step/configuration/step_check_rds_manifest.h [new file with mode: 0644]
src/wgt/step/configuration/step_check_start_files.cc [new file with mode: 0644]
src/wgt/step/configuration/step_check_start_files.h [new file with mode: 0644]
src/wgt/step/configuration/step_parse.cc [new file with mode: 0644]
src/wgt/step/configuration/step_parse.h [new file with mode: 0644]
src/wgt/step/configuration/step_parse_recovery.cc [new file with mode: 0644]
src/wgt/step/configuration/step_parse_recovery.h [new file with mode: 0644]
src/wgt/step/configuration/step_set_old_signature_files_location.cc [new file with mode: 0644]
src/wgt/step/configuration/step_set_old_signature_files_location.h [new file with mode: 0644]
src/wgt/step/encryption/step_encrypt_resources.cc [new file with mode: 0644]
src/wgt/step/encryption/step_encrypt_resources.h [new file with mode: 0644]
src/wgt/step/encryption/step_remove_encryption_data.cc [new file with mode: 0644]
src/wgt/step/encryption/step_remove_encryption_data.h [new file with mode: 0644]
src/wgt/step/filesystem/step_copy_preview_icons.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_copy_preview_icons.h [new file with mode: 0644]
src/wgt/step/filesystem/step_create_symbolic_link.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_create_symbolic_link.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_patch_icons.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_patch_icons.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_patch_storage_directories.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_prepare_package_directory.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_resource_directory.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_resource_directory.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_update_package_directory.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_update_package_directory.h [new file with mode: 0644]
src/wgt/step/pkgmgr/step_generate_xml.cc [new file with mode: 0644]
src/wgt/step/pkgmgr/step_generate_xml.h [new file with mode: 0644]
src/wgt/step/security/step_add_default_privileges.cc [new file with mode: 0644]
src/wgt/step/security/step_add_default_privileges.h [new file with mode: 0644]
src/wgt/step/security/step_check_extension_privileges.cc [new file with mode: 0755]
src/wgt/step/security/step_check_extension_privileges.h [new file with mode: 0755]
src/wgt/step/security/step_check_settings_level.cc [new file with mode: 0644]
src/wgt/step/security/step_check_settings_level.h [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_background_category.cc [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_background_category.h [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_ime_privilege.cc [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_ime_privilege.h [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_notification_category.cc [new file with mode: 0644]
src/wgt/step/security/step_check_wgt_notification_category.h [new file with mode: 0644]
src/wgt/step/security/step_direct_manifest_check_signature.cc [new file with mode: 0644]
src/wgt/step/security/step_direct_manifest_check_signature.h [new file with mode: 0644]
src/wgt/step/security/step_wgt_recover_signature.cc [new file with mode: 0644]
src/wgt/step/security/step_wgt_recover_signature.h [new file with mode: 0644]
src/wgt/wgt_app_query_interface.cc [new file with mode: 0644]
src/wgt/wgt_app_query_interface.h [new file with mode: 0644]
src/wgt/wgt_backend_data.h [new file with mode: 0644]
src/wgt/wgt_installer.cc [new file with mode: 0644]
src/wgt/wgt_installer.h [new file with mode: 0644]
src/wgt_backend/CMakeLists.txt [new file with mode: 0644]
src/wgt_backend/wgt_backend.cc [new file with mode: 0644]
tizen-manifest.xml [deleted file]
tools/check-coding-style [new file with mode: 0755]

diff --git a/.cproject b/.cproject
deleted file mode 100644 (file)
index 6ac5504..0000000
--- a/.cproject
+++ /dev/null
@@ -1,656 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-       <storageModule moduleId="org.eclipse.cdt.core.settings">
-               <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1635604740">
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1635604740" moduleId="org.eclipse.cdt.core.settings" name="Debug">
-                               <externalSettings/>
-                               <extensions>
-                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                               </extensions>
-                       </storageModule>
-                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration artifactName="complication-provider" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1635604740" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
-                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1635604740." name="/" resourcePath="">
-                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.1510450360" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
-                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.355922757" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
-                                                       <builder autoBuildTarget="all" buildPath="${workspace_loc:/analog-watch}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.778047418" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
-                                                       <tool command="i586-linux-gnueabi-ar.exe" id="org.tizen.nativecore.tool.sbi.gnu.archiver.2122994893" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.727249197" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
-                                                               <option id="gnu.cpp.compiler.option.optimization.level.753367908" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.653151688" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.454828969" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.2066349202" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180813_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1400785047" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/screen_connector_watcher_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watch-control&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1566894922" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.compiler.option.include.paths.1627589831" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.508925566" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.1778230074" name="Defined symbols (-D)" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
-                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
-                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
-                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.944192438" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
-                                                       </tool>
-                                                       <tool command="clang.exe" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1334480879" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
-                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1429910639" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.2050546718" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1469084232" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.212028038" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180813_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2081322027" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/screen_connector_watcher_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watch-control&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1567266628" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="$(TC_COMPILER_MISC)"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_COMPILER_MISC)"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;$(SBI_SYSROOT)&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.c.compiler.option.include.paths.808536886" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.269131465" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.1598582459" name="Defined symbols (-D)" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
-                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
-                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
-                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1330833921" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.205613832" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.1048676664" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.link.option.strip.898872563" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1629520054" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.1450444335" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1660737816" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" useByScannerDiscovery="false" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="$(TC_LINKER_MISC)"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_LINKER_MISC)"/>
-                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;$(SBI_SYSROOT)&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;$(PROJ_PATH)/.exportMap&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-L&quot;$(SBI_SYSROOT)/usr/lib&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.link.option.paths.1044065461" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1960794865" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
-                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
-                                                               </inputType>
-                                                       </tool>
-                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1343543194" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1014307380" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.686813138" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.2145368258" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.801506259" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.839891908" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1164863114" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.1119417666" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1866676979" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler">
-                                                               <option command="-id " id="sbi.gnu.edc.compiler.option.misc.id.953626007" superClass="sbi.gnu.edc.compiler.option.misc.id" useByScannerDiscovery="false" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/res/images&quot;"/>
-                                                               </option>
-                                                       </tool>
-                                               </toolChain>
-                                       </folderInfo>
-                                       <sourceEntries>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-                                       </sourceEntries>
-                               </configuration>
-                       </storageModule>
-                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-               </cconfiguration>
-               <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.release.680460953">
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.release.680460953" moduleId="org.eclipse.cdt.core.settings" name="Release">
-                               <externalSettings/>
-                               <extensions>
-                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                               </extensions>
-                       </storageModule>
-                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration artifactName="analog-watch" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.680460953" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
-                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.680460953." name="/" resourcePath="">
-                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.2003141861" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
-                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.9276310" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
-                                                       <builder buildPath="${workspace_loc:/analog-watch}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.1915612031" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
-                                                       <tool command="i586-linux-gnueabi-ar.exe" id="org.tizen.nativecore.tool.sbi.gnu.archiver.114305155" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1235541035" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
-                                                               <option id="gnu.cpp.compiler.option.optimization.level.752874930" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.none" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1206738683" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.2075584166" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.930025696" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180522_1_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1664708278" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/unicode&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1818053736" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.compiler.option.include.paths.440066546" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.956377911" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1866222720" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
-                                                       </tool>
-                                                       <tool command="clang.exe" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1906659308" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
-                                                               <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.127306788" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.c.debugging.level.none" id="sbi.gnu.c.compiler.option.debugging.level.core.1300717931" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.802359605" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.1192050400" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180522_1_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2008616711" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/unicode&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1058320237" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.c.compiler.option.include.paths.146303412" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.1504190837" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2134661558" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.379144480" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.226143927" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
-                                                               <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.2118978965" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1713633492" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.1679296443" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.88295997" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;${PROJ_PATH}/.exportMap&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/usr/lib&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.link.option.paths.1233038015" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1973849866" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
-                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
-                                                               </inputType>
-                                                       </tool>
-                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.451729639" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.319035248" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.546419095" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.1455958094" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.348984920" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.1219120616" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1013181826" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.155845205" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1019887253" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
-                                               </toolChain>
-                                       </folderInfo>
-                                       <sourceEntries>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-                                       </sourceEntries>
-                               </configuration>
-                       </storageModule>
-                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-               </cconfiguration>
-       </storageModule>
-       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-               <project id="analog-watch.org.tizen.nativecore.target.sbi.gcc45.app.1941726899" name="Tizen Native Application" projectType="org.tizen.nativecore.target.sbi.gcc45.app"/>
-       </storageModule>
-       <storageModule moduleId="scannerConfiguration">
-               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.debug.1635604740">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               </scannerConfigBuildInfo>
-               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.release.680460953">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               </scannerConfigBuildInfo>
-       </storageModule>
-       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
-       <storageModule moduleId="refreshScope"/>
-       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
-</cproject>
diff --git a/.exportMap b/.exportMap
deleted file mode 100644 (file)
index de30516..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-       global: main;
-       _IO_*;
-       local: *;
-};
diff --git a/.project b/.project
deleted file mode 100644 (file)
index 83bb8b8..0000000
--- a/.project
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>analog-watch</name>
-       <comment></comment>
-       <projects>
-               <project>complication-provider</project>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
-                       <triggers>full,incremental,</triggers>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.cdt.core.cnature</nature>
-               <nature>org.eclipse.cdt.core.ccnature</nature>
-               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
-               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
-       </natures>
-       <filteredResources>
-               <filter>
-                       <id>1527574068694</id>
-                       <name></name>
-                       <type>26</type>
-                       <matcher>
-                               <id>org.eclipse.ui.ide.multiFilter</id>
-                               <arguments>1.0-projectRelativePath-matches-false-false-*/.tpk</arguments>
-                       </matcher>
-               </filter>
-               <filter>
-                       <id>1527574068710</id>
-                       <name></name>
-                       <type>6</type>
-                       <matcher>
-                               <id>org.eclipse.ui.ide.multiFilter</id>
-                               <arguments>1.0-name-matches-false-false-project_def.prop</arguments>
-                       </matcher>
-               </filter>
-       </filteredResources>
-</projectDescription>
diff --git a/.tproject b/.tproject
deleted file mode 100644 (file)
index 14b6372..0000000
--- a/.tproject
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<tproject xmlns="http://www.tizen.org/tproject">
-    <platforms>
-        <platform>
-            <name>wearable-5.0</name>
-        </platform>
-    </platforms>
-    <package>
-        <blacklist/>
-        <resFallback autoGen="true"/>
-        <subProjects>
-            <tizenProject project="complication-provider"/>
-        </subProjects>
-    </package>
-</tproject>
diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..d115209
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+p.sikorski@samsung.com
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..86b3f98
--- /dev/null
@@ -0,0 +1,59 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
+PROJECT(WgtBackend)
+SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
+SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
+SET(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+SET(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share")
+SET(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include")
+
+IF(NOT CMAKE_BUILD_TYPE)
+  SET(CMAKE_BUILD_TYPE "Release")
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+# Compiler flags
+SET(EXTRA_FLAGS "-Wall -Wextra")
+SET(CMAKE_C_FLAGS_PROFILING    "-O2 ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++11 ${EXTRA_FLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++11 -g ${EXTRA_FLAGS}")
+SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++11 -g ${EXTRA_FLAGS}")
+SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++11 -g --coverage ${EXTRA_FLAGS}")
+
+# Linker flags
+SET(EXTRA_LINKER_FLAGS "-Wl,--as-needed")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}")
+
+# Targets
+SET(TARGET_LIBNAME_WGT "wgt-installer")
+SET(TARGET_LIBNAME_WGT_ARCHIVE_INFO "wgt")
+SET(TARGET_WGT_BACKEND "wgt-backend")
+SET(TARGET_LIBNAME_HYBRID "hybrid-installer")
+
+SET(TARGET_SMOKE_TEST "smoke-test")
+SET(TARGET_SMOKE_TEST_EXTENSIVE "extensive-smoke-test")
+SET(TARGET_SMOKE_TEST_HELPER "smoke-test-helper")
+SET(TARGET_MANIFEST_TEST "manifest-test")
+
+ADD_DEFINITIONS("-DPROJECT_TAG=\"WGT_BACKEND\"")
+
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
+INCLUDE(FindPkgConfig)
+INCLUDE(ApplyPkgConfig)
+
+# Find all needed packages once
+PKG_CHECK_MODULES(APP_INSTALLERS_DEPS REQUIRED app-installers)
+PKG_CHECK_MODULES(WGT_MANIFEST_HANDLERS_DEPS REQUIRED wgt-manifest-handlers)
+PKG_CHECK_MODULES(MANIFEST_PARSER_DEPS REQUIRED manifest-parser)
+PKG_CHECK_MODULES(PKGMGR_INSTALLER_DEPS REQUIRED pkgmgr-installer)
+PKG_CHECK_MODULES(PKGMGR_TYPES_DEPS REQUIRED pkgmgr-types)
+PKG_CHECK_MODULES(ENCRYPTION_DEPS REQUIRED libwebappenc)
+PKG_CHECK_MODULES(TPK_INSTALLER_DEPS REQUIRED tpk-installer)
+PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
+PKG_CHECK_MODULES(GUM_DEPS REQUIRED libgum)
+
+FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
+FIND_PACKAGE(GTest REQUIRED)
+
+ADD_SUBDIRECTORY(data)
+ADD_SUBDIRECTORY(src)
diff --git a/LICENSE b/LICENSE
index 4a0af40..53779e4 100644 (file)
--- a/LICENSE
+++ b/LICENSE
-Flora License
-
-Version 1.1, April, 2013
-
-http://floralicense.org/license/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction,
-and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by
-the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and
-all other entities that control, are controlled by, or are
-under common control with that entity. For the purposes of
-this definition, "control" means (i) the power, direct or indirect,
-to cause the direction or management of such entity,
-whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
-or more of the outstanding shares, or (iii) beneficial ownership of
-such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity
-exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications,
-including but not limited to software source code, documentation source,
-and configuration files.
-
-"Object" form shall mean any form resulting from mechanical
-transformation or translation of a Source form, including but
-not limited to compiled object code, generated documentation,
-and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form,
-made available under the License, as indicated by a copyright notice
-that is included in or attached to the work (an example is provided
-in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form,
-that is based on (or derived from) the Work and for which the editorial
-revisions, annotations, elaborations, or other modifications represent,
-as a whole, an original work of authorship. For the purposes of this License,
-Derivative Works shall not include works that remain separable from,
-or merely link (or bind by name) to the interfaces of, the Work and
-Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original
-version of the Work and any modifications or additions to that Work or
-Derivative Works thereof, that is intentionally submitted to Licensor
-for inclusion in the Work by the copyright owner or by an individual or
-Legal Entity authorized to submit on behalf of the copyright owner.
-For the purposes of this definition, "submitted" means any form of
-electronic, verbal, or written communication sent to the Licensor or
-its representatives, including but not limited to communication on
-electronic mailing lists, source code control systems, and issue
-tracking systems that are managed by, or on behalf of, the Licensor
-for the purpose of discussing and improving the Work, but excluding
-communication that is conspicuously marked or otherwise designated
-in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity
-on behalf of whom a Contribution has been received by Licensor and
-subsequently incorporated within the Work.
-
-"Tizen Certified Platform" shall mean a software platform that complies
-with the standards set forth in the Tizen Compliance Specification
-and passes the Tizen Compliance Tests as defined from time to time
-by the Tizen Technical Steering Group and certified by the Tizen
-Association or its designated agent.
-
-2. Grant of Copyright License.  Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the
-Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.  Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-(except as stated in this section) patent license to make, have made,
-use, offer to sell, sell, import, and otherwise transfer the Work
-solely as incorporated into a Tizen Certified Platform, where such
-license applies only to those patent claims licensable by such
-Contributor that are necessarily infringed by their Contribution(s)
-alone or by combination of their Contribution(s) with the Work solely
-as incorporated into a Tizen Certified Platform to which such
-Contribution(s) was submitted. If You institute patent litigation
-against any entity (including a cross-claim or counterclaim
-in a lawsuit) alleging that the Work or a Contribution incorporated
-within the Work constitutes direct or contributory patent infringement,
-then any patent licenses granted to You under this License for that
-Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.  You may reproduce and distribute copies of the
-Work or Derivative Works thereof pursuant to the copyright license
-above, in any medium, with or without modifications, and in Source or
-Object form, provided that You meet the following conditions:
-
-  1. You must give any other recipients of the Work or Derivative Works
-     a copy of this License; and
-  2. You must cause any modified files to carry prominent notices stating
-     that You changed the files; and
-  3. You must retain, in the Source form of any Derivative Works that
-     You distribute, all copyright, patent, trademark, and attribution
-     notices from the Source form of the Work, excluding those notices
-     that do not pertain to any part of the Derivative Works; and
-  4. If the Work includes a "NOTICE" text file as part of its distribution,
-     then any Derivative Works that You distribute must include a readable
-     copy of the attribution notices contained within such NOTICE file,
-     excluding those notices that do not pertain to any part of
-     the Derivative Works, in at least one of the following places:
-     within a NOTICE text file distributed as part of the Derivative Works;
-     within the Source form or documentation, if provided along with the
-     Derivative Works; or, within a display generated by the Derivative Works,
-     if and wherever such third-party notices normally appear.
-     The contents of the NOTICE file are for informational purposes only
-     and do not modify the License. You may add Your own attribution notices
-     within Derivative Works that You distribute, alongside or as an addendum
-     to the NOTICE text from the Work, provided that such additional attribution
-     notices cannot be construed as modifying the License. You may add Your own
-     copyright statement to Your modifications and may provide additional or
-     different license terms and conditions for use, reproduction, or
-     distribution of Your modifications, or for any such Derivative Works
-     as a whole, provided Your use, reproduction, and distribution of
-     the Work otherwise complies with the conditions stated in this License
-     and your own copyright statement or terms and conditions do not conflict
-     the conditions stated in the License including section 3.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
-any Contribution intentionally submitted for inclusion in the Work
-by You to the Licensor shall be under the terms and conditions of
-this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify
-the terms of any separate license agreement you may have executed
-with Licensor regarding such Contributions.
-
-6. Trademarks.  This License does not grant permission to use the trade
-names, trademarks, service marks, or product names of the Licensor,
-except as required for reasonable and customary use in describing the
-origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
-agreed to in writing, Licensor provides the Work (and each
-Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied, including, without limitation, any warranties or conditions
-of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-PARTICULAR PURPOSE. You are solely responsible for determining the
-appropriateness of using or redistributing the Work and assume any
-risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
-whether in tort (including negligence), contract, or otherwise,
-unless required by applicable law (such as deliberate and grossly
-negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special,
-incidental, or consequential damages of any character arising as a
-result of this License or out of the use or inability to use the
-Work (including but not limited to damages for loss of goodwill,
-work stoppage, computer failure or malfunction, or any and all
-other commercial damages or losses), even if such Contributor
-has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
-the Work or Derivative Works thereof, You may choose to offer,
-and charge a fee for, acceptance of support, warranty, indemnity,
-or other liability obligations and/or rights consistent with this
-License. However, in accepting such obligations, You may act only
-on Your own behalf and on Your sole responsibility, not on behalf
-of any other Contributor, and only if You agree to indemnify,
-defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason
-of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Flora License to your work
-
-To apply the Flora License to your work, attach the following
-boilerplate notice, with the fields enclosed by brackets "[]"
-replaced with your own identifying information. (Don't include
-the brackets!) The text should be enclosed in the appropriate
-comment syntax for the file format. We also recommend that a
-file or class name and description of purpose be included on the
-same "printed page" as the copyright notice for easier
-identification within third-party archives.
+// 2015, Copyright (c) Samsung Electronics Co., Ltd All Rights Reserved
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
 
    Copyright [yyyy] [name of copyright owner]
 
-   Licensed under the Flora License, Version 1.1 (the "License");
+   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
-       http://floralicense.org/license/
+       http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-
diff --git a/WORKSPACE b/WORKSPACE
deleted file mode 100644 (file)
index 113eb88..0000000
--- a/WORKSPACE
+++ /dev/null
@@ -1,2 +0,0 @@
-complication-provider
-./
diff --git a/aegis_test.c b/aegis_test.c
deleted file mode 100644 (file)
index e893238..0000000
+++ /dev/null
@@ -1,1015 +0,0 @@
-opyright 2012  Samsung Electronics Co., Ltd 
- *          
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "browser-settings-class.h"
-#include "browser-settings-website-setting.h"
-#include "browser-view.h"
-
-Browser_Settings_Website_Setting::Browser_Settings_Website_Setting(Browser_Settings_Main_View *main_view)
-:
-       m_genlist(NULL)
-       ,m_details_genlist(NULL)
-       ,m_back_button(NULL)
-       ,m_back_button_details(NULL)
-       ,m_clear_confirm_popup(NULL)
-       ,m_delete_all_website_list_confirm_popup(NULL)
-       ,m_delete_all_details_list_confirm_popup(NULL)
-       ,m_bottom_control_bar(NULL)
-       ,m_details_bottom_control_bar(NULL)
-       ,m_delete_all_website_list_conbar_item(NULL)
-       ,m_delete_all_details_conbar_item(NULL)
-       ,m_current_website_item_data(NULL)
-       ,m_current_item_data(NULL)
-       ,m_is_called_appcache_cb_flag(false)
-       ,m_is_called_webstorage_cb_flag(false)
-       ,m_is_called_webdb_cb_flag(false)
-       ,m_main_view(main_view)
-{
-       BROWSER_LOGD("[%s]", __func__);
-}
-
-Browser_Settings_Website_Setting::~Browser_Settings_Website_Setting(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-
-       for (int i = 0 ; i < m_website_setting_list.size() ; i++) {
-               if (m_website_setting_list[i])
-                       delete m_website_setting_list[i];
-       }
-       m_website_setting_list.clear();
-}
-
-Eina_Bool Browser_Settings_Website_Setting::init(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-
-       if (!_create_main_layout()) {
-               BROWSER_LOGE("_create_main_layout failed");
-               return EINA_FALSE;
-       }
-
-       return EINA_TRUE;
-}
-
-Evas_Object *Browser_Settings_Website_Setting::__genlist_icon_get(void *data,
-                                               Evas_Object *obj, const char *part)
-{
-       if (!data)
-               return NULL;
-
-       BROWSER_LOGD("part = [%s]", part);
-
-       Browser_Geolocation_DB::geolocation_info *info = (Browser_Geolocation_DB::geolocation_info *)data;
-
-       if (part && strlen(part) > 0) {
-               if (!strncmp(part, "elm.icon.1", strlen("elm.icon.1"))) {
-                       Evas_Object *favicon = NULL;
-                       favicon = m_data_manager->get_browser_view()->get_favicon(info->url.c_str());
-                       if (favicon)
-                               return favicon;
-                       else {
-                               Evas_Object *default_icon = elm_icon_add(obj);
-                               if (!default_icon)
-                                       return NULL;
-                               if (!elm_icon_file_set(default_icon, BROWSER_IMAGE_DIR"/faviconDefault.png", NULL)) {
-                                       BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                       return NULL;
-                               }
-                               evas_object_size_hint_aspect_set(default_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                               return default_icon;
-                       }
-               } else if (!strncmp(part,"elm.icon.2", strlen("elm.icon.2"))) {
-                       Evas_Object *location_icon = elm_icon_add(obj);
-                       if (!location_icon)
-                               return NULL;
-
-                       if (info->geolocation) {
-                               if (info->allow) {
-                                       if (!elm_icon_file_set(location_icon, BROWSER_IMAGE_DIR"/I01_icon_location_allowed.png", NULL)) {
-                                               BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                               return NULL;
-                                       }
-                                       evas_object_size_hint_aspect_set(location_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                                       return location_icon;
-                               } else {
-                                       if (!elm_icon_file_set(location_icon, BROWSER_IMAGE_DIR"/I01_icon_location_denied.png", NULL)) {
-                                               BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                               return NULL;
-                                       }
-                                       evas_object_size_hint_aspect_set(location_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                                       return location_icon;
-                               }
-                       }
-               } else if (!strncmp(part,"elm.icon.3", strlen("elm.icon.3"))) {
-                       Evas_Object *storage_icon = elm_icon_add(obj);
-                       if (!storage_icon)
-                               return NULL;
-                       if (info->storage) {
-                               if (!elm_icon_file_set(storage_icon, BROWSER_IMAGE_DIR"/I01_icon_web_storage.png", NULL)) {
-                                       BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                       return NULL;
-                               }
-                               evas_object_size_hint_aspect_set(storage_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                               return storage_icon;
-                       }
-               }
-       }
-
-       return NULL;
-}
-
-char *Browser_Settings_Website_Setting::__genlist_label_get(void *data,
-                                       Evas_Object *obj, const char *part)
-{
-       if (!data)
-               return NULL;
-
-       BROWSER_LOGD("part = [%s]", part);
-
-       Browser_Geolocation_DB::geolocation_info *info = (Browser_Geolocation_DB::geolocation_info *)data;
-       const char *url = info->url.c_str();
-
-       if (part && strlen(part) > 0) {
-               if (!strncmp(part,"elm.text", strlen("elm.text"))) {
-                       if (url && strlen(url))
-                               return strdup(url);
-               }
-       }
-
-       return NULL;
-}
-
-Evas_Object *Browser_Settings_Website_Setting::__details_genlist_icon_get(void *data,
-                                               Evas_Object *obj, const char *part)
-{
-       if (!data)
-               return NULL;
-
-       BROWSER_LOGD("part = [%s]", part);
-
-       genlist_callback_data *callback_data = (genlist_callback_data *)data;
-       Browser_Settings_Website_Setting::menu_type type = callback_data->type;
-       Browser_Settings_Website_Setting *website_setting = NULL;
-
-       Browser_Geolocation_DB::geolocation_info *info =
-               (Browser_Geolocation_DB::geolocation_info *)(callback_data->user_data);
-
-       if (part && strlen(part) > 0) {
-               if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
-                       if (type == BR_MENU_LOCATION) {
-                               BROWSER_LOGD("location menu\n");
-                               Evas_Object *location_icon = elm_icon_add(obj);
-                               if (!location_icon)
-                                       return NULL;
-                               if (info->geolocation) {
-                                       if (info->allow) {
-                                               if (!elm_icon_file_set(location_icon, BROWSER_IMAGE_DIR"/I01_icon_location_allowed_small.png", NULL)) {
-                                                       BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                                       return NULL;
-                                               }
-                                               evas_object_size_hint_aspect_set(location_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                                               return location_icon;
-                                       } else {
-                                               if (!elm_icon_file_set(location_icon, BROWSER_IMAGE_DIR"/I01_icon_location_denied_small.png", NULL)) {
-                                                       BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                                       return NULL;
-                                               }
-                                               evas_object_size_hint_aspect_set(location_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                                               return location_icon;
-                                       }
-                               }
-                       } else if (type == BR_MENU_WEB_STORAGE) {
-                               BROWSER_LOGD("web storage menu.\n");
-                               Evas_Object *storage_icon = elm_icon_add(obj);
-                               if (!storage_icon)
-                                       return NULL;
-                               if (info->storage) {
-                                       if (!elm_icon_file_set(storage_icon, BROWSER_IMAGE_DIR"/I01_icon_web_storage_small.png", NULL)) {
-                                               BROWSER_LOGE("elm_icon_file_set is failed.\n");
-                                               return NULL;
-                                       }
-                                       evas_object_size_hint_aspect_set(storage_icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-                                       return storage_icon;
-                               }
-                       }else {
-                               BROWSER_LOGD("wrong menu index.\n");
-                               return NULL;
-                       }
-               }
-       }
-       return NULL;
-}
-
-char *Browser_Settings_Website_Setting::__details_genlist_label_get(void *data,
-                                       Evas_Object *obj, const char *part)
-{
-       if (!data)
-               return NULL;
-
-       BROWSER_LOGD("part = [%s]", part);
-       genlist_callback_data *callback_data = (genlist_callback_data *)data;
-       Browser_Settings_Website_Setting::menu_type type = callback_data->type;
-       Browser_Settings_Website_Setting *website_setting = NULL;
-
-       Browser_Geolocation_DB::geolocation_info *info =
-               (Browser_Geolocation_DB::geolocation_info *)(callback_data->user_data);
-       const char *url = info->url.c_str();
-
-       if (part && strlen(part) > 0) {
-               if (!strncmp(part,"elm.text", strlen("elm.text"))) {
-                       if (type == BR_MENU_LOCATION) {
-                               BROWSER_LOGD("location menu.\n");
-                               return strdup(BR_STRING_CLEAR_LOCATION_ACCESS);
-                       } else if (type == BR_MENU_WEB_STORAGE) {
-                               BROWSER_LOGD("web storage menu.\n");
-                               return strdup(BR_STRING_CLEAR_STORED_DATA);
-                       }else {
-                               BROWSER_LOGD("wrong menu index.\n");
-                               return NULL;
-                       }
-               }
-       }
-       return NULL;
-}
-
-void Browser_Settings_Website_Setting::__item_selected_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       Elm_Object_Item *it = (Elm_Object_Item *)event_info;
-       website_setting->m_current_website_item_data = NULL;
-       website_setting->m_current_website_item_data = (website_setting_item *)elm_object_item_data_get(it);
-
-       website_setting->_show_details_list(website_setting->m_current_website_item_data);
-       elm_genlist_item_selected_set(it, EINA_FALSE);
-}
-
-void Browser_Settings_Website_Setting::__details_item_selected_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       genlist_callback_data *callback_data = (genlist_callback_data *)data;
-       Browser_Settings_Website_Setting::menu_type type = callback_data->type;
-       Browser_Settings_Website_Setting *website_setting = NULL;
-       website_setting = (Browser_Settings_Website_Setting *)(callback_data->cp);
-
-       website_setting->m_current_item_data = (website_setting_item *)callback_data->user_data;
-       if (type == BR_MENU_LOCATION) {
-               website_setting->_show_clear_location_confirm_popup();
-       } else if (type == BR_MENU_WEB_STORAGE) {
-               website_setting->_show_clear_web_storage_confirm_popup();
-       }
-
-       elm_genlist_item_selected_set(callback_data->it, EINA_FALSE);
-}
-
-Eina_Bool Browser_Settings_Website_Setting::_show_clear_location_confirm_popup(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (m_clear_confirm_popup)
-               evas_object_del(m_clear_confirm_popup);
-
-       m_clear_confirm_popup = elm_popup_add(m_details_genlist);
-       if (!m_clear_confirm_popup) {
-               BROWSER_LOGE("elm_popup_add failed");
-               return EINA_FALSE;
-       }
-
-       evas_object_size_hint_weight_set(m_clear_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       elm_object_text_set(m_clear_confirm_popup, BR_STRING_CLEAR_LOCATION_ACCESS_FOR_THIS_WEBSITE);
-
-       Evas_Object *ok_button = elm_button_add(m_clear_confirm_popup);
-       if (!ok_button) {
-               BROWSER_LOGE("elm_button_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_text_set(ok_button, BR_STRING_YES);
-       elm_object_part_content_set(m_clear_confirm_popup, "button1", ok_button);
-       evas_object_smart_callback_add(ok_button, "clicked", __clear_location_confirm_response_cb, this);
-
-       Evas_Object *cancel_button = elm_button_add(m_clear_confirm_popup);
-       elm_object_text_set(cancel_button, BR_STRING_NO);
-       elm_object_part_content_set(m_clear_confirm_popup, "button2", cancel_button);
-       evas_object_smart_callback_add(cancel_button, "clicked", __cancel_clear_location_confirm_response_cb, this);
-
-       evas_object_show(m_clear_confirm_popup);
-
-       return EINA_TRUE;
-}
-
-Eina_Bool Browser_Settings_Website_Setting::_show_clear_web_storage_confirm_popup(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (m_clear_confirm_popup)
-               evas_object_del(m_clear_confirm_popup);
-
-       m_clear_confirm_popup = elm_popup_add(m_details_genlist);
-       if (!m_clear_confirm_popup) {
-               BROWSER_LOGE("elm_popup_add failed");
-               return EINA_FALSE;
-       }
-
-       evas_object_size_hint_weight_set(m_clear_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       elm_object_text_set(m_clear_confirm_popup, BR_STRING_DELETE_ALL_STORED_DATA_BY_THIS_WEBSITE);
-
-       Evas_Object *ok_button = elm_button_add(m_clear_confirm_popup);
-       if (!ok_button) {
-               BROWSER_LOGE("elm_button_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_text_set(ok_button, BR_STRING_YES);
-       elm_object_part_content_set(m_clear_confirm_popup, "button1", ok_button);
-       evas_object_smart_callback_add(ok_button, "clicked", __clear_web_storage_confirm_response_cb, this);
-
-       Evas_Object *cancel_button = elm_button_add(m_clear_confirm_popup);
-       elm_object_text_set(cancel_button, BR_STRING_NO);
-       elm_object_part_content_set(m_clear_confirm_popup, "button2", cancel_button);
-       evas_object_smart_callback_add(cancel_button, "clicked", __cancel_clear_web_storage_confirm_response_cb, this);
-
-       evas_object_show(m_clear_confirm_popup);
-
-       return EINA_TRUE;
-}
-
-Eina_Bool Browser_Settings_Website_Setting::_show_delete_all_website_list_confirm_popup(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (m_delete_all_website_list_confirm_popup)
-               evas_object_del(m_delete_all_website_list_confirm_popup);
-
-       m_delete_all_website_list_confirm_popup = elm_popup_add(m_genlist);
-       if (!m_delete_all_website_list_confirm_popup) {
-               BROWSER_LOGE("elm_popup_add failed");
-               return EINA_FALSE;
-       }
-
-       evas_object_size_hint_weight_set(m_delete_all_website_list_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       elm_object_text_set(m_delete_all_website_list_confirm_popup, BR_STRING_DELETE_ALL_WEBSITE_DATA_AND_LOCATION_PERMISSIONS);
-
-       Evas_Object *ok_button = elm_button_add(m_delete_all_website_list_confirm_popup);
-       if (!ok_button) {
-               BROWSER_LOGE("elm_button_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_text_set(ok_button, BR_STRING_YES);
-       elm_object_part_content_set(m_delete_all_website_list_confirm_popup, "button1", ok_button);
-       evas_object_smart_callback_add(ok_button, "clicked", __delete_all_website_list_confirm_response_cb, this);
-
-       Evas_Object *cancel_button = elm_button_add(m_delete_all_website_list_confirm_popup);
-       elm_object_text_set(cancel_button, BR_STRING_NO);
-       elm_object_part_content_set(m_delete_all_website_list_confirm_popup, "button2", cancel_button);
-       evas_object_smart_callback_add(cancel_button, "clicked", __cancel_delete_all_website_list_confirm_response_cb, this);
-
-       evas_object_show(m_delete_all_website_list_confirm_popup);
-
-       return EINA_TRUE;
-}
-
-Eina_Bool Browser_Settings_Website_Setting::_show_delete_all_details_list_confirm_popup(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (m_delete_all_details_list_confirm_popup)
-               evas_object_del(m_delete_all_details_list_confirm_popup);
-
-       m_delete_all_details_list_confirm_popup = elm_popup_add(m_details_genlist);
-       if (!m_delete_all_details_list_confirm_popup) {
-               BROWSER_LOGE("elm_popup_add failed");
-               return EINA_FALSE;
-       }
-
-       evas_object_size_hint_weight_set(m_delete_all_details_list_confirm_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       elm_object_text_set(m_delete_all_details_list_confirm_popup, BR_STRING_DELETE_ALL_WEBSITE_DATA_AND_LOCATION_PERMISSIONS);
-
-       Evas_Object *ok_button = elm_button_add(m_delete_all_details_list_confirm_popup);
-       if (!ok_button) {
-               BROWSER_LOGE("elm_button_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_text_set(ok_button, BR_STRING_YES);
-       elm_object_part_content_set(m_delete_all_details_list_confirm_popup, "button1", ok_button);
-       evas_object_smart_callback_add(ok_button, "clicked", __delete_all_details_list_confirm_response_cb, this);
-
-       Evas_Object *cancel_button = elm_button_add(m_delete_all_details_list_confirm_popup);
-       elm_object_text_set(cancel_button, BR_STRING_NO);
-       elm_object_part_content_set(m_delete_all_details_list_confirm_popup, "button2", cancel_button);
-       evas_object_smart_callback_add(cancel_button, "clicked", __cancel_delete_all_details_list_confirm_response_cb, this);
-
-       evas_object_show(m_delete_all_details_list_confirm_popup);
-
-       return EINA_TRUE;
-}
-
-void Browser_Settings_Website_Setting::__clear_location_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_clear_confirm_popup) {
-               evas_object_del(website_setting->m_clear_confirm_popup);
-               website_setting->m_clear_confirm_popup = NULL;
-       }
-
-       Browser_Geolocation_DB geolocation_db;
-
-       geolocation_db.remove_geolocation_data(website_setting->m_current_item_data->url.c_str());
-       website_setting->m_current_item_data->geolocation = false;
-
-       if(website_setting->m_current_item_data->storage == false) {
-               website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-               website_setting->_refresh_website_list();
-       } else {
-               website_setting->_refresh_details_list(website_setting->m_current_item_data);
-       }
-
-       website_setting->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE);
-}
-
-void Browser_Settings_Website_Setting::__cancel_clear_location_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_clear_confirm_popup) {
-               evas_object_del(website_setting->m_clear_confirm_popup);
-               website_setting->m_clear_confirm_popup = NULL;
-       }
-}
-
-void Browser_Settings_Website_Setting::__clear_web_storage_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_clear_confirm_popup) {
-               evas_object_del(website_setting->m_clear_confirm_popup);
-               website_setting->m_clear_confirm_popup = NULL;
-       }
-
-       /* Clear cache */
-       Ewk_Context *ewk_context = ewk_context_default_get();
-       ewk_context_application_cache_delete(ewk_context, (Ewk_Security_Origin*)(website_setting->m_current_item_data->origin));
-       ewk_context_web_database_delete(ewk_context, (Ewk_Security_Origin*)(website_setting->m_current_item_data->origin));
-       ewk_context_web_storage_origin_delete(ewk_context, (Ewk_Security_Origin*)(website_setting->m_current_item_data->origin));
-       website_setting->m_current_item_data->storage = false;
-
-       if(website_setting->m_current_item_data->geolocation == false) {
-               website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-               website_setting->_refresh_website_list();
-       } else
-               website_setting->_refresh_details_list(website_setting->m_current_item_data);
-
-       website_setting->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE);
-}
-
-void Browser_Settings_Website_Setting::__cancel_clear_web_storage_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_clear_confirm_popup) {
-               evas_object_del(website_setting->m_clear_confirm_popup);
-               website_setting->m_clear_confirm_popup = NULL;
-       }
-}
-
-void Browser_Settings_Website_Setting::__delete_all_website_list_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_delete_all_website_list_confirm_popup) {
-               evas_object_del(website_setting->m_delete_all_website_list_confirm_popup);
-               website_setting->m_delete_all_website_list_confirm_popup = NULL;
-       }
-
-       /* Clear Geolocation */
-       Browser_Geolocation_DB geolocation_db;
-       geolocation_db.remove_all_geolocation_data();
-       /* Clear cache */
-       Ewk_Context *ewk_context = ewk_context_default_get();
-       ewk_context_cache_clear(ewk_context);
-       ewk_context_web_indexed_database_delete_all(ewk_context);
-       ewk_context_application_cache_delete_all(ewk_context);
-       ewk_context_web_storage_delete_all(ewk_context);
-       ewk_context_web_database_delete_all(ewk_context);
-
-       website_setting->_refresh_website_list();
-
-       website_setting->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE);
-}
-
-void Browser_Settings_Website_Setting::__cancel_delete_all_website_list_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_delete_all_website_list_confirm_popup) {
-               evas_object_del(website_setting->m_delete_all_website_list_confirm_popup);
-               website_setting->m_delete_all_website_list_confirm_popup = NULL;
-       }
-}
-
-void Browser_Settings_Website_Setting::__delete_all_details_list_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_delete_all_details_list_confirm_popup) {
-               evas_object_del(website_setting->m_delete_all_details_list_confirm_popup);
-               website_setting->m_delete_all_details_list_confirm_popup = NULL;
-       }
-
-       website_setting_item *info = website_setting->m_current_website_item_data;
-       if (info->geolocation) {
-               Browser_Geolocation_DB geolocation_db;
-               geolocation_db.remove_geolocation_data(info->url.c_str());
-               info->geolocation = false;
-       }
-
-       if (info->storage) {
-               /* Clear cache */
-               Ewk_Context *ewk_context = ewk_context_default_get();
-               ewk_context_application_cache_delete(ewk_context,
-                       (Ewk_Security_Origin*)(info->origin));
-               ewk_context_web_database_delete(ewk_context,
-                       (Ewk_Security_Origin*)(info->origin));
-               ewk_context_web_storage_origin_delete(ewk_context,
-                       (Ewk_Security_Origin*)(info->origin));
-               info->storage = false;
-       }
-
-       website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-       website_setting->_refresh_website_list();
-
-       website_setting->show_notify_popup(BR_STRING_DELETED, 3, EINA_TRUE);
-}
-
-void Browser_Settings_Website_Setting::__cancel_delete_all_details_list_confirm_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if (!data)
-               return;
-
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-       if (website_setting->m_delete_all_details_list_confirm_popup) {
-               evas_object_del(website_setting->m_delete_all_details_list_confirm_popup);
-               website_setting->m_delete_all_details_list_confirm_popup = NULL;
-       }
-}
-void Browser_Settings_Website_Setting::_show_details_list(website_setting_item *item_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       if(!item_info)
-               return;
-
-       m_details_genlist = elm_genlist_add(m_navi_bar);
-       if (!m_details_genlist) {
-               BROWSER_LOGE("elm_genlist_add failed");
-               return;
-       }
-
-       evas_object_show(m_details_genlist);
-
-       m_1_text_1_icon_item_class.item_style = "1text.1icon";
-       m_1_text_1_icon_item_class.func.text_get = __details_genlist_label_get;
-       m_1_text_1_icon_item_class.func.content_get = __details_genlist_icon_get;
-       m_1_text_1_icon_item_class.func.state_get = NULL;
-       m_1_text_1_icon_item_class.func.del = NULL;
-
-       if (item_info->geolocation) {
-               m_location_item_callback_data.type = BR_MENU_LOCATION;
-               m_location_item_callback_data.cp = this;
-               m_location_item_callback_data.user_data = item_info;
-               m_location_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
-                       &m_1_text_1_icon_item_class, &m_location_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
-                       __details_item_selected_cb, &m_location_item_callback_data);
-       }
-
-       if (item_info->storage) {
-               m_web_storage_item_callback_data.type = BR_MENU_WEB_STORAGE;
-               m_web_storage_item_callback_data.cp = this;
-               m_web_storage_item_callback_data.user_data = item_info;
-               m_web_storage_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
-                               &m_1_text_1_icon_item_class, &m_web_storage_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
-                               __details_item_selected_cb, &m_web_storage_item_callback_data);
-       }
-
-       m_back_button_details = elm_button_add(m_details_genlist);
-       if (!m_back_button_details) {
-               BROWSER_LOGE("elm_button_add failed");
-               return;
-       }
-       elm_object_style_set(m_back_button_details, "browser/bookmark_controlbar_back");
-       evas_object_show(m_back_button_details);
-       evas_object_smart_callback_add(m_back_button_details, "clicked", __back_button_clicked_cb, this);
-
-       Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, item_info->url.c_str(),
-                                                       m_back_button_details, NULL, m_details_genlist, "browser_titlebar");
-
-       m_details_bottom_control_bar = elm_toolbar_add(m_navi_bar);
-       if (!m_details_bottom_control_bar) {
-               BROWSER_LOGE("elm_toolbar_add failed");
-               return;
-       }
-       elm_object_style_set(m_details_bottom_control_bar, "browser/default");
-       elm_toolbar_shrink_mode_set(m_details_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND);
-
-       m_delete_all_details_conbar_item = elm_toolbar_item_append(m_details_bottom_control_bar,
-                                                       NULL, BR_STRING_DELETE_ALL,
-                                                       __delete_all_details_list_conbar_item_clicked_cb, this);
-       if (elm_genlist_items_count(m_details_genlist) == 0) {
-               elm_object_item_disabled_set(m_delete_all_details_conbar_item, EINA_TRUE);
-       }
-
-       Elm_Object_Item *empty_item = elm_toolbar_item_append(m_details_bottom_control_bar, NULL, NULL, NULL, NULL);
-       elm_object_item_disabled_set(empty_item, EINA_TRUE);
-
-       empty_item = elm_toolbar_item_append(m_details_bottom_control_bar, NULL, NULL, NULL, NULL);
-       elm_object_item_disabled_set(empty_item, EINA_TRUE);
-
-       evas_object_show(m_details_bottom_control_bar);
-       elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_details_bottom_control_bar);
-}
-
-void Browser_Settings_Website_Setting::_refresh_details_list(website_setting_item *item_info)
-{
-       elm_genlist_clear(m_details_genlist);
-
-       if (item_info->geolocation) {
-               m_location_item_callback_data.type = BR_MENU_LOCATION;
-               m_location_item_callback_data.cp = this;
-               m_location_item_callback_data.user_data = item_info;
-               m_location_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
-                       &m_1_text_1_icon_item_class, &m_location_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
-                       __details_item_selected_cb, &m_location_item_callback_data);
-       }
-
-       if (item_info->storage) {
-               m_web_storage_item_callback_data.type = BR_MENU_WEB_STORAGE;
-               m_web_storage_item_callback_data.cp = this;
-               m_web_storage_item_callback_data.user_data = item_info;
-               m_web_storage_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
-                               &m_1_text_1_icon_item_class, &m_web_storage_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
-                               __details_item_selected_cb, &m_web_storage_item_callback_data);
-       }
-}
-
-void Browser_Settings_Website_Setting::__back_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-
-       if (elm_naviframe_bottom_item_get(m_navi_bar)
-           != elm_naviframe_top_item_get(m_navi_bar))
-               elm_naviframe_item_pop(m_navi_bar);
-}
-
-void Browser_Settings_Website_Setting::__delete_all_website_list_conbar_item_clicked_cb(void *data,
-                                                               Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-
-       website_setting->_show_delete_all_website_list_confirm_popup();
-}
-
-void Browser_Settings_Website_Setting::__delete_all_details_list_conbar_item_clicked_cb(void *data,
-                                                               Evas_Object *obj, void *event_info)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)data;
-
-       website_setting->_show_delete_all_details_list_confirm_popup();
-}
-
-void Browser_Settings_Website_Setting::__application_cache_origin_get_cb(Eina_List* origins, void* user_data)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)user_data;
-
-       Eina_List *list = NULL;
-       void *list_data = NULL;
-
-       EINA_LIST_FOREACH(origins, list, list_data) {
-               BROWSER_LOGD("list_data=%d", list_data);
-               if (list_data) {
-                       Ewk_Security_Origin *origin = (Ewk_Security_Origin *)list_data;;
-                       BROWSER_LOGD("<<< host = [%s]", ewk_security_origin_host_get(origin));
-
-                       Eina_Bool duplicated = EINA_FALSE;
-                       for (int i = 0 ; i < website_setting->m_website_setting_list.size() ; i++) {
-                               if (!website_setting->m_website_setting_list[i]->url.empty()
-                                   && !strcmp(website_setting->m_website_setting_list[i]->url.c_str(), ewk_security_origin_host_get(origin))) {
-                                       duplicated = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->storage = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->origin = origin;
-
-                                       elm_genlist_item_update((Elm_Object_Item *)(website_setting->m_website_setting_list[i]->user_data));
-                                       break;
-                               }
-                       }
-
-                       if (!duplicated) {
-                               website_setting_item *item = new(nothrow) website_setting_item;
-                               item->allow = EINA_FALSE;
-                               item->geolocation = EINA_FALSE;
-                               item->storage = EINA_TRUE;
-                               item->url = std::string(ewk_security_origin_host_get(origin));
-                               item->origin = origin;
-
-                               item->user_data = (void*)elm_genlist_item_append(website_setting->m_genlist, &website_setting->m_1_text_2_icon_item_class,
-                                                                               item, NULL, ELM_GENLIST_ITEM_NONE,
-                                                                               __item_selected_cb, website_setting);
-                               website_setting->m_website_setting_list.push_back(item);
-                       }
-               }
-       }
-
-       /* enable the deleteall button at every origin callback
-               because these callbacks are invoked asyncronously*/
-       if (website_setting->m_website_setting_list.size() > 0) {
-               if (website_setting->m_delete_all_website_list_conbar_item != NULL)
-                       elm_object_item_disabled_set(website_setting->m_delete_all_website_list_conbar_item, EINA_FALSE);
-       }
-
-       website_setting->m_is_called_appcache_cb_flag = true;
-       if ((website_setting->m_is_called_appcache_cb_flag == true)
-           && (website_setting->m_is_called_webstorage_cb_flag == true)
-           && (website_setting->m_is_called_webdb_cb_flag == true)) {
-               if (website_setting->m_website_setting_list.size() == 0) {
-                       website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-               }
-       }
-}
-
-void Browser_Settings_Website_Setting::__web_storage_origin_get_cb(Eina_List* origins, void* user_data)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)user_data;
-
-       Eina_List *list = NULL;
-       void *list_data = NULL;
-
-       EINA_LIST_FOREACH(origins, list, list_data) {
-               BROWSER_LOGD("list_data=%d", list_data);
-               if (list_data) {
-                       Ewk_Security_Origin *origin = (Ewk_Security_Origin *)list_data;;
-                       BROWSER_LOGD("<<< host = [%s]", ewk_security_origin_host_get(origin));
-
-                       Eina_Bool duplicated = EINA_FALSE;
-                       for (int i = 0 ; i < website_setting->m_website_setting_list.size() ; i++) {
-                               if (!website_setting->m_website_setting_list[i]->url.empty()
-                                   && !strcmp(website_setting->m_website_setting_list[i]->url.c_str(), ewk_security_origin_host_get(origin))) {
-                                       duplicated = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->storage = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->origin = origin;
-
-                                       elm_genlist_item_update((Elm_Object_Item *)(website_setting->m_website_setting_list[i]->user_data));
-                                       break;
-                               }
-                       }
-
-                       if (!duplicated) {
-                               website_setting_item *item = new(nothrow) website_setting_item;
-                               item->allow = EINA_FALSE;
-                               item->geolocation = EINA_FALSE;
-                               item->storage = EINA_TRUE;
-                               item->url = std::string(ewk_security_origin_host_get(origin));
-                               item->origin = origin;
-
-                               item->user_data = (void*)elm_genlist_item_append(website_setting->m_genlist, &website_setting->m_1_text_2_icon_item_class,
-                                                                               item, NULL, ELM_GENLIST_ITEM_NONE,
-                                                                               __item_selected_cb, website_setting);
-                               website_setting->m_website_setting_list.push_back(item);
-                       }
-               }
-       }
-
-       /* enable the deleteall button at every origin callback
-               because these callbacks are invoked asyncronously*/
-       if (website_setting->m_website_setting_list.size() > 0) {
-               if (website_setting->m_delete_all_website_list_conbar_item != NULL)
-                       elm_object_item_disabled_set(website_setting->m_delete_all_website_list_conbar_item, EINA_FALSE);
-       }
-
-       website_setting->m_is_called_webstorage_cb_flag = true;
-       if ((website_setting->m_is_called_appcache_cb_flag == true)
-           && (website_setting->m_is_called_webstorage_cb_flag == true)
-           && (website_setting->m_is_called_webdb_cb_flag == true)) {
-               if (website_setting->m_website_setting_list.size() == 0) {
-                       website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-               }
-       }
-}
-
-void Browser_Settings_Website_Setting::__web_database_origin_get_cb(Eina_List* origins, void* user_data)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       Browser_Settings_Website_Setting *website_setting = (Browser_Settings_Website_Setting *)user_data;
-
-       Eina_List *list = NULL;
-       void *list_data = NULL;
-
-       EINA_LIST_FOREACH(origins, list, list_data) {
-               BROWSER_LOGD("list_data=%d", list_data);
-               if (list_data) {
-                       Ewk_Security_Origin *origin = (Ewk_Security_Origin *)list_data;
-                       BROWSER_LOGD("<<< host = [%s]", ewk_security_origin_host_get(origin));
-
-                       Eina_Bool duplicated = EINA_FALSE;
-                       for (int i = 0 ; i < website_setting->m_website_setting_list.size() ; i++) {
-                               if (!website_setting->m_website_setting_list[i]->url.empty()
-                                   && !strcmp(website_setting->m_website_setting_list[i]->url.c_str(), ewk_security_origin_host_get(origin))) {
-                                       duplicated = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->storage = EINA_TRUE;
-                                       website_setting->m_website_setting_list[i]->origin = origin;
-
-                                       elm_genlist_item_update((Elm_Object_Item *)(website_setting->m_website_setting_list[i]->user_data));
-                                       break;
-                               }
-                       }
-
-                       if (!duplicated) {
-                               website_setting_item *item = new(nothrow) website_setting_item;
-                               item->allow = EINA_FALSE;
-                               item->geolocation = EINA_FALSE;
-                               item->storage = EINA_TRUE;
-                               item->url = std::string(ewk_security_origin_host_get(origin));
-                               item->origin = origin;
-
-                               item->user_data = (void*)elm_genlist_item_append(website_setting->m_genlist, &website_setting->m_1_text_2_icon_item_class,
-                                                                               item, NULL, ELM_GENLIST_ITEM_NONE,
-                                                                               __item_selected_cb, website_setting);
-                               website_setting->m_website_setting_list.push_back(item);
-
-                       }
-               }
-       }
-
-       /* enable the deleteall button at every origin callback
-               because these callbacks are invoked asyncronously*/
-       if (website_setting->m_website_setting_list.size() > 0) {
-               if (website_setting->m_delete_all_website_list_conbar_item != NULL)
-                       elm_object_item_disabled_set(website_setting->m_delete_all_website_list_conbar_item, EINA_FALSE);
-       }
-
-       website_setting->m_is_called_webdb_cb_flag = true;
-       if ((website_setting->m_is_called_appcache_cb_flag == true)
-           && (website_setting->m_is_called_webstorage_cb_flag == true)
-           && (website_setting->m_is_called_webdb_cb_flag == true)) {
-               if (website_setting->m_website_setting_list.size() == 0) {
-                       website_setting->__back_button_clicked_cb(NULL, NULL, NULL);
-               }
-       }
-}
-
-void Browser_Settings_Website_Setting::_website_list_get(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-       m_is_called_appcache_cb_flag = false;
-       m_is_called_webstorage_cb_flag = false;
-       m_is_called_webdb_cb_flag = false;
-       Ewk_Context *context = ewk_context_default_get();
-       ewk_context_application_cache_origins_get(context, __application_cache_origin_get_cb, this);
-       ewk_context_web_storage_origins_get(context, __web_storage_origin_get_cb, this);
-       ewk_context_web_database_origins_get(context, __web_database_origin_get_cb, this);
-
-       Browser_Geolocation_DB geolocation_db;
-
-       geolocation_db.get_geolocation_info_list(m_geolocation_list);
-
-       BROWSER_LOGD("geolocation_list size=%d", m_geolocation_list.size());
-
-       for (int i = 0 ; i < m_geolocation_list.size() ; i++) {
-               m_geolocation_list[i]->user_data = (void* )elm_genlist_item_append(m_genlist, &m_1_text_2_icon_item_class,
-                                                               m_geolocation_list[i], NULL, ELM_GENLIST_ITEM_NONE,
-                                                               __item_selected_cb, this);
-
-               m_website_setting_list.push_back((website_setting_item *)(m_geolocation_list[i]));
-       }
-}
-
-void Browser_Settings_Website_Setting::_refresh_website_list(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-
-       for (int i = 0 ; i < m_website_setting_list.size() ; i++) {
-               if (m_website_setting_list[i])
-                       delete m_website_setting_list[i];
-       }
-       m_website_setting_list.clear();
-       m_geolocation_list.clear();
-
-       elm_genlist_clear(m_genlist);
-
-       _website_list_get();
-
-       if (m_website_setting_list.size() == 0) {
-               if (m_delete_all_website_list_conbar_item != NULL)
-                       elm_object_item_disabled_set(m_delete_all_website_list_conbar_item, EINA_TRUE);
-       }
-}
-
-Eina_Bool Browser_Settings_Website_Setting::_create_main_layout(void)
-{
-       BROWSER_LOGD("[%s]", __func__);
-
-       m_genlist = elm_genlist_add(m_navi_bar);
-       if (!m_genlist) {
-               BROWSER_LOGE("elm_genlist_add failed");
-               return EINA_FALSE;
-       }
-
-       evas_object_show(m_genlist);
-
-       m_back_button = elm_button_add(m_genlist);
-       if (!m_back_button) {
-               BROWSER_LOGE("elm_button_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_style_set(m_back_button, "browser/bookmark_controlbar_back");
-       evas_object_show(m_back_button);
-       evas_object_smart_callback_add(m_back_button, "clicked", __back_button_clicked_cb, this);
-
-       m_1_text_2_icon_item_class.item_style = "1text.3icon.2";
-       m_1_text_2_icon_item_class.func.text_get = __genlist_label_get;
-       m_1_text_2_icon_item_class.func.content_get = __genlist_icon_get;
-       m_1_text_2_icon_item_class.func.state_get = NULL;
-       m_1_text_2_icon_item_class.func.del = NULL;
-
-       _website_list_get();
-
-       Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_WEBSITE_SETTINGS,
-                                                       m_back_button, NULL, m_genlist, "browser_titlebar");
-
-       m_bottom_control_bar = elm_toolbar_add(m_navi_bar);
-       if (!m_bottom_control_bar) {
-               BROWSER_LOGE("elm_toolbar_add failed");
-               return EINA_FALSE;
-       }
-       elm_object_style_set(m_bottom_control_bar, "browser/default");
-       elm_toolbar_shrink_mode_set(m_bottom_control_bar, ELM_TOOLBAR_SHRINK_EXPAND);
-
-       m_delete_all_website_list_conbar_item = elm_toolbar_item_append(m_bottom_control_bar,
-                                                       NULL, BR_STRING_DELETE_ALL,
-                                                       __delete_all_website_list_conbar_item_clicked_cb, this);
-
-       if (!m_delete_all_website_list_conbar_item) {
-               BROWSER_LOGE("elm_toolbar_item_append failed");
-               return EINA_FALSE;
-       }
-
-       if (m_website_setting_list.size() == 0) {
-               elm_object_item_disabled_set(m_delete_all_website_list_conbar_item, EINA_TRUE);
-       }
-
-       Elm_Object_Item *empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL);
-       elm_object_item_disabled_set(empty_item, EINA_TRUE);
-
-       empty_item = elm_toolbar_item_append(m_bottom_control_bar, NULL, NULL, NULL, NULL);
-       elm_object_item_disabled_set(empty_item, EINA_TRUE);
-
-       evas_object_show(m_bottom_control_bar);
-       elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_CONTROLBAR, m_bottom_control_bar);
-
-       return EINA_TRUE;
-}
-
-
-
diff --git a/cmake/Modules/ApplyPkgConfig.cmake b/cmake/Modules/ApplyPkgConfig.cmake
new file mode 100644 (file)
index 0000000..97679d7
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+#
+# This function applies external (out of source tree) dependencies
+# to given target. Arguments are:
+#   TARGET - valid cmake target
+#   PRIVACY - dependency can be inherited by dependent targets or not:
+#     PUBLIC - this should be used by default, cause compile/link flags passing
+#     PRIVATE - do not passes any settings to dependent targets,
+#               may be usefull for static libraries from the inside of the project
+# Argument ARGV2 and following are supposed to be names of checked pkg config
+# packages. This function will use variables created by check_pkg_modules().
+#  - ${DEP_NAME}_LIBRARIES
+#  - ${DEP_NAME}_INCLUDE_DIRS
+#  - ${DEP_NAME}_CFLAGS
+#
+FUNCTION(APPLY_PKG_CONFIG TARGET PRIVACY)
+  MATH(EXPR DEST_INDEX "${ARGC}-1")
+  FOREACH(I RANGE 2 ${DEST_INDEX})
+    IF(NOT ${ARGV${I}}_FOUND)
+      MESSAGE(FATAL_ERROR "Not found dependency - ${ARGV${I}}_FOUND")
+    ENDIF(NOT ${ARGV${I}}_FOUND)
+    TARGET_LINK_LIBRARIES(${TARGET} ${PRIVACY} "${${ARGV${I}}_LIBRARIES}")
+    TARGET_INCLUDE_DIRECTORIES(${TARGET} ${PRIVACY} SYSTEM "${${ARGV${I}}_INCLUDE_DIRS}")
+    STRING(REPLACE ";" " " CFLAGS_STR "${${ARGV${I}}_CFLAGS}")
+    SET(CFLAGS_LIST ${CFLAGS_STR})
+    SEPARATE_ARGUMENTS(CFLAGS_LIST)
+    FOREACH(OPTION ${CFLAGS_LIST})
+      TARGET_COMPILE_OPTIONS(${TARGET} ${PRIVACY} ${OPTION})
+    ENDFOREACH(OPTION)
+    SET_TARGET_PROPERTIES(${TARGET} PROPERTIES SKIP_BUILD_RPATH true)
+  ENDFOREACH(I RANGE 2 ${DEST_INDEX})
+ENDFUNCTION(APPLY_PKG_CONFIG TARGET PRIVACY)
diff --git a/complication-provider/.cproject b/complication-provider/.cproject
deleted file mode 100755 (executable)
index 0f1f7c5..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
-       <storageModule moduleId="org.eclipse.cdt.core.settings">
-               <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1547945608">
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1547945608" moduleId="org.eclipse.cdt.core.settings" name="Debug">
-                               <externalSettings/>
-                               <extensions>
-                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                               </extensions>
-                       </storageModule>
-                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration artifactName="complication-provider" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1547945608" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
-                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1547945608." name="/" resourcePath="">
-                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.652220719" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
-                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.114402787" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
-                                                       <builder autoBuildTarget="all" buildPath="${workspace_loc:/complication-provider}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.445293514" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
-                                                       <tool command="i586-linux-gnueabi-ar.exe" id="org.tizen.nativecore.tool.sbi.gnu.archiver.1075687502" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.381282949" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
-                                                               <option id="gnu.cpp.compiler.option.optimization.level.230430717" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.528078622" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.959745419" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.372682793" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180813_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.302507258" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/screen_connector_watcher_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watch-control&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.330905035" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.compiler.option.include.paths.2085983105" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.199599541" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.208561911" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
-                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
-                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
-                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1349648055" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
-                                                       </tool>
-                                                       <tool command="clang.exe" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.994111464" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
-                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.382813035" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.1162616707" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.722981029" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.1545234841" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180813_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.562199907" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/screen_connector_watcher_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watch-control&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.696179427" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.c.compiler.option.include.paths.189860316" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.1198172296" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.1058413973" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
-                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
-                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
-                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.880884046" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.460818576" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.682463799" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.link.option.strip.423423679" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1015026092" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.1001730002" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.369262557" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;${PROJ_PATH}/.exportMap&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/usr/lib&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.link.option.paths.858567975" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.443732972" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
-                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
-                                                               </inputType>
-                                                       </tool>
-                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.611454648" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2014260073" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.1822602608" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.442519936" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.1072073159" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.980677772" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.855590470" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.432370440" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1275186363" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
-                                               </toolChain>
-                                       </folderInfo>
-                                       <sourceEntries>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-                                       </sourceEntries>
-                               </configuration>
-                       </storageModule>
-                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-               </cconfiguration>
-               <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.release.1949070098">
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.release.1949070098" moduleId="org.eclipse.cdt.core.settings" name="Release">
-                               <externalSettings/>
-                               <extensions>
-                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-                               </extensions>
-                       </storageModule>
-                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration artifactName="complication-provider" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.1949070098" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
-                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.1949070098." name="/" resourcePath="">
-                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.2037975884" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
-                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1250592966" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
-                                                       <builder buildPath="${workspace_loc:/complication-provider}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.933819037" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
-                                                       <tool command="i586-linux-gnueabi-ar.exe" id="org.tizen.nativecore.tool.sbi.gnu.archiver.321982682" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1421889385" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
-                                                               <option id="gnu.cpp.compiler.option.optimization.level.364382168" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.none" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1150407177" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.983221193" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.1035562517" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180517_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.978099193" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/unicode&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1065102073" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.compiler.option.include.paths.1256540840" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.207486161" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1155728031" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
-                                                       </tool>
-                                                       <tool command="clang.exe" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.718905911" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
-                                                               <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1891771675" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
-                                                               <option defaultValue="gnu.c.debugging.level.none" id="sbi.gnu.c.compiler.option.debugging.level.core.1618702232" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
-                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1335547735" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.793187522" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="wearable-5.0-emulator.core.private.20180517_2_llvm40.i386"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2009430269" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/asp/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/context-service/wearable/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/csr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dali-toolkit&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device-certificate-manager&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-buffer-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-con-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-file-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-imf-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-input-evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-ipc-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ector-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/edje-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/elementary-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/embryo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/emile-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eom&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ethumb-client-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/evas-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/feedback&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media-content&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/messaging&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/metadata-editor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/msg-service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/privacy-privilege-manager/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rpc-port&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tef&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/telephony-client&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/tzsh&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ug-1&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ui&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/unicode&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vconf&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/vulkan&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-common&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/watchface-complication-provider&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_service&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_dali&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/widget_viewer_evas&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/yaca&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.111697275" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                               </option>
-                                                               <option id="gnu.c.compiler.option.include.paths.733718744" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
-                                                               </option>
-                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.295991805" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
-                                                                       <listOptionValue builtIn="false" value="Native_API"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.143093186" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1328806187" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
-                                                       <tool command="clang++.exe" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.161728597" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
-                                                               <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.237220429" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.562646634" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
-                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.2026445640" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1639147956" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
-                                                                       <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
-                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
-                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;${PROJ_PATH}/.exportMap&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/usr/lib&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
-                                                               </option>
-                                                               <option id="gnu.cpp.link.option.paths.1415978430" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
-                                                               </option>
-                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2090711632" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
-                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
-                                                               </inputType>
-                                                       </tool>
-                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as.exe" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1695107929" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1219887500" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-                                                       </tool>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.254785328" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
-                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.452425496" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.1489137743" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
-                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.1695367496" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.557638768" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.793035039" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
-                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.4288712" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
-                                               </toolChain>
-                                       </folderInfo>
-                                       <sourceEntries>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
-                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
-                                       </sourceEntries>
-                               </configuration>
-                       </storageModule>
-                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-               </cconfiguration>
-       </storageModule>
-       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-               <project id="complication-provider.org.tizen.nativecore.target.sbi.gcc45.app.1565142131" name="Tizen Native Application" projectType="org.tizen.nativecore.target.sbi.gcc45.app"/>
-       </storageModule>
-       <storageModule moduleId="scannerConfiguration">
-               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.debug.1547945608">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               </scannerConfigBuildInfo>
-               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.release.1949070098">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-               </scannerConfigBuildInfo>
-       </storageModule>
-       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
-       <storageModule moduleId="refreshScope"/>
-       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
-</cproject>
diff --git a/complication-provider/.exportMap b/complication-provider/.exportMap
deleted file mode 100755 (executable)
index de30516..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-       global: main;
-       _IO_*;
-       local: *;
-};
diff --git a/complication-provider/.project b/complication-provider/.project
deleted file mode 100755 (executable)
index 4010469..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>complication-provider</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
-                       <triggers>full,incremental,</triggers>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.cdt.core.cnature</nature>
-               <nature>org.eclipse.cdt.core.ccnature</nature>
-               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
-               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
-       </natures>
-       <filteredResources>
-               <filter>
-                       <id>1528273670556</id>
-                       <name></name>
-                       <type>26</type>
-                       <matcher>
-                               <id>org.eclipse.ui.ide.multiFilter</id>
-                               <arguments>1.0-projectRelativePath-matches-false-false-*/.tpk</arguments>
-                       </matcher>
-               </filter>
-               <filter>
-                       <id>1528273670575</id>
-                       <name></name>
-                       <type>6</type>
-                       <matcher>
-                               <id>org.eclipse.ui.ide.multiFilter</id>
-                               <arguments>1.0-name-matches-false-false-project_def.prop</arguments>
-                       </matcher>
-               </filter>
-       </filteredResources>
-</projectDescription>
diff --git a/complication-provider/.tproject b/complication-provider/.tproject
deleted file mode 100755 (executable)
index ccab492..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<tproject xmlns="http://www.tizen.org/tproject">
-    <platforms>
-        <platform>
-            <name>wearable-5.0</name>
-        </platform>
-    </platforms>
-    <package>
-        <blacklist/>
-        <resFallback autoGen="true"/>
-    </package>
-</tproject>
diff --git a/complication-provider/inc/complication-provider.h b/complication-provider/inc/complication-provider.h
deleted file mode 100644 (file)
index 58c9414..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __complication_provider_H__
-#define __complication_provider_H__
-
-#include <dlog.h>
-
-#ifdef  LOG_TAG
-#undef  LOG_TAG
-#endif
-#define LOG_TAG "complication-provider"
-
-#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.complication-provider"
-#endif
-
-#endif /* __complication_provider_H__ */
diff --git a/complication-provider/project_def.prop b/complication-provider/project_def.prop
deleted file mode 100755 (executable)
index 1b3bbcf..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# Project Name
-APPNAME = complication-provider
-
-# Project Type
-type = app
-
-# Project Profile
-profile = wearable-5.0
-
-# C/CPP Sources
-USER_SRCS = src/complication-provider.c
-
-# EDC Sources
-USER_EDCS =
-
-# User Defines
-USER_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING
-USER_CPP_DEFS =
-
-# User Undefines
-USER_UNDEFS =
-USER_CPP_UNDEFS =
-
-
-# User Libraries
-USER_LIBS =
-
-# User Objects
-USER_OBJS =
-
-
-# User Includes
-## C Compiler
-USER_C_INC_DIRS = inc
-USER_INC_FILES =
-## C++ Compiler
-USER_CPP_INC_DIRS =
-USER_CPP_INC_FILES =
-
-USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
-
-# User Library Path
-USER_LIB_DIRS =
-
-# EDC Resource Path
-USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR}
-
-# EDC Flags
-USER_EXT_EDC_KEYS = EDC0
-
-USER_EXT_EDC0_EDCS =
-USER_EXT_EDC0_EDCS_IMAGE_DIRS =
-
-# Resource Filter
-USER_RES_INCLUDE =
-USER_RES_EXCLUDE =
\ No newline at end of file
diff --git a/complication-provider/src/complication-provider.c b/complication-provider/src/complication-provider.c
deleted file mode 100644 (file)
index 8223277..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include "complication-provider.h"
-#include <service_app.h>
-#include <watchface-complication-provider.h>
-#include <bundle.h>
-#include <device/battery.h>
-#include <device/callback.h>
-
-
-#define BATTERY_PROVIDER_ID "org.tizen.complication-provider/battery"
-
-void battery_changed_cb(device_callback_e type, void *value, void *user_data)
-{
-       watchface_complication_provider_notify_update(BATTERY_PROVIDER_ID);
-}
-
-void __on_update_request(const char *provider_id, const char *req_appid,
-               watchface_complication_type_e type, const bundle *context, bundle *shared_data,
-               void *user_data) {
-       char num_str[128] = { 0, };
-       int ret;
-       int pct = 0;
-
-       ret = device_battery_get_percent(&pct);
-       if (ret != DEVICE_ERROR_NONE)
-               dlog_print(DLOG_ERROR, LOG_TAG, "failed to get battery percent : %d", ret);
-
-       if (type == WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT) {
-               snprintf(num_str, sizeof(num_str), "%d", pct);
-               watchface_complication_provider_data_set_short_text(shared_data, num_str);
-       } else if (type == WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE) {
-               watchface_complication_provider_data_set_ranged_value(shared_data, (double)pct, 0.0, 100.0);
-       }
-}
-
-static bool
-app_create(void *data)
-{
-       /* Hook to take necessary actions before main event loop starts
-               Initialize UI resources and application's data
-               If this function returns true, the main loop of application starts
-               If this function returns false, the application is terminated */
-       watchface_complication_provider_add_update_requested_cb(
-               BATTERY_PROVIDER_ID, __on_update_request, NULL);
-
-       device_add_callback(DEVICE_CALLBACK_BATTERY_CAPACITY,
-               battery_changed_cb, NULL);
-
-       return true;
-}
-
-static void
-app_control(app_control_h app_control, void *data)
-{
-       /* Handle the launch request. */
-}
-
-
-static void
-app_terminate(void *data)
-{
-       /* Release all resources. */
-
-       device_remove_callback(DEVICE_CALLBACK_BATTERY_CAPACITY, battery_changed_cb);
-}
-
-int
-main(int argc, char *argv[])
-{
-       int ret;
-
-       service_app_lifecycle_callback_s event_callback = {0, };
-
-       event_callback.create = app_create;
-       event_callback.terminate = app_terminate;
-       event_callback.app_control = app_control;
-
-       ret = service_app_main(argc, argv, &event_callback, NULL);
-       if (ret != APP_ERROR_NONE)
-               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() failed. err = %d", ret);
-
-       return ret;
-}
diff --git a/complication-provider/tizen-manifest.xml b/complication-provider/tizen-manifest.xml
deleted file mode 100755 (executable)
index a2b8a2e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.complication-provider" version="1.0.0">
-    <profile name="wearable"/>
-    <service-application appid="org.tizen.complication-provider" exec="complication-provider" multiple="false" nodisplay="true" taskmanage="false" type="capp">
-        <label>complication-provider</label>
-        <icon>complication-provider.png</icon>
-        <complication provider-id="org.tizen.complication-provider/battery">
-            <support-type>
-                <short-text-type>
-                    <default-short-text>10</default-short-text>
-                </short-text-type>
-                <long-text-type>
-                    <default-long-text>Battery</default-long-text>
-                </long-text-type>
-                <ranged-value-type>
-                                       <default-min>0</default-min>
-                                       <default-max>100</default-max>
-                                       <default-value>75</default-value>
-                </ranged-value-type>
-                <time-type>
-                    <default-hour>23</default-hour>
-                    <default-minute>50</default-minute>
-                    <default-second>50</default-second>
-                </time-type>
-                 <icon-type>
-                    <default-icon>iconicon</default-icon>
-                </icon-type>
-                <image-type>
-                    <default-image>imageimage</default-image>
-                </image-type>
-            </support-type>
-            <period>60</period>
-            <label>Battery</label>
-            <label xml:lang="ar-ae">ﺎﻠﺘﻗﻮﻴﻣ</label>
-            <label xml:lang="az-az">Təqvim</label>
-            <label xml:lang="bg-bg">Календар</label>
-            <privileges>
-                <privilege>http://tizen.org/privilege/alarm.get</privilege>
-                <privilege>http://tizen.org/privilege/alarm.set</privilege>
-                <privilege>http://tizen.org/privilege/datasharing</privilege>
-            </privileges>
-        </complication>
-    </service-application>
-</manifest>
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ea0766f
--- /dev/null
@@ -0,0 +1 @@
+INSTALL(FILES "default.png" DESTINATION "${SHAREDIR}/wgt-backend/")
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from complication-provider/shared/res/complication-provider.png
rename to data/default.png
diff --git a/inc/analog-watch.h b/inc/analog-watch.h
deleted file mode 100644 (file)
index d51a536..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ANALOG_WATCH_H_
-#define _ANALOG_WATCH_H_
-
-#include <app.h>
-#include <Elementary.h>
-#include <tizen.h>
-#include <watch_app.h>
-#include <watch_app_efl.h>
-#include <system_settings.h>
-#include <efl_extension.h>
-
-#ifdef  LOG_TAG
-#undef  LOG_TAG
-#endif
-#define LOG_TAG "analog-watch"
-
-
-#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.analog-watch"
-#endif
-
-#endif /* _ANALOG_WATCH_H__ */
diff --git a/inc/app-log.h b/inc/app-log.h
deleted file mode 100644 (file)
index a1f952b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _APP_LOG_H_
-#define _APP_LOG_H_
-
-#include <dlog.h>
-
-#define __D(format, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, format, ##arg)
-#define __I(format, arg...) dlog_print(DLOG_INFO, LOG_TAG, format, ##arg)
-#define __E(format, arg...) dlog_print(DLOG_ERROR, LOG_TAG, format, ##arg)
-
-#endif /* _APP_LOG_H_ */
diff --git a/inc/comp-manager.h b/inc/comp-manager.h
deleted file mode 100644 (file)
index ad290d6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _COMP_MANAGER_H_
-#define _COMP_MANAGER_H_
-
-#include <app.h>
-#include "watchface-editable.h"
-#include "watchface-complication.h"
-
-#define DIAL_NUM 5
-#define HANDS_NUM 5
-#define DIAL_EDIT 1
-#define HANDS_EDIT 2
-#define RIGHT_COMP 9
-#define MSG_ID_SET_BATTERY_COMP 1
-#define MSG_ID_SET_BATTERY_LEVEL 2
-#define MSG_ID_SET_DIAL_STYLE 3
-
-#define DATA_KEY_HANDS_SEC "__HANDS_SEC__"
-#define DATA_KEY_HANDS_MIN "__HANDS_MIN__"
-#define DATA_KEY_HANDS_HOUR "__HANDS_HOUR__"
-#define DATA_KEY_HANDS_SEC_SHADOW "__HANDS_SEC_SHADOW__"
-#define DATA_KEY_HANDS_MIN_SHADOW "__HANDS_MIN_SHADOW__"
-#define DATA_KEY_HANDS_HOUR_SHADOW "__HANDS_HOUR_SHADOW__"
-#define DATA_KEY_HANDS_CENTER_PIVOT "__HANDS_CENTER_PIVOT__"
-
-#define BATTERY_PROVIDER_ID "org.tizen.complication-provider/battery"
-
-
-/*
- * brief initializes the comp-manager
- */
-void comp_init();
-
-/*
- * @brief Removes the callback for editables
- */
-void comp_destroy();
-
-
-#endif /* _COMP_MANAGER_H_ */
diff --git a/inc/data-provider.h b/inc/data-provider.h
deleted file mode 100644 (file)
index 0ad472c..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _DATA_PROVIDER_H_
-#define _DATA_PROVIDER_H_
-
-#include <app.h>
-
-#define MAIN_EDJ "edje/main.edj"
-#define MAIN_GRP "layout_watchface"
-#define IMAGE_BG_PATH "images/default_analog_bg.png"
-
-
-typedef enum {
-       PARTS_TYPE_HANDS_SEC = 0,
-       PARTS_TYPE_HANDS_MIN = 1,
-       PARTS_TYPE_HANDS_HOUR = 2,
-       PARTS_TYPE_HANDS_SEC_SHADOW = 3,
-       PARTS_TYPE_HANDS_MIN_SHADOW = 4,
-       PARTS_TYPE_HANDS_HOUR_SHADOW = 5,
-       PARTS_TYPE_HANDS_CENTER_PIVOT = 6,
-       PARTS_TYPE_MAX,
-} parts_type_e;
-
-
-struct color{
-       int r;
-       int g;
-       int b;
-       int a;
-};
-
-/* Layout */
-#define BASE_WIDTH 360
-#define BASE_HEIGHT 360
-
-/* Angle */
-#define HOUR_ANGLE 30
-#define MIN_ANGLE 6
-#define SEC_ANGLE 6
-
-#define HANDS_SEC_WIDTH 32
-#define HANDS_SEC_HEIGHT 360
-#define HANDS_MIN_WIDTH 32
-#define HANDS_MIN_HEIGHT 360
-#define HANDS_HOUR_WIDTH 32
-#define HANDS_HOUR_HEIGHT 360
-#define HANDS_CENTER_PIVOT_WIDTH 32
-#define HANDS_CENTER_PIVOT_HEIGHT 32
-
-/* Shadow Pivot */
-
-#define HANDS_SEC_SHADOW_PIVOT_Y_01 184
-#define HANDS_MIN_SHADOW_PIVOT_Y_01 186
-#define HANDS_HR_SHADOW_PIVOT_Y_01 186
-#define HANDS_SEC_SHADOW_PIVOT_Y_02 180
-#define HANDS_MIN_SHADOW_PIVOT_Y_02 180
-#define HANDS_HR_SHADOW_PIVOT_Y_02 180
-#define HANDS_SEC_SHADOW_PIVOT_Y_03 184
-#define HANDS_MIN_SHADOW_PIVOT_Y_03 185
-#define HANDS_HR_SHADOW_PIVOT_Y_03 180
-#define HANDS_SEC_SHADOW_PIVOT_Y_04 186
-#define HANDS_MIN_SHADOW_PIVOT_Y_04 186
-#define HANDS_HR_SHADOW_PIVOT_Y_04 186
-#define HANDS_SEC_SHADOW_PIVOT_Y_05 186
-#define HANDS_MIN_SHADOW_PIVOT_Y_05 186
-#define HANDS_HR_SHADOW_PIVOT_Y_05 186
-
-/**
- * @brief Get a image path of the part.
- * @param[in] type The part type
- * @param[in] style The current style
- * @param[in] lr flag to distinguish left half and right half plane
- */
-char *data_get_parts_image_path(parts_type_e type, char *style, bool lr);
-
-/**
- * @brief Get a position of the part.
- * @param[in] type The part type
- * @param[out] x The pointer to an integer in which to store the X coordinate of the part
- * @param[out] y The pointer to an integer in which to store the Y coordinate of the part
- */
-void data_get_parts_position(parts_type_e type, int *x, int *y);
-
-/**
- * @brief Get a width size of the part.
- * @param[in] type The part type
- */
-int data_get_parts_width_size(parts_type_e type);
-
-/**
- * @brief Get a height size of the part.
- * @param[in] type The part type
- */
-int data_get_parts_height_size(parts_type_e type);
-
-/**
- * @brief Get plus angle for the hour hand.
- * @param[in] minute Current minute
- */
-int data_get_plus_angle(int minute);
-
-/**
- * @brief Get Y pivot of shadow hand
- * @param[in] Type of hands
- * @param[in] Style of hands
- */
-int data_get_hand_shadow_pivot(parts_type_e type, char *style);
-
-#endif /* _DATA_PROVIDER_H_ */
diff --git a/inc/utils.h b/inc/utils.h
deleted file mode 100644 (file)
index ee05916..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _UTILS_H_
-#define _UTILS_H_
-
-#include <app.h>
-#include<Elementary.h>
-
-/*
- * @brief Creates path to the given resource file by concatenation of the basic resource path and the given file_name.
- * @param[in] file_name File name or path relative to the resource directory.
- * @return: The absolute path to the resource with given file_name is returned.
- */
-char* utils_create_resource_path(const char*);
-
-
-#endif /* _UTILS_H_ */
diff --git a/inc/view.h b/inc/view.h
deleted file mode 100644 (file)
index a5cb840..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _VIEW_H_
-#define _VIEW_H_
-
-#include <Elementary.h>
-
-/*
- * @brief sets the dial style in view
- * @param selected style of dial
- */
-void view_set_dial_style(char *);
-
-/*
- * @brief sets the hands style in view
- * @param selected style of hands
- */
-void view_set_hands_style(char *);
-
-/*
- *
- */
-void view_set_time(int, int, int);
-
-/*
- * @brief sets the battery value in view
- * @param battery level
- * @param user data
- */
-void view_set_battery_status(int, void*);
-
-/*
- * @brief returns the watchface-layout
- */
-Evas_Object *view_get_watchface_layout(void);
-
-/*
- * @brief rotation of hands in view part is shown
- * @param Evas object for hand of clock
- * @param angle of the hand
- * @param x coord of hand
- * @param y coord of hand
- */
-void view_rotate_hand(Evas_Object *hand, double degree, Evas_Coord cx, Evas_Coord cy);
-
-/* initializes the view */
-void view_init();
-
-/* destroys the view */
-void view_destroy();
-
-#endif /* _VIEW_H_ */
diff --git a/packaging/wgt-backend-tests.manifest b/packaging/wgt-backend-tests.manifest
new file mode 100644 (file)
index 0000000..8ea34c3
--- /dev/null
@@ -0,0 +1,10 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+        <assign>
+                <filesystem path="/usr/bin/wgt-backend-ut/smoke-test" exec_label="System" />
+                <filesystem path="/usr/bin/wgt-backend-ut/smoke-test-helper" exec_label="System" />
+                <filesystem path="/usr/bin/wgt-backend-ut/extensive-smoke-test" exec_label="System" />
+        </assign>
+</manifest>
diff --git a/packaging/wgt-backend.manifest b/packaging/wgt-backend.manifest
new file mode 100644 (file)
index 0000000..85f79f1
--- /dev/null
@@ -0,0 +1,8 @@
+<manifest>
+        <request>
+                <domain name="_" />
+        </request>
+        <assign>
+                <filesystem path="/usr/bin/wgt-backend" label="System" exec_label="none" />
+        </assign>
+</manifest>
diff --git a/packaging/wgt-backend.spec b/packaging/wgt-backend.spec
new file mode 100644 (file)
index 0000000..7dab1c5
--- /dev/null
@@ -0,0 +1,70 @@
+Name:           wgt-backend
+Summary:        Application installer backend for WGT
+Version:        0.11.1
+Release:        1
+Group:          Application Framework/Package Management
+License:        Apache-2.0
+Source0:        %{name}-%{version}.tar.gz
+
+Source1000:     wgt-backend.manifest
+Source1001:     wgt-backend-tests.manifest
+
+BuildRequires:  boost-devel
+BuildRequires:  cmake
+BuildRequires:  gtest-devel
+BuildRequires:  app-installers-tests
+BuildRequires:  pkgconfig(app-installers)
+BuildRequires:  pkgconfig(manifest-parser)
+BuildRequires:  pkgconfig(wgt-manifest-handlers)
+BuildRequires:  pkgconfig(pkgmgr-installer)
+BuildRequires:  pkgconfig(pkgmgr-types)
+BuildRequires:  pkgconfig(libwebappenc)
+BuildRequires:  pkgconfig(tpk-installer)
+BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(libgum)
+
+%description
+This is a package that installs the WGT backend of pkgmgr.
+
+%package tests
+Summary: Unit tests for wgt-backend
+Requires: %{name} = %{version}
+
+%description tests
+Unit tests for wgt-backend
+
+%prep
+%setup -q
+
+cp %{SOURCE1000} .
+cp %{SOURCE1001} .
+
+%build
+%cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}
+make %{?_smp_mflags}
+
+%install
+%make_install
+mkdir -p %{buildroot}/etc/package-manager/backend
+ln -s %{_bindir}/wgt-backend %{buildroot}%{_sysconfdir}/package-manager/backend/wgt
+
+%post tests
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner=eip %{_bindir}/wgt-backend-ut/smoke-test
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner=eip %{_bindir}/wgt-backend-ut/smoke-test-helper
+
+%files
+%manifest wgt-backend.manifest
+%license LICENSE
+%{_sysconfdir}/package-manager/backend/wgt
+%{_sysconfdir}/package-manager/backendlib/libwgt.so
+%{_bindir}/wgt-backend
+%{_datadir}/wgt-backend/default.png
+
+%files tests
+%manifest wgt-backend-tests.manifest
+%{_bindir}/wgt-backend-ut/*
+%{_datadir}/wgt-backend-ut/*
+
+%changelog
+* Thu Dec 18 2015 Pawel Sikorski <p.sikorski@samsung.com> 0.1-1
+- initial files creation
diff --git a/project_def.prop b/project_def.prop
deleted file mode 100644 (file)
index d15b0ac..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# Project Name
-APPNAME = analog-watch
-
-# Project Type
-type = app
-
-# Project Profile
-profile = wearable-5.0
-
-# C/CPP Sources
-USER_SRCS = src/main.c src/view.c src/data-provider.c src/comp-manager.c src/utils.c
-
-# EDC Sources
-USER_EDCS =
-
-# User Defines
-USER_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING
-USER_CPP_DEFS =
-
-# User Undefines
-USER_UNDEFS =
-USER_CPP_UNDEFS =
-
-
-# User Libraries
-USER_LIBS =
-
-# User Objects
-USER_OBJS =
-
-
-# User Includes
-## C Compiler
-USER_C_INC_DIRS = inc
-USER_INC_FILES =
-## C++ Compiler
-USER_CPP_INC_DIRS =
-USER_CPP_INC_FILES =
-
-USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
-
-# User Library Path
-USER_LIB_DIRS =
-
-# EDC Resource Path
-USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} res/images
-
-# EDC Flags
-USER_EXT_EDC_KEYS = EDC0
-
-USER_EXT_EDC0_EDCS = res/edje/main.edc res/edje/color_classes.edc
-USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} res/images
-
-# Resource Filter
-USER_RES_INCLUDE =
-USER_RES_EXCLUDE =
diff --git a/res/edje/color_classes.edc b/res/edje/color_classes.edc
deleted file mode 100644 (file)
index 901b673..0000000
+++ /dev/null
@@ -1,1035 +0,0 @@
-/*
- * Samsung API
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-color_classes {
-        color_class {
-                       name: "AO0011D";
-                       color: 250 250 250 77;
-        }
-        color_class {
-                       name: "AO0011";
-                       color: 250 250 250 255;
-        }
-        color_class {
-                       name: "AO0014";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO0012";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO0012S";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO0021";
-                       color: 250 250 250 77;
-        }
-        color_class {
-                       name: "AO0021S";
-                       color: 250 250 250 255;
-        }
-        color_class{
-                       name: "AO011";
-                       color: 0 0 0 179;
-        }
-        color_class{
-                       name: "AO011P";
-                       color: 0 0 0 179;
-        }
-        color_class{
-                       name: "AO011D";
-                       color: 0 0 0 179;
-        }
-        color_class {
-                       name: "AO0111";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO0112";
-                       color: 0 0 0 165;
-        }
-        color_class {
-                       name: "AO0113";
-                       color: 10 10 10 255;
-        }
-        color_class {
-                       name: "AO0121L1";
-                       color: 21 191 52 255;
-        }
-        color_class {
-                       name: "AO0121L1P";
-                       color: 21 191 52 127;
-        }
-        color_class {
-                       name: "AO0121L2";
-                       color: 8 181 224 255;
-        }
-        color_class {
-                       name: "AO0121L2P";
-                       color: 8 181 224 127;
-        }
-        color_class {
-                       name: "AO0121L3";
-                       color: 23 144 237 255;
-        }
-        color_class {
-                       name: "AO0121L3P";
-                       color: 23 144 237 127;
-        }
-        color_class {
-                       name: "AO0121L4";
-                       color: 255 161 0 255;
-        }
-        color_class {
-                       name: "AO0121L4P";
-                       color: 255 161 0 127;
-        }
-        color_class {
-                       name: "AO0121L5";
-                       color: 255 114 0 255;
-        }
-        color_class {
-                       name: "AO0121L5P";
-                       color: 255 114 0 127;
-        }
-        color_class {
-                       name: "AO0121L6";
-                       color: 255 59 0 255;
-        }
-        color_class {
-                       name: "AO0121L6P";
-                       color: 255 59 0 127;
-        }
-        color_class {
-                       name: "AO0121L7";
-                       color: 160 91 239 255;
-        }
-        color_class {
-                       name: "AO0121L7P";
-                       color: 160 91 239 127;
-        }
-        color_class {
-                       name: "AO0121L8";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO0121L8P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO0122L1";
-                       color: 255 255 255 255;
-        }
-        color_class {
-                       name: "AO0122L2";
-                       color: 61 61 61 255;
-        }
-        color_class {
-                       name: "AO0123L1";
-                       color: 51 51 51 255;
-        }
-        color_class {
-                       name: "AO0123L2";
-                       color: 160 160 160 255;
-        }
-        color_class {
-                       name: "AO013L1";
-                       color: 255 106 0 255;
-        }
-        color_class {
-                       name: "AO013L2";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO014";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO14P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO014P";
-                       color: 249 249 249 127;
-        }
-        color_class {
-                       name: "AO0151";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO0151P";
-                       color: 0 0 0 165;
-        }
-        color_class {
-                       name: "AO0151D";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO0152";
-                       color: 0 0 0 76;
-        }
-        color_class {
-                       name: "AO0152P";
-                       color: 0 0 0 38;
-        }
-        color_class {
-                       name: "AO0152D";
-                       color: 0 0 0 25;
-        }
-        color_class {
-                       name: "AO0161";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO0161P";
-                       color: 0 0 0 165;
-        }
-        color_class {
-                       name: "AO0161D";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO0162";
-                       color: 212 213 214 76;
-        }
-        color_class {
-                       name: "AO0162P";
-                       color: 212 213 214 76;
-        }
-        color_class {
-                       name: "AO0162D";
-                       color: 212 213 214 76;
-        }
-        color_class {
-                       name: "AO021";
-                       color: 127 127 127 255;
-        }
-        color_class {
-                       name: "AO021S";
-                       color: 165 63 56 255;
-        }
-        color_class {
-                       name: "AO022";
-                       color: 0 105 147 255;
-        }
-        color_class {
-                       name: "AO023";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO024";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO024P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO0251L1";
-                       color: 255 255 255 255;
-        }
-        color_class {
-                       name: "AO0251L2";
-                       color: 61 61 61 255;
-        }
-        color_class {
-                       name: "AO0252L1";
-                       color: 51 51 51 255;
-        }
-        color_class {
-                       name: "AO0252L2";
-                       color: 160 160 160 255;
-        }
-        color_class {
-                       name: "AO031";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO032";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO0321";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO032S";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO033";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO033P";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO034";
-                       color: 250 250 250 255;
-        }
-        color_class {
-                       name: "AO034P";
-                       color: 250 250 250 127;
-        }
-        color_class {
-                       name: "AO035";
-                       color: 201 221 220 255;
-        }
-        color_class {
-                       name: "AO035P";
-                       color: 201 221 220 127;
-        }
-        color_class {
-                       name: "AO0401";
-                       color: 0 166 255 255;
-        }
-        color_class {
-                       name: "AO0401A";
-                       color: 70 124 191 255;
-        }
-        color_class {
-                       name: "AO0402";
-                       color: 0 184 235 255;
-        }
-        color_class {
-                       name: "AO0402A";
-                       color: 0 150 191 255;
-        }
-        color_class {
-                       name: "AO0403";
-                       color: 0 235 215 255;
-        }
-        color_class {
-                       name: "AO0403A";
-                       color: 0 179 164 255;
-        }
-        color_class {
-                       name: "AO0404";
-                       color: 168 250 80 255;
-        }
-        color_class {
-                       name: "AO0404A";
-                       color: 120 179 57 255;
-        }
-        color_class {
-                       name: "AO0405";
-                       color: 196 240 0 255;
-        }
-        color_class {
-                       name: "AO0405A";
-                       color: 146 179 0 255;
-        }
-        color_class {
-                       name: "AO0406";
-                       color: 255 248 56 255;
-        }
-        color_class {
-                       name: "AO0406A";
-                       color: 191 186 42 255;
-        }
-        color_class {
-                       name: "AO0407";
-                       color: 255 161 20 255;
-        }
-        color_class {
-                       name: "AO0407A";
-                       color: 204 129 16 255;
-        }
-        color_class {
-                       name: "AO0408";
-                       color: 255 102 0 255;
-        }
-        color_class {
-                       name: "AO0408A";
-                       color: 191 77 0 255;
-        }
-        color_class {
-                       name: "AO0409";
-                       color: 255 52 41 255;
-        }
-        color_class {
-                       name: "AO0409A";
-                       color: 191 39 31 255;
-        }
-        color_class {
-                       name: "AO0410";
-                       color: 230 62 188 255;
-        }
-        color_class {
-                       name: "AO0410A";
-                       color: 179 48 146 255;
-        }
-        color_class {
-                       name: "AO0411";
-                       color: 150 77 240 255;
-        }
-        color_class {
-                       name: "AO0411A";
-                       color: 104 53 166 255;
-        }
-        color_class {
-                       name: "AO0412";
-                       color: 255 255 255 255;
-        }
-        color_class {
-                       name: "AO0412A";
-                       color: 179 179 179 255;
-        }
-        color_class {
-                       name: "AO041";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO042";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO043";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO044L1";
-                       color: 250 250 250 255;
-        }
-        color_class {
-                       name: "AO044L2";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO044L3";
-                       color: 184 46 46 255;
-        }
-        color_class {
-                       name: "AO044L4";
-                       color: 0 0 0 90;
-        }
-        color_class {
-                       name: "AO045";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO046";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO047";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO0481";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO0482";
-                       color: 0 0 0 25;
-        }
-        color_class {
-                       name: "AO0491";
-                       color: 250 250 250 26;
-        }
-        color_class {
-                       name: "AO0493";
-                       color: 0 0 0 100;
-        }
-        color_class{
-                       name: "AO0501";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AO0502";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AO0503";
-                       color: 255 52 41 255;
-        }
-        color_class {
-                       name: "AO051S";
-                       color: 155 234 18 229;
-        }
-        color_class {
-                       name: "AO051";
-                       color: 0 0 0 229;
-        }
-        color_class {
-                       name: "AO051D";
-                       color: 155 234 18 127;
-        }
-        color_class {
-                       name: "AO052L1S";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO052L1";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO052L1D";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO052L2S";
-                       color: 160 141 56 255;
-        }
-        color_class {
-                       name: "AO052L2";
-                       color: 45 45 45 255;
-        }
-        color_class {
-                       name: "AO052L2D";
-                       color: 160 141 56 127;
-        }
-        color_class {
-                       name: "AO053";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO0531";
-                       color: 54 77 84 255;
-        }
-        color_class {
-                       name: "AO054L1S";
-                       color: 0 20 28 255;
-        }
-        color_class {
-                       name: "AO054L1";
-                       color: 0 20 28 255;
-        }
-        color_class {
-                       name: "AO054L1D";
-                       color: 0 20 28 127;
-        }
-        color_class {
-                       name: "AO054L2S";
-                       color: 172 234 0 229;
-        }
-        color_class {
-                       name: "AO054L2";
-                       color: 255 255 255 255;
-        }
-        color_class {
-                       name: "AO054L2D";
-                       color: 255 255 255 127;
-        }
-        color_class {
-                       name: "AO056L1";
-                       color: 25 25 25 255;
-        }
-        color_class {
-                       name: "AO056L1P";
-                       color: 25 25 25 127;
-        }
-        color_class {
-                       name: "AO056L2";
-                       color: 76 76 76 255;
-        }
-        color_class {
-                       name: "AO056L2P";
-                       color: 76 76 76 127;
-        }
-        color_class {
-                       name: "AO056L3";
-                       color: 186 255 0 255;
-        }
-        color_class {
-                       name: "AO056L3P";
-                       color: 186 255 0 127;
-        }
-        color_class {
-                       name: "AO056L4";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO056L4P";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AO056L5";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO056L5P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO057";
-                       color: 56 56 56 255;
-        }
-        color_class {
-                       name: "AO058";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO058P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO058D";
-                       color: 0 0 0 38;
-        }
-        color_class{
-                       name: "AO0601";
-                       color: 255 52 41 255;
-        }
-        color_class{
-                       name: "AO0601A";
-                       color: 191 55 31 255;
-        }
-        color_class {
-                       name: "AO061";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO062";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AO062P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO063";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO064";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO064P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO065";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AO0661";
-                       color: 0 0 0 25;
-        }
-        color_class {
-                       name: "AO0662";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AO0663";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AO0664";
-                       color: 255 255 255 127;
-        }
-        color_class{
-                       name: "AO0701";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AO0702";
-                       color: 255 217 0 255;
-        }
-        color_class{
-                       name: "AO0703";
-                       color: 237 31 34 255;
-        }
-        color_class{
-                       name: "AO0704";
-                       color: 255 255 255 255;
-        }
-        color_class{
-                       name: "AO0705";
-                       color: 255 255 255 128;
-        }
-        color_class{
-                       name: "AO0706";
-                       color: 255 255 255 128;
-        }
-        color_class {
-                       name: "AO081S";
-                       color: 178 255 0 76;
-        }
-        color_class {
-                       name: "AO081";
-                       color: 212 213 214 76;
-        }
-        color_class {
-                       name: "AO081D";
-                       color: 212 213 214 38;
-        }
-        color_class {
-                       name: "AO082";
-                       color: 0 0 0 178;
-        }
-        color_class {
-                       name: "AO082P";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AO082D";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO083L1";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO083L1P";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO083L2";
-                       color: 186 255 0 255;
-        }
-        color_class {
-                       name: "AO083L2P";
-                       color: 186 255 0 127;
-        }
-        color_class {
-                       name: "AO084L1";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO084L1P";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO084L2";
-                       color: 158 158 158 178;
-        }
-        color_class {
-                       name: "AO084L2P";
-                       color: 158 158 158 89;
-        }
-        color_class {
-                       name: "AO085L1";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO085L2";
-                       color: 0 0 0 51;
-        }
-        color_class {
-                       name: "AO086L1";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO086L1P";
-                       color: 0 0 0 102;
-        }
-        color_class {
-                       name: "AO086L2";
-                       color: 0 0 0 178;
-        }
-        color_class {
-                       name: "AO086L2P";
-                       color: 0 0 0 89;
-        }
-        color_class{
-                       name: "AT011";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT011P";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT011D";
-                       color: 0 0 0 102;
-        }
-        color_class{
-                       name: "AT011S";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT0101";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT0102";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0111";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0112";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0121";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0121P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT0122";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0122P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT0131";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0132";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0133";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0134";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT014";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT014P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT014D";
-                       color: 0 0 0 51;
-        }
-        color_class{
-                       name: "AT0201";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT0201P";
-                       color: 0 0 0 128;
-        }
-        color_class{
-                       name: "AT0202";
-                       color: 8 8 8 255;
-        }
-        color_class{
-                       name: "AT0203";
-                       color: 0 0 0 255;
-        }
-        color_class{
-                       name: "AT0204";
-                       color: 0 0 0 153;
-        }
-        color_class {
-                       name: "AT021";
-                       color: 249 249 249 255;
-        }
-        color_class {
-                       name: "AT0301";
-                       color: 200 200 200 255;
-        }
-        color_class {
-                       name: "AT0302";
-                       color: 200 200 200 255;
-        }
-        color_class {
-                       name: "AT0303";
-                       color: 225 225 225 255;
-        }
-        color_class {
-                       name: "AT0304";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0305";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0306";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0307";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0308";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0309";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0310";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0311";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0312";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0313";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0314";
-                       color: 0 0 0 204;
-        }
-        color_class {
-                       name: "AT0315";
-                       color: 0 0 0 204;
-        }
-        color_class {
-                       name: "AT0316";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0317";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0318";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0319";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0320";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0321";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0322";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0323";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0324";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0325";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT0326";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT041S";
-                       color: 178 255 0 255;
-        }
-        color_class {
-                       name: "AT041";
-                       color: 0 0 0 153;
-        }
-        color_class {
-                       name: "AT041D";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AT043";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT043P";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT043D";
-                       color: 0 0 0 38;
-        }
-        color_class {
-                       name: "AT045";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT045P";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT054";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT054P";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AT054D";
-                       color: 0 0 0 20;
-        }
-        color_class {
-                       name: "AT055";
-                       color: 186 255 0 255;
-        }
-        color_class {
-                       name: "AT055P";
-                       color: 186 255 0 127;
-        }
-        color_class {
-                       name: "AT056";
-                       color: 0 0 0 127;
-        }
-        color_class {
-                       name: "AT056P";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AT057";
-                       color: 0 0 0 63;
-        }
-        color_class {
-                       name: "AT10101";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT10101A";
-                       color: 255 255 255 26;
-        }
-        color_class {
-                       name: "AT10102";
-                       color: 0 0 0 255;
-        }
-        color_class {
-                       name: "AT10102A";
-                       color: 255 255 255 26;
-        }
-        color_class {
-                       name: "B018E";
-                       color: 165 63 56 178;
-        }
-        color_class {
-                       name: "B019";
-                       color: 165 63 56 255;
-        }
-}
diff --git a/res/edje/main.edc b/res/edje/main.edc
deleted file mode 100644 (file)
index 112a191..0000000
+++ /dev/null
@@ -1,984 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "color_classes.edc"
-
-#define IMAGE_BG "dial/ref_dial_bg.png"
-#define IMAGE_DIAL_01 "dial/ref_dial_unit_01.png"
-#define IMAGE_DIAL_02 "dial/ref_dial_unit_02.png"
-#define IMAGE_DIAL_03 "dial/ref_dial_unit_03.png"
-#define IMAGE_DIAL_04 "dial/ref_dial_unit_04.png"
-#define IMAGE_DIAL_05 "dial/ref_dial_unit_05.png"
-
-#define IMAGE_COMP_BG "battery/ref_com_bg.png"
-#define IMAGE_BATTERY_ICON_01 "battery/ref_battery_ic_01.png"
-#define IMAGE_BATTERY_ICON_02 "battery/ref_battery_ic_02.png"
-#define IMAGE_BATTERY_PERCENT_01 "battery/ref_battery_percent_01.png"
-#define IMAGE_BATTERY_PERCENT_02 "battery/ref_battery_percent_02.png"
-#define IMAGE_BATTERY_GAUGE_01 "battery/ref_com_gauge_01.png"
-#define IMAGE_BATTERY_GAUGE_02 "battery/ref_com_gauge_02.png"
-#define IMAGE_BATTERY_GAUGE_03 "battery/ref_com_gauge_03.png"
-#define IMAGE_BATTERY_GAUGE_HANDS_01 "battery/ref_com_gauge_hands_01.png"
-#define IMAGE_BATTERY_GAUGE_HANDS_02 "battery/ref_com_gauge_hands_02.png"
-#define IMAGE_BATTERY_GAUGE_HANDS_03 "battery/ref_com_gauge_hands_03.png"
-
-#define MSG_ID_SET_BATTERY_COMP 1
-#define MSG_ID_SET_BATTERY_LEVEL 2
-#define MSG_ID_SET_DIAL_STYLE 3
-
-#define MAX_PART_NAME_LEN 255
-#define BATTERY_COMP_TYPE_EMPTY 1
-#define BATTERY_COMP_TYPE_SHORT_TEXT 2
-#define BATTERY_COMP_TYPE_LONG_TEXT 4
-#define BATTERY_COMP_TYPE_RANGED_VALUE 8
-#define BATTERY_COMP_TYPE_TIME 16
-#define BATTERY_COMP_TYPE_ICON 32
-#define BATTERY_COMP_TYPE_ICON_INDICATOR 64
-
-#define STATE_DEFAULT "default"
-#define STATE_HIDDEN "hide"
-#define STATE_CUSTOM "custom"
-#define STATE_BATTERY_90 "battery90"
-#define STATE_BATTERY_70 "battery70"
-#define STATE_BATTERY_50 "battery50"
-#define STATE_BATTERY_30 "battery30"
-#define STATE_BATTERY_10 "battery10"
-
-#define STATE_DIAL_01 "dial01"
-#define STATE_DIAL_02 "dial02"
-#define STATE_DIAL_03 "dial03"
-#define STATE_DIAL_04 "dial04"
-#define STATE_DIAL_05 "dial05"
-
-#define PART_BG "img.bg"
-#define PART_DIAL_BG "img.dial.bg"
-#define PART_RIGHT_COMP_MODULE "right.complication.module"
-#define PART_RIGHT_COMP_BG "right.complication.module.bg"
-#define PART_BATTERY_LABEL "right.complication.module.label"
-#define PART_BATTERY_VALUE_01 "txt.battery.value.01"
-#define PART_BATTERY_VALUE_02 "txt.battery.value.02"
-#define PART_BATTERY_VALUE_03 "txt.battery.value.03"
-#define PART_BATTERY_ICON_01 "img.battery.icon.01"
-#define PART_BATTERY_ICON_02 "img.battery.icon.02"
-#define PART_BATTERY_ICON_03 "img.battery.icon.03"
-#define PART_BATTERY_ICON_04 "img.battery.icon.04"
-#define PART_BATTERY_PERCENTAGE_01 "img.battery.percentage.01"
-#define PART_BATTERY_PERCENTAGE_02 "img.battery.percentage.02"
-#define PART_BATTERY_PERCENTAGE_03 "img.battery.percentage.03"
-#define PART_BATTERY_CLIPPER_01 "rect.battery.clipper.01"
-#define PART_BATTERY_CLIPPER_02 "rect.battery.clipper.02"
-#define PART_BATTERY_CLIPPER_03 "rect.battery.clipper.03"
-#define PART_BATTERY_CLIPPER_04 "rect.battery.clipper.04"
-#define PART_BATTERY_CLIPPER_05 "rect.battery.clipper.05"
-#define PART_BATTERY_CLIPPER_06 "rect.battery.clipper.06"
-#define PART_BATTERY_GAUGE_01 "img.battery.gauge.01"
-#define PART_BATTERY_GAUGE_MASK_01 "img.battery.gauge.mask.01"
-#define PART_BATTERY_GAUGE_MASK_02 "img.battery.gauge.mask.02"
-#define PART_BATTERY_GAUGE_02 "img.battery.gauge.02"
-#define PART_BATTERY_GAUGE_HANDS_01 "img.battery.gauge.hands.01"
-
-#define RIGHT_COMP_H 124
-#define RIGHT_COMP_W 124
-
-images {
-   image:IMAGE_BG                      COMP;
-   image:IMAGE_DIAL_01 COMP;
-   image:IMAGE_DIAL_02 COMP;
-   image:IMAGE_DIAL_03 COMP;
-   image:IMAGE_DIAL_04 COMP;
-   image:IMAGE_DIAL_05 COMP;
-
-   image:IMAGE_COMP_BG COMP;
-   image:IMAGE_BATTERY_ICON_01 COMP;
-   image:IMAGE_BATTERY_ICON_02 COMP;
-   image:IMAGE_BATTERY_PERCENT_01              COMP;
-   image:IMAGE_BATTERY_PERCENT_02              COMP;
-   image:IMAGE_BATTERY_GAUGE_01                COMP;
-   image:IMAGE_BATTERY_GAUGE_02                COMP;
-   image:IMAGE_BATTERY_GAUGE_03                COMP;
-   image:IMAGE_BATTERY_GAUGE_HANDS_01          COMP;
-   image:IMAGE_BATTERY_GAUGE_HANDS_02          COMP;
-   image:IMAGE_BATTERY_GAUGE_HANDS_03          COMP;
-}
-collections {
-   group { name: "layout_watchface";
-      parts {
-         part { name: PART_BG;
-            type: IMAGE;
-            mouse_events: 1;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1 { relative:  (0.0) (0.0); }
-               rel2 { relative: (1.0) (1.0); }
-               align: 0.0 0.0;
-               image {
-                  normal: IMAGE_BG;
-               }
-               color: 0 0 0 255;
-            }
-         }
-         part { name: PART_RIGHT_COMP_MODULE;
-            type: SWALLOW;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1 { relative: (180 + (180-RIGHT_COMP_W)/2)/360.0 (180.0-(RIGHT_COMP_H/2))/360.0; }
-               rel2 { relative: (180 + (180-RIGHT_COMP_W)/2 + RIGHT_COMP_W)/360.0 (180.0+(RIGHT_COMP_H/2))/360.0; }
-               align: 0.0 0.0;
-               min: RIGHT_COMP_W RIGHT_COMP_H;
-               fixed: 1 1;
-            }
-         }
-         part { name: PART_RIGHT_COMP_BG;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1 {
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2 {
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_COMP_BG;
-               }
-               align: 0.5 0.5;
-               min: RIGHT_COMP_W RIGHT_COMP_H;
-               fixed: 1 1;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_LABEL;
-            type: TEXT;
-            description { state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 33/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 (33 + 24)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               align: 0.5 0.5;
-               text{
-                  font: "BreezeSans:style=Regular";
-                  size: 16;
-                  text: "Battery";
-               }
-               color_class: "AT0301";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_VALUE_01;
-            type: TEXT;
-            description { state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 (33 + 24 + 2)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 (33 + 24 + 2 + 26)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               align: 0.42 0.5;
-               text {
-                  font: "BreezeSans:Style=Regular";
-                  size: 24;
-                  text: "85";
-                  align: 0 0.5;
-                  max: 1 1;
-                  ellipsis: -1;
-               }
-               color_class: "AT0302";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_PERCENTAGE_01;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 1 0;
-                  to: PART_BATTERY_VALUE_01;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_BATTERY_VALUE_01;
-               }
-               image {
-                  normal: IMAGE_BATTERY_PERCENT_01;
-               }
-               align: 0 1;
-               min: 16 26;
-               max: 16 26;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_ICON_01;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: (RIGHT_COMP_W/2 - 30/2)/RIGHT_COMP_W 26/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: (RIGHT_COMP_W/2 + 30/2)/RIGHT_COMP_W (26 + 30)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_ICON_01;
-               }
-               align: 0.5 0.5;
-               min: 30 30;
-               fixed: 1 1;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_VALUE_02;
-            type: TEXT;
-            description { state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 (26 + 30 + 2)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 (26 + 30 + 2 + 30)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               align: 0.42 0.5;
-               text {
-                  font: "BreezeSans:style=Regular";
-                  size: 28;
-                  text: "80";
-                  align: 0 0.5;
-                  max: 1 1;
-                  ellipsis: -1;
-               }
-               color_class: "AT0303";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_PERCENTAGE_02;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 1 0;
-                  to: PART_BATTERY_VALUE_02;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_BATTERY_VALUE_02;
-               }
-               image {
-                  normal: IMAGE_BATTERY_PERCENT_02;
-               }
-               align: 0 1;
-               min: 18 30;
-               max: 18 30;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_CLIPPER_01;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_CLIPPER_02;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_CLIPPER_03;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_CLIPPER_04;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-
-         }
-         part { name: PART_BATTERY_CLIPPER_05;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-
-         }
-         part { name: PART_BATTERY_CLIPPER_06;
-            type: RECT;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0.5 0.5;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 0.85 1.0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               clip_to: PART_BATTERY_GAUGE_MASK_01;
-               color_class: "AO0704";
-               map.on: 1;
-               map.rotation.center: PART_RIGHT_COMP_MODULE;
-               map.rotation.z: 45;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-
-         }
-         part { name: PART_BATTERY_GAUGE_01;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_GAUGE_01;
-               }
-               align: 0.5 0.5;
-               min: 124 124;
-               fixed: 1 1;
-               color_class: "AO0705";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_GAUGE_MASK_01;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_GAUGE_01;
-               }
-
-               align: 0.5 0.5;
-               min: 124 124;
-               fixed: 1 1;
-               color: 255 255 255 255;
-            }
-         }
-         part { name: PART_BATTERY_ICON_02;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_ICON_02;
-               }
-               align: 0.5 0.5;
-               min: 36 36;
-               max: 36 36;
-               fixed: 1 1;
-               color_class: "AO0706";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_GAUGE_02;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_GAUGE_02;
-               }
-               align: 0.5 0.5;
-               min: 124 124;
-               fixed: 1 1;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_ICON_03;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 21/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 (21 + 30)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_ICON_01;
-               }
-               align: 0.5 0.5;
-               min: 30 30;
-               max: 30 30;
-               fixed: 1 1;
-               color_class: "AO0706";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_GAUGE_HANDS_01;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 0 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_GAUGE_HANDS_01;
-               }
-               align: 0.5 0.5;
-               min: 20 124;
-               max: 20 124;
-               map.on: 1;
-               map.rotation.z: 0;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_ICON_04;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: (RIGHT_COMP_W/2 - 50)/RIGHT_COMP_W 0;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: (RIGHT_COMP_W/2 - 20)/RIGHT_COMP_W 1;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               image {
-                  normal: IMAGE_BATTERY_ICON_01;
-               }
-               align: 0.5 0.5;
-               min: 30 30;
-               max: 30 30;
-               fixed: 1 1;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_VALUE_03;
-            type: TEXT;
-            description { state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: (RIGHT_COMP_W/2 - 20)/RIGHT_COMP_W (RIGHT_COMP_H/2 - 30/2)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               rel2{
-                  relative: 1 (RIGHT_COMP_H/2 + 30/2)/RIGHT_COMP_H;
-                  to: PART_RIGHT_COMP_MODULE;
-               }
-               align: 0 0.5;
-               text {
-                  font: "BreezeSans:Style=Regular";
-                  size: 28;
-                  text: "80";
-                  align: 0 0.5;
-                  max: 1 1;
-                  ellipsis: -1;
-               }
-               color_class: "AT0303";
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_BATTERY_PERCENTAGE_03;
-            type: IMAGE;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1{
-                  relative: 1 0;
-                  to: PART_BATTERY_VALUE_03;
-               }
-               rel2{
-                  relative: 1 1;
-                  to: PART_BATTERY_VALUE_03;
-               }
-               image {
-                  normal: IMAGE_BATTERY_PERCENT_02;
-               }
-               align: 0 1;
-               min: 18 30;
-               max: 18 30;
-            }
-            description { state: STATE_HIDDEN 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               visible: 0;
-            }
-         }
-         part { name: PART_DIAL_BG;
-            type: IMAGE;
-            mouse_events: 1;
-            description {
-               state: STATE_DEFAULT 0.0;
-               rel1 { relative:        (0.0) (0.0); }
-               rel2 { relative: (1.0) (1.0); }
-               align: 0.0 0.0;
-               image {
-                  normal: IMAGE_DIAL_01;
-               }
-            }
-            description { state: STATE_DIAL_01 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               image {
-                  normal: IMAGE_DIAL_01;
-               }
-            }
-            description { state: STATE_DIAL_02 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               image {
-                  normal: IMAGE_DIAL_02;
-               }
-            }
-            description { state: STATE_DIAL_03 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               image {
-                  normal: IMAGE_DIAL_03;
-               }
-            }
-            description { state: STATE_DIAL_04 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               image {
-                  normal: IMAGE_DIAL_04;
-               }
-            }
-            description { state: STATE_DIAL_05 0.0;
-               inherit: STATE_DEFAULT 0.0;
-               image {
-                  normal: IMAGE_DIAL_05;
-               }
-            }
-         }
-      }
-      script
-      {
-         public g_curr_battery_comp;
-         public g_curr_dial_style;
-
-         public _set_battery_comp(num) {
-            new battery_bg = get_part_id(PART_RIGHT_COMP_BG);
-            new battery_label = get_part_id(PART_BATTERY_LABEL);
-            new battery_icon_01 = get_part_id(PART_BATTERY_ICON_01);
-            new battery_icon_02 = get_part_id(PART_BATTERY_ICON_02);
-            new battery_icon_03 = get_part_id(PART_BATTERY_ICON_03);
-            new battery_icon_04 = get_part_id(PART_BATTERY_ICON_04);
-            new battery_value_01 = get_part_id(PART_BATTERY_VALUE_01);
-            new battery_value_02 = get_part_id(PART_BATTERY_VALUE_02);
-            new battery_value_03 = get_part_id(PART_BATTERY_VALUE_03);
-            new battery_percent_01 = get_part_id(PART_BATTERY_PERCENTAGE_01);
-            new battery_percent_02 = get_part_id(PART_BATTERY_PERCENTAGE_02);
-            new battery_percent_03 = get_part_id(PART_BATTERY_PERCENTAGE_03);
-            new battery_gauge_01 = get_part_id(PART_BATTERY_GAUGE_01);
-            new battery_gauge_02 = get_part_id(PART_BATTERY_GAUGE_02);
-            new battery_gauge_hands_01 = get_part_id(PART_BATTERY_GAUGE_HANDS_01);
-            new battery_clipper_01 = get_part_id(PART_BATTERY_CLIPPER_01);
-            new battery_clipper_02 = get_part_id(PART_BATTERY_CLIPPER_02);
-            new battery_clipper_03 = get_part_id(PART_BATTERY_CLIPPER_03);
-            new battery_clipper_04 = get_part_id(PART_BATTERY_CLIPPER_04);
-            new battery_clipper_05 = get_part_id(PART_BATTERY_CLIPPER_05);
-            new battery_clipper_06 = get_part_id(PART_BATTERY_CLIPPER_06);
-
-
-            if (num == BATTERY_COMP_TYPE_EMPTY) {
-               set_state(battery_bg, STATE_HIDDEN, 0);
-               set_state(battery_label, STATE_HIDDEN, 0);
-               set_state(battery_icon_01, STATE_HIDDEN, 0);
-               set_state(battery_icon_02, STATE_HIDDEN, 0);
-               set_state(battery_icon_03, STATE_HIDDEN, 0);
-               set_state(battery_icon_04, STATE_HIDDEN, 0);
-               set_state(battery_value_01, STATE_HIDDEN, 0);
-               set_state(battery_value_02, STATE_HIDDEN, 0);
-               set_state(battery_value_03, STATE_HIDDEN, 0);
-               set_state(battery_percent_01, STATE_HIDDEN, 0);
-               set_state(battery_percent_02, STATE_HIDDEN, 0);
-               set_state(battery_percent_03, STATE_HIDDEN, 0);
-               set_state(battery_gauge_01, STATE_HIDDEN, 0);
-               set_state(battery_gauge_02, STATE_HIDDEN, 0);
-               set_state(battery_gauge_hands_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_02, STATE_HIDDEN, 0);
-               set_state(battery_clipper_03, STATE_HIDDEN, 0);
-               set_state(battery_clipper_04, STATE_HIDDEN, 0);
-               set_state(battery_clipper_05, STATE_HIDDEN, 0);
-               set_state(battery_clipper_06, STATE_HIDDEN, 0);
-            } else if (num == BATTERY_COMP_TYPE_SHORT_TEXT) {
-               set_state(battery_bg, STATE_DEFAULT, 0);
-               set_state(battery_label, STATE_DEFAULT, 0);
-               set_state(battery_icon_01, STATE_HIDDEN, 0);
-               set_state(battery_icon_02, STATE_HIDDEN, 0);
-               set_state(battery_icon_03, STATE_HIDDEN, 0);
-               set_state(battery_icon_04, STATE_HIDDEN, 0);
-               set_state(battery_value_01, STATE_DEFAULT, 0);
-               set_state(battery_value_02, STATE_HIDDEN, 0);
-               set_state(battery_value_03, STATE_HIDDEN, 0);
-               set_state(battery_percent_01, STATE_DEFAULT, 0);
-               set_state(battery_percent_02, STATE_HIDDEN, 0);
-               set_state(battery_percent_03, STATE_HIDDEN, 0);
-               set_state(battery_gauge_01, STATE_HIDDEN, 0);
-               set_state(battery_gauge_02, STATE_HIDDEN, 0);
-               set_state(battery_gauge_hands_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_02, STATE_HIDDEN, 0);
-               set_state(battery_clipper_03, STATE_HIDDEN, 0);
-               set_state(battery_clipper_04, STATE_HIDDEN, 0);
-               set_state(battery_clipper_05, STATE_HIDDEN, 0);
-               set_state(battery_clipper_06, STATE_HIDDEN, 0);
-            } else if (num == BATTERY_COMP_TYPE_LONG_TEXT) {
-               set_state(battery_bg, STATE_DEFAULT, 0);
-               set_state(battery_label, STATE_HIDDEN, 0);
-               set_state(battery_icon_01, STATE_DEFAULT, 0);
-               set_state(battery_icon_02, STATE_HIDDEN, 0);
-               set_state(battery_icon_03, STATE_HIDDEN, 0);
-               set_state(battery_icon_04, STATE_HIDDEN, 0);
-               set_state(battery_value_01, STATE_HIDDEN, 0);
-               set_state(battery_value_02, STATE_DEFAULT, 0);
-               set_state(battery_value_03, STATE_HIDDEN, 0);
-               set_state(battery_percent_01, STATE_HIDDEN, 0);
-               set_state(battery_percent_02, STATE_DEFAULT, 0);
-               set_state(battery_percent_03, STATE_HIDDEN, 0);
-               set_state(battery_gauge_01, STATE_HIDDEN, 0);
-               set_state(battery_gauge_02, STATE_HIDDEN, 0);
-               set_state(battery_gauge_hands_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_02, STATE_HIDDEN, 0);
-               set_state(battery_clipper_03, STATE_HIDDEN, 0);
-               set_state(battery_clipper_04, STATE_HIDDEN, 0);
-               set_state(battery_clipper_05, STATE_HIDDEN, 0);
-               set_state(battery_clipper_06, STATE_HIDDEN, 0);
-            } else if (num == BATTERY_COMP_TYPE_RANGED_VALUE) {
-               set_state(battery_bg, STATE_DEFAULT, 0);
-               set_state(battery_label, STATE_HIDDEN, 0);
-               set_state(battery_icon_01, STATE_HIDDEN, 0);
-               set_state(battery_icon_02, STATE_DEFAULT, 0);
-               set_state(battery_icon_03, STATE_HIDDEN, 0);
-               set_state(battery_icon_04, STATE_HIDDEN, 0);
-               set_state(battery_value_01, STATE_HIDDEN, 0);
-               set_state(battery_value_02, STATE_HIDDEN, 0);
-               set_state(battery_value_03, STATE_HIDDEN, 0);
-               set_state(battery_percent_01, STATE_HIDDEN, 0);
-               set_state(battery_percent_02, STATE_HIDDEN, 0);
-               set_state(battery_percent_03, STATE_HIDDEN, 0);
-               set_state(battery_gauge_01, STATE_DEFAULT, 0);
-               set_state(battery_gauge_02, STATE_HIDDEN, 0);
-               set_state(battery_gauge_hands_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_01, STATE_DEFAULT, 0);
-               set_state(battery_clipper_02, STATE_DEFAULT, 0);
-               set_state(battery_clipper_03, STATE_DEFAULT, 0);
-               set_state(battery_clipper_04, STATE_DEFAULT, 0);
-               set_state(battery_clipper_05, STATE_DEFAULT, 0);
-               set_state(battery_clipper_06, STATE_DEFAULT, 0);
-            } else if (num == BATTERY_COMP_TYPE_TIME) {
-               set_state(battery_bg, STATE_DEFAULT, 0);
-               set_state(battery_label, STATE_HIDDEN, 0);
-               set_state(battery_icon_01, STATE_HIDDEN, 0);
-               set_state(battery_icon_02, STATE_HIDDEN, 0);
-               set_state(battery_icon_03, STATE_DEFAULT, 0);
-               set_state(battery_icon_04, STATE_HIDDEN, 0);
-               set_state(battery_value_01, STATE_HIDDEN, 0);
-               set_state(battery_value_02, STATE_HIDDEN, 0);
-               set_state(battery_value_03, STATE_HIDDEN, 0);
-               set_state(battery_percent_01, STATE_HIDDEN, 0);
-               set_state(battery_percent_02, STATE_HIDDEN, 0);
-               set_state(battery_percent_03, STATE_HIDDEN, 0);
-               set_state(battery_gauge_01, STATE_HIDDEN, 0);
-               set_state(battery_gauge_02, STATE_DEFAULT, 0);
-               set_state(battery_gauge_hands_01, STATE_DEFAULT, 0);
-               set_state(battery_clipper_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_02, STATE_HIDDEN, 0);
-               set_state(battery_clipper_03, STATE_HIDDEN, 0);
-               set_state(battery_clipper_04, STATE_HIDDEN, 0);
-               set_state(battery_clipper_05, STATE_HIDDEN, 0);
-               set_state(battery_clipper_06, STATE_HIDDEN, 0);
-            } else if (num == BATTERY_COMP_TYPE_ICON) {
-               set_state(battery_bg, STATE_HIDDEN, 0);
-               set_state(battery_label, STATE_HIDDEN, 0);
-               set_state(battery_icon_01, STATE_HIDDEN, 0);
-               set_state(battery_icon_02, STATE_HIDDEN, 0);
-               set_state(battery_icon_03, STATE_HIDDEN, 0);
-               set_state(battery_icon_04, STATE_DEFAULT, 0);
-               set_state(battery_value_01, STATE_HIDDEN, 0);
-               set_state(battery_value_02, STATE_HIDDEN, 0);
-               set_state(battery_value_03, STATE_DEFAULT, 0);
-               set_state(battery_percent_01, STATE_HIDDEN, 0);
-               set_state(battery_percent_02, STATE_HIDDEN, 0);
-               set_state(battery_percent_03, STATE_DEFAULT, 0);
-               set_state(battery_gauge_01, STATE_HIDDEN, 0);
-               set_state(battery_gauge_02, STATE_HIDDEN, 0);
-               set_state(battery_gauge_hands_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_01, STATE_HIDDEN, 0);
-               set_state(battery_clipper_02, STATE_HIDDEN, 0);
-               set_state(battery_clipper_03, STATE_HIDDEN, 0);
-               set_state(battery_clipper_04, STATE_HIDDEN, 0);
-               set_state(battery_clipper_05, STATE_HIDDEN, 0);
-               set_state(battery_clipper_06, STATE_HIDDEN, 0);
-            }
-         }
-
-         public _set_battery_level(num) {
-            new curr_battery_comp = get_int(g_curr_battery_comp);
-            new battery_value_01 = get_part_id(PART_BATTERY_VALUE_01);
-            new battery_value_02 = get_part_id(PART_BATTERY_VALUE_02);
-            new battery_value_03 = get_part_id(PART_BATTERY_VALUE_03);
-            new battery_gauge_hands_01 = get_part_id(PART_BATTERY_GAUGE_HANDS_01);
-            new battery_clipper_01 = get_part_id(PART_BATTERY_CLIPPER_01);
-            new battery_clipper_02 = get_part_id(PART_BATTERY_CLIPPER_02);
-            new battery_clipper_03 = get_part_id(PART_BATTERY_CLIPPER_03);
-            new battery_clipper_04 = get_part_id(PART_BATTERY_CLIPPER_04);
-            new battery_clipper_05 = get_part_id(PART_BATTERY_CLIPPER_05);
-            new battery_clipper_06 = get_part_id(PART_BATTERY_CLIPPER_06);
-            new level[MAX_PART_NAME_LEN];
-            snprintf(level, MAX_PART_NAME_LEN, "%d", num);
-
-            new Float:z, Float:val = num, Float:deg;
-            deg = (286*val)/100;
-            if (val < 50) {
-               z = 143*(val/50) + 217;
-            } else {
-               z = 143*((val - 50)/50);
-            }
-
-            if (curr_battery_comp == BATTERY_COMP_TYPE_SHORT_TEXT) {
-               custom_state(battery_value_01, STATE_DEFAULT, 0.0);
-               set_state_val(battery_value_01, STATE_TEXT, level);
-               set_state(battery_value_01, STATE_CUSTOM, 0);
-            } else if (curr_battery_comp == BATTERY_COMP_TYPE_LONG_TEXT) {
-               custom_state(battery_value_02, STATE_DEFAULT, 0.0);
-               set_state_val(battery_value_02, STATE_TEXT, level);
-               set_state(battery_value_02, STATE_CUSTOM, 0);
-            } else if (curr_battery_comp == BATTERY_COMP_TYPE_RANGED_VALUE) {
-               custom_state(battery_clipper_01, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_01, STATE_MAP_ROT_Z, (deg > (90 - 37.0)) ? 90.0 : (deg + 37.0));
-               set_state(battery_clipper_01, STATE_CUSTOM, 0);
-               custom_state(battery_clipper_02, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_02, STATE_MAP_ROT_Z, (deg > (135 - 37.0)) ? 135.0 : (deg + 37.0));
-               set_state(battery_clipper_02, STATE_CUSTOM, 0);
-               custom_state(battery_clipper_03, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_03, STATE_MAP_ROT_Z, (deg > (180 - 37.0)) ? 180.0 : (deg + 37.0));
-               set_state(battery_clipper_03, STATE_CUSTOM, 0);
-               custom_state(battery_clipper_04, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_04, STATE_MAP_ROT_Z, (deg > (225 - 37.0)) ? 225.0 : (deg + 37.0));
-               set_state(battery_clipper_04, STATE_CUSTOM, 0);
-               custom_state(battery_clipper_05, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_05, STATE_MAP_ROT_Z, (deg > (270 - 37.0)) ? 270.0 : (deg + 37.0));
-               set_state(battery_clipper_05, STATE_CUSTOM, 0);
-               custom_state(battery_clipper_06, STATE_DEFAULT, 0.0);
-               set_state_val(battery_clipper_06, STATE_MAP_ROT_Z, (deg > (325 - 37.0)) ? 325.0 : (deg + 37.0));
-               set_state(battery_clipper_06, STATE_CUSTOM, 0);
-            } else if (curr_battery_comp == BATTERY_COMP_TYPE_TIME) {
-               custom_state(battery_gauge_hands_01, STATE_DEFAULT, 0.0);
-               set_state_val(battery_gauge_hands_01, STATE_MAP_ROT_Z, z);
-               set_state(battery_gauge_hands_01, STATE_CUSTOM, 0);
-            } else if (curr_battery_comp == BATTERY_COMP_TYPE_ICON) {
-               custom_state(battery_value_03, STATE_DEFAULT, 0.0);
-               set_state_val(battery_value_03, STATE_TEXT, level);
-               set_state(battery_value_03, STATE_CUSTOM, 0);
-            }
-         }
-
-         public _set_dial_style(num) {
-            new dst[MAX_PART_NAME_LEN];
-            snprintf(dst, MAX_PART_NAME_LEN, "%s%d", "dial0", num);
-            new dial = get_part_id(PART_DIAL_BG);
-            set_state(dial, dst, 0);
-         }
-
-         public message(Msg_Type:type, id, ...) {
-            new val = getarg(2);
-
-            if (type == MSG_INT) {
-               switch (id) {
-                  case MSG_ID_SET_BATTERY_COMP: {
-                     set_int(g_curr_battery_comp, val);
-                     _set_battery_comp(val);
-                  }
-                  case MSG_ID_SET_BATTERY_LEVEL: {
-                     _set_battery_level(val);
-                  }
-                  case MSG_ID_SET_DIAL_STYLE: {
-                     set_int(g_curr_dial_style, val);
-                     _set_dial_style(val);
-                  }
-                  default: {
-                                       //LOGA(d1, "Unknown message: %d", id)
-                  }
-               }
-            }
-         }
-      }
-   }
-}
diff --git a/res/images/battery/ref_battery_ic_01.png b/res/images/battery/ref_battery_ic_01.png
deleted file mode 100644 (file)
index 1cfa848..0000000
Binary files a/res/images/battery/ref_battery_ic_01.png and /dev/null differ
diff --git a/res/images/battery/ref_battery_ic_02.png b/res/images/battery/ref_battery_ic_02.png
deleted file mode 100644 (file)
index 9136ad5..0000000
Binary files a/res/images/battery/ref_battery_ic_02.png and /dev/null differ
diff --git a/res/images/battery/ref_battery_percent_01.png b/res/images/battery/ref_battery_percent_01.png
deleted file mode 100644 (file)
index 4014a3f..0000000
Binary files a/res/images/battery/ref_battery_percent_01.png and /dev/null differ
diff --git a/res/images/battery/ref_battery_percent_02.png b/res/images/battery/ref_battery_percent_02.png
deleted file mode 100644 (file)
index f726890..0000000
Binary files a/res/images/battery/ref_battery_percent_02.png and /dev/null differ
diff --git a/res/images/battery/ref_com_bg.png b/res/images/battery/ref_com_bg.png
deleted file mode 100644 (file)
index d583536..0000000
Binary files a/res/images/battery/ref_com_bg.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_01.png b/res/images/battery/ref_com_gauge_01.png
deleted file mode 100644 (file)
index e1ed423..0000000
Binary files a/res/images/battery/ref_com_gauge_01.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_02.png b/res/images/battery/ref_com_gauge_02.png
deleted file mode 100644 (file)
index b5ce71a..0000000
Binary files a/res/images/battery/ref_com_gauge_02.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_03.png b/res/images/battery/ref_com_gauge_03.png
deleted file mode 100644 (file)
index 4956af1..0000000
Binary files a/res/images/battery/ref_com_gauge_03.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_hands_01.png b/res/images/battery/ref_com_gauge_hands_01.png
deleted file mode 100644 (file)
index 36bff1e..0000000
Binary files a/res/images/battery/ref_com_gauge_hands_01.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_hands_02.png b/res/images/battery/ref_com_gauge_hands_02.png
deleted file mode 100644 (file)
index 634f765..0000000
Binary files a/res/images/battery/ref_com_gauge_hands_02.png and /dev/null differ
diff --git a/res/images/battery/ref_com_gauge_hands_03.png b/res/images/battery/ref_com_gauge_hands_03.png
deleted file mode 100644 (file)
index 5e4ceea..0000000
Binary files a/res/images/battery/ref_com_gauge_hands_03.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_bg.png b/res/images/dial/ref_dial_bg.png
deleted file mode 100644 (file)
index c36baab..0000000
Binary files a/res/images/dial/ref_dial_bg.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_unit_01.png b/res/images/dial/ref_dial_unit_01.png
deleted file mode 100644 (file)
index a37e2b5..0000000
Binary files a/res/images/dial/ref_dial_unit_01.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_unit_02.png b/res/images/dial/ref_dial_unit_02.png
deleted file mode 100644 (file)
index 0041998..0000000
Binary files a/res/images/dial/ref_dial_unit_02.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_unit_03.png b/res/images/dial/ref_dial_unit_03.png
deleted file mode 100644 (file)
index 9542dbf..0000000
Binary files a/res/images/dial/ref_dial_unit_03.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_unit_04.png b/res/images/dial/ref_dial_unit_04.png
deleted file mode 100644 (file)
index 8edf526..0000000
Binary files a/res/images/dial/ref_dial_unit_04.png and /dev/null differ
diff --git a/res/images/dial/ref_dial_unit_05.png b/res/images/dial/ref_dial_unit_05.png
deleted file mode 100644 (file)
index f28e359..0000000
Binary files a/res/images/dial/ref_dial_unit_05.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_center_pivot.png b/res/images/hands/ref_hands_01_center_pivot.png
deleted file mode 100644 (file)
index 9506e76..0000000
Binary files a/res/images/hands/ref_hands_01_center_pivot.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_hr_l.png b/res/images/hands/ref_hands_01_hr_l.png
deleted file mode 100644 (file)
index dec6ba1..0000000
Binary files a/res/images/hands/ref_hands_01_hr_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_hr_r.png b/res/images/hands/ref_hands_01_hr_r.png
deleted file mode 100644 (file)
index 4c11a44..0000000
Binary files a/res/images/hands/ref_hands_01_hr_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_hr_shadow.png b/res/images/hands/ref_hands_01_hr_shadow.png
deleted file mode 100644 (file)
index 759fcef..0000000
Binary files a/res/images/hands/ref_hands_01_hr_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_min_l.png b/res/images/hands/ref_hands_01_min_l.png
deleted file mode 100644 (file)
index 5d0da0e..0000000
Binary files a/res/images/hands/ref_hands_01_min_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_min_r.png b/res/images/hands/ref_hands_01_min_r.png
deleted file mode 100644 (file)
index 7afc870..0000000
Binary files a/res/images/hands/ref_hands_01_min_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_min_shadow.png b/res/images/hands/ref_hands_01_min_shadow.png
deleted file mode 100644 (file)
index fa7918f..0000000
Binary files a/res/images/hands/ref_hands_01_min_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_sec.png b/res/images/hands/ref_hands_01_sec.png
deleted file mode 100644 (file)
index 73ab20b..0000000
Binary files a/res/images/hands/ref_hands_01_sec.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_01_sec_shadow.png b/res/images/hands/ref_hands_01_sec_shadow.png
deleted file mode 100644 (file)
index b6a3c5d..0000000
Binary files a/res/images/hands/ref_hands_01_sec_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_center_point.png b/res/images/hands/ref_hands_02_center_point.png
deleted file mode 100644 (file)
index ca95013..0000000
Binary files a/res/images/hands/ref_hands_02_center_point.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_hr.png b/res/images/hands/ref_hands_02_hr.png
deleted file mode 100644 (file)
index a0aba89..0000000
Binary files a/res/images/hands/ref_hands_02_hr.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_hr_shadow.png b/res/images/hands/ref_hands_02_hr_shadow.png
deleted file mode 100644 (file)
index cb33013..0000000
Binary files a/res/images/hands/ref_hands_02_hr_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_min.png b/res/images/hands/ref_hands_02_min.png
deleted file mode 100644 (file)
index ea47b5f..0000000
Binary files a/res/images/hands/ref_hands_02_min.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_min_shadow.png b/res/images/hands/ref_hands_02_min_shadow.png
deleted file mode 100644 (file)
index 252a6cb..0000000
Binary files a/res/images/hands/ref_hands_02_min_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_sec.png b/res/images/hands/ref_hands_02_sec.png
deleted file mode 100644 (file)
index 5ee82ff..0000000
Binary files a/res/images/hands/ref_hands_02_sec.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_02_sec_shadow.png b/res/images/hands/ref_hands_02_sec_shadow.png
deleted file mode 100644 (file)
index bf9fc08..0000000
Binary files a/res/images/hands/ref_hands_02_sec_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_hr.png b/res/images/hands/ref_hands_03_hr.png
deleted file mode 100644 (file)
index f33bacb..0000000
Binary files a/res/images/hands/ref_hands_03_hr.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_hr_shadow.png b/res/images/hands/ref_hands_03_hr_shadow.png
deleted file mode 100644 (file)
index bfa1073..0000000
Binary files a/res/images/hands/ref_hands_03_hr_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_min.png b/res/images/hands/ref_hands_03_min.png
deleted file mode 100644 (file)
index 10428a5..0000000
Binary files a/res/images/hands/ref_hands_03_min.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_min_shadow.png b/res/images/hands/ref_hands_03_min_shadow.png
deleted file mode 100644 (file)
index 793e065..0000000
Binary files a/res/images/hands/ref_hands_03_min_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_sec.png b/res/images/hands/ref_hands_03_sec.png
deleted file mode 100644 (file)
index d45acd8..0000000
Binary files a/res/images/hands/ref_hands_03_sec.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_03_sec_shadow.png b/res/images/hands/ref_hands_03_sec_shadow.png
deleted file mode 100644 (file)
index 653f8b6..0000000
Binary files a/res/images/hands/ref_hands_03_sec_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_hr_l.png b/res/images/hands/ref_hands_04_hr_l.png
deleted file mode 100644 (file)
index b13ae5a..0000000
Binary files a/res/images/hands/ref_hands_04_hr_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_hr_r.png b/res/images/hands/ref_hands_04_hr_r.png
deleted file mode 100644 (file)
index 0b001ea..0000000
Binary files a/res/images/hands/ref_hands_04_hr_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_hr_shadow.png b/res/images/hands/ref_hands_04_hr_shadow.png
deleted file mode 100644 (file)
index d903e54..0000000
Binary files a/res/images/hands/ref_hands_04_hr_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_min_l.png b/res/images/hands/ref_hands_04_min_l.png
deleted file mode 100644 (file)
index 67174bd..0000000
Binary files a/res/images/hands/ref_hands_04_min_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_min_r.png b/res/images/hands/ref_hands_04_min_r.png
deleted file mode 100644 (file)
index e309b82..0000000
Binary files a/res/images/hands/ref_hands_04_min_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_min_shadow.png b/res/images/hands/ref_hands_04_min_shadow.png
deleted file mode 100644 (file)
index 91e27e3..0000000
Binary files a/res/images/hands/ref_hands_04_min_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_sec.png b/res/images/hands/ref_hands_04_sec.png
deleted file mode 100644 (file)
index 4c5df2a..0000000
Binary files a/res/images/hands/ref_hands_04_sec.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_04_sec_shadow.png b/res/images/hands/ref_hands_04_sec_shadow.png
deleted file mode 100644 (file)
index 8f3cabd..0000000
Binary files a/res/images/hands/ref_hands_04_sec_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_hr_l.png b/res/images/hands/ref_hands_05_hr_l.png
deleted file mode 100644 (file)
index 7d59423..0000000
Binary files a/res/images/hands/ref_hands_05_hr_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_hr_r.png b/res/images/hands/ref_hands_05_hr_r.png
deleted file mode 100644 (file)
index 7a2fd3e..0000000
Binary files a/res/images/hands/ref_hands_05_hr_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_hr_shadow.png b/res/images/hands/ref_hands_05_hr_shadow.png
deleted file mode 100644 (file)
index cc5d8ef..0000000
Binary files a/res/images/hands/ref_hands_05_hr_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_min_l.png b/res/images/hands/ref_hands_05_min_l.png
deleted file mode 100644 (file)
index fb20b79..0000000
Binary files a/res/images/hands/ref_hands_05_min_l.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_min_r.png b/res/images/hands/ref_hands_05_min_r.png
deleted file mode 100644 (file)
index 20b095f..0000000
Binary files a/res/images/hands/ref_hands_05_min_r.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_min_shadow.png b/res/images/hands/ref_hands_05_min_shadow.png
deleted file mode 100644 (file)
index 84d16d7..0000000
Binary files a/res/images/hands/ref_hands_05_min_shadow.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_sec.png b/res/images/hands/ref_hands_05_sec.png
deleted file mode 100644 (file)
index bbadbdf..0000000
Binary files a/res/images/hands/ref_hands_05_sec.png and /dev/null differ
diff --git a/res/images/hands/ref_hands_05_sec_shadow.png b/res/images/hands/ref_hands_05_sec_shadow.png
deleted file mode 100644 (file)
index 8e1f78b..0000000
Binary files a/res/images/hands/ref_hands_05_sec_shadow.png and /dev/null differ
diff --git a/shared/res/analog-watch.png b/shared/res/analog-watch.png
deleted file mode 100644 (file)
index bd32cfe..0000000
Binary files a/shared/res/analog-watch.png and /dev/null differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5384753
--- /dev/null
@@ -0,0 +1,5 @@
+ADD_SUBDIRECTORY(hybrid)
+ADD_SUBDIRECTORY(lib)
+ADD_SUBDIRECTORY(wgt)
+ADD_SUBDIRECTORY(wgt_backend)
+ADD_SUBDIRECTORY(unit_tests)
diff --git a/src/comp-manager.c b/src/comp-manager.c
deleted file mode 100644 (file)
index 40c91a4..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "analog-watch.h"
-#include "data-provider.h"
-#include "app-log.h"
-#include "comp-manager.h"
-#include "view.h"
-#include <device/battery.h>
-#include <watchface-complication-provider.h>
-
-static void _comp_draw_dial(bundle*);
-static void _comp_draw_hand(bundle*);
-static void _comp_on_editable_update(const watchface_editable_h, int, const watchface_editable_edit_state_e, void*);
-static void _comp_draw_complication(watchface_complication_type_e);
-static void _comp_on_complication_update(int, const char*, watchface_complication_type_e, const bundle*, void*);
-static void _comp_on_ready_for_edit_cb(watchface_editable_container_h, const char*, void*);
-static void _comp_init_editable();
-static void _comp_init_complication();
-static int _comp_battery_get_status();
-static void _on_complication_error_cb(int complication_id, const char* provider_id,
-                               watchface_complication_type_e type, watchface_complication_error_e error, void* user_data);
-
-static complication_h _comp;
-
-char _hand_styles[HANDS_NUM][5] = {
-       "01",
-       "02",
-       "03",
-       "04",
-       "05",
-};
-
-char _dial_styles[DIAL_NUM][5] = {
-       "01",
-       "02",
-       "03",
-       "04",
-       "05",
-};
-
-static void _on_complication_error_cb(int complication_id, const char* provider_id,
-                               watchface_complication_type_e type, watchface_complication_error_e error,
-                               void* user_data)
-{
-       __E("complication(%d) can not use (%s), %d", complication_id,
-               provider_id, error);
-}
-
-/*
- * @brief provide the battery level
- * return battery level
- */
-static int _comp_battery_get_status()
-{
-       int battery_level = 0;
-       int ret = device_battery_get_percent(&battery_level);
-       if (ret != DEVICE_ERROR_NONE) {
-               __E("device_battery_get_percentage error : %d", ret);
-       }
-       __D("%s", __func__);
-       return battery_level;
-}
-
-/*
- * @brief draws the complication with the help of edj
- * @param Enumeration for Complication Type.
- */
-void _comp_draw_complication(watchface_complication_type_e type)
-{
-       int percent;
-       Evas_Object* watchface_layout;
-       Edje_Message_Int msg = {0,};
-
-       watchface_layout = view_get_watchface_layout();
-       msg.val = type;
-       edje_object_message_send(elm_layout_edje_get(watchface_layout), EDJE_MESSAGE_INT, MSG_ID_SET_BATTERY_COMP, &msg);
-
-       percent = _comp_battery_get_status();
-       __D("_battery_state_changed_cb %d", percent);
-
-       msg.val = percent;
-       edje_object_message_send(elm_layout_edje_get(watchface_layout), EDJE_MESSAGE_INT, MSG_ID_SET_BATTERY_LEVEL, &msg);
-}
-
-/**
- * @brief Called when the complication is updated.
- * @param[in] complication_id A number that identifies the complication
- * @param[in] provider_id The name of the provider
- * @param[in] type The type shown in the complication
- * @param[in] data The data of the complication provided by the provider
- * @param[in] user_data The user data passed from the callback function
- */
-void _comp_on_complication_update(int complication_id, const char *provider_id,
-               watchface_complication_type_e type, const bundle *data, void *user_data)
-{
-       __D("%s: Complication Type: %d", __func__, type);
-       _comp_draw_complication(type);
-}
-
-/*
- * @brief initializes the complication for watch
- */
-void _comp_init_complication()
-{
-
-       char* current_comp_id = NULL;
-       int ret;
-       complication_allowed_list_h allowed_list;
-       watchface_complication_type_e cur_type;
-
-       __D("%s", __func__);
-
-       ret = watchface_complication_create(RIGHT_COMP, BATTERY_PROVIDER_ID,
-                       WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT,
-                       WATCHFACE_COMPLICATION_TYPE_NO_DATA|WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT|WATCHFACE_COMPLICATION_TYPE_LONG_TEXT
-                       |WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE|WATCHFACE_COMPLICATION_TYPE_TIME|WATCHFACE_COMPLICATION_TYPE_ICON,
-                       WATCHFACE_COMPLICATION_EVENT_NONE, &_comp);
-
-       ret = watchface_complication_allowed_list_create(&allowed_list);
-
-       ret = watchface_complication_allowed_list_add(allowed_list, BATTERY_PROVIDER_ID,
-                       WATCHFACE_COMPLICATION_TYPE_NO_DATA|WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT|WATCHFACE_COMPLICATION_TYPE_LONG_TEXT
-                       |WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE|WATCHFACE_COMPLICATION_TYPE_TIME|WATCHFACE_COMPLICATION_TYPE_ICON);
-       if (ret == WATCHFACE_COMPLICATION_ERROR_EXIST_ID) {
-               __E("WATCHFACE_COMPLICATION_ERROR_EXIST_ID");
-               watchface_complication_allowed_list_delete(allowed_list, BATTERY_PROVIDER_ID);
-               watchface_complication_allowed_list_add(allowed_list, BATTERY_PROVIDER_ID,
-                               WATCHFACE_COMPLICATION_TYPE_NO_DATA|WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT|WATCHFACE_COMPLICATION_TYPE_LONG_TEXT
-                               |WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE|WATCHFACE_COMPLICATION_TYPE_TIME|WATCHFACE_COMPLICATION_TYPE_ICON);
-       }
-       ret = watchface_complication_allowed_list_apply(_comp, allowed_list);
-       watchface_complication_allowed_list_clear(_comp);
-
-       ret = watchface_complication_get_current_provider_id(_comp, &current_comp_id);
-       watchface_complication_add_updated_cb(_comp, _comp_on_complication_update, _on_complication_error_cb, NULL);
-       if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) {
-               watchface_complication_get_current_type(_comp, &cur_type);
-               __D("watchface_complication_get_current_type %d", cur_type);
-               watchface_complication_send_update_request(_comp);
-               _comp_draw_complication(cur_type);
-               free(current_comp_id);
-       } else {
-               _comp_draw_complication(WATCHFACE_COMPLICATION_TYPE_NO_DATA);
-       }
-}
-
-/*
- * @brief draws the selected dial
- * @param data containing style of dial
- */
-void _comp_draw_dial(bundle *data)
-{
-       char *val = NULL;
-
-       if (data == NULL) {
-               __I("NULL data");
-               return;
-       }
-
-       bundle_get_str(data, "TEST_DIAL", &val);
-       if (val == NULL) {
-               __I("NULL dial data");
-               return;
-       }
-
-       view_set_dial_style(val);
-}
-
-/*
- * @brief draws the selected hands
- * @param data containing style of hands
- */
-void _comp_draw_hand(bundle *data)
-{
-       char *val = NULL;
-
-       if (data == NULL) {
-               __I("NULL data");
-               return;
-       }
-
-       bundle_get_str(data, "TEST_HAND", &val);
-       if (val == NULL) {
-               __I("NULL hand data");
-               return;
-       }
-
-       view_set_hands_style(val);
-}
-
-/**
- * @brief Called when an editable requests an edit.
- * @param handle The editable handle
- *            The @a handle can be used only in the callback.
- * @param selected_idx Index
- * @param state Editable state
- * @param user_data The user data passed from the callback function
- */
-void _comp_on_editable_update(const watchface_editable_h handle,
-               int selected_idx,
-               const watchface_editable_edit_state_e state,
-               void *user_data)
-{
-
-       bundle *data;
-       int ed_id;
-
-       watchface_editable_get_current_data(handle, &data);
-       watchface_editable_get_editable_id(handle, &ed_id);
-       __D("%s: curr state: %d, editable id: %d", __func__, state, ed_id);
-
-       if (ed_id == HANDS_EDIT)
-               _comp_draw_hand(data);
-       else if (ed_id == DIAL_EDIT)
-               _comp_draw_dial(data);
-}
-
-/**
- * @brief Called when the editor is ready to edit.
- * @param[in] handle The editable container handle
- * @param[in] editor_appid The name of editor
- * @param[in] user_data The user data passed from the callback function
- */
-void _comp_on_ready_for_edit_cb(watchface_editable_container_h ed_con_h, const char *editor_appid, void *user_data)
-{
-       watchface_editable_highlight_h hi;
-       complication_candidates_list_h candidates_list = NULL;
-       bundle *edit_data;
-       int current_idx = 0;
-       bundle *selected_data = NULL;
-       char *current_hand = NULL;
-       char *current_dial = NULL;
-
-       /* Dial */
-       watchface_editable_load_current_data(DIAL_EDIT, &selected_data);
-       bundle_get_str(selected_data, "TEST_DIAL", &current_dial);
-       watchface_editable_candidates_list_create(&candidates_list);
-
-       for (int i = 0; i < DIAL_NUM; i++) {
-               edit_data = bundle_create();
-               bundle_add_str(edit_data, "TEST_DIAL", _dial_styles[i]);
-               watchface_editable_candidates_list_add(candidates_list, edit_data);
-               __I("add element dial style: %s", _dial_styles[i]);
-               if (selected_data != NULL) {
-                       if (strcmp(current_dial, _dial_styles[i]) == 0)
-                               current_idx = i;
-               }
-       }
-
-       watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE);
-       watchface_editable_highlight_set_geometry(hi, 0, 0, 360, 360);
-       watchface_editable_add_design_element(ed_con_h, DIAL_EDIT, current_idx,
-               candidates_list, hi, "Dial");
-       watchface_editable_candidates_list_destroy(candidates_list);
-
-       /* Hands */
-       watchface_editable_load_current_data(HANDS_EDIT, &selected_data);
-       bundle_get_str(selected_data, "TEST_HAND", &current_hand);
-       watchface_editable_candidates_list_create(&candidates_list);
-
-       for (int i = 0; i < HANDS_NUM; i++) {
-               edit_data = bundle_create();
-               bundle_add_str(edit_data, "TEST_HAND", _hand_styles[i]);
-               watchface_editable_candidates_list_add(candidates_list, edit_data);
-               __I("add element hand style: %s", _hand_styles[i]);
-               if (selected_data != NULL) {
-                       if (strcmp(current_hand, _hand_styles[i]) == 0)
-                               current_idx = i;
-               }
-       }
-
-       watchface_editable_add_design_element(ed_con_h, HANDS_EDIT, current_idx,
-               candidates_list, NULL, "Hand");
-       watchface_editable_candidates_list_destroy(candidates_list);
-
-       /* Battery */
-       watchface_editable_highlight_set_geometry(hi, 208, 118, 124, 124);
-       watchface_editable_add_complication(ed_con_h, RIGHT_COMP, _comp, hi);
-       watchface_editable_request_edit(ed_con_h, _comp_on_editable_update, user_data);
-
-       watchface_editable_highlight_destroy(hi);
-}
-
-/*
- * @brief initializes the editables
- */
-void _comp_init_editable()
-{
-       bundle * selected_Data = NULL;
-       watchface_editable_load_current_data(HANDS_EDIT, &selected_Data);
-       _comp_draw_hand(selected_Data);
-       watchface_editable_load_current_data(DIAL_EDIT, &selected_Data);
-       _comp_draw_dial(selected_Data);
-}
-
-/*
- * brief initializes the comp-manager
- */
-void comp_init()
-{
-       _comp_init_complication();
-       _comp_init_editable();
-
-       watchface_editable_add_edit_ready_cb(_comp_on_ready_for_edit_cb, NULL);
-}
-
-/*
- * @brief Removes the callback for editables
- */
-void comp_destroy()
-{
-       watchface_editable_remove_edit_ready_cb(_comp_on_ready_for_edit_cb);
-}
diff --git a/src/data-provider.c b/src/data-provider.c
deleted file mode 100644 (file)
index 7313229..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <app_common.h>
-
-#include <Elementary.h>
-#include <efl_extension.h>
-#include "analog-watch.h"
-
-#include "data-provider.h"
-#include "app-log.h"
-#include "utils.h"
-
-#define IMAGE_COMMON_PATH "images/hands/ref_hands_"
-#define IMAGE_HANDS_CENTER_PIVOT_01_PATH "images/hands/ref_hands_01_center_pivot.png"
-#define IMAGE_SEC_HAND_01_PATH "images/hands/ref_hands_01_sec.png"
-#define IMAGE_SEC_HAND_SHADOW_01_PATH "images/hands/ref_hands_01_sec_shadow.png"
-#define IMAGE_MIN_HAND_l_01_PATH "images/hands/ref_hands_01_min_l.png"
-#define IMAGE_MIN_HAND_r_01_PATH "images/hands/ref_hands_01_min_r.png"
-#define IMAGE_MIN_HAND_SHADOW_01_PATH "images/hands/ref_hands_01_min_shadow.png"
-#define IMAGE_HOUR_HAND_l_01_PATH "images/hands/ref_hands_01_hr_l.png"
-#define IMAGE_HOUR_HAND_r_01_PATH "images/hands/ref_hands_01_hr_r.png"
-#define IMAGE_HOUR_HAND_SHADOW_01_PATH "images/hands/ref_hands_01_hr_shadow.png"
-
-
-#define IMAGE_HANDS_CENTER_PIVOT_02_PATH "images/hands/ref_hands_02_center_point.png"
-#define IMAGE_SEC_HAND_02_PATH "images/hands/ref_hands_02_sec.png"
-#define IMAGE_SEC_HAND_SHADOW_02_PATH "images/hands/ref_hands_02_sec_shadow.png"
-#define IMAGE_MIN_HAND_l_02_PATH "images/hands/ref_hands_02_min.png"
-#define IMAGE_MIN_HAND_r_02_PATH "images/hands/ref_hands_02_min.png"
-#define IMAGE_MIN_HAND_SHADOW_02_PATH "images/hands/ref_hands_02_min_shadow.png"
-#define IMAGE_HOUR_HAND_l_02_PATH "images/hands/ref_hands_02_hr.png"
-#define IMAGE_HOUR_HAND_r_02_PATH "images/hands/ref_hands_02_hr.png"
-#define IMAGE_HOUR_HAND_SHADOW_02_PATH "images/hands/ref_hands_02_hr_shadow.png"
-
-#define IMAGE_SEC_HAND_03_PATH "images/hands/ref_hands_03_sec.png"
-#define IMAGE_SEC_HAND_SHADOW_03_PATH "images/hands/ref_hands_03_sec_shadow.png"
-#define IMAGE_MIN_HAND_l_03_PATH "images/hands/ref_hands_03_min.png"
-#define IMAGE_MIN_HAND_r_03_PATH "images/hands/ref_hands_03_min.png"
-#define IMAGE_MIN_HAND_SHADOW_03_PATH "images/hands/ref_hands_03_min_shadow.png"
-#define IMAGE_HOUR_HAND_l_03_PATH "images/hands/ref_hands_03_hr.png"
-#define IMAGE_HOUR_HAND_r_03_PATH "images/hands/ref_hands_03_hr.png"
-#define IMAGE_HOUR_HAND_SHADOW_03_PATH "images/hands/ref_hands_03_hr_shadow.png"
-
-#define IMAGE_SEC_HAND_04_PATH "images/hands/ref_hands_04_sec.png"
-#define IMAGE_SEC_HAND_SHADOW_04_PATH "images/hands/ref_hands_04_sec_shadow.png"
-#define IMAGE_MIN_HAND_l_04_PATH "images/hands/ref_hands_04_min_l.png"
-#define IMAGE_MIN_HAND_r_04_PATH "images/hands/ref_hands_04_min_r.png"
-#define IMAGE_MIN_HAND_SHADOW_04_PATH "images/hands/ref_hands_04_min_shadow.png"
-#define IMAGE_HOUR_HAND_l_04_PATH "images/hands/ref_hands_04_hr_l.png"
-#define IMAGE_HOUR_HAND_r_04_PATH "images/hands/ref_hands_04_hr_r.png"
-#define IMAGE_HOUR_HAND_SHADOW_04_PATH "images/hands/ref_hands_04_hr_shadow.png"
-
-#define IMAGE_SEC_HAND_05_PATH "images/hands/ref_hands_05_sec.png"
-#define IMAGE_SEC_HAND_SHADOW_05_PATH "images/hands/ref_hands_05_sec_shadow.png"
-#define IMAGE_MIN_HAND_l_05_PATH "images/hands/ref_hands_05_min_l.png"
-#define IMAGE_MIN_HAND_r_05_PATH "images/hands/ref_hands_05_min_r.png"
-#define IMAGE_MIN_HAND_SHADOW_05_PATH "images/hands/ref_hands_05_min_shadow.png"
-#define IMAGE_HOUR_HAND_l_05_PATH "images/hands/ref_hands_05_hr_l.png"
-#define IMAGE_HOUR_HAND_r_05_PATH "images/hands/ref_hands_05_hr_r.png"
-#define IMAGE_HOUR_HAND_SHADOW_05_PATH "images/hands/ref_hands_05_hr_shadow.png"
-
-/**
- * @brief Get a image path of the part.
- * @param[in] type The part type
- * @param[in] style The current style
- * @param[in] lr flag to distinguish left half and right half plane
- */
-char *data_get_parts_image_path(parts_type_e type, char *style, bool lr)
-{
-       char *image_path;
-       static char res_path_buff[PATH_MAX] = {0,};
-
-       switch (type) {
-       case PARTS_TYPE_HANDS_SEC:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style, "_sec.png");
-               break;
-       case PARTS_TYPE_HANDS_MIN:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style,
-                       (!strcmp(style, "02") || !strcmp(style, "03")) ? "_min.png" : (lr == 0 ? "_min_l.png" : "_min_r.png"));
-               break;
-       case PARTS_TYPE_HANDS_HOUR:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style,
-                       (!strcmp(style, "02") || !strcmp(style, "03")) ? "_hr.png" :  (lr == 0 ? "_hr_l.png" : "_hr_r.png"));
-               break;
-       case PARTS_TYPE_HANDS_SEC_SHADOW:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style, "_sec_shadow.png");
-               break;
-       case PARTS_TYPE_HANDS_MIN_SHADOW:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style, "_min_shadow.png");
-               break;
-       case PARTS_TYPE_HANDS_HOUR_SHADOW:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style, "_hr_shadow.png");
-               break;
-       case PARTS_TYPE_HANDS_CENTER_PIVOT:
-               snprintf(res_path_buff, PATH_MAX, "%s%s%s", IMAGE_COMMON_PATH, style,
-                                       (!strcmp(style, "01")) ? "_center_pivot.png" : "_center_point.png");
-               break;
-       default:
-               __D("type error : %d", type);
-               return NULL;
-       }
-       image_path = utils_create_resource_path(&res_path_buff[0]);
-       return image_path;
-}
-
-/**
- * @brief Get a position of the part.
- * @param[in] type The part type
- * @param[out] x The pointer to an integer in which to store the X coordinate of the part
- * @param[out] y The pointer to an integer in which to store the Y coordinate of the part
- */
-void data_get_parts_position(parts_type_e type, int *x, int *y)
-{
-       switch (type) {
-       case PARTS_TYPE_HANDS_SEC:
-               *x = (BASE_WIDTH / 2) - (HANDS_SEC_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_MIN:
-               *x = (BASE_WIDTH / 2) - (HANDS_MIN_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_HOUR:
-               *x = (BASE_WIDTH / 2) - (HANDS_HOUR_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_SEC_SHADOW:
-               *x = (BASE_WIDTH / 2) - (HANDS_SEC_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_MIN_SHADOW:
-               *x = (BASE_WIDTH / 2) - (HANDS_MIN_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_HOUR_SHADOW:
-               *x = (BASE_WIDTH / 2) - (HANDS_HOUR_WIDTH / 2);
-               *y = 0;
-               break;
-       case PARTS_TYPE_HANDS_CENTER_PIVOT:
-               *x = (BASE_WIDTH / 2) - (HANDS_CENTER_PIVOT_WIDTH / 2);
-               *y = (BASE_HEIGHT / 2) - (HANDS_CENTER_PIVOT_HEIGHT / 2);
-               break;
-       default:
-               __E("type error : %d", type);
-               break;
-       }
-}
-
-
-/**
- * @brief Get a width size of the part.
- * @param[in] type The part type
- */
-int data_get_parts_width_size(parts_type_e type)
-{
-       int parts_width = 0;
-
-       switch (type) {
-       case PARTS_TYPE_HANDS_SEC:
-               parts_width = HANDS_SEC_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_MIN:
-               parts_width = HANDS_MIN_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_HOUR:
-               parts_width = HANDS_HOUR_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_SEC_SHADOW:
-               parts_width = HANDS_SEC_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_MIN_SHADOW:
-               parts_width = HANDS_MIN_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_HOUR_SHADOW:
-               parts_width = HANDS_HOUR_WIDTH;
-               break;
-       case PARTS_TYPE_HANDS_CENTER_PIVOT:
-               parts_width = HANDS_CENTER_PIVOT_WIDTH;
-               break;
-       default:
-               __E("type error : %d", type);
-               break;
-       }
-
-       return parts_width;
-}
-
-/**
- * @brief Get a height size of the part.
- * @param[in] type The part type
- */
-int data_get_parts_height_size(parts_type_e type)
-{
-       int parts_height = 0;
-
-       switch (type) {
-       case PARTS_TYPE_HANDS_SEC:
-               parts_height = HANDS_SEC_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_MIN:
-               parts_height = HANDS_MIN_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_HOUR:
-               parts_height = HANDS_HOUR_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_SEC_SHADOW:
-               parts_height = HANDS_SEC_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_MIN_SHADOW:
-               parts_height = HANDS_MIN_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_HOUR_SHADOW:
-               parts_height = HANDS_HOUR_HEIGHT;
-               break;
-       case PARTS_TYPE_HANDS_CENTER_PIVOT:
-               parts_height = HANDS_CENTER_PIVOT_HEIGHT;
-               break;
-       default:
-               __E("type error : %d", type);
-               break;
-       }
-
-       return parts_height;
-}
-
-/**
- * @brief Get plus angle for the hour hand.
- * @param[in] minute Current minute
- */
-int data_get_plus_angle(int minute)
-{
-       int angle = 0;
-
-       if (minute >= 0 && minute < 12) {
-               angle = 0;
-       } else if (minute >= 12 && minute < 24) {
-               angle = 6;
-       } else if (minute >= 24 && minute < 36) {
-               angle = 12;
-       } else if (minute >= 36 && minute < 48) {
-               angle = 18;
-       } else if (minute >= 48 && minute < 60) {
-               angle = 24;
-       }
-
-       return angle;
-}
-
-/**
- * @brief Get Y pivot of shadow hand
- * @param[in] Type of hands
- * @param[in] Style of hands
- */
-int data_get_hand_shadow_pivot(parts_type_e type, char *style)
-{
-       int pivot = 180;
-
-       switch (type) {
-       case PARTS_TYPE_HANDS_SEC_SHADOW:
-               if (!strcmp(style, "01"))
-                       pivot = HANDS_SEC_SHADOW_PIVOT_Y_01;
-               else if (!strcmp(style, "02"))
-                       pivot = HANDS_SEC_SHADOW_PIVOT_Y_02;
-               else if (!strcmp(style, "03"))
-                       pivot = HANDS_SEC_SHADOW_PIVOT_Y_03;
-               else if (!strcmp(style, "04"))
-                       pivot = HANDS_SEC_SHADOW_PIVOT_Y_04;
-               else if (!strcmp(style, "05"))
-                       pivot = HANDS_SEC_SHADOW_PIVOT_Y_05;
-               break;
-       case PARTS_TYPE_HANDS_MIN_SHADOW:
-               if (!strcmp(style, "01"))
-                       pivot = HANDS_MIN_SHADOW_PIVOT_Y_01;
-               else if (!strcmp(style, "02"))
-                       pivot = HANDS_MIN_SHADOW_PIVOT_Y_02;
-               else if (!strcmp(style, "03"))
-                       pivot = HANDS_MIN_SHADOW_PIVOT_Y_03;
-               else if (!strcmp(style, "04"))
-                       pivot = HANDS_MIN_SHADOW_PIVOT_Y_04;
-               else if (!strcmp(style, "05"))
-                       pivot = HANDS_MIN_SHADOW_PIVOT_Y_05;
-               break;
-       case PARTS_TYPE_HANDS_HOUR_SHADOW:
-               if (!strcmp(style, "01"))
-                       pivot = HANDS_HR_SHADOW_PIVOT_Y_01;
-               else if (!strcmp(style, "02"))
-                       pivot = HANDS_HR_SHADOW_PIVOT_Y_02;
-               else if (!strcmp(style, "03"))
-                       pivot = HANDS_HR_SHADOW_PIVOT_Y_03;
-               else if (!strcmp(style, "04"))
-                       pivot = HANDS_HR_SHADOW_PIVOT_Y_04;
-               else if (!strcmp(style, "05"))
-                       pivot = HANDS_HR_SHADOW_PIVOT_Y_05;
-               break;
-       default:
-               __E("type error : %d", type);
-               break;
-       }
-
-       return pivot;
-}
diff --git a/src/hybrid/CMakeLists.txt b/src/hybrid/CMakeLists.txt
new file mode 100644 (file)
index 0000000..016c783
--- /dev/null
@@ -0,0 +1,21 @@
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} HYBRID_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/configuration HYBRID_STEP_CONFIGURATION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/encryption HYBRID_STEP_ENCRYPTION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/pkgmgr HYBRID_STEP_PKGMGR_SRCS)
+ADD_LIBRARY(${TARGET_LIBNAME_HYBRID} STATIC
+  ${HYBRID_SRCS}
+  ${HYBRID_STEP_CONFIGURATION_SRCS}
+  ${HYBRID_STEP_ENCRYPTION_SRCS}
+  ${HYBRID_STEP_PKGMGR_SRCS})
+
+TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_HYBRID} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
+
+# Target - deps
+APPLY_PKG_CONFIG(${TARGET_LIBNAME_HYBRID} PUBLIC
+  TPK_INSTALLER_DEPS
+  Boost
+)
+
+# Target - in-package deps
+TARGET_LINK_LIBRARIES(${TARGET_LIBNAME_HYBRID} PRIVATE ${TARGET_LIBNAME_WGT})
+SET_TARGET_PROPERTIES(${TARGET_LIBNAME_HYBRID} PROPERTIES COMPILE_FLAGS "-fPIC")
diff --git a/src/hybrid/hybrid_backend_data.h b/src/hybrid/hybrid_backend_data.h
new file mode 100644 (file)
index 0000000..9cc98c9
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_HYBRID_BACKEND_DATA_H_
+#define HYBRID_HYBRID_BACKEND_DATA_H_
+
+#include <common/utils/property.h>
+#include <pkgmgrinfo_basic.h>
+#include <pkgmgr_parser.h>
+#include <wgt_manifest_handlers/setting_handler.h>
+
+#include <string>
+#include <vector>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace hybrid {
+
+class HybridBackendData : public wgt::WgtBackendData {
+ public:
+  HybridBackendData() : tpk_manifest_data(nullptr) { }
+  ~HybridBackendData() override {
+    if (tpk_manifest_data.get())
+      pkgmgr_parser_free_manifest_xml(tpk_manifest_data.get());
+  }
+
+  Property<manifest_x*> tpk_manifest_data;
+};
+
+}  // namespace hybrid
+
+#endif  // HYBRID_HYBRID_BACKEND_DATA_H_
+
diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc
new file mode 100644 (file)
index 0000000..95adccd
--- /dev/null
@@ -0,0 +1,777 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/hybrid_installer.h"
+
+#include <common/privileges.h>
+#include <common/step/backup/step_backup_icons.h>
+#include <common/step/backup/step_backup_manifest.h>
+#include <common/step/backup/step_copy_backup.h>
+#include <common/step/configuration/step_block_cross_update.h>
+#include <common/step/configuration/step_check_tizen_version.h>
+#include <common/step/configuration/step_configure.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_ownership_and_permission.h>
+#include <common/step/filesystem/step_copy.h>
+#include <common/step/filesystem/step_copy_storage_directories.h>
+#include <common/step/filesystem/step_copy_tep.h>
+#include <common/step/filesystem/step_create_icons.h>
+#include <common/step/filesystem/step_create_globalapp_symlinks.h>
+#include <common/step/filesystem/step_create_per_user_storage_directories.h>
+#include <common/step/filesystem/step_create_storage_directories.h>
+#include <common/step/filesystem/step_delta_patch.h>
+#include <common/step/filesystem/step_disable_external_mount.h>
+#include <common/step/filesystem/step_enable_external_mount.h>
+#include <common/step/filesystem/step_migrate_legacy_external_image.h>
+#include <common/step/filesystem/step_recover_change_owner.h>
+#include <common/step/filesystem/step_recover_files.h>
+#include <common/step/filesystem/step_recover_icons.h>
+#include <common/step/filesystem/step_recover_manifest.h>
+#include <common/step/filesystem/step_recover_external_storage.h>
+#include <common/step/filesystem/step_recover_per_user_storage_directories.h>
+#include <common/step/filesystem/step_recover_storage_directories.h>
+#include <common/step/filesystem/step_remove_files.h>
+#include <common/step/filesystem/step_remove_icons.h>
+#include <common/step/filesystem/step_remove_globalapp_symlinks.h>
+#include <common/step/filesystem/step_remove_per_user_storage_directories.h>
+#include <common/step/filesystem/step_remove_temporary_directory.h>
+#include <common/step/filesystem/step_remove_user_data.h>
+#include <common/step/filesystem/step_remove_zip_image.h>
+#include <common/step/filesystem/step_remove_tep.h>
+#include <common/step/filesystem/step_unzip.h>
+#include <common/step/filesystem/step_update_per_user_storage_directories.h>
+#include <common/step/filesystem/step_update_storage_directories.h>
+#include <common/step/filesystem/step_update_tep.h>
+#include <common/step/mount/step_mount_install.h>
+#include <common/step/mount/step_mount_unpacked.h>
+#include <common/step/mount/step_mount_recover.h>
+#include <common/step/mount/step_mount_update.h>
+#include <common/step/pkgmgr/step_check_force_clean.h>
+#include <common/step/pkgmgr/step_check_installable.h>
+#include <common/step/pkgmgr/step_check_removable.h>
+#include <common/step/pkgmgr/step_check_restriction.h>
+#include <common/step/pkgmgr/step_kill_apps.h>
+#include <common/step/pkgmgr/step_recover_application.h>
+#include <common/step/pkgmgr/step_register_app.h>
+#include <common/step/pkgmgr/step_remove_manifest.h>
+#include <common/step/pkgmgr/step_run_parser_plugins.h>
+#include <common/step/pkgmgr/step_unregister_app.h>
+#include <common/step/pkgmgr/step_update_app.h>
+#include <common/step/pkgmgr/step_update_pkg_disable_info.h>
+#include <common/step/recovery/step_open_recovery_file.h>
+#include <common/step/recovery/step_create_recovery_file.h>
+#include <common/step/security/step_check_signature.h>
+#include <common/step/security/step_get_privilege_level.h>
+#include <common/step/security/step_privacy_privilege.h>
+#include <common/step/security/step_privilege_compatibility.h>
+#include <common/step/security/step_recover_privilege_compatibility.h>
+#include <common/step/security/step_recover_security.h>
+#include <common/step/security/step_register_security.h>
+#include <common/step/security/step_revoke_security.h>
+#include <common/step/security/step_revoke_trust_anchor.h>
+#include <common/step/security/step_rollback_installation_security.h>
+#include <common/step/security/step_save_signature.h>
+#include <common/step/security/step_update_security.h>
+#include <common/step/security/step_register_trust_anchor.h>
+#include <common/step/security/step_unregister_trust_anchor.h>
+
+#include <tpk/step/filesystem/step_create_symbolic_link.h>
+#include <tpk/step/filesystem/step_tpk_patch_icons.h>
+#include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
+#include <tpk/step/filesystem/step_tpk_update_package_directory.h>
+#include <tpk/step/pkgmgr/step_manifest_adjustment.h>
+#include <tpk/step/security/step_tpk_recover_signature.h>
+
+#include "hybrid/hybrid_backend_data.h"
+#include "hybrid/shared_dirs.h"
+#include "hybrid/step/configuration/step_merge_tpk_config.h"
+#include "hybrid/step/configuration/step_merge_tpk_privileges.h"
+#include "hybrid/step/configuration/step_stash_tpk_config.h"
+#include "hybrid/step/encryption/step_encrypt_resources.h"
+#include "hybrid/step/pkgmgr/step_generate_xml.h"
+#include "wgt/step/configuration/step_parse.h"
+#include "wgt/step/configuration/step_set_old_signature_files_location.h"
+#include "wgt/step/encryption/step_remove_encryption_data.h"
+#include "wgt/step/filesystem/step_copy_preview_icons.h"
+#include "wgt/step/filesystem/step_create_symbolic_link.h"
+#include "wgt/step/filesystem/step_wgt_patch_icons.h"
+#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
+#include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
+#include "wgt/step/pkgmgr/step_generate_xml.h"
+#include "wgt/step/security/step_check_settings_level.h"
+#include "wgt/step/security/step_check_wgt_background_category.h"
+#include "wgt/step/security/step_check_wgt_notification_category.h"
+#include "wgt/step/security/step_check_wgt_ime_privilege.h"
+
+namespace ci = common_installer;
+
+namespace hybrid {
+
+HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
+    : AppInstaller("wgt", pkgmgr) {
+  Init();
+  context_->cross_app_rules.set(true);
+  context_->backend_data.set(new HybridBackendData());
+}
+
+void HybridInstaller::InstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(false);
+  AddStep<ci::filesystem::StepCopy>();
+  AddStep<ci::filesystem::StepCopyTep>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::HybridAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::UpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+  AddStep<ci::backup::StepCopyBackup>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCopyStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::UninstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::pkgmgr::StepCheckRemovable>();
+  AddStep<ci::pkgmgr::StepCheckForceClean>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+  AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+  AddStep<ci::pkgmgr::StepUnregisterApplication>();
+  AddStep<ci::filesystem::StepRemoveTep>();
+  AddStep<ci::filesystem::StepRemoveFiles>();
+  AddStep<ci::filesystem::StepRemoveZipImage>();
+  AddStep<ci::filesystem::StepRemoveIcons>();
+  AddStep<wgt::encryption::StepRemoveEncryptionData>();
+  AddStep<ci::security::StepUnregisterTrustAnchor>();
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
+  AddStep<ci::security::StepRevokeSecurity>();
+  AddStep<ci::pkgmgr::StepRemoveManifest>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ReinstallSteps() {
+  // RDS is not supported for hybrid apps
+  AddStep<ci::configuration::StepFail>();
+}
+
+void HybridInstaller::DeltaSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<wgt::filesystem::StepWgtUndoPatchStorageDirectories>();
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::filesystem::StepEnableExternalMount>();
+  AddStep<ci::filesystem::StepDeltaPatch>();
+  AddStep<ci::filesystem::StepDisableExternalMount>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+  AddStep<ci::backup::StepCopyBackup>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCopyStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::RecoverySteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::recovery::StepOpenRecoveryFile>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
+  AddStep<ci::filesystem::StepRecoverIcons>();
+  AddStep<ci::filesystem::StepRecoverManifest>();
+  AddStep<ci::filesystem::StepRecoverExternalStorage>();
+  AddStep<ci::filesystem::StepRecoverPerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepRecoverStorageDirectories>();
+  AddStep<ci::filesystem::StepRecoverFiles>();
+  AddStep<ci::mount::StepMountRecover>();
+  AddStep<tpk::security::StepTpkRecoverSignature>();
+  AddStep<ci::security::StepRecoverPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<ci::filesystem::StepRecoverChangeOwner>();
+  AddStep<ci::security::StepRecoverSecurity>();
+  AddStep<ci::pkgmgr::StepRecoverApplication>();
+}
+
+void HybridInstaller::MountInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::mount::StepMountUnpacked>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::mount::StepMountInstall>();
+  AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
+  AddStep<ci::filesystem::StepCopyTep>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::HybridAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::MountUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::mount::StepMountUnpacked>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::mount::StepMountUpdate>();
+  AddStep<tpk::filesystem::StepTpkUpdatePackageDirectory>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ManifestDirectInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::OVERWRITE);
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::HybridAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ManifestDirectUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::OVERWRITE);
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ManifestPartialInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::OVERWRITE);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::HybridAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ManifestPartialUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::OVERWRITE);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::PartialUninstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::pkgmgr::StepCheckRemovable>();
+  AddStep<ci::pkgmgr::StepCheckForceClean>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+  AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+  AddStep<ci::pkgmgr::StepUnregisterApplication>();
+  AddStep<wgt::encryption::StepRemoveEncryptionData>();
+  AddStep<ci::security::StepUnregisterTrustAnchor>();
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
+  AddStep<ci::security::StepRevokeSecurity>();
+}
+
+void HybridInstaller::ReadonlyUpdateInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<hybrid::encryption::StepEncryptResources>();
+  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<tpk::filesystem::StepTpkPatchIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateStorageDirectories>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<hybrid::pkgmgr::StepGenerateXml>();
+  AddStep<tpk::pkgmgr::StepManifestAdjustment>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::CONCAT);
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void HybridInstaller::ReadonlyUpdateUninstallSteps() {
+  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<ci::configuration::StepParsePreload>();
+  AddStep<wgt::configuration::StepSetOldSignatureFilesLocation>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  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::filesystem::StepRemoveUserData>();
+  AddStep<ci::configuration::StepSwitchReadonlyMode>();
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRemoveManifest>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+}
+
+void HybridInstaller::EnablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+      ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+}
+
+void HybridInstaller::DisablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+      ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+}
+
+void HybridInstaller::MigrateExtImgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::security::StepMigrateLegacyExtImage>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+}
+
+void HybridInstaller::RecoverDBSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<hybrid::configuration::StepStashTpkConfig>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
+  AddStep<ci::security::StepGetPrivilegeLevel>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<hybrid::configuration::StepMergeTpkConfig>(
+      hybrid::configuration::StepMergeTpkConfig::MergeType::OVERWRITE);
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+}
+
+}  // namespace hybrid
+
diff --git a/src/hybrid/hybrid_installer.h b/src/hybrid/hybrid_installer.h
new file mode 100644 (file)
index 0000000..b76cc10
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_HYBRID_INSTALLER_H_
+#define HYBRID_HYBRID_INSTALLER_H_
+
+#include "common/app_installer.h"
+#include "common/pkgmgr_interface.h"
+
+namespace ci = common_installer;
+
+namespace hybrid {
+
+/**
+ * @brief The TpkInstaller class
+ *        Handles request of installation of native part of hybrid package.
+ *
+ * Pkgmgr request is parsed within and sequence of steps is built to be run.
+ *
+ * This backend is called by wgt-backend if it encounters hybrid package to
+ * install native part of that package.
+ */
+class HybridInstaller : public common_installer::AppInstaller {
+ public:
+  explicit HybridInstaller(common_installer::PkgMgrPtr pkgmgr);
+
+  SCOPE_LOG_TAG(HybridInstaller)
+
+ private:
+  void InstallSteps() override;
+  void UpdateSteps() override;
+  void UninstallSteps() override;
+  void ReinstallSteps() override;
+  void DeltaSteps() override;
+  void RecoverySteps() override;
+  void MountInstallSteps() override;
+  void MountUpdateSteps() override;
+  void ManifestDirectInstallSteps() override;
+  void ManifestDirectUpdateSteps() override;
+  void DisablePkgSteps() override;
+  void EnablePkgSteps() override;
+  void ManifestPartialInstallSteps() override;
+  void ManifestPartialUpdateSteps() override;
+  void PartialUninstallSteps() override;
+  void ReadonlyUpdateInstallSteps() override;
+  void ReadonlyUpdateUninstallSteps() override;
+  void MigrateExtImgSteps() override;
+  void RecoverDBSteps() override;
+};
+
+}  // namespace hybrid
+
+#endif  // HYBRID_HYBRID_INSTALLER_H_
diff --git a/src/hybrid/shared_dirs.h b/src/hybrid/shared_dirs.h
new file mode 100644 (file)
index 0000000..a6a4683
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_SHARED_DIRS_H_
+#define HYBRID_SHARED_DIRS_H_
+
+#include <vector>
+
+namespace wgt {
+namespace filesystem {
+
+const std::vector<const char*> HybridAdditionalSharedDirs = {
+  {"tmp"},
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // HYBRID_SHARED_DIRS_H_
diff --git a/src/hybrid/step/configuration/step_merge_tpk_config.cc b/src/hybrid/step/configuration/step_merge_tpk_config.cc
new file mode 100644 (file)
index 0000000..d63d003
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/step/configuration/step_merge_tpk_config.h"
+
+#include <pkgmgrinfo_basic.h>
+
+#include "hybrid/hybrid_backend_data.h"
+
+namespace hybrid {
+namespace configuration {
+
+StepMergeTpkConfig::StepMergeTpkConfig(
+    common_installer::InstallerContext* context,
+    MergeType type) : Step(context), merge_type_(type) {
+}
+
+common_installer::Step::Status StepMergeTpkConfig::process() {
+  HybridBackendData* data =
+      static_cast<HybridBackendData*>(context_->backend_data.get());
+  manifest_x* tpk_data = data->tpk_manifest_data.get();
+  manifest_x* wgt_data = context_->manifest_data.get();
+
+  if (merge_type_ == MergeType::CONCAT)
+    wgt_data->application =
+        g_list_concat(wgt_data->application, tpk_data->application);
+  else
+    wgt_data->application = tpk_data->application;
+
+  tpk_data->application = nullptr;
+  return Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace hybrid
diff --git a/src/hybrid/step/configuration/step_merge_tpk_config.h b/src/hybrid/step/configuration/step_merge_tpk_config.h
new file mode 100644 (file)
index 0000000..6491d34
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_
+#define HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace hybrid {
+namespace configuration {
+
+/**
+ * \brief MergeTpkConfig
+ *        Merges information from tpk manifest into information from widget
+ *        configuration for hybrid package.
+ */
+class StepMergeTpkConfig : public common_installer::Step {
+ public:
+  enum class MergeType {
+    CONCAT,      // Concatenate configurations
+    OVERWRITE    // Overwrite one with others
+  };
+
+  explicit StepMergeTpkConfig(common_installer::InstallerContext* context,
+      MergeType type);
+
+  using Step::Step;
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+ private:
+  MergeType merge_type_;
+
+  STEP_NAME(MergeTpkConfig)
+};
+
+}  // namespace configuration
+}  // namespace hybrid
+
+#endif  // HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_CONFIG_H_
diff --git a/src/hybrid/step/configuration/step_merge_tpk_privileges.cc b/src/hybrid/step/configuration/step_merge_tpk_privileges.cc
new file mode 100644 (file)
index 0000000..631189e
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/step/configuration/step_merge_tpk_privileges.h"
+
+#include <pkgmgrinfo_basic.h>
+
+#include "hybrid/hybrid_backend_data.h"
+
+namespace hybrid {
+namespace configuration {
+
+common_installer::Step::Status StepMergeTpkPrivileges::process() {
+  HybridBackendData* data =
+      static_cast<HybridBackendData*>(context_->backend_data.get());
+  manifest_x* tpk_data = data->tpk_manifest_data.get();
+  manifest_x* wgt_data = context_->manifest_data.get();
+
+  wgt_data->privileges =
+      g_list_concat(wgt_data->privileges, tpk_data->privileges);
+  tpk_data->privileges = nullptr;
+
+  wgt_data->appdefined_privileges =
+      g_list_concat(wgt_data->appdefined_privileges,
+                    tpk_data->appdefined_privileges);
+  tpk_data->appdefined_privileges = nullptr;
+
+  wgt_data->provides_appdefined_privileges =
+      g_list_concat(wgt_data->provides_appdefined_privileges,
+                    tpk_data->provides_appdefined_privileges);
+  tpk_data->provides_appdefined_privileges = nullptr;
+
+  return Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace hybrid
diff --git a/src/hybrid/step/configuration/step_merge_tpk_privileges.h b/src/hybrid/step/configuration/step_merge_tpk_privileges.h
new file mode 100644 (file)
index 0000000..98651fc
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_PRIVILEGES_H_
+#define HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_PRIVILEGES_H_
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace hybrid {
+namespace configuration {
+
+class StepMergeTpkPrivileges : 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(MergeTpkPrivileges)
+};
+
+}  // namespace configuration
+}  // namespace hybrid
+
+#endif  // HYBRID_STEP_CONFIGURATION_STEP_MERGE_TPK_PRIVILEGES_H_
diff --git a/src/hybrid/step/configuration/step_stash_tpk_config.cc b/src/hybrid/step/configuration/step_stash_tpk_config.cc
new file mode 100644 (file)
index 0000000..2ec91e7
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/step/configuration/step_stash_tpk_config.h"
+
+#include "hybrid/hybrid_backend_data.h"
+
+namespace hybrid {
+namespace configuration {
+
+common_installer::Step::Status StepStashTpkConfig::process() {
+  HybridBackendData* data =
+      static_cast<HybridBackendData*>(context_->backend_data.get());
+  data->tpk_manifest_data.set(context_->manifest_data.get());
+  context_->manifest_data.set(nullptr);
+
+  return Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace hybrid
diff --git a/src/hybrid/step/configuration/step_stash_tpk_config.h b/src/hybrid/step/configuration/step_stash_tpk_config.h
new file mode 100644 (file)
index 0000000..2ac4716
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_
+#define HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace hybrid {
+namespace configuration {
+
+/**
+ * \brief StepCheckHybrid
+ *        Backups information about parsing tpk manifest file in backend_data
+ *        structure.
+ */
+class StepStashTpkConfig : 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(StashTpkConfig)
+};
+
+}  // namespace configuration
+}  // namespace hybrid
+
+#endif  // HYBRID_STEP_CONFIGURATION_STEP_STASH_TPK_CONFIG_H_
diff --git a/src/hybrid/step/encryption/step_encrypt_resources.cc b/src/hybrid/step/encryption/step_encrypt_resources.cc
new file mode 100644 (file)
index 0000000..2265a35
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/step/encryption/step_encrypt_resources.h"
+
+namespace hybrid {
+namespace encryption {
+
+void StepEncryptResources::SetEncryptionRoot() {
+  input_ = context_->unpacked_dir_path.get() / "res/wgt";
+}
+
+}  // namespace encryption
+}  // namespace hybrid
+
diff --git a/src/hybrid/step/encryption/step_encrypt_resources.h b/src/hybrid/step/encryption/step_encrypt_resources.h
new file mode 100644 (file)
index 0000000..88b0f5b
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
+#define HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "wgt/step/encryption/step_encrypt_resources.h"
+
+namespace hybrid {
+namespace encryption {
+
+/**
+ * \brief Step that encrypt application resources files if flagged to do so
+ *
+ * This is variant for hybrid package
+ */
+class StepEncryptResources : public wgt::encryption::StepEncryptResources {
+ public:
+  using wgt::encryption::StepEncryptResources::StepEncryptResources;
+
+ private:
+  void SetEncryptionRoot() override;
+
+  STEP_NAME(EncryptResources)
+};
+
+}  // namespace encryption
+}  // namespace hybrid
+
+#endif  // HYBRID_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
diff --git a/src/hybrid/step/pkgmgr/step_generate_xml.cc b/src/hybrid/step/pkgmgr/step_generate_xml.cc
new file mode 100644 (file)
index 0000000..10246e9
--- /dev/null
@@ -0,0 +1,192 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "hybrid/step/pkgmgr/step_generate_xml.h"
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <pkgmgr_parser.h>
+
+#include <common/utils/file_util.h>
+#include <common/utils/glist_range.h>
+
+#include <utility>
+#include <string>
+#include <vector>
+
+#include "hybrid/hybrid_backend_data.h"
+
+namespace ci = common_installer;
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+namespace {
+
+const std::vector<std::string> kBlackListNodes = {
+  {"author"},
+  {"description"},
+  {"profile"},
+  {"privileges"},
+  {"provides-appdefined-privileges"},
+  {"trust-anchor"},
+};
+const std::vector<std::string> kNeedMergeNodes = {
+  {"manifest"},
+};
+const std::vector<std::pair<std::string, std::string>> kApplicationNodeNames = {
+  {"ui-application", "uiapp"},
+  {"service-application", "svcapp"},
+  {"widget-application", "widgetapp"},
+  {"watch-application", "watchapp"},
+};
+
+}  // namespace
+
+namespace hybrid {
+namespace pkgmgr {
+
+bool StepGenerateXml::LoadXmlDocument(const bf::path& wgt_xml_path,
+    const bf::path& tpk_xml_path) {
+  // trim blanks
+  int keep_blanks = xmlKeepBlanksDefault(0);
+  wgt_doc_ = xmlParseFile(wgt_xml_path.string().c_str());
+  if (!wgt_doc_) {
+    LOG(ERROR) << "Failed to parse file: " << wgt_xml_path;
+    xmlKeepBlanksDefault(keep_blanks);
+    return false;
+  }
+  tpk_doc_ = xmlParseFile(tpk_xml_path.string().c_str());
+  if (!tpk_doc_) {
+    LOG(ERROR) << "Failed to parse file: " << tpk_xml_path;
+    xmlKeepBlanksDefault(keep_blanks);
+    return false;
+  }
+  xmlKeepBlanksDefault(keep_blanks);
+  return true;
+}
+
+xmlNodePtr StepGenerateXml::GetXmlNode(const xmlDocPtr doc,
+    const std::string& name, const std::string& attr,
+    const std::string& attr_val) {
+  xmlXPathContextPtr ctxt = xmlXPathNewContext(doc);
+  if (!ctxt) {
+    LOG(ERROR) << "Failed to create XPath context";
+    return nullptr;
+  }
+
+  std::string expr = "//*[local-name()='" + name + "']";
+  if (!attr.empty() && !attr_val.empty())
+    expr.append("[@" + attr + "='" + attr_val + "']");
+
+  xmlXPathObjectPtr obj =
+      xmlXPathEvalExpression((const xmlChar*)expr.c_str(), ctxt);
+  if (!obj || !obj->nodesetval || !obj->nodesetval->nodeNr) {
+    xmlXPathFreeContext(ctxt);
+    return nullptr;
+  }
+
+  xmlNodePtr node = obj->nodesetval->nodeTab[0];
+  xmlXPathFreeObject(obj);
+  xmlXPathFreeContext(ctxt);
+
+  return node;
+}
+
+void StepGenerateXml::MergeXmlNode(xmlNodePtr node1, xmlNodePtr node2) {
+  xmlNodePtr last = xmlGetLastChild(node1);
+  xmlNodePtr next;
+  // merge node2's child into node1
+  for (xmlNodePtr cur = node2->children; cur; cur = next) {
+    next = cur->next;
+    if (std::find(kBlackListNodes.begin(), kBlackListNodes.end(),
+        reinterpret_cast<const char*>(cur->name)) != kBlackListNodes.end())
+      continue;
+    // to avoid duplicate
+    if (std::find(kNeedMergeNodes.begin(), kNeedMergeNodes.end(),
+        reinterpret_cast<const char*>(cur->name)) != kNeedMergeNodes.end())
+      continue;
+    if (xmlAddNextSibling(last, cur) != nullptr)
+      last = last->next;
+  }
+}
+
+void StepGenerateXml::SetXmlNodeAttribute(xmlNodePtr node,
+    const std::string& attr, const std::string& attr_val) {
+  xmlSetProp(node, reinterpret_cast<const xmlChar*>(attr.c_str()),
+      reinterpret_cast<const xmlChar*>(attr_val.c_str()));
+}
+
+ci::Step::Status StepGenerateXml::process() {
+  bf::path wgt_xml_path = context_->xml_path.get();
+  bf::path tpk_xml_path = context_->GetPkgPath() / "tizen-manifest.xml";
+
+  if (!LoadXmlDocument(wgt_xml_path, tpk_xml_path))
+    return Step::Status::MANIFEST_ERROR;
+
+  for (auto& entry : kNeedMergeNodes) {
+    xmlNodePtr tpk_node = GetXmlNode(tpk_doc_, entry);
+    if (tpk_node == nullptr)
+      continue;
+    // TODO(s89.jang): If cannot find node from wgt doc, merge tpk node itself
+    // instead of merging its child nodes.
+    xmlNodePtr wgt_node = GetXmlNode(wgt_doc_, entry);
+    MergeXmlNode(wgt_node, tpk_node);
+  }
+
+  // set app's executable path
+  HybridBackendData* data =
+      static_cast<HybridBackendData*>(context_->backend_data.get());
+  manifest_x* tpk_data = data->tpk_manifest_data.get();
+  for (application_x* app :
+      GListRange<application_x*>(tpk_data->application)) {
+    auto r = std::find_if(kApplicationNodeNames.begin(),
+        kApplicationNodeNames.end(),
+        [app](const std::pair<std::string, std::string>& e) {
+          return strcmp(e.second.c_str(), app->component_type) == 0;
+        });
+    if (r == kApplicationNodeNames.end()) {
+      LOG(WARNING) << "Cannot find component type!";
+      continue;
+    }
+    xmlNodePtr node = GetXmlNode(wgt_doc_, (*r).first, "appid", app->appid);
+    SetXmlNodeAttribute(node, "exec", app->exec);
+  }
+
+  if (xmlSaveFormatFile(wgt_xml_path.string().c_str(), wgt_doc_, 1) == -1) {
+    LOG(ERROR) << "Cannot write xml file";
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  if (pkgmgr_parser_check_manifest_validation(
+      wgt_xml_path.string().c_str()) != 0) {
+    LOG(ERROR) << "Merged manifest is not valid";
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  return Status::OK;
+}
+
+ci::Step::Status StepGenerateXml::precheck() {
+  bf::path wgt_xml_path = context_->xml_path.get();
+  if (!bf::exists(wgt_xml_path)) {
+    LOG(ERROR) << "Converted config file not found: " << wgt_xml_path;
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  bf::path tpk_xml_path = context_->GetPkgPath() / "tizen-manifest.xml";
+  if (!bf::exists(tpk_xml_path)) {
+    LOG(ERROR) << "Native manifest file not found: " << tpk_xml_path;
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  return Status::OK;
+}
+
+}  // namespace pkgmgr
+}  // namespace hybrid
diff --git a/src/hybrid/step/pkgmgr/step_generate_xml.h b/src/hybrid/step/pkgmgr/step_generate_xml.h
new file mode 100644 (file)
index 0000000..8fce64d
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
+#define HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
+
+#include <boost/filesystem.hpp>
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+#include <libxml/tree.h>
+
+#include <string>
+
+namespace hybrid {
+namespace pkgmgr {
+
+class StepGenerateXml : public common_installer::Step {
+ public:
+  using Step::Step;
+  explicit StepGenerateXml(common_installer::InstallerContext* context)
+      : Step(context), wgt_doc_(nullptr), tpk_doc_(nullptr) {}
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override;
+
+ private:
+  bool LoadXmlDocument(const boost::filesystem::path& wgt_xml_path,
+      const boost::filesystem::path& tpk_xml_path);
+  xmlNodePtr GetXmlNode(const xmlDocPtr doc, const std::string& name,
+      const std::string& attr = {}, const std::string& attr_val = {});
+  void MergeXmlNode(xmlNodePtr node1, xmlNodePtr node2);
+  void SetXmlNodeAttribute(xmlNodePtr node, const std::string& attr,
+      const std::string& attr_val);
+
+  xmlDocPtr wgt_doc_;
+  xmlDocPtr tpk_doc_;
+
+  STEP_NAME(GenerateXml2);
+};
+
+}  // namespace pkgmgr
+}  // namespace hybrid
+
+#endif  // HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a14aaae
--- /dev/null
@@ -0,0 +1,15 @@
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} LIB_SRCS)
+ADD_LIBRARY(${TARGET_LIBNAME_WGT_ARCHIVE_INFO} SHARED ${LIB_SRCS})
+
+TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_WGT_ARCHIVE_INFO} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
+
+APPLY_PKG_CONFIG(${TARGET_LIBNAME_WGT_ARCHIVE_INFO} PUBLIC
+  APP_INSTALLERS_DEPS
+  PKGMGR_TYPES_DEPS
+  MANIFEST_PARSER_DEPS
+  WGT_MANIFEST_HANDLERS_DEPS
+  VCONF_DEPS
+  Boost
+)
+
+INSTALL(TARGETS ${TARGET_LIBNAME_WGT_ARCHIVE_INFO} DESTINATION ${SYSCONF_INSTALL_DIR}/package-manager/backendlib)
diff --git a/src/lib/wgt_archive_info.cc b/src/lib/wgt_archive_info.cc
new file mode 100644 (file)
index 0000000..095b60d
--- /dev/null
@@ -0,0 +1,245 @@
+// 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 "lib/wgt_archive_info.h"
+
+#include <package-manager-plugin.h>
+#include <pkgmgr-info.h>
+#include <vconf.h>
+
+#include <wgt_manifest_handlers/widget_config_parser.h>
+#include <wgt_manifest_handlers/application_icons_handler.h>
+#include <wgt_manifest_handlers/application_manifest_constants.h>
+#include <wgt_manifest_handlers/permissions_handler.h>
+#include <wgt_manifest_handlers/tizen_application_handler.h>
+#include <wgt_manifest_handlers/widget_handler.h>
+
+#include <common/utils/file_util.h>
+
+#include <cstdio>
+#include <cstdlib>
+#include <fstream>
+#include <string>
+#include <vector>
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+const char kVconfLanguageKey[] = VCONFKEY_LANGSET;
+const char kConfigFileName[] = "config.xml";
+const char kHybridConfigFileName[] = "res/wgt/config.xml";
+
+bool ExtractPackageArchive(const char* file_path, const char* file,
+    const bf::path& tmp_dir) {
+  if (!ci::ExtractToTmpDir(file_path, tmp_dir, file)) {
+    LOG(ERROR) << "Failed to extract";
+    return false;
+  }
+  return true;
+}
+
+bool GetPackageInfo(const wgt::parse::WidgetConfigParser& parser,
+    package_manager_pkg_detail_info_t* info) {
+  auto widget_info =
+      std::static_pointer_cast<const wgt::parse::WidgetInfo>(
+          parser.GetManifestData(wgt::parse::WidgetInfo::Key()));
+  auto app_info =
+      std::static_pointer_cast<const wgt::parse::TizenApplicationInfo>(
+          parser.GetManifestData(wgt::parse::TizenApplicationInfo::Key()));
+  if (!widget_info || !app_info) {
+    LOG(ERROR) << "WidgetInfo / TizenApplicationInfo not found";
+    return false;
+  }
+
+  snprintf(info->pkg_type, sizeof(info->pkg_type), "wgt");
+  snprintf(info->version, sizeof(info->version), "%s",
+      widget_info->version().c_str());
+  snprintf(info->author, sizeof(info->version), "%s",
+      widget_info->author().c_str());
+
+  snprintf(info->pkg_name, sizeof(info->pkg_name), "%s",
+      app_info->package().c_str());
+  snprintf(info->pkgid, sizeof(info->pkgid), "%s", app_info->package().c_str());
+  snprintf(info->api_version, sizeof(info->api_version), "%s",
+      app_info->required_version().c_str());
+
+  return true;
+}
+
+bool GetPrivilegesInfo(const wgt::parse::WidgetConfigParser& parser,
+    package_manager_pkg_detail_info_t* info) {
+  auto privileges_info =
+      std::static_pointer_cast<const wgt::parse::PermissionsInfo>(
+          parser.GetManifestData(wgt::parse::PermissionsInfo::Key()));
+  if (!privileges_info)
+    return false;
+
+  const auto& privileges = privileges_info->GetAPIPermissions();
+  for (auto& priv : privileges) {
+    info->privilege_list = g_list_append(info->privilege_list,
+        strdup(priv.c_str()));
+  }
+
+  return true;
+}
+
+bool GetLabelInfo(const wgt::parse::WidgetConfigParser& parser,
+    const char* locale, package_manager_pkg_detail_info_t* info) {
+  auto widget_info =
+      std::static_pointer_cast<const wgt::parse::WidgetInfo>(
+          parser.GetManifestData(wgt::parse::WidgetInfo::Key()));
+  if (!widget_info)
+    return false;
+
+  std::string name;
+  const auto& labels = widget_info->name_set();
+  if (labels.find(locale) != labels.end()) {
+    name = labels.find(locale)->second;
+    snprintf(info->label, sizeof(info->label), "%s", name.c_str());
+    return true;
+  } else if (labels.find("") != labels.end()) {
+    name = labels.find("")->second;
+    snprintf(info->label, sizeof(info->label), "%s", name.c_str());
+    return true;
+  }
+
+  return false;
+}
+
+bool GetDescriptionInfo(const wgt::parse::WidgetConfigParser& parser,
+    const char* locale, package_manager_pkg_detail_info_t* info) {
+  auto widget_info =
+      std::static_pointer_cast<const wgt::parse::WidgetInfo>(
+          parser.GetManifestData(wgt::parse::WidgetInfo::Key()));
+  if (!widget_info)
+    return false;
+
+  std::string desc;
+  const auto& descriptions = widget_info->description_set();
+  if (descriptions.find(locale) != descriptions.end()) {
+    desc = descriptions.find(locale)->second;
+    snprintf(info->pkg_description, sizeof(info->pkg_description), "%s",
+        desc.c_str());
+    return true;
+  } else if (descriptions.find("") != descriptions.end()) {
+    desc = descriptions.find("")->second;
+    snprintf(info->pkg_description, sizeof(info->pkg_description), "%s",
+        desc.c_str());
+    return true;
+  }
+
+  return false;
+}
+
+bool ReadIcon(const bf::path& icon, const bf::path& tmp_dir,
+    package_manager_pkg_detail_info_t* info) {
+  bf::path icon_path = tmp_dir / icon;
+
+  LOG(INFO) << "Icon file path: " << icon_path;
+
+  if (!bf::exists(icon_path)) {
+    LOG(WARNING) << "Icon file doesn't actually exist, skip reading icon";
+    return true;
+  }
+
+  std::ifstream ifs(icon_path.c_str(),
+      std::ifstream::in | std::ifstream::binary);
+  ifs.seekg(0, ifs.end);
+  int len = ifs.tellg();
+  ifs.seekg(0, ifs.beg);
+
+  if (len <= 0)
+    return false;
+
+  char* buf = static_cast<char*>(malloc(sizeof(char) * len));
+
+  LOG(INFO) << "Reading icon file, " << len << " bytes";
+  ifs.read(buf, len);
+
+  info->icon_buf = buf;
+  info->icon_size = len;
+
+  return true;
+}
+
+std::string GetIconInfo(const wgt::parse::WidgetConfigParser& parser) {
+  auto icons_info =
+      std::static_pointer_cast<const wgt::parse::ApplicationIconsInfo>(
+          parser.GetManifestData(wgt::parse::ApplicationIconsInfo::Key()));
+  if (!icons_info || icons_info->icons().empty())
+    return {};
+
+  return std::string(icons_info->icons().front().path());
+}
+
+}  // namespace
+
+bool WgtArchiveInfo::GetArchiveInfo(const char* file_path,
+    package_manager_pkg_detail_info_t* info) {
+  bf::path tmp_dir = ci::GenerateTmpDir("/tmp");
+  if (!ci::CreateDir(tmp_dir))
+    return false;
+  LOG(DEBUG) << "Unpack at temporary dir: " << tmp_dir;
+  bool is_hybrid = false;
+  if (!ExtractPackageArchive(file_path, kHybridConfigFileName, tmp_dir))
+    return false;
+  if (bf::exists(tmp_dir / kHybridConfigFileName)) {
+    is_hybrid = true;
+  } else {
+    if (!ExtractPackageArchive(file_path, kConfigFileName, tmp_dir))
+      return false;
+  }
+
+  wgt::parse::WidgetConfigParser parser;
+  bf::path manifest_path;
+  if (is_hybrid)
+    manifest_path = tmp_dir / kHybridConfigFileName;
+  else
+    manifest_path = tmp_dir / kConfigFileName;
+  if (!parser.ParseManifest(manifest_path)) {
+    LOG(ERROR) << "Failed to parse";
+    bf::remove_all(tmp_dir);
+    return false;
+  }
+
+  if (!GetPackageInfo(parser, info)) {
+    LOG(ERROR) << "Failed to get package info";
+    bf::remove_all(tmp_dir);
+    return false;
+  }
+  if (!GetPrivilegesInfo(parser, info))
+    LOG(WARNING) << "Failed to get privileges info";
+  std::string icon = GetIconInfo(parser);
+  if (!icon.empty()) {
+    std::string icon_path;
+    if (is_hybrid)
+      icon_path = "res/wgt/" + icon;
+    else
+      icon_path = icon;
+    if (!ExtractPackageArchive(file_path, icon_path.c_str(), tmp_dir)) {
+      bf::remove_all(tmp_dir);
+      return false;
+    }
+    if (!ReadIcon(icon_path, tmp_dir, info)) {
+      LOG(WARNING) << "Failed to get icon info";
+      bf::remove_all(tmp_dir);
+      return false;
+    }
+  }
+
+  char* locale = vconf_get_str(kVconfLanguageKey);
+  if (!locale)
+    locale = strdup("");
+  if (!GetLabelInfo(parser, locale, info))
+    LOG(WARNING) << "Failed to get label info";
+  if (!GetDescriptionInfo(parser, locale, info))
+    LOG(WARNING) << "Failed to get description info";
+
+  free(locale);
+  bf::remove_all(tmp_dir);
+
+  return true;
+}
diff --git a/src/lib/wgt_archive_info.h b/src/lib/wgt_archive_info.h
new file mode 100644 (file)
index 0000000..e2bf8d1
--- /dev/null
@@ -0,0 +1,23 @@
+// 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 LIB_WGT_ARCHIVE_INFO_H_
+#define LIB_WGT_ARCHIVE_INFO_H_
+
+#include <package-manager-plugin.h>
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/utils/singleton.h>
+
+class WgtArchiveInfo : public common_installer::Singleton<WgtArchiveInfo> {
+  CRTP_DECLARE_DEFAULT_CONSTRUCTOR_CLASS(WgtArchiveInfo)
+ public:
+  bool GetArchiveInfo(const char* file_path,
+    package_manager_pkg_detail_info_t* info);
+
+  SCOPE_LOG_TAG(WgtArchiveInfo)
+};
+
+#endif  // LIB_WGT_ARCHIVE_INFO_H_
diff --git a/src/lib/wgt_pkgmgr.cc b/src/lib/wgt_pkgmgr.cc
new file mode 100644 (file)
index 0000000..129c185
--- /dev/null
@@ -0,0 +1,34 @@
+// 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 <package-manager-plugin.h>
+
+#include "lib/wgt_archive_info.h"
+
+#define EXPORT_API __attribute__((visibility("default")))
+
+namespace {
+
+int GetPackageArchiveInfo(const char* path,
+    package_manager_pkg_detail_info_t* info) {
+  if (!WgtArchiveInfo::Instance().GetArchiveInfo(path, info))
+    return -1;
+  return 0;
+}
+
+void PluginOnUnload() {
+}
+
+}  // namespace
+
+extern "C" EXPORT_API int pkg_plugin_on_load(pkg_plugin_set* set) {
+  if (set == nullptr)
+    return -1;
+  set->plugin_on_unload = PluginOnUnload;
+  set->pkg_is_installed = nullptr;
+  set->get_installed_pkg_list = nullptr;
+  set->get_pkg_detail_info = nullptr;
+  set->get_pkg_detail_info_from_package = GetPackageArchiveInfo;
+  return 0;
+}
diff --git a/src/main.c b/src/main.c
deleted file mode 100644 (file)
index 8cb4633..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "comp-manager.h"
-#include "analog-watch.h"
-#include "app-log.h"
-#include "view.h"
-
-static bool
-app_create(int width, int height, void* user_data)
-{
-       /* Hook to take necessary actions before main event loop starts
-               Initialize UI resources and application's data
-               If this function returns true, the main loop of application starts
-               If this function returns false, the application is terminated */
-       __I("%s", __func__);
-       view_init();
-       comp_init();
-       return true;
-}
-
-static void
-app_control(app_control_h app_control, void *data)
-{
-       /* Handle the launch request. */
-       __I("%s", __func__);
-}
-
-static void
-app_pause(void *data)
-{
-       /* Take necessary actions when application becomes invisible. */
-       __I("%s", __func__);
-}
-
-static void
-app_resume(void *data)
-{
-       /* Take necessary actions when application becomes visible. */
-       __I("%s", __func__);
-}
-
-static void
-app_terminate(void *data)
-{
-       /* Release all resources. */
-       comp_destroy();
-       view_destroy();
-}
-
-static void
-app_lang_changed(app_event_info_h event_info, void *user_data)
-{
-       /*APP_EVENT_LANGUAGE_CHANGED*/
-       char *locale = NULL;
-       system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-       elm_language_set(locale);
-       free(locale);
-       return;
-}
-
-static void
-app_orient_changed(app_event_info_h event_info, void *user_data)
-{
-       /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
-       return;
-}
-
-static void
-app_region_changed(app_event_info_h event_info, void *user_data)
-{
-       /*APP_EVENT_REGION_FORMAT_CHANGED*/
-}
-
-static void
-low_battery(app_event_info_h event_info, void *user_data)
-{
-       /*APP_EVENT_LOW_BATTERY*/
-}
-
-static void
-low_memory(app_event_info_h event_info, void *user_data)
-{
-       /*APP_EVENT_LOW_MEMORY*/
-       watch_app_exit();
-}
-
-void app_time_tick(watch_time_h watch_time, void* user_data)
-{
-       int hour = 0;
-       int min = 0;
-       int sec = 0;
-       int month = 0;
-       int day = 0;
-
-       watch_time_get_hour(watch_time, &hour);
-       watch_time_get_minute(watch_time, &min);
-       watch_time_get_second(watch_time, &sec);
-       watch_time_get_day(watch_time, &day);
-       watch_time_get_month(watch_time, &month);
-
-       view_set_time(hour, min, sec);
-}
-
-int
-main(int argc, char *argv[])
-{
-       int ret = 0;
-
-       watch_app_lifecycle_callback_s event_callback = { 0, };
-       app_event_handler_h handlers[5] = {NULL, };
-
-       event_callback.create = app_create;
-       event_callback.terminate = app_terminate;
-       event_callback.pause = app_pause;
-       event_callback.resume = app_resume;
-       event_callback.app_control = app_control;
-       event_callback.time_tick = app_time_tick;
-
-       watch_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, low_battery, NULL);
-       watch_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, low_memory, NULL);
-       watch_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, app_orient_changed, NULL);
-       watch_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, app_lang_changed, NULL);
-       watch_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, app_region_changed, NULL);
-
-       ret = watch_app_main(argc, argv, &event_callback, NULL);
-       if (ret != APP_ERROR_NONE) {
-               __E("app_main() is failed. err = %d", ret);
-       }
-
-       return ret;
-}
diff --git a/src/unit_tests/CMakeLists.txt b/src/unit_tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5e98bc3
--- /dev/null
@@ -0,0 +1,57 @@
+SET(DESTINATION_DIR wgt-backend-ut)
+SET(TARGET_SMOKE_UTILS smoke-utils)
+
+# Executables
+ADD_EXECUTABLE(${TARGET_SMOKE_TEST}
+  smoke_test.cc
+  smoke_utils.h
+  smoke_utils.cc
+)
+ADD_EXECUTABLE(${TARGET_SMOKE_TEST_EXTENSIVE}
+  extensive_smoke_test.cc
+  smoke_utils.h
+  smoke_utils.cc
+)
+ADD_EXECUTABLE(${TARGET_SMOKE_TEST_HELPER}
+  smoke_test_helper.cc
+)
+ADD_EXECUTABLE(${TARGET_MANIFEST_TEST}
+  manifest_test.cc
+)
+
+TARGET_INCLUDE_DIRECTORIES(${TARGET_SMOKE_TEST} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+TARGET_INCLUDE_DIRECTORIES(${TARGET_SMOKE_TEST_EXTENSIVE} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+TARGET_INCLUDE_DIRECTORIES(${TARGET_SMOKE_TEST_HELPER} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+TARGET_INCLUDE_DIRECTORIES(${TARGET_MANIFEST_TEST} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)
+
+INSTALL(DIRECTORY test_samples/ DESTINATION ${SHAREDIR}/${DESTINATION_DIR}/test_samples)
+
+APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST} PUBLIC
+  Boost
+  GTEST
+  GUM_DEPS
+  VCONF_DEPS
+)
+APPLY_PKG_CONFIG(${TARGET_SMOKE_TEST_EXTENSIVE} PUBLIC
+  Boost
+  GTEST
+  GUM_DEPS
+  VCONF_DEPS
+)
+APPLY_PKG_CONFIG(${TARGET_MANIFEST_TEST} PUBLIC
+  Boost
+  GTEST
+)
+
+# FindGTest module do not sets all needed libraries in GTEST_LIBRARIES and
+# GTest main libraries is still missing, so additional linking of
+# GTEST_MAIN_LIBRARIES is needed.
+TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES} ${TARGET_SMOKE_UTILS})
+TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_EXTENSIVE} PRIVATE ${TARGET_LIBNAME_WGT} ${TARGET_LIBNAME_HYBRID} ${GTEST_MAIN_LIBRARIES} ${TARGET_SMOKE_UTILS})
+TARGET_LINK_LIBRARIES(${TARGET_SMOKE_TEST_HELPER} PRIVATE ${TARGET_LIBNAME_WGT})
+TARGET_LINK_LIBRARIES(${TARGET_MANIFEST_TEST} PRIVATE ${TARGET_LIBNAME_WGT} ${GTEST_MAIN_LIBRARIES})
+
+INSTALL(TARGETS ${TARGET_SMOKE_TEST} DESTINATION ${BINDIR}/${DESTINATION_DIR})
+INSTALL(TARGETS ${TARGET_SMOKE_TEST_EXTENSIVE} DESTINATION ${BINDIR}/${DESTINATION_DIR})
+INSTALL(TARGETS ${TARGET_SMOKE_TEST_HELPER} DESTINATION ${BINDIR}/${DESTINATION_DIR})
+INSTALL(TARGETS ${TARGET_MANIFEST_TEST} DESTINATION ${BINDIR}/${DESTINATION_DIR})
diff --git a/src/unit_tests/extensive_smoke_test.cc b/src/unit_tests/extensive_smoke_test.cc
new file mode 100644 (file)
index 0000000..1f0a8ab
--- /dev/null
@@ -0,0 +1,439 @@
+// Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <common/utils/subprocess.h>
+
+#include <common/utils/file_util.h>
+#include <unit_tests/common/smoke_utils.h>
+
+#include <gtest/gtest.h>
+#include <gtest/gtest-death-test.h>
+
+#include "unit_tests/smoke_utils.h"
+
+namespace ci = common_installer;
+
+namespace smoke_test {
+
+class SmokeEnvironment : public testing::Environment {
+ public:
+  explicit SmokeEnvironment(ci::RequestMode mode) {\
+    request_mode_ = mode;
+  }
+  void SetUp() override {
+    if (request_mode_ == ci::RequestMode::USER)
+      ASSERT_TRUE(AddTestUser(&test_user));
+    backups_ = SetupBackupDirectories(test_user.uid);
+    for (auto& path : backups_)
+      ASSERT_TRUE(BackupPath(path));
+  }
+  void TearDown() override {
+    ASSERT_TRUE(request_mode_ == ci::RequestMode::GLOBAL ||
+                (request_mode_ == ci::RequestMode::USER &&
+                kGlobalUserUid != test_user.uid));
+    WgtBackendInterface backend(std::to_string(test_user.uid));
+    UninstallAllSmokeApps(request_mode_, test_user.uid, &backend);
+    for (auto& path : backups_)
+      ASSERT_TRUE(RestorePath(path));
+    if (request_mode_ == ci::RequestMode::USER)
+      ASSERT_TRUE(DeleteTestUser());
+  }
+  User test_user;
+
+ private:
+  ci::RequestMode request_mode_;
+  std::vector<bf::path> backups_;
+};
+
+}  // namespace smoke_test
+
+namespace {
+
+smoke_test::SmokeEnvironment *env = nullptr;
+void signalHandler(int signum) {
+  env->TearDown();
+  exit(signum);
+}
+
+}  // namespace
+
+namespace smoke_test {
+
+class SmokeTest : public testing::Test {
+ public:
+  SmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::WGT, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  WgtBackendInterface backend;
+  TestParameters params;
+};
+
+class HybridSmokeTest : public testing::Test {
+ public:
+  HybridSmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::HYBRID, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  HybridBackendInterface backend;
+  TestParameters params;
+};
+
+TEST_F(SmokeTest, RecoveryMode_ForInstallation) {
+  bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForInstallation.wgt";
+  std::string pkgid = "smokewgt09";
+  std::string appid = "smokewgt09.RecoveryModeForInstallation";
+
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> args =
+      {"", "-i", path.string(), "-u", test_user_str.c_str()};
+  backend.CrashAfterEachStep(&args, [&](int step) -> bool {
+    if (step >= 1) {
+      bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                                params.test_user.uid);
+      EXTENDED_ASSERT_FALSE(recovery_file.empty());
+      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
+          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+    }
+    return true;
+  }, params.pkg_type);
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForUpdate) {
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForUpdate.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForUpdate_2.wgt";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  std::string pkgid = "smokewgt10";
+  std::string appid = "smokewgt10.RecoveryModeForUpdate";
+  AddDataFiles(pkgid, params.test_user.uid);
+
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> args =
+      {"", "-i", path_new.string(), "-u", test_user_str.c_str()};
+  backend.CrashAfterEachStep(&args, [&](int step) -> bool {
+    if (step >= 1) {
+      bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                                params.test_user.uid);
+      EXTENDED_ASSERT_FALSE(recovery_file.empty());
+      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
+          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+      EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+          "res/wgt/VERSION", "1\n", params));
+      EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    }
+    return true;
+  }, params.pkg_type);
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForDelta) {
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+  std::string pkgid = "smokewgt30";
+  std::string appid = "smokewgt30.RecoveryModeForDelta";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> args =
+      {"", "-i", path_new.string(), "-u", test_user_str.c_str()};
+  backend.CrashAfterEachStep(&args, [&](int step) -> bool {
+    if (step >= 1) {
+      bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                                params.test_user.uid);
+      EXTENDED_ASSERT_FALSE(recovery_file.empty());
+      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
+          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+      EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+          "res/wgt/VERSION", "1\n", params));
+      EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    }
+    return true;
+  }, params.pkg_type);
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
+  bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.wgt";
+  std::string pkgid = "smokewgt31";
+  std::string appid = "smokewgt31.RecoveryModeForMountInstall";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> args =
+      {"", "-w", path.string(), "-u", test_user_str.c_str()};
+  backend.CrashAfterEachStep(&args, [&](int step) -> bool {
+    if (step >= 1) {
+      bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                                params.test_user.uid);
+      EXTENDED_ASSERT_FALSE(recovery_file.empty());
+      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
+          ci::AppInstaller::Result::OK);
+      EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+    }
+    return true;
+  }, params.pkg_type);
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
+  bf::path path_old =
+      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.wgt";
+  bf::path path_new =
+      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate_2.wgt";
+  std::string pkgid = "smokewgt32";
+  std::string appid = "smokewgt32.RecoveryModeForMountUpdate";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.MountInstall(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  std::vector<std::string> args =
+      {"", "-w", path_new.string(), "-u", test_user_str.c_str()};
+  backend.CrashAfterEachStep(&args, [&](int step) -> bool {
+    if (step >= 1) {
+      // Filesystem may be mounted after crash
+      ScopedTzipInterface poweroff_unmount_interface(pkgid,
+                                                     params.test_user.uid);
+      poweroff_unmount_interface.Release();
+
+      bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                                params.test_user.uid);
+      EXTENDED_ASSERT_FALSE(recovery_file.empty());
+      EXTENDED_ASSERT_EQ(backend.Recover(recovery_file),
+          ci::AppInstaller::Result::OK);
+
+      ScopedTzipInterface interface(pkgid, params.test_user.uid);
+      EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+      EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(
+          pkgid, "res/wgt/VERSION", "1\n", params));
+      EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    }
+    return true;
+  }, params.pkg_type);
+}
+
+
+TEST_F(SmokeTest, InstallationMode_Rollback) {
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.wgt";
+  std::string pkgid = "smokewgt06";
+  std::string appid = "smokewgt06.InstallationModeRollback";
+
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+    return true;
+  });
+}
+
+TEST_F(SmokeTest, UpdateMode_Rollback) {
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Rollback.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_2.wgt";
+  std::string pkgid = "smokewgt07";
+  std::string appid = "smokewgt07.UpdateModeRollback";
+  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] =
+      {"", "-i", path_new.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "res/wgt/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    return true;
+  });
+}
+
+TEST_F(SmokeTest, DeltaMode_Rollback) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback.wgt";
+  bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback.delta";
+  std::string pkgid = "smokewgt01";
+  std::string appid = "smokewgt01.DeltaMode";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] =
+      {"", "-i", delta_package.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED",
+                                             "version 1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    EXTENDED_ASSERT_TRUE(bf::exists(GetPackageRoot(
+        pkgid, params.test_user.uid) / "res/wgt/DELETED"));
+    EXTENDED_ASSERT_FALSE(bf::exists(GetPackageRoot(
+        pkgid, params.test_user.uid) / "res/wgt/ADDED"));
+    return true;
+  });
+}
+
+TEST_F(HybridSmokeTest, InstallationMode_Rollback) {
+  bf::path path = kSmokePackagesDirectory /
+      "InstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb07";
+  std::string appid1 = "smokehyb07.web";
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+     EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+     return true;
+  });
+}
+
+TEST_F(HybridSmokeTest, UpdateMode_Rollback) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb08";
+  std::string appid1 = "smokehyb08.web";
+  ASSERT_EQ(backend.Install(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] =
+      {"", "-i", path_new.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "res/wgt/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "lib/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    return true;
+  });
+}
+
+TEST_F(HybridSmokeTest, DeltaMode_Rollback_Hybrid) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.wgt";
+  bf::path delta_package = kSmokePackagesDirectory /
+      "DeltaMode_Rollback_Hybrid.delta";
+  std::string pkgid = "smokehyb11";
+  std::string appid1 = "smokehyb11.web";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] = {"", "-i", path.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+    // Check delta modifications
+    bf::path root_path = GetPackageRoot(pkgid, params.test_user.uid);
+    EXTENDED_ASSERT_TRUE(bf::exists(root_path / "res" / "wgt" / "DELETED"));
+    EXTENDED_ASSERT_FALSE(bf::exists(root_path / "res" / "wgt" / "ADDED"));
+    EXTENDED_ASSERT_TRUE(bf::exists(root_path / "lib" / "DELETED"));
+    EXTENDED_ASSERT_FALSE(bf::exists(root_path / "lib" / "ADDED"));
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED",
+                                             "version 1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED",
+                                             "version 1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    return true;
+  });
+}
+
+TEST_F(HybridSmokeTest, MountInstallationMode_Rollback) {
+  bf::path path = kSmokePackagesDirectory /
+      "MountInstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb09";
+  std::string appid1 = "smokehyb09.web";
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] = {"", "-w", path.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    ScopedTzipInterface interface(pkgid, params.test_user.uid);
+    EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+    return true;
+  });
+}
+
+TEST_F(HybridSmokeTest, MountUpdateMode_Rollback) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb10";
+  std::string appid1 = "smokehyb10.web";
+  ASSERT_EQ(backend.MountInstall(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] =
+      {"", "-w", path_new.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    ScopedTzipInterface interface(pkgid, params.test_user.uid);
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "res/wgt/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "lib/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    return true;
+  });
+}
+
+TEST_F(SmokeTest, MountInstallationMode_Rollback) {
+  bf::path path =
+      kSmokePackagesDirectory / "MountInstallationMode_Rollback.wgt";
+  std::string pkgid = "smokewgt33";
+  std::string appid = "smokewgt33.web";
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] = {"", "-w", path.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [=]() -> bool {
+    ScopedTzipInterface interface(pkgid, params.test_user.uid);
+    EXTENDED_ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+    return true;
+  });
+}
+
+TEST_F(SmokeTest, MountUpdateMode_Rollback) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback.wgt";
+  bf::path path_new =
+      kSmokePackagesDirectory / "MountUpdateMode_Rollback_2.wgt";
+  std::string pkgid = "smokewgt34";
+  std::string appid = "smokewgt34.web";
+  ASSERT_EQ(backend.MountInstall(path_old),
+            ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  std::string test_user_str = std::to_string(params.test_user.uid);
+  const char* argv[] =
+      {"", "-w", path_new.c_str(), "-u", test_user_str.c_str()};
+  backend.TestRollbackAfterEachStep(SIZEOFARRAY(argv), argv, [&]() -> bool {
+    ScopedTzipInterface interface(pkgid, params.test_user.uid);
+    EXTENDED_ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+    EXTENDED_ASSERT_TRUE(ValidateFileContentInPackage(pkgid,
+        "res/wgt/VERSION", "1\n", params));
+    EXTENDED_ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+    return true;
+  });
+}
+
+}  // namespace smoke_test
+
+int main(int argc,  char** argv) {
+  try {
+    ci::RequestMode request_mode = smoke_test::ParseRequestMode(argc, argv);
+    if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) {
+      std::cout << "Skip tests for preload request" << std::endl;
+      ::testing::GTEST_FLAG(filter) = "SmokeTest.*";
+    }
+    testing::InitGoogleTest(&argc, argv);
+    ::env = static_cast<smoke_test::SmokeEnvironment*>(
+        testing::AddGlobalTestEnvironment(
+            new smoke_test::SmokeEnvironment(request_mode)));
+    signal(SIGINT, ::signalHandler);
+    signal(SIGSEGV, ::signalHandler);
+    return RUN_ALL_TESTS();
+  } catch (...) {
+    std::cout << "Exception occurred during testing";
+    return 1;
+  }
+}
diff --git a/src/unit_tests/manifest_test.cc b/src/unit_tests/manifest_test.cc
new file mode 100644 (file)
index 0000000..051d2f3
--- /dev/null
@@ -0,0 +1,774 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <boost/filesystem/path.hpp>
+
+#include <common/installer_context.h>
+#include <common/request.h>
+#include <common/utils/glist_range.h>
+
+#include <wgt_manifest_handlers/setting_handler.h>
+
+#include <glib.h>
+#include <gtest/gtest.h>
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "wgt/step/configuration/step_parse.h"
+#include "wgt/wgt_backend_data.h"
+
+#define ASSERT_CSTR_EQ(STR1, STR2)                                             \
+  ASSERT_EQ(strcmp(STR1, STR2), 0)                                             \
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+const char kManifestTestcaseData[] =
+    "/usr/share/wgt-backend-ut/test_samples/manifest/";
+
+template<typename T>
+gint Size(GListRange<T>* range) {
+  return std::distance(range->begin(), range->end());
+}
+
+class StepParseRunner {
+ public:
+  explicit StepParseRunner(const std::string& dir_suffix,
+                           bool ignore_start_files = true)
+      : dir_suffix_(dir_suffix),
+        ignore_start_files_(ignore_start_files),
+        context_(nullptr) {
+  }
+
+  bool Run() {
+    PrepareContext();
+    wgt::configuration::StepParse step(context_.get(),
+        wgt::configuration::StepParse::ConfigLocation::PACKAGE,
+        !ignore_start_files_);
+    return step.process() == ci::Step::Status::OK;
+  }
+
+  wgt::WgtBackendData* GetBackendData() const {
+    return static_cast<wgt::WgtBackendData*>(context_->backend_data.get());
+  }
+
+  manifest_x* GetManifest() const {
+    return context_->manifest_data.get();
+  }
+
+ private:
+  void PrepareContext() {
+    context_.reset(new ci::InstallerContext());
+    context_->root_application_path.set(ci::GetRootAppPath(false, getuid()));
+    context_->unpacked_dir_path.set(
+        bf::path(kManifestTestcaseData) / dir_suffix_);
+    context_->backend_data.set(new wgt::WgtBackendData());
+  }
+
+  std::string dir_suffix_;
+  bool ignore_start_files_;
+  std::unique_ptr<ci::InstallerContext> context_;
+};
+
+}  // namespace
+
+class ManifestTest : public testing::Test {
+ public:
+  std::string GetMyName() const {
+    std::string suite =
+        testing::UnitTest::GetInstance()->current_test_info()->test_case_name();
+    std::string case_name =
+        testing::UnitTest::GetInstance()->current_test_info()->name();
+    return suite + '.' + case_name;
+  }
+};
+
+TEST_F(ManifestTest, WidgetElement_Valid) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  ASSERT_CSTR_EQ(m->package, "package0id");
+  auto apps = GListRange<application_x*>(m->application);
+  ASSERT_EQ(Size(&apps), 1);
+  application_x* app = *apps.begin();
+  ASSERT_CSTR_EQ(app->appid, "package0id.appid");
+}
+
+TEST_F(ManifestTest, WidgetElement_InvalidNamespace) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, WidgetElement_MissingNamespace) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, WidgetElement_ManyNamespaces) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_ManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_ValidAppId) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+  ASSERT_NE(app, nullptr);
+  ASSERT_CSTR_EQ(app->appid, "package0id.appid");
+}
+
+TEST_F(ManifestTest, ApplicationElement_MissingAppId) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_InvalidAppId) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_ValidPackage) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  ASSERT_CSTR_EQ(m->package, "package0id");
+}
+
+TEST_F(ManifestTest, ApplicationElement_InvalidPackage) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_MissingPackage) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_ValidVersion) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  ASSERT_CSTR_EQ(m->api_version, "3.0");
+}
+
+TEST_F(ManifestTest, ApplicationElement_InvalidVersion) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ApplicationElement_MissingVersion) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, PrivilegeElement_ValidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (privilege_x* priv : GListRange<privilege_x*>(m->privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_FALSE(priv_vec.empty());
+  const char* expected_name = "http://tizen.org/privilege/application.launch";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name);
+}
+
+TEST_F(ManifestTest, PrivilegeElement_ManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (privilege_x* priv : GListRange<privilege_x*>(m->privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_EQ(priv_vec.size(), 2);
+  const char* first_priv = "http://tizen.org/privilege/application.close";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv);
+  const char* second_priv = "http://tizen.org/privilege/application.launch";
+  ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv);
+}
+
+TEST_F(ManifestTest, PrivilegeElement_InvalidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, PrivilegeElement_MissingName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_Invalid_NotURI) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_Invalid_OverLength) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_ValidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (appdefined_privilege_x* priv :
+      GListRange<appdefined_privilege_x*>(m->appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_FALSE(priv_vec.empty());
+  const char* expected_name = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name);
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_ManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (appdefined_privilege_x* priv :
+      GListRange<appdefined_privilege_x*>(m->appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_EQ(priv_vec.size(), 2);
+  const char* first_priv = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv);
+  const char* second_priv = "http://package0id/appdefined/test.write";
+  ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv);
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_WithLicenseValidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  std::vector<std::string> license_vec;
+  for (appdefined_privilege_x* priv :
+      GListRange<appdefined_privilege_x*>(m->appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+    license_vec.push_back(priv->license);
+  }
+  ASSERT_FALSE(priv_vec.empty());
+  const char* expected_name = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name);
+  ASSERT_FALSE(license_vec.empty());
+  bf::path path(m->root_path);
+  path /= "res/cert";
+  ASSERT_CSTR_EQ(license_vec[0].c_str(), path.c_str());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_WithLicenseManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  std::vector<std::string> license_vec;
+  for (appdefined_privilege_x* priv :
+      GListRange<appdefined_privilege_x*>(m->appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+    license_vec.push_back(priv->license);
+  }
+  ASSERT_EQ(priv_vec.size(), 2);
+  const char* first_priv = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv);
+  const char* second_priv = "http://package0id/appdefined/test.write";
+  ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv);
+  ASSERT_EQ(license_vec.size(), 2);
+  bf::path path(m->root_path);
+  path /= "res/cert";
+  ASSERT_CSTR_EQ(license_vec[0].c_str(), path.c_str());
+  ASSERT_CSTR_EQ(license_vec[1].c_str(), path.c_str());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_InvalidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppDefinedPrivilegeElement_MissingName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_Invalid_NotURI) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_Invalid_OverLength) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_ValidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+      m->provides_appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_FALSE(priv_vec.empty());
+  const char* expected_name = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name);
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_ManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+      m->provides_appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+  }
+  ASSERT_EQ(priv_vec.size(), 2);
+  const char* first_priv = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv);
+  const char* second_priv = "http://package0id/appdefined/test.write";
+  ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv);
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_WithLicenseValidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  std::vector<std::string> license_vec;
+  for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+      m->provides_appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+    license_vec.push_back(priv->license);
+  }
+  ASSERT_FALSE(priv_vec.empty());
+  const char* expected_name = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), expected_name);
+  ASSERT_FALSE(license_vec.empty());
+  bf::path path(m->root_path);
+  path /= "res/cert";
+  ASSERT_CSTR_EQ(license_vec[0].c_str(), path.c_str());
+}
+
+TEST_F(ManifestTest,
+       ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  std::vector<std::string> priv_vec;
+  std::vector<std::string> license_vec;
+  for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+      m->provides_appdefined_privileges)) {
+    priv_vec.push_back(priv->value);
+    license_vec.push_back(priv->license);
+  }
+  ASSERT_EQ(priv_vec.size(), 2);
+  const char* first_priv = "http://package0id/appdefined/test.read";
+  ASSERT_CSTR_EQ(priv_vec[0].c_str(), first_priv);
+  const char* second_priv = "http://package0id/appdefined/test.write";
+  ASSERT_CSTR_EQ(priv_vec[1].c_str(), second_priv);
+  ASSERT_EQ(license_vec.size(), 2);
+  bf::path path(m->root_path);
+  path /= "res/cert";
+  ASSERT_CSTR_EQ(license_vec[0].c_str(), path.c_str());
+  ASSERT_CSTR_EQ(license_vec[1].c_str(), path.c_str());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_InvalidName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, ProvidesAppDefinedPrivilegeElement_MissingName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppControlElement_Valid) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+  ASSERT_NE(app, nullptr);
+  std::vector<appcontrol_x*> app_controls;
+  for (appcontrol_x* app_control : GListRange<appcontrol_x*>(app->appcontrol)) {
+    app_controls.push_back(app_control);
+  }
+  ASSERT_EQ(app_controls.size(), 1);
+  ASSERT_CSTR_EQ(app_controls[0]->mime, "image/jpg");
+  ASSERT_CSTR_EQ(app_controls[0]->operation,
+                 "http://tizen.org/appcontrol/operation/edit");
+  ASSERT_CSTR_EQ(app_controls[0]->uri, "myapp");
+}
+
+TEST_F(ManifestTest, AppControlElement_MissingMIME) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+  ASSERT_NE(app, nullptr);
+  std::vector<appcontrol_x*> app_controls;
+  for (appcontrol_x* app_control : GListRange<appcontrol_x*>(app->appcontrol)) {
+    app_controls.push_back(app_control);
+  }
+  ASSERT_CSTR_EQ(app_controls[0]->mime, "");
+}
+
+TEST_F(ManifestTest, AppControlElement_MissingOperation) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppControlElement_MissingSrc) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, AppControlElement_MissingURI) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+  ASSERT_NE(app, nullptr);
+  std::vector<appcontrol_x*> app_controls;
+  for (appcontrol_x* app_control : GListRange<appcontrol_x*>(app->appcontrol)) {
+    app_controls.push_back(app_control);
+  }
+  ASSERT_CSTR_EQ(app_controls[0]->uri, "");
+}
+
+TEST_F(ManifestTest, SettingsElement_Valid) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+
+  ASSERT_EQ(settings.background_support_enabled(), true);
+  ASSERT_EQ(settings.context_menu_enabled(), false);
+  ASSERT_EQ(settings.encryption_enabled(), true);
+  ASSERT_EQ(settings.screen_orientation(),
+            wgt::parse::SettingInfo::ScreenOrientation::LANDSCAPE);
+  ASSERT_EQ(settings.install_location(),
+            wgt::parse::SettingInfo::InstallLocation::INTERNAL);
+  ASSERT_EQ(settings.hwkey_enabled(), true);
+  ASSERT_EQ(settings.background_vibration(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_BackgroundSupportEnabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_support_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_BackgroundSupportDisabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_support_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingBackgroundSupport) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_support_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_BackgroundVibrationEnabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_vibration(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_BackgroundVibrationDisabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_vibration(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingBackgroundVibration) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.background_vibration(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_ContextMenuEnabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.context_menu_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_ContextMenuDisabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.context_menu_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingContextMenu) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.context_menu_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_EncryptionEnabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.encryption_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_EncryptionDisabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.encryption_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingEncryption) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.encryption_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_HwKeyEnabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.hwkey_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_HwKeyDisabled) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.hwkey_enabled(), false);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingHwKeyEvent) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.hwkey_enabled(), true);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingInstallLocation) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.install_location(),
+            wgt::parse::SettingInfo::InstallLocation::AUTO);
+}
+
+TEST_F(ManifestTest, SettingsElement_MissingScreenOrientation) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto backend_data = runner.GetBackendData();
+  auto settings = backend_data->settings.get();
+  ASSERT_EQ(settings.screen_orientation(),
+            wgt::parse::SettingInfo::ScreenOrientation::AUTO);
+}
+
+TEST_F(ManifestTest, MetadataElement_Valid) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+
+  std::map<std::string, std::string> meta_data_map;
+  for (metadata_x* meta_data : GListRange<metadata_x*>(app->metadata)) {
+    if (meta_data->value)
+      meta_data_map[meta_data->key] = meta_data->value;
+    else
+      meta_data_map[meta_data->key] = std::string();
+  }
+  ASSERT_EQ(meta_data_map.size(), 2);
+  ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), "");
+  ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "value2");
+}
+
+TEST_F(ManifestTest, MetadataElement_DuplicateKey) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+
+  std::map<std::string, std::string> meta_data_map;
+  for (metadata_x* meta_data : GListRange<metadata_x*>(app->metadata)) {
+    meta_data_map[meta_data->key] = meta_data->value;
+  }
+  ASSERT_EQ(meta_data_map.size(), 2);
+  ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), "key1value");
+  ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "key2value");
+}
+
+TEST_F(ManifestTest, MetadataElement_MissingValue) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+
+  std::map<std::string, std::string> meta_data_map;
+  for (metadata_x* meta_data : GListRange<metadata_x*>(app->metadata)) {
+    if (meta_data->value)
+      meta_data_map[meta_data->key] = meta_data->value;
+    else
+      meta_data_map[meta_data->key] = std::string();
+  }
+  ASSERT_EQ(meta_data_map.size(), 2);
+  ASSERT_CSTR_EQ(meta_data_map["key1"].c_str(), "");
+  ASSERT_CSTR_EQ(meta_data_map["key2"].c_str(), "");
+}
+
+TEST_F(ManifestTest, MetadataElement_MissingKey) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, CategoryElement_Valid) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+
+  std::vector<std::string> categories;
+  for (const char* category : GListRange<char*>(app->category)) {
+    categories.push_back(category);
+  }
+  ASSERT_EQ(categories.size(), 1);
+  ASSERT_CSTR_EQ(categories[0].c_str(),
+                 "http://tizen.org/category/wearable_clock");
+}
+
+TEST_F(ManifestTest, CategoryElement_MissingName) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_FALSE(runner.Run());
+}
+
+TEST_F(ManifestTest, CategoryElement_MultipleElements) {
+  StepParseRunner runner(GetMyName());
+  ASSERT_TRUE(runner.Run());
+  manifest_x* m = runner.GetManifest();
+  ASSERT_NE(m, nullptr);
+  auto apps = GListRange<application_x*>(m->application);
+  application_x* app = *apps.begin();
+
+  std::vector<std::string> categories;
+  for (const char* category : GListRange<char*>(app->category)) {
+    categories.push_back(category);
+  }
+  ASSERT_EQ(categories.size(), 3);
+  ASSERT_CSTR_EQ(categories[0].c_str(),
+                 "http://tizen.org/category/category_0");
+  ASSERT_CSTR_EQ(categories[1].c_str(),
+                 "http://tizen.org/category/category_1");
+  ASSERT_CSTR_EQ(categories[2].c_str(),
+                 "http://tizen.org/category/category_2");
+}
diff --git a/src/unit_tests/smoke_test.cc b/src/unit_tests/smoke_test.cc
new file mode 100644 (file)
index 0000000..d61b444
--- /dev/null
@@ -0,0 +1,887 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <gtest/gtest-death-test.h>
+
+#include <common/utils/subprocess.h>
+#include <common/utils/file_util.h>
+#include <common/pkgmgr_query.h>
+#include <unit_tests/common/smoke_utils.h>
+
+#include <memory>
+
+#include "unit_tests/smoke_utils.h"
+
+namespace st = smoke_test;
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+namespace bo = boost::program_options;
+
+namespace smoke_test {
+
+class SmokeEnvironment : public testing::Environment {
+ public:
+  explicit SmokeEnvironment(ci::RequestMode mode) {\
+    request_mode_ = mode;
+  }
+  void SetUp() override {
+    if (request_mode_ == ci::RequestMode::USER)
+      ASSERT_TRUE(AddTestUser(&test_user));
+    backups_ = SetupBackupDirectories(test_user.uid);
+    for (auto& path : backups_)
+      ASSERT_TRUE(BackupPath(path));
+  }
+  void TearDown() override {
+    ASSERT_TRUE(request_mode_ == ci::RequestMode::GLOBAL ||
+                (request_mode_ == ci::RequestMode::USER &&
+                kGlobalUserUid != test_user.uid));
+    WgtBackendInterface backend(std::to_string(test_user.uid));
+    UninstallAllSmokeApps(request_mode_, test_user.uid, &backend);
+    for (auto& path : backups_)
+      ASSERT_TRUE(RestorePath(path));
+    if (request_mode_ == ci::RequestMode::USER)
+      ASSERT_TRUE(DeleteTestUser());
+  }
+  User test_user;
+
+ private:
+  ci::RequestMode request_mode_;
+  std::vector<bf::path> backups_;
+};
+
+}  // namespace smoke_test
+
+namespace {
+
+smoke_test::SmokeEnvironment* env = nullptr;
+void signalHandler(int signum) {
+  env->TearDown();
+  exit(signum);
+}
+
+}  // namespace
+
+namespace smoke_test {
+
+class SmokeTest : public testing::Test {
+ public:
+  SmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::WGT, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  WgtBackendInterface backend;
+  TestParameters params;
+};
+
+class RollbackSmokeTest : public testing::Test {
+ public:
+  RollbackSmokeTest() : backend(std::to_string(env->test_user.uid),
+      RequestResult::FAIL), params{PackageType::WGT, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  WgtBackendInterface backend;
+  TestParameters params;
+};
+
+class HybridSmokeTest : public testing::Test {
+ public:
+  HybridSmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::HYBRID, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  HybridBackendInterface backend;
+  TestParameters params;
+};
+
+class RollbackHybridSmokeTest : public testing::Test {
+ public:
+  RollbackHybridSmokeTest() : backend(std::to_string(env->test_user.uid),
+      RequestResult::FAIL), params{PackageType::HYBRID, false} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  HybridBackendInterface backend;
+  TestParameters params;
+};
+
+class PreloadSmokeTest : public testing::Test {
+ public:
+  PreloadSmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::WGT, true}  {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  WgtBackendInterface backend;
+  TestParameters params;
+};
+
+class HybridPreloadSmokeTest : public testing::Test {
+ public:
+  HybridPreloadSmokeTest() : backend(std::to_string(env->test_user.uid)),
+      params{PackageType::HYBRID, true} {
+    params.test_user.uid = env->test_user.uid;
+    params.test_user.gid = env->test_user.gid;
+  }
+ protected:
+  HybridBackendInterface backend;
+  TestParameters params;
+};
+
+TEST_F(SmokeTest, InstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "InstallationMode.wgt";
+  std::string pkgid = "smokewgt03";
+  std::string appid = "smokewgt03.InstallationMode";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(SmokeTest, UpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_2.wgt";
+  std::string pkgid = "smokewgt04";
+  std::string appid = "smokewgt04.UpdateMode";
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(SmokeTest, DeinstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "DeinstallationMode.wgt";
+  std::string pkgid = "smokewgt05";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(SmokeTest, RDSMode) {
+  bf::path path = kSmokePackagesDirectory / "RDSMode.wgt";
+  std::string pkgid = "smokewgt11";
+  std::string appid = "smokewgt11.RDSMode";
+  bf::path delta_directory = kSmokePackagesDirectory / "delta_dir";
+  bf::path sdk_expected_directory = kSdkDirectory / "tmp" / pkgid;
+  ASSERT_TRUE(ci::CopyDir(delta_directory, sdk_expected_directory));
+  ASSERT_EQ(backend.RDSUpdate(path, pkgid),
+            ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  // Check delta modifications
+  ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "DELETED"));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "ADDED"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "2\n",
+      params));
+}
+
+TEST_F(SmokeTest, EnablePkg) {
+  bf::path path = kSmokePackagesDirectory / "EnablePkg.wgt";
+  std::string pkgid = "smokewgt22";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.EnablePackage(pkgid), ci::AppInstaller::Result::OK);
+
+  ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid);
+  ASSERT_TRUE(pkg_query.IsPackageInstalled(
+      ci::GetRequestMode(params.test_user.uid)));
+}
+
+TEST_F(SmokeTest, DisablePkg) {
+  bf::path path = kSmokePackagesDirectory / "DisablePkg.wgt";
+  std::string pkgid = "smokewgt21";
+  std::string appid = "smokewgt21.DisablePkg";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.DisablePackage(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ci::QueryIsDisabledPackage(pkgid, params.test_user.uid));
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(SmokeTest, DeltaMode) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode.wgt";
+  bf::path delta_package = kSmokePackagesDirectory / "DeltaMode.delta";
+  std::string pkgid = "smokewgt17";
+  std::string appid = "smokewgt17.DeltaMode";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  // Check delta modifications
+  ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "DELETED"));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "ADDED"));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "css" / "style.css"));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "images" / "tizen_32.png"));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+      "res" / "wgt" / "js" / "main.js"));
+  ASSERT_TRUE(ValidateFileContentInPackage(
+      pkgid, "res/wgt/MODIFIED", "version 2\n", params));
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForInstallation) {
+  bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForInstallation.wgt";
+  ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  backend_crash.Run("-i", path.string(), "-u", test_uid_str.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  std::string pkgid = "smokewgt09";
+  bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                            params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForUpdate) {
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForUpdate.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForUpdate_2.wgt";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  std::string pkgid = "smokewgt10";
+  std::string appid = "smokewgt10.RecoveryModeForUpdate";
+  AddDataFiles(pkgid, params.test_user.uid);
+  ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                            params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForDelta) {
+  bf::path path_old = kSmokePackagesDirectory / "RecoveryMode_ForDelta.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "RecoveryMode_ForDelta.delta";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  backend_crash.Run("-i", path_new.string(), "-u", test_uid_str.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  std::string pkgid = "smokewgt30";
+  std::string appid = "smokewgt30.RecoveryModeForDelta";
+  bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                            params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForMountInstall) {
+  bf::path path = kSmokePackagesDirectory / "RecoveryMode_ForMountInstall.wgt";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  backend_crash.Run("-w", path.string(), "-u", test_uid_str.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  std::string pkgid = "smokewgt31";
+  bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                                            params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(SmokeTest, RecoveryMode_ForMountUpdate) {
+  bf::path path_old =
+      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate.wgt";
+  bf::path path_new =
+      kSmokePackagesDirectory / "RecoveryMode_ForMountUpdate_2.wgt";
+  std::string pkgid = "smokewgt32";
+  std::string appid = "smokewgt32.RecoveryModeForMountUpdate";
+  RemoveAllRecoveryFiles("/wgt-recovery", params.test_user.uid);
+  ASSERT_EQ(backend.MountInstallSuccess(path_old),
+            ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ci::Subprocess backend_crash("/usr/bin/wgt-backend-ut/smoke-test-helper");
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  backend_crash.Run("-w", path_new.string(), "-u", test_uid_str.c_str());
+  ASSERT_NE(backend_crash.Wait(), 0);
+
+  // Filesystem may be mounted after crash
+  ScopedTzipInterface poweroff_unmount_interface(pkgid, params.test_user.uid);
+  poweroff_unmount_interface.Release();
+
+  bf::path recovery_file = FindRecoveryFile("/wgt-recovery",
+                           params.test_user.uid);
+  ASSERT_FALSE(recovery_file.empty());
+  ASSERT_EQ(backend.Recover(recovery_file), ci::AppInstaller::Result::OK);
+
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(SmokeTest, InstallationMode_GoodSignature) {
+  // pkgid: smokewgt08
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_GoodSignature.wgt";  // NOLINT
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+}
+
+TEST_F(SmokeTest, InstallationMode_WrongSignature) {
+  // pkgid: smokewgt12
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_WrongSignature.wgt";  // NOLINT
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR);
+}
+
+TEST_F(RollbackSmokeTest, InstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_Rollback.wgt";
+  std::string pkgid = "smokewgt06";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(RollbackSmokeTest, UpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Rollback.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Rollback_2.wgt";
+  std::string pkgid = "smokewgt07";
+  std::string appid = "smokewgt07.UpdateModeRollback";
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::ERROR);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(RollbackSmokeTest, DeltaMode) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback.wgt";
+  bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Rollback.delta";
+  std::string pkgid = "smokewgt01";
+  std::string appid = "smokewgt01.DeltaMode";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::ERROR);
+
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED",
+                                           "version 1\n", params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+  ASSERT_TRUE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+                         "res/wgt/DELETED"));
+  ASSERT_FALSE(bf::exists(GetPackageRoot(pkgid, params.test_user.uid) /
+                          "res/wgt/ADDED"));
+}
+
+TEST_F(HybridSmokeTest, InstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_Hybrid.wgt";
+  std::string pkgid = "smokehyb01";
+  // Excutable for native app doesn't create symlink
+  std::string appid1 = "smokehyb01.Web";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+}
+
+TEST_F(HybridSmokeTest, UpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb02";
+  std::string appid1 = "smokehyb02.Web";
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_new),
+            ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n",
+      params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "VERSION", "2\n", params));
+  ValidateDataFiles(pkgid, params.test_user.uid);
+}
+
+TEST_F(HybridSmokeTest, DeinstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Hybrid.wgt";
+  std::string pkgid = "smokehyb03";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(HybridSmokeTest, DeltaMode) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Hybrid.wgt";
+  bf::path delta_package = kSmokePackagesDirectory / "DeltaMode_Hybrid.delta";
+  std::string pkgid = "smokehyb04";
+  std::string appid1 = "smokehyb04.Web";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+  // Check delta modifications
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "wgt" / "DELETED"));
+  ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "ADDED"));
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "lib" / "DELETED"));
+  ASSERT_TRUE(bf::exists(root_path / pkgid / "lib" / "ADDED"));
+  ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "css" / "style.css"));  // NOLINT
+  ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "images" / "tizen_32.png"));  // NOLINT
+  ASSERT_TRUE(bf::exists(root_path / pkgid / "res" / "wgt" / "js" / "main.js"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED", "version 2\n", params));  // NOLINT
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED", "version 2\n", params));  // NOLINT
+}
+
+TEST_F(HybridSmokeTest, MountInstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "MountInstallationMode_Hybrid.wgt";
+  std::string pkgid = "smokehyb05";
+  std::string appid1 = "smokehyb05.web";
+  ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+}
+
+TEST_F(HybridSmokeTest, MountUpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb06";
+  std::string appid1 = "smokehyb06.web";
+  ASSERT_EQ(backend.MountInstallSuccess(path_old),
+      ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n",
+      params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "2\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(RollbackHybridSmokeTest, InstallationMode) {
+  bf::path path = kSmokePackagesDirectory /
+      "InstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb07";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::ERROR);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(RollbackHybridSmokeTest, UpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "UpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb08";
+  std::string appid1 = "smokehyb08.web";
+  ASSERT_EQ(backend.InstallSuccess(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(path_new), ci::AppInstaller::Result::ERROR);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(RollbackHybridSmokeTest, DeltaMode) {
+  bf::path path = kSmokePackagesDirectory / "DeltaMode_Rollback_Hybrid.wgt";
+  bf::path delta_package = kSmokePackagesDirectory /
+      "DeltaMode_Rollback_Hybrid.delta";
+  std::string pkgid = "smokehyb11";
+  std::string appid1 = "smokehyb11.web";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.Install(delta_package),
+            ci::AppInstaller::Result::ERROR);
+
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+  // Check delta modifications
+  bf::path root_path = GetPackageRoot(pkgid, params.test_user.uid);
+  ASSERT_TRUE(bf::exists(root_path / "res" / "wgt" / "DELETED"));
+  ASSERT_FALSE(bf::exists(root_path / "res" / "wgt" / "ADDED"));
+  ASSERT_TRUE(bf::exists(root_path / "lib" / "DELETED"));
+  ASSERT_FALSE(bf::exists(root_path / "lib" / "ADDED"));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/MODIFIED",
+                                           "version 1\n", params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/MODIFIED",
+                                           "version 1\n", params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(RollbackHybridSmokeTest, MountInstallationMode) {
+  bf::path path = kSmokePackagesDirectory /
+      "MountInstallationMode_Rollback_Hybrid.wgt";
+  std::string pkgid = "smokehyb09";
+  ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(RollbackHybridSmokeTest, MountUpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid.wgt";
+  bf::path path_new = kSmokePackagesDirectory /
+      "MountUpdateMode_Rollback_Hybrid_2.wgt";
+  std::string pkgid = "smokehyb10";
+  std::string appid1 = "smokehyb10.web";
+  ASSERT_EQ(backend.MountInstallSuccess(path_old),
+            ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "lib/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(SmokeTest, MountInstallationMode) {
+  bf::path path = kSmokePackagesDirectory / "MountInstallationMode.wgt";
+  std::string pkgid = "smokewgt28";
+  std::string appid = "smokewgt28.InstallationMode";
+  ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(SmokeTest, MountUpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "MountUpdateMode_2.wgt";
+  std::string pkgid = "smokewgt29";
+  std::string appid = "smokewgt29.UpdateMode";
+  ASSERT_EQ(backend.MountInstallSuccess(path_old),
+      ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::OK);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(RollbackSmokeTest, MountInstallationMode) {
+  bf::path path =
+      kSmokePackagesDirectory / "MountInstallationMode_Rollback.wgt";
+  std::string pkgid = "smokewgt33";
+  ASSERT_EQ(backend.MountInstall(path), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(CheckPackageNonExistance(pkgid, params));
+}
+
+TEST_F(RollbackSmokeTest, MountUpdateMode) {
+  bf::path path_old = kSmokePackagesDirectory / "MountUpdateMode_Rollback.wgt";
+  bf::path path_new =
+      kSmokePackagesDirectory / "MountUpdateMode_Rollback_2.wgt";
+  std::string pkgid = "smokewgt34";
+  std::string appid = "smokewgt34.web";
+  ASSERT_EQ(backend.MountInstallSuccess(path_old),
+            ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.MountInstall(path_new), ci::AppInstaller::Result::ERROR);
+  ScopedTzipInterface interface(pkgid, params.test_user.uid);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "1\n",
+      params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(SmokeTest, UserDefinedPlugins) {
+  bf::path path = kSmokePackagesDirectory / "SimpleEchoPrivilege.wgt";
+  std::string pkgid = "smokewgt02";
+  std::string appid = "smokewgt02.SimpleEcho";
+  std::string call_privilege = "http://tizen.org/privilege/call";
+  std::string location_privilege = "http://tizen.org/privilege/location";
+  std::string power_privilege = "http://tizen.org/privilege/power";
+
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  std::vector<std::string> res;
+  ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid);
+  ASSERT_TRUE(pkg_query.PrivilegesForPkgId(&res));
+  ASSERT_TRUE(std::find(res.begin(), res.end(), call_privilege) != res.end());
+  ASSERT_TRUE(std::find(res.begin(), res.end(), location_privilege)
+          != res.end());
+  ASSERT_TRUE(std::find(res.begin(), res.end(), power_privilege) != res.end());
+}
+
+TEST_F(SmokeTest, InstallExternalMode) {
+  ASSERT_TRUE(CheckAvailableExternalPath());
+  bf::path path = kSmokePackagesDirectory / "InstallExternalMode.wgt";
+  std::string pkgid = "smokewgt35";
+  std::string appid = "smokewgt35.web";
+  ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTERNAL),
+      ci::AppInstaller::Result::OK);
+  ValidateExternalPackage(pkgid, {appid}, params);
+}
+
+TEST_F(SmokeTest, MigrateLegacyExternalImageMode) {
+  ASSERT_TRUE(CheckAvailableExternalPath());
+  bf::path path =
+      kSmokePackagesDirectory / "MigrateLegacyExternalImageMode.wgt";
+  std::string pkgid = "smokewgt36";
+  std::string appid = "smokewgt36.web";
+  bf::path legacy_path = kSmokePackagesDirectory / kLegacyExtImageDir;
+  std::string test_uid_str = std::to_string(params.test_user.uid);
+  if (test_uid_str == kDefaultUserIdStr ||
+      params.test_user.uid == kGlobalUserUid) {
+    ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path),
+        ci::AppInstaller::Result::OK);
+    ValidateExternalPackage(pkgid, {appid}, params);
+  } else {
+    ASSERT_EQ(backend.MigrateLegacyExternalImage(pkgid, path, legacy_path),
+        ci::AppInstaller::Result::ERROR);
+  }
+}
+
+TEST_F(PreloadSmokeTest, InstallationMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path path = kSmokePackagesDirectory / "InstallationMode_Preload.wgt";
+  std::string pkgid = "smokewgt37";
+  std::string appid = "smokewgt37.InstallationModePreload";
+  ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(PreloadSmokeTest, UpdateMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path path_old = kSmokePackagesDirectory / "UpdateMode_Preload.wgt";
+  bf::path path_new = kSmokePackagesDirectory / "UpdateMode_Preload2.wgt";
+  std::string pkgid = "smokewgt38";
+  std::string appid = "smokewgt38.UpdateModePreload";
+  ASSERT_EQ(backend.InstallPreload(path_old), ci::AppInstaller::Result::OK);
+  AddDataFiles(pkgid, params.test_user.uid);
+  ASSERT_EQ(backend.InstallPreload(path_new), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+
+  ASSERT_TRUE(ValidateFileContentInPackage(pkgid, "res/wgt/VERSION", "2",
+                                           params));
+  ASSERT_TRUE(ValidateDataFiles(pkgid, params.test_user.uid));
+}
+
+TEST_F(PreloadSmokeTest, DeinstallationMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path path = kSmokePackagesDirectory / "DeinstallationMode_Preload.wgt";
+  std::string pkgid = "smokewgt39";
+  ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.UninstallPreload(pkgid), ci::AppInstaller::Result::OK);
+  CheckPackageReadonlyNonExistance(pkgid, params);
+}
+
+TEST_F(SmokeTest, ManifestDirectInstallMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path src_path = kSmokePackagesDirectory / "ManifestDirectInstallMode";
+  std::string pkgid = "smokewgt40";
+  std::string appid = "smokewgt40.ManifestDirectInstallMode";
+  bf::path pkg_path = ci::GetRootAppPath(false, params.test_user.uid);
+
+  ci::CopyDir(src_path / pkgid, pkg_path / pkgid);
+  ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid);
+  ASSERT_FALSE(pkg_query.IsPackageInstalled(
+      ci::GetRequestMode(params.test_user.uid)));
+  ASSERT_EQ(backend.ManifestDirectInstall(pkgid),
+            ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(SmokeTest, ManifestDirectUpdateMode) {
+  bf::path path = kSmokePackagesDirectory / "ManifestDirectUpdateMode.wgt";
+  std::string pkgid = "smokewgt41";
+  std::string appid = "smokewgt41.ManifestDirectUpdateMode";
+
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid);
+  ASSERT_EQ(backend.ManifestDirectInstall(pkgid),
+            ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(GetAppInstalledTime(appid.c_str(),
+                                  params.test_user.uid) > install_time)
+      << "Package is not updated (app installed time didn't change).";
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(PreloadSmokeTest, ReadonlyUpdateInstallMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path path = kSmokePackagesDirectory / "ReadonlyUpdateInstallMode.wgt";
+  std::string pkgid = "smokewgt42";
+  std::string appid = "smokewgt42.ReadonlyUpdateInstallMode";
+
+  ASSERT_EQ(backend.InstallPreload(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(PreloadSmokeTest, ReadonlyUpdateUninstallMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path path = kSmokePackagesDirectory / "ReadonlyUpdateUninstallMode.wgt";
+  std::string pkgid = "smokewgt43";
+  std::string appid = "smokewgt43.ReadonlyUpdateUninstallMode";
+
+  ASSERT_EQ(backend.InstallPreload(path),
+            ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  ASSERT_EQ(backend.Uninstall(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(HybridSmokeTest, ManifestDirectInstallMode) {
+  ASSERT_EQ(getuid(), 0) << "Test cannot be run by normal user";
+  bf::path src_path = kSmokePackagesDirectory /
+      "ManifestDirectInstallMode_Hybrid";
+  std::string pkgid = "smokehyb12";
+  std::string appid = "smokehyb12.ManifestDirectInstallModeHybrid";
+  bf::path pkg_path = ci::GetRootAppPath(false, params.test_user.uid);
+
+  ci::CopyDir(src_path / pkgid, pkg_path / pkgid);
+  ci::PkgQueryInterface pkg_query(pkgid, params.test_user.uid);
+  ASSERT_FALSE(pkg_query.IsPackageInstalled(
+      ci::GetRequestMode(params.test_user.uid)));
+  ASSERT_EQ(backend.ManifestDirectInstall(pkgid),
+            ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(HybridSmokeTest, ManifestDirectUpdateMode) {
+  bf::path path = kSmokePackagesDirectory /
+      "ManifestDirectUpdateMode_Hybrid.wgt";
+  std::string pkgid = "smokehyb13";
+  std::string appid = "smokehyb13.ManifestDirectUpdateModeHybrid";
+
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid);
+  ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(GetAppInstalledTime(appid.c_str(),
+                                  params.test_user.uid) > install_time)
+      << "Package is not updated (app installed time didn't change).";
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+}
+
+TEST_F(SmokeTest, SharedRes24) {
+  bf::path path = kSmokePackagesDirectory / "SharedRes24.wgt";
+  std::string pkgid = "smokeSh2xx";
+  std::string appid = "smokeSh2xx.SharedRes24";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ValidatePackage(pkgid, {appid}, params);
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "NOT-SHARED-WGT"));  // NOLINT
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "NOT-SHARED-WGT"));  // NOLINT
+}
+
+TEST_F(SmokeTest, SharedRes30) {
+  bf::path path = kSmokePackagesDirectory / "SharedRes30.wgt";
+  std::string pkgid = "smokeSh3xx";
+  std::string appid = "smokeSh3xx.SharedRes30";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT"));  // NOLINT
+}
+
+TEST_F(SmokeTest, SharedRes30Delta) {
+  bf::path path = kSmokePackagesDirectory / "SharedRes30Delta.wgt";
+  bf::path delta_package = kSmokePackagesDirectory / "SharedRes30Delta.delta";
+  std::string pkgid = "smokeSh3De";
+  std::string appid = "smokeSh3De.SharedRes30Delta";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
+  // Check delta modifications
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-2"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT-2"));  // NOLINT
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-1"));  // NOLINT
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "SHARED-WGT-1"));  // NOLINT
+}
+
+TEST_F(HybridSmokeTest, SharedRes30Hybrid) {
+  bf::path path = kSmokePackagesDirectory / "SharedRes30Hybrid.wgt";
+  std::string pkgid = "smokeSh3Hy";
+  std::string appid1 = "smokeSh3Hy.SharedRes30Hybrid";
+  std::string appid2 = "sharedres30hybridserivce";
+  ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2}, params));
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-TPK"));  // NOLINT
+}
+
+TEST_F(HybridSmokeTest, SharedRes30HybridDelta) {
+  bf::path path = kSmokePackagesDirectory / "SharedRes30HybridDelta.wgt";
+  bf::path delta_package = kSmokePackagesDirectory /
+      "SharedRes30HybridDelta.delta";
+  std::string pkgid = "smokeSh3HD";
+  std::string appid1 = "smokeSh3HD.SharedRes30HybridDelta";
+  std::string appid2 = "sharedres30hybriddeltaserivce";
+  ASSERT_EQ(backend.InstallSuccess(path), ci::AppInstaller::Result::OK);
+  ASSERT_EQ(backend.Install(delta_package), ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidatePackage(pkgid, {appid1, appid2}, params));
+  // Check delta modifications
+  bf::path root_path = ci::GetRootAppPath(false, params.test_user.uid);
+  ASSERT_TRUE(bf::is_symlink(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-2"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-WGT-2"));  // NOLINT
+  ASSERT_TRUE(bf::is_regular_file(root_path / pkgid / "shared" / "res" / "SHARED-TPK-2"));  // NOLINT
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "res" / "wgt" / "shared" / "res" / "SHARED-WGT-1"));  // NOLINT
+  ASSERT_FALSE(bf::exists(root_path / pkgid / "shared" / "res" / "SHARED-WGT-1"));  // NOLINT
+}
+
+TEST_F(SmokeTest, InstallExtendedMode) {
+  ASSERT_TRUE(CheckAvailableExtendedPath());
+  bf::path path = kSmokePackagesDirectory / "InstallExtendedMode.wgt";
+  std::string pkgid = "smokewgt44";
+  std::string appid = "smokewgt44.web";
+  ASSERT_EQ(backend.InstallWithStorage(path, StorageType::EXTENDED),
+      ci::AppInstaller::Result::OK);
+  ASSERT_TRUE(ValidateExtendedPackage(pkgid, {appid}, params));
+}
+
+}  // namespace smoke_test
+
+int main(int argc,  char** argv) {
+  try {
+    ci::RequestMode request_mode = st::ParseRequestMode(argc, argv);
+    if (getuid() != 0 || request_mode != ci::RequestMode::GLOBAL) {
+      std::cout << "Skip tests for preload request" << std::endl;
+      ::testing::GTEST_FLAG(filter) = "SmokeTest.*";
+    }
+    testing::InitGoogleTest(&argc, argv);
+    ::env = static_cast<smoke_test::SmokeEnvironment*>(
+        testing::AddGlobalTestEnvironment(
+            new smoke_test::SmokeEnvironment(request_mode)));
+    signal(SIGINT, ::signalHandler);
+    signal(SIGSEGV, ::signalHandler);
+    return RUN_ALL_TESTS();
+  } catch (...) {
+    std::cout << "Exception occurred during testing" << std::endl;
+    return 1;
+  }
+}
diff --git a/src/unit_tests/smoke_test_helper.cc b/src/unit_tests/smoke_test_helper.cc
new file mode 100644 (file)
index 0000000..d767cdb
--- /dev/null
@@ -0,0 +1,59 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <common/pkgmgr_interface.h>
+#include <cerrno>
+
+#include "wgt/wgt_app_query_interface.h"
+#include "wgt/wgt_installer.h"
+
+namespace ci = common_installer;
+
+namespace {
+
+class StepCrash : public ci::Step {
+ public:
+  using Step::Step;
+
+  ci::Step::Status process() override {
+    raise(SIGSEGV);
+    return Status::OK;
+  }
+  ci::Step::Status clean() override { return ci::Step::Status::OK; }
+  ci::Step::Status undo() override { return ci::Step::Status::OK; }
+  ci::Step::Status precheck() override { return ci::Step::Status::OK; }
+
+  STEP_NAME(Crash)
+};
+
+}  // namespace
+
+// this main of test binay in done purely for recovery smoke test.
+int main(int argc, char** argv) {
+  int index = -1;
+  int backend_argc = argc;
+  if (!strcmp(argv[argc-2], "-idx")) {
+    index = atoi(argv[argc-1]);
+    backend_argc = argc - 2;
+    LOG(DEBUG) << "Step crash after " << index << " step.";
+  }
+
+  ci::PkgmgrInstaller pkgmgr_installer;
+  wgt::WgtAppQueryInterface query_interface;
+  auto pkgmgr = ci::PkgMgrInterface::Create(backend_argc, argv,
+      &pkgmgr_installer, &query_interface);
+  if (!pkgmgr) {
+    LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
+    return EINVAL;
+  }
+
+  wgt::WgtInstaller installer(pkgmgr);
+  if (index != -1) {
+    installer.AddStepAtIndex<StepCrash>(index);
+  } else {
+    installer.AddStep<StepCrash>();
+  }
+  return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
+}
+
diff --git a/src/unit_tests/smoke_utils.cc b/src/unit_tests/smoke_utils.cc
new file mode 100644 (file)
index 0000000..817cdbc
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include <unit_tests/common/smoke_utils.h>
+
+#include <string>
+#include <vector>
+#include <utility>
+
+#include "wgt/wgt_installer.h"
+#include "hybrid/hybrid_installer.h"
+
+#include "unit_tests/smoke_utils.h"
+
+namespace ci = common_installer;
+namespace st = smoke_test;
+
+namespace smoke_test {
+
+const bf::path kSmokePackagesDirectory =
+    "/usr/share/wgt-backend-ut/test_samples/smoke/";
+
+bool ValidatePackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidatePackage(pkgid, apps, params);
+}
+
+bool ValidateExternalPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidateExternalPackage(pkgid, apps, params);
+}
+
+bool ValidateExtendedPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params) {
+  Apps apps;
+  for (const auto& appid : appids) {
+    apps.push_back(std::make_pair(appid, appid));
+  }
+  return ValidateExtendedPackage(pkgid, apps, params);
+}
+
+WgtBackendInterface::AppQueryInterfacePtr
+WgtBackendInterface::CreateQueryInterface() const {
+  return AppQueryInterfacePtr(new wgt::WgtAppQueryInterface());
+}
+
+WgtBackendInterface::AppInstallerPtr
+WgtBackendInterface::CreateInstaller(ci::PkgMgrPtr pkgmgr) const {
+  return AppInstallerPtr(new wgt::WgtInstaller(pkgmgr));
+}
+
+WgtBackendInterface::AppQueryInterfacePtr
+HybridBackendInterface::CreateQueryInterface() const {
+  return AppQueryInterfacePtr(new wgt::WgtAppQueryInterface());
+}
+
+WgtBackendInterface::AppInstallerPtr
+HybridBackendInterface::CreateInstaller(ci::PkgMgrPtr pkgmgr) const {
+  return AppInstallerPtr(new hybrid::HybridInstaller(pkgmgr));
+}
+
+}  // namespace smoke_test
diff --git a/src/unit_tests/smoke_utils.h b/src/unit_tests/smoke_utils.h
new file mode 100644 (file)
index 0000000..e6ecbae
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef UNIT_TESTS_SMOKE_UTILS_H_
+#define UNIT_TESTS_SMOKE_UTILS_H_
+
+#include <common/pkgmgr_interface.h>
+#include <common/app_installer.h>
+#include <unit_tests/common/smoke_utils.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "wgt/wgt_app_query_interface.h"
+
+namespace smoke_test {
+
+bool ValidatePackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
+bool ValidateExternalPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
+bool ValidateExtendedPackage(const std::string& pkgid,
+    const std::vector<std::string>& appids,
+    const TestParameters& params);
+
+extern const bf::path kSmokePackagesDirectory;
+
+class WgtBackendInterface: public BackendInterface {
+ public:
+  using BackendInterface::BackendInterface;
+
+ private:
+  AppQueryInterfacePtr CreateQueryInterface() const override;
+  AppInstallerPtr CreateInstaller(
+      common_installer::PkgMgrPtr pkgmgr) const override;
+};
+
+class HybridBackendInterface: public BackendInterface {
+ public:
+  using BackendInterface::BackendInterface;
+
+ private:
+  AppQueryInterfacePtr CreateQueryInterface() const override;
+  AppInstallerPtr CreateInstaller(
+      common_installer::PkgMgrPtr pkgmgr) const override;
+};
+
+}  // namespace smoke_test
+
+
+#endif  // UNIT_TESTS_SMOKE_UTILS_H_
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingMIME/config.xml
new file mode 100644 (file)
index 0000000..a0f5c94
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:app-control>
+    <tizen:src name="edit.html"/>
+    <tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
+    <tizen:uri name="myapp"/>
+  </tizen:app-control>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingOperation/config.xml
new file mode 100644 (file)
index 0000000..6e9f364
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:app-control>
+    <tizen:src name="edit.html"/>
+    <tizen:mime name="image/jpg" />
+    <tizen:uri name="myapp"/>
+  </tizen:app-control>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingSrc/config.xml
new file mode 100644 (file)
index 0000000..4aa7ace
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:app-control>
+    <tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
+    <tizen:mime name="image/jpg" />
+    <tizen:uri name="myapp"/>
+  </tizen:app-control>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_MissingURI/config.xml
new file mode 100644 (file)
index 0000000..8101514
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:app-control>
+    <tizen:src name="edit.html"/>
+    <tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
+    <tizen:mime name="image/jpg" />
+  </tizen:app-control>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppControlElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..cdbd2eb
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:app-control>
+    <tizen:src name="edit.html"/>
+    <tizen:operation name="http://tizen.org/appcontrol/operation/edit"/>
+    <tizen:mime name="image/jpg" />
+    <tizen:uri name="myapp"/>
+  </tizen:app-control>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_InvalidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_InvalidName/config.xml
new file mode 100644 (file)
index 0000000..d5aaa70
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name=""/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoURI/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_NoURI/config.xml
new file mode 100644 (file)
index 0000000..d824f8d
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="package0id/appdefined/test.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_OverLength/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_Invalid_OverLength/config.xml
new file mode 100644 (file)
index 0000000..79a8bec
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/longnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ManyElements/config.xml
new file mode 100644 (file)
index 0000000..97cdcc1
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.read"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.write"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_MissingName/config.xml
new file mode 100644 (file)
index 0000000..3dc4f44
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_ValidName/config.xml
new file mode 100644 (file)
index 0000000..00611d1
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseManyElements/config.xml
new file mode 100644 (file)
index 0000000..270313a
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.read" license="res/cert"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.write" license="res/cert"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.AppDefinedPrivilegeElement_WithLicenseValidName/config.xml
new file mode 100644 (file)
index 0000000..536dca6
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:appdefined-privilege name="http://package0id/appdefined/test.read" license="res/cert"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidAppId/config.xml
new file mode 100644 (file)
index 0000000..e0a53e1
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id123.appidinvalid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidPackage/config.xml
new file mode 100644 (file)
index 0000000..671c8e0
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0idinvalid" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_InvalidVersion/config.xml
new file mode 100644 (file)
index 0000000..0edbe47
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="Invalid"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ManyElements/config.xml
new file mode 100644 (file)
index 0000000..c4cd426
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingAppId/config.xml
new file mode 100644 (file)
index 0000000..80a23d3
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingPackage/config.xml
new file mode 100644 (file)
index 0000000..2e8076c
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_MissingVersion/config.xml
new file mode 100644 (file)
index 0000000..8e328b7
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidAppId/config.xml
new file mode 100644 (file)
index 0000000..14d024a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidPackage/config.xml
new file mode 100644 (file)
index 0000000..14d024a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ApplicationElement_ValidVersion/config.xml
new file mode 100644 (file)
index 0000000..14d024a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MissingName/config.xml
new file mode 100644 (file)
index 0000000..698d3fd
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:category />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_MultipleElements/config.xml
new file mode 100644 (file)
index 0000000..5e2a900
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:category name="http://tizen.org/category/category_0" />
+  <tizen:category name="http://tizen.org/category/category_1" />
+  <tizen:category name="http://tizen.org/category/category_2" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.CategoryElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..55de5ee
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:category name="http://tizen.org/category/wearable_clock" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_DuplicateKey/config.xml
new file mode 100644 (file)
index 0000000..5cafe7e
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:metadata key="key1" value="key1value"/>
+  <tizen:metadata key="key2" value="key2value"/>
+  <tizen:metadata key="key1" value="key3value"/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingKey/config.xml
new file mode 100644 (file)
index 0000000..66bbf64
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:metadata/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_MissingValue/config.xml
new file mode 100644 (file)
index 0000000..9f21ae3
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:metadata key="key1"/>
+  <tizen:metadata key="key2"/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.MetadataElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..353cfc3
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:metadata key="key1"/>
+  <tizen:metadata key="key2" value="value2"/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_InvalidName/config.xml
new file mode 100644 (file)
index 0000000..6fb0b33
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:privilege name=""/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ManyElements/config.xml
new file mode 100644 (file)
index 0000000..94fbcc1
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+  <tizen:privilege name="http://tizen.org/privilege/application.close"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_MissingName/config.xml
new file mode 100644 (file)
index 0000000..a9defae
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:privilege/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.PrivilegeElement_ValidName/config.xml
new file mode 100644 (file)
index 0000000..f4ff663
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_InvalidName/config.xml
new file mode 100644 (file)
index 0000000..948de8c
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name=""/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoPKGID/config.xml
new file mode 100644 (file)
index 0000000..1fce6a4
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package1id/appdefined/test.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_NoURI/config.xml
new file mode 100644 (file)
index 0000000..cfdfa4a
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="package0id/appdefined/test.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_Invalid_OverLength/config.xml
new file mode 100644 (file)
index 0000000..8897072
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/longnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ManyElements/config.xml
new file mode 100644 (file)
index 0000000..9eecba2
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.read"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.write"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_MissingName/config.xml
new file mode 100644 (file)
index 0000000..1be2518
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_ValidName/config.xml
new file mode 100644 (file)
index 0000000..64572e9
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.read"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseManyElements/config.xml
new file mode 100644 (file)
index 0000000..ad2ce75
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.read" license="res/cert"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.write" license="res/cert"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.ProvidesAppDefinedPrivilegeElement_WithLicenseValidName/config.xml
new file mode 100644 (file)
index 0000000..7985282
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:provides-appdefined-privilege name="http://package0id/appdefined/test.read" license="res/cert"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportDisabled/config.xml
new file mode 100644 (file)
index 0000000..ef25267
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="disable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+  
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundSupportEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationDisabled/config.xml
new file mode 100644 (file)
index 0000000..421c7b1
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="disable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_BackgroundVibrationEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuDisabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_ContextMenuEnabled/config.xml
new file mode 100644 (file)
index 0000000..1f688a2
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="enable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionDisabled/config.xml
new file mode 100644 (file)
index 0000000..441d232
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="disable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_EncryptionEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyDisabled/config.xml
new file mode 100644 (file)
index 0000000..3b10bc5
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="disable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_HwKeyEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundSupport/config.xml
new file mode 100644 (file)
index 0000000..ed8fc2a
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingBackgroundVibration/config.xml
new file mode 100644 (file)
index 0000000..798ae31
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingContextMenu/config.xml
new file mode 100644 (file)
index 0000000..bd72968
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingEncryption/config.xml
new file mode 100644 (file)
index 0000000..699bdcd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingHwKeyEvent/config.xml
new file mode 100644 (file)
index 0000000..5ec89c9
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingInstallLocation/config.xml
new file mode 100644 (file)
index 0000000..523fde8
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_MissingScreenOrientation/config.xml
new file mode 100644 (file)
index 0000000..b2b92f3
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportDisabled/config.xml
new file mode 100644 (file)
index 0000000..ef25267
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="disable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+  
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundSupportEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationDisabled/config.xml
new file mode 100644 (file)
index 0000000..421c7b1
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="disable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_BackgroundVibrationEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuDisabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_ContextMenuEnabled/config.xml
new file mode 100644 (file)
index 0000000..1f688a2
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="enable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionDisabled/config.xml
new file mode 100644 (file)
index 0000000..441d232
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="disable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_EncryptionEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyDisabled/config.xml
new file mode 100644 (file)
index 0000000..3b10bc5
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="disable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_HwKeyEnabled/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundSupport/config.xml
new file mode 100644 (file)
index 0000000..ed8fc2a
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingBackgroundVibration/config.xml
new file mode 100644 (file)
index 0000000..798ae31
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingContextMenu/config.xml
new file mode 100644 (file)
index 0000000..bd72968
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingEncryption/config.xml
new file mode 100644 (file)
index 0000000..699bdcd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingHwKeyEvent/config.xml
new file mode 100644 (file)
index 0000000..5ec89c9
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingInstallLocation/config.xml
new file mode 100644 (file)
index 0000000..523fde8
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_MissingScreenOrientation/config.xml
new file mode 100644 (file)
index 0000000..b2b92f3
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.SettingsElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..90a4aea
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+  <tizen:setting background-support="enable" />
+  <tizen:setting context-menu="disable" />
+  <tizen:setting encryption="enable" />
+  <tizen:setting screen-orientation="landscape" />
+  <tizen:setting install-location="internal-only" />
+  <tizen:setting hwkey-event="enable" />
+  <tizen:setting background-vibration="enable" />
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_InvalidNamespace/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_InvalidNamespace/config.xml
new file mode 100644 (file)
index 0000000..d4c2eef
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets/invalid" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_ManyNamespaces/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_ManyNamespaces/config.xml
new file mode 100644 (file)
index 0000000..0e1033a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets/invalid" xmlns:tizen="http://tizen.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_MissingNamespace/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_MissingNamespace/config.xml
new file mode 100644 (file)
index 0000000..862d3cb
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_Valid/config.xml b/src/unit_tests/test_samples/manifest/ManifestTest.WidgetElement_Valid/config.xml
new file mode 100644 (file)
index 0000000..14d024a
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets">
+  <tizen:application id="package0id.appid" package="package0id" required_version="3.0"/>
+</widget>
diff --git a/src/unit_tests/test_samples/smoke/DeinstallationMode.wgt b/src/unit_tests/test_samples/smoke/DeinstallationMode.wgt
new file mode 100644 (file)
index 0000000..fa15fe2
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeinstallationMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeinstallationMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/DeinstallationMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..0dbd80c
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeinstallationMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeinstallationMode_Preload.wgt b/src/unit_tests/test_samples/smoke/DeinstallationMode_Preload.wgt
new file mode 100644 (file)
index 0000000..cb80036
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeinstallationMode_Preload.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode.delta b/src/unit_tests/test_samples/smoke/DeltaMode.delta
new file mode 100644 (file)
index 0000000..2f6b058
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode.delta differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode.wgt b/src/unit_tests/test_samples/smoke/DeltaMode.wgt
new file mode 100644 (file)
index 0000000..c5a9db9
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_2.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_2.wgt
new file mode 100644 (file)
index 0000000..dfdf31d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.delta b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.delta
new file mode 100644 (file)
index 0000000..d80a2db
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.delta differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..870bd56
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..86edcec
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.delta b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.delta
new file mode 100644 (file)
index 0000000..3ecf982
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.delta differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..1c7fce3
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_2.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_2.wgt
new file mode 100644 (file)
index 0000000..627529b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.delta b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.delta
new file mode 100644 (file)
index 0000000..b5f7a9a
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.delta differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..0811e57
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..884f97d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DeltaMode_Rollback_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/DisablePkg.wgt b/src/unit_tests/test_samples/smoke/DisablePkg.wgt
new file mode 100644 (file)
index 0000000..e2281eb
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/DisablePkg.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/EnablePkg.wgt b/src/unit_tests/test_samples/smoke/EnablePkg.wgt
new file mode 100644 (file)
index 0000000..b5abc2a
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/EnablePkg.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt b/src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt
new file mode 100644 (file)
index 0000000..677b337
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallExtendedMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallExternalMode.wgt b/src/unit_tests/test_samples/smoke/InstallExternalMode.wgt
new file mode 100644 (file)
index 0000000..c5f50b3
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallExternalMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode.wgt b/src/unit_tests/test_samples/smoke/InstallationMode.wgt
new file mode 100644 (file)
index 0000000..6baa0b9
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_GoodSignature.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_GoodSignature.wgt
new file mode 100644 (file)
index 0000000..f777def
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_GoodSignature.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..633347a
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_Preload.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_Preload.wgt
new file mode 100644 (file)
index 0000000..086e074
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_Preload.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..c063f73
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..2850a89
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/InstallationMode_WrongSignature.wgt b/src/unit_tests/test_samples/smoke/InstallationMode_WrongSignature.wgt
new file mode 100644 (file)
index 0000000..28e3862
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/InstallationMode_WrongSignature.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/bin/smokewgt40.ManifestDirectInstallMode b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/bin/smokewgt40.ManifestDirectInstallMode
new file mode 100644 (file)
index 0000000..c038e83
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/bin/smokewgt40.ManifestDirectInstallMode differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/LICENSE.APLv2 b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/NOTICE b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/NOTICE
new file mode 100644 (file)
index 0000000..1c1a4d0
--- /dev/null
@@ -0,0 +1,3 @@
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License, Version 2 terms and conditions.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/author-signature.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/author-signature.xml
new file mode 100644 (file)
index 0000000..d26eeaf
--- /dev/null
@@ -0,0 +1,86 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="AuthorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="LICENSE.APLv2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>z8d0m5b2O9McPEK1xHG/dWgUBT6EfBDz6wA0F7xSPTA=</DigestValue>
+</Reference>
+<Reference URI="NOTICE">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>ijjaB8GEO5OJP/jK6n7Hr3vZFI9gy8ocoDhviViKNnU=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>D77P2OH9hj+3BeuzXRjd5kkSP4H9bK3f2COPhdsWtEE=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>f7q5O05HNVS6mBDhCOBPBMFo6OA2iSqQVOf9aMoKPhs=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>pw+EAHkfej6NPKau0RrL0ZIVHj1Q0QJxUlUMBCFRIFU=</DigestValue>
+</Reference>
+<Reference URI="js%2Fapp.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>mCAANytlgxQx/1c82dNNjO4QUPgqRMkzu2b1sbBLPk8=</DigestValue>
+</Reference>
+<Reference URI="version.txt">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>9eXJU0UyhA/NRbsALmnthcYduidTRQ4mtEi33xSB4k0=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+Gqm9cp1feyu5Pb/XFuVF5YNufXLznoJyAfPk6va995dLcsqLwPOPXx7eqxOJVI0wBTTfSblbhb0X
+DLnI2NHasWwyMRgLSce9YhxarDTz4FvYaSR4xOaVJTByyGtZ40G9RkIQes30LdaZ42sEm0Tqat+a
+7Yz+Di4a1dFvGdHMKDo=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIICnDCCAYSgAwIBAgIGAVvS9uY8MA0GCSqGSIb3DQEBBQUAMFYxGjAYBgNVBAoMEVRpemVuIEFz
+c29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4gRGV2
+ZWxvcGVycyBDQTAeFw0xMjExMDEwMDAwMDBaFw0xOTAxMDEwMDAwMDBaMBgxFjAUBgNVBAMMDUFw
+cF9pbnN0YWxsZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIKgQLsl5UIJdfdaDXbY+aQ6
+VHjwTPv5+aUlF1l6G9SDZ7tmJTCO1yAudmMr6vEN+ZL/bbOEAlyhkJPTmntPesO1h/WzjIlpFzTO
+UcHlEXAu1vZGTnPBoYTutBeVmbH9JY/dCSm2xFSioKaWHl+uMn0SB1DcvgIVSs4DkvO0F1+TAgMB
+AAGjMjAwMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMA0G
+CSqGSIb3DQEBBQUAA4IBAQBwNrj9b7/g4JI9K3wohRLHW5IpxOwBO9gUlkotSUNaiAvNwsQfB5pE
+k+rTUa4Nwxcq6rFfne1brXP1vbl/bVGW/WJqV6dF3BL1QfwGif0vvcO1Sz2QOpoc/Jtt8zlmsRne
+TIEMph6kDUT1oNUlTCGnxD24WagRxuGUe/RZ6L4y+6T8L+fBDtMyyM+GytqE72V+0KeyITJMTdzM
+wRMjN3XccXemcox73isLxSXlgwrFbotkTyYPTFphiZCRU7BlA3EClIk+3To0b3irROY/iIlg6ZyY
+gNbND9/aIJxqPqCghW7PMjGH/9KK2mtNhtJSFrIAvvUiW/fMrNj1opsAHGgJ
+</X509Certificate>
+<X509Certificate>
+MIIDOTCCAiGgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMRowGAYDVQQKDBFUaXplbiBBc3NvY2lh
+dGlvbjEaMBgGA1UECwwRVGl6ZW4gQXNzb2NpYXRpb24xHjAcBgNVBAMMFVRpemVuIERldmVsb3Bl
+cnMgUm9vdDAeFw0xMjAxMDEwMDAwMDBaFw0yNzAxMDEwMDAwMDBaMFYxGjAYBgNVBAoMEVRpemVu
+IEFzc29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4g
+RGV2ZWxvcGVycyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANVGhRGmMIUyBA7o
+PCz8Sxut6z6HNkF4oDIuzuKaMzRYPeWodwe9O0gmqAkToQHfwg2giRhE5GoPld0fq+OYMMwSasCu
+g8dwODx1eDeSYVuOLWRxpAmbTXOsSFi6VoWeyaPEm18JBHvZBsU5YQtgZ6Kp7MqzvQg3pXOxtajj
+vyHxiatJl+xXrHgcXC1wgyG3buty7u/Fi2mvKXJ0PRJcCjjK81dqe/Vr20sRUCrbk02zbm5ggFt/
+jIEhV8wbFRQpliobc7J4dSTKhFfrqGM8rdd54LYhD7gSI1CFSe16pUXfcVR7FhJztRaiGLnCrwBE
+dyTZ248+D4L/qR/D0axb3jcCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC
+AQEAnOXXQ/1O/QTDHyrmQDtFziqPY3xWlJBqJtEqXiT7Y+Ljpe66e+Ee/OjQMlZe8gu21/8cKklH
+95RxjopMWCVedXDUbWdvS2+CdyvVW/quT2E0tjqIzXDekUTYwwhlPWlGxvfj3VsxqSFq3p8Brl04
+1Gx5RKAGyKVsMfTLhbbwSWwApuBUxYfcNpKwLWGPXkysu+HctY03OKv4/xKBnVWiN8ex/Sgesi0M
++OBAOMdZMPK32uJBTeKFx1xZgTLIhk45V0hPOomPjZloiv0LSS11eyd451ufjW0iHRE7WlpR6EvI
+W6TFyZgMpQq+kg4hWl2SBTf3s2VI8Ygz7gj8TMlClg==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#AuthorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#AuthorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-author"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#AuthorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/config.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/config.xml
new file mode 100644 (file)
index 0000000..061061d
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/Basic" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="smokewgt40.ManifestDirectInstallMode" package="smokewgt40" required_version="3.0"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>ManifestDirectInstallMode</name>
+    <tizen:profile name="mobile"/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/css/style.css b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/css/style.css
new file mode 100644 (file)
index 0000000..a1775c1
--- /dev/null
@@ -0,0 +1,26 @@
+html, body {
+    width: 100%;
+    height: 100%;
+    margin: 0 auto;
+    padding: 0;
+}
+
+#container {
+    width: 100%;
+    height: 100%;
+    display: table;
+}
+
+#contents {
+    display: table-cell;
+    text-align: center;
+    vertical-align: middle;
+    background-color:#aaaaff;
+    -webkit-tap-highlight-color: transparent;
+}
+
+#content_text {
+    font-weight: bold;
+    font-size: 5em;
+    color: #ffffff;
+}
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/icon.png b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/icon.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/icon.png differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/index.html b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/index.html
new file mode 100644 (file)
index 0000000..1553bfd
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+    <title>Hello Tizen</title>
+    <link rel="stylesheet" href="css/style.css">
+</head>
+
+<body>
+    <div id="container">
+        <div id="contents">
+            <span id="content-text">Hello Tizen</span>
+        </div>
+    </div>
+
+    <script src="js/app.js"></script>
+</body>
+</html>
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/js/app.js b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/js/app.js
new file mode 100644 (file)
index 0000000..6fe9d9e
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function() {
+    /**
+     * Handles the hardware key event.
+     * @private
+     * @param {Object} event - The hardware key event object
+     */
+    function keyEventHandler(event) {
+        if (event.keyName === "back") {
+            try {
+                // If the back key is pressed, exit the application.
+                tizen.application.getCurrentApplication().exit();
+            } catch (ignore) {}
+        }
+    }
+
+    /**
+     * Initializes the application.
+     * @private
+     */
+    function init() {
+        var textbox = document.querySelector("#contents");
+
+        // Add hardware event listener
+        document.addEventListener("tizenhwkey", keyEventHandler);
+
+        // Add click event listener
+        textbox.addEventListener("click", function() {
+            var box = document.querySelector("#content-text");
+
+            if (box.innerHTML === "Hello Tizen") {
+                // If the text in box is "Hello Tizen", change it to "Hi WebApp"
+                box.innerHTML = "Hi WebApp";
+            } else {
+                // If the text in box is not "Hello Tizen", change it to "Hello Tizen"
+                box.innerHTML = "Hello Tizen";
+            }
+        });
+    }
+
+    // The function "init" will be executed after the application successfully loaded.
+    window.onload = init;
+}());
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/signature1.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/signature1.xml
new file mode 100644 (file)
index 0000000..e8ef7b8
--- /dev/null
@@ -0,0 +1,88 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="DistributorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="LICENSE.APLv2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>z8d0m5b2O9McPEK1xHG/dWgUBT6EfBDz6wA0F7xSPTA=</DigestValue>
+</Reference>
+<Reference URI="NOTICE">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>ijjaB8GEO5OJP/jK6n7Hr3vZFI9gy8ocoDhviViKNnU=</DigestValue>
+</Reference>
+<Reference URI="author-signature.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>leQv/rgXPAEhwQ84QN6OuE4aUf0vawVd4fx2GCvH6nI=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>D77P2OH9hj+3BeuzXRjd5kkSP4H9bK3f2COPhdsWtEE=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>f7q5O05HNVS6mBDhCOBPBMFo6OA2iSqQVOf9aMoKPhs=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>pw+EAHkfej6NPKau0RrL0ZIVHj1Q0QJxUlUMBCFRIFU=</DigestValue>
+</Reference>
+<Reference URI="js%2Fapp.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>mCAANytlgxQx/1c82dNNjO4QUPgqRMkzu2b1sbBLPk8=</DigestValue>
+</Reference>
+<Reference URI="version.txt">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>9eXJU0UyhA/NRbsALmnthcYduidTRQ4mtEi33xSB4k0=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+mj0i35KMm0SDEzc8LflluEAXvKWqARc9GJlAZfNHKbJzB5P4yvNwYwgkH1hO2qtJB3H9WRH2LJo9
+McDywe8hr7Tu1rb6znAa0y2q3ZKcc3PUubQbcayv6mL6kZuFAg8bfZDP4nOCIltu2TtdeKRGrcQb
+XU4ivseIgptrDc21fNQ=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIICnTCCAgYCCQDE9MbMmJ/yCzANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCS1IxDjAMBgNV
+BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE
+CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTElMCMGA1UEAwwcVGl6ZW4gUGFydG5lciBEaXN0
+cmlidXRvciBDQTAeFw0xMjEwMjcwNzQ4MzNaFw0yMjEwMjUwNzQ4MzNaMIGUMQswCQYDVQQGEwJL
+UjEOMAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENB
+MSIwIAYDVQQLDBlUaXplbiBEaXN0cmlidXRvciBUZXN0IENBMSkwJwYDVQQDDCBUaXplbiBQYXJ0
+bmVyIERpc3RyaWJ1dG9yIFNpZ25lcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAy9mg2x4B
+zxlK3LJL81GsLq/pJfK1evdCKG/IOBpdoRO0rLhYnsL5+KvToPFa5g9GTZo32LikpW1NZ7++3EHE
+fnO2IGLUau4kquvhmz1LNg5xBTx7IbucmwLMRGo1BPGdsAQQLyXeQKJ5PCERmVg4MIoiL2zT/JsL
+sZ9UPT6GEB8CAwEAATANBgkqhkiG9w0BAQUFAAOBgQAw5xPBFR1XKuZ8QpsCtSE0zXVHvwIa+Ha4
+YBdRtGwEoZmiKGZV/wAhPRdmR0kISkTz20kIGz/ZwRZCVGhsr5hkkpFknYlKeKkEJ/tJfZl4D7ec
+GFAnynOzlWZqSIPz+yxX8ah9E6lTv4Vs9DhNb08nxVvxLqlpyVdk9RUsCx/yIA==
+</X509Certificate>
+<X509Certificate>
+MIICtTCCAh6gAwIBAgIJAKORBcIiXygIMA0GCSqGSIb3DQEBBQUAMIGVMQswCQYDVQQGEwJLUjEO
+MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSIw
+IAYDVQQLDBlUaXplbiBEaXN0cmlidXRvciBUZXN0IENBMSowKAYDVQQDDCFUaXplbiBQYXJ0bmVy
+IERpc3RyaWJ1dG9yIFJvb3QgQ0EwHhcNMTIxMDI3MDc0NTIwWhcNMjIxMDI1MDc0NTIwWjCBkDEL
+MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6
+ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTElMCMGA1UEAwwc
+VGl6ZW4gUGFydG5lciBEaXN0cmlidXRvciBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+2ZQrdEowjqxUmB8FX8ej19VKY6jGHKNIRE5wrhBkuZ1b0FLRPiN3/Cl9wMkCnyJui4QhC28g1aBg
+w/JnaObcDqW1NgFVH3006+gZvCTDlw1nIEjvZa6P+uWOOi05xPPAE0feKPkO1POnOjnapfkkEVNU
+8TXsLbLYBylWT8rxZC8CAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBJ
+yJ7p6qs0JI+1iKOk/sYWVP6dMueY72qOc/wVj5c3ejOlgJNNXDMAQ14QcRRexffc68ipTwybU/3m
+tcNwydzKJe+GFa4b2zyKOvOgrfs4MKSR0T9XEPmTKeR+NDT2CbA6/kQoRYm0fSORzD2UXJzNZWe/
+WjwSA66hv4q+0QZQFQ==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#DistributorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#DistributorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-distributor"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#DistributorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/version.txt b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/res/wgt/version.txt
new file mode 100644 (file)
index 0000000..21e8796
--- /dev/null
@@ -0,0 +1 @@
+1.0.3
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/shared/res/smokewgt40.ManifestDirectInstallMode.png b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/shared/res/smokewgt40.ManifestDirectInstallMode.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/shared/res/smokewgt40.ManifestDirectInstallMode.png differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/tmp/sth b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode/smokewgt40/tmp/sth
new file mode 100644 (file)
index 0000000..a3cc0b5
--- /dev/null
@@ -0,0 +1 @@
+Needed, because empty directories are skipped when copying, and directory structure will be invalid.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/author-signature.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/author-signature.xml
new file mode 100644 (file)
index 0000000..84c3f89
--- /dev/null
@@ -0,0 +1,102 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="AuthorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="bin%2Fservice2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>RnPKffWQVeWGu6c85RAZ2ok7U2TSjUwneF+3BwbY/q0=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>TwwCzhdio1vGkQ6raK/ABUQH0YKx0TPrVEoOgwCuLkU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2FLICENSE.APLv2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>z8d0m5b2O9McPEK1xHG/dWgUBT6EfBDz6wA0F7xSPTA=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2FNOTICE">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>ijjaB8GEO5OJP/jK6n7Hr3vZFI9gy8ocoDhviViKNnU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fconfig.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>gzrsgCaAh6OG7sGSP2wiAI/eD61S687+NuTnSqwLylc=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fcss%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>f7q5O05HNVS6mBDhCOBPBMFo6OA2iSqQVOf9aMoKPhs=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Ficon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Findex.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>pw+EAHkfej6NPKau0RrL0ZIVHj1Q0QJxUlUMBCFRIFU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fjs%2Fapp.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>mCAANytlgxQx/1c82dNNjO4QUPgqRMkzu2b1sbBLPk8=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fversion.txt">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>9eXJU0UyhA/NRbsALmnthcYduidTRQ4mtEi33xSB4k0=</DigestValue>
+</Reference>
+<Reference URI="shared%2Fres%2Fservice2.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="tizen-manifest.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Tg/KmHRmoo0F+PrxTKOEcKJWfr7PF+jEJ5y2Y3uTiqo=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+O/O7XzUC18XJpjl0YUHdOmaeSjYzVkGBL5/kQhLhgZqaXshdpYi4XjN1R5H8dSoRlxMDorfqHa1E
+ntjHjvSBysVLJHX9+uE4vIfQKzsma4hfniqYwPO/yLwFhxMUS6mRKq+5yHBGzvL9uKmMArVRMiqC
+tLRAkjQu+ZBZeNUUYzM=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIICnDCCAYSgAwIBAgIGAVvS9uY8MA0GCSqGSIb3DQEBBQUAMFYxGjAYBgNVBAoMEVRpemVuIEFz
+c29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4gRGV2
+ZWxvcGVycyBDQTAeFw0xMjExMDEwMDAwMDBaFw0xOTAxMDEwMDAwMDBaMBgxFjAUBgNVBAMMDUFw
+cF9pbnN0YWxsZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIKgQLsl5UIJdfdaDXbY+aQ6
+VHjwTPv5+aUlF1l6G9SDZ7tmJTCO1yAudmMr6vEN+ZL/bbOEAlyhkJPTmntPesO1h/WzjIlpFzTO
+UcHlEXAu1vZGTnPBoYTutBeVmbH9JY/dCSm2xFSioKaWHl+uMn0SB1DcvgIVSs4DkvO0F1+TAgMB
+AAGjMjAwMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMA0G
+CSqGSIb3DQEBBQUAA4IBAQBwNrj9b7/g4JI9K3wohRLHW5IpxOwBO9gUlkotSUNaiAvNwsQfB5pE
+k+rTUa4Nwxcq6rFfne1brXP1vbl/bVGW/WJqV6dF3BL1QfwGif0vvcO1Sz2QOpoc/Jtt8zlmsRne
+TIEMph6kDUT1oNUlTCGnxD24WagRxuGUe/RZ6L4y+6T8L+fBDtMyyM+GytqE72V+0KeyITJMTdzM
+wRMjN3XccXemcox73isLxSXlgwrFbotkTyYPTFphiZCRU7BlA3EClIk+3To0b3irROY/iIlg6ZyY
+gNbND9/aIJxqPqCghW7PMjGH/9KK2mtNhtJSFrIAvvUiW/fMrNj1opsAHGgJ
+</X509Certificate>
+<X509Certificate>
+MIIDOTCCAiGgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMRowGAYDVQQKDBFUaXplbiBBc3NvY2lh
+dGlvbjEaMBgGA1UECwwRVGl6ZW4gQXNzb2NpYXRpb24xHjAcBgNVBAMMFVRpemVuIERldmVsb3Bl
+cnMgUm9vdDAeFw0xMjAxMDEwMDAwMDBaFw0yNzAxMDEwMDAwMDBaMFYxGjAYBgNVBAoMEVRpemVu
+IEFzc29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4g
+RGV2ZWxvcGVycyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANVGhRGmMIUyBA7o
+PCz8Sxut6z6HNkF4oDIuzuKaMzRYPeWodwe9O0gmqAkToQHfwg2giRhE5GoPld0fq+OYMMwSasCu
+g8dwODx1eDeSYVuOLWRxpAmbTXOsSFi6VoWeyaPEm18JBHvZBsU5YQtgZ6Kp7MqzvQg3pXOxtajj
+vyHxiatJl+xXrHgcXC1wgyG3buty7u/Fi2mvKXJ0PRJcCjjK81dqe/Vr20sRUCrbk02zbm5ggFt/
+jIEhV8wbFRQpliobc7J4dSTKhFfrqGM8rdd54LYhD7gSI1CFSe16pUXfcVR7FhJztRaiGLnCrwBE
+dyTZ248+D4L/qR/D0axb3jcCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC
+AQEAnOXXQ/1O/QTDHyrmQDtFziqPY3xWlJBqJtEqXiT7Y+Ljpe66e+Ee/OjQMlZe8gu21/8cKklH
+95RxjopMWCVedXDUbWdvS2+CdyvVW/quT2E0tjqIzXDekUTYwwhlPWlGxvfj3VsxqSFq3p8Brl04
+1Gx5RKAGyKVsMfTLhbbwSWwApuBUxYfcNpKwLWGPXkysu+HctY03OKv4/xKBnVWiN8ex/Sgesi0M
++OBAOMdZMPK32uJBTeKFx1xZgTLIhk45V0hPOomPjZloiv0LSS11eyd451ufjW0iHRE7WlpR6EvI
+W6TFyZgMpQq+kg4hWl2SBTf3s2VI8Ygz7gj8TMlClg==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#AuthorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#AuthorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-author"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#AuthorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/service2 b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/service2
new file mode 100644 (file)
index 0000000..f1427f9
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/service2 differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/smokehyb12.ManifestDirectInstallModeHybrid b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/smokehyb12.ManifestDirectInstallModeHybrid
new file mode 100644 (file)
index 0000000..5f3adec
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/bin/smokehyb12.ManifestDirectInstallModeHybrid differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/config.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/config.xml
new file mode 100644 (file)
index 0000000..21d5e4f
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/Basic" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="smokehyb12.ManifestDirectInstallModeHybrid" package="smokehyb12" required_version="3.0"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>ManifestDirectInstallMode_Hybrid</name>
+    <tizen:profile name="mobile"/>
+</widget>
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/lib/sth.txt b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/lib/sth.txt
new file mode 100644 (file)
index 0000000..a3cc0b5
--- /dev/null
@@ -0,0 +1 @@
+Needed, because empty directories are skipped when copying, and directory structure will be invalid.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/LICENSE.APLv2 b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/NOTICE b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/NOTICE
new file mode 100644 (file)
index 0000000..1c1a4d0
--- /dev/null
@@ -0,0 +1,3 @@
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License, Version 2 terms and conditions.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/config.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/config.xml
new file mode 100644 (file)
index 0000000..4f8d925
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/Basic" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="smokehyb12.ManifestDirectInstallModeHybrid" package="smokehyb12" required_version="3.0"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>ManifestDirectInstallMode_Hybrid</name>
+    <tizen:profile name="mobile"/>
+</widget>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/css/style.css b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/css/style.css
new file mode 100644 (file)
index 0000000..a1775c1
--- /dev/null
@@ -0,0 +1,26 @@
+html, body {
+    width: 100%;
+    height: 100%;
+    margin: 0 auto;
+    padding: 0;
+}
+
+#container {
+    width: 100%;
+    height: 100%;
+    display: table;
+}
+
+#contents {
+    display: table-cell;
+    text-align: center;
+    vertical-align: middle;
+    background-color:#aaaaff;
+    -webkit-tap-highlight-color: transparent;
+}
+
+#content_text {
+    font-weight: bold;
+    font-size: 5em;
+    color: #ffffff;
+}
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/icon.png b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/icon.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/icon.png differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/index.html b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/index.html
new file mode 100644 (file)
index 0000000..1553bfd
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+    <title>Hello Tizen</title>
+    <link rel="stylesheet" href="css/style.css">
+</head>
+
+<body>
+    <div id="container">
+        <div id="contents">
+            <span id="content-text">Hello Tizen</span>
+        </div>
+    </div>
+
+    <script src="js/app.js"></script>
+</body>
+</html>
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/js/app.js b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/js/app.js
new file mode 100644 (file)
index 0000000..6fe9d9e
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+(function() {
+    /**
+     * Handles the hardware key event.
+     * @private
+     * @param {Object} event - The hardware key event object
+     */
+    function keyEventHandler(event) {
+        if (event.keyName === "back") {
+            try {
+                // If the back key is pressed, exit the application.
+                tizen.application.getCurrentApplication().exit();
+            } catch (ignore) {}
+        }
+    }
+
+    /**
+     * Initializes the application.
+     * @private
+     */
+    function init() {
+        var textbox = document.querySelector("#contents");
+
+        // Add hardware event listener
+        document.addEventListener("tizenhwkey", keyEventHandler);
+
+        // Add click event listener
+        textbox.addEventListener("click", function() {
+            var box = document.querySelector("#content-text");
+
+            if (box.innerHTML === "Hello Tizen") {
+                // If the text in box is "Hello Tizen", change it to "Hi WebApp"
+                box.innerHTML = "Hi WebApp";
+            } else {
+                // If the text in box is not "Hello Tizen", change it to "Hello Tizen"
+                box.innerHTML = "Hello Tizen";
+            }
+        });
+    }
+
+    // The function "init" will be executed after the application successfully loaded.
+    window.onload = init;
+}());
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/version.txt b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/res/wgt/version.txt
new file mode 100644 (file)
index 0000000..21e8796
--- /dev/null
@@ -0,0 +1 @@
+1.0.3
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/service2.png b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/service2.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/service2.png differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/smokehyb12.ManifestDirectInstallModeHybrid.png b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/smokehyb12.ManifestDirectInstallModeHybrid.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/shared/res/smokehyb12.ManifestDirectInstallModeHybrid.png differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/signature1.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/signature1.xml
new file mode 100644 (file)
index 0000000..1c7171f
--- /dev/null
@@ -0,0 +1,104 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="DistributorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="author-signature.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>EqT9TFwwEUqOae+jSUwl+1QGX3DSuLgjkeXUJh5pECo=</DigestValue>
+</Reference>
+<Reference URI="bin%2Fservice2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>RnPKffWQVeWGu6c85RAZ2ok7U2TSjUwneF+3BwbY/q0=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>TwwCzhdio1vGkQ6raK/ABUQH0YKx0TPrVEoOgwCuLkU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2FLICENSE.APLv2">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>z8d0m5b2O9McPEK1xHG/dWgUBT6EfBDz6wA0F7xSPTA=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2FNOTICE">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>ijjaB8GEO5OJP/jK6n7Hr3vZFI9gy8ocoDhviViKNnU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fconfig.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>gzrsgCaAh6OG7sGSP2wiAI/eD61S687+NuTnSqwLylc=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fcss%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>f7q5O05HNVS6mBDhCOBPBMFo6OA2iSqQVOf9aMoKPhs=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Ficon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Findex.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>pw+EAHkfej6NPKau0RrL0ZIVHj1Q0QJxUlUMBCFRIFU=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fjs%2Fapp.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>mCAANytlgxQx/1c82dNNjO4QUPgqRMkzu2b1sbBLPk8=</DigestValue>
+</Reference>
+<Reference URI="res%2Fwgt%2Fversion.txt">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>9eXJU0UyhA/NRbsALmnthcYduidTRQ4mtEi33xSB4k0=</DigestValue>
+</Reference>
+<Reference URI="shared%2Fres%2Fservice2.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="tizen-manifest.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Tg/KmHRmoo0F+PrxTKOEcKJWfr7PF+jEJ5y2Y3uTiqo=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+q4QCfU18xiU4d397IiQ2/+RsfoQAHjFbvJpFm9Hn/01897/joNhMggZ3rJv1+7YrG2uyWpeskwBQ
+Ckg3jaBGyrRS17t3zZcAPUZT085Bq608fzn+sNUm2XY2FweOD3ttebAalgJBAhSshE1/sNY5eSy0
+lk9wVUXaVlInM6YWtx0=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIICnTCCAgYCCQDE9MbMmJ/yCzANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCS1IxDjAMBgNV
+BAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6ZW4gVGVzdCBDQTEiMCAGA1UE
+CwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTElMCMGA1UEAwwcVGl6ZW4gUGFydG5lciBEaXN0
+cmlidXRvciBDQTAeFw0xMjEwMjcwNzQ4MzNaFw0yMjEwMjUwNzQ4MzNaMIGUMQswCQYDVQQGEwJL
+UjEOMAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENB
+MSIwIAYDVQQLDBlUaXplbiBEaXN0cmlidXRvciBUZXN0IENBMSkwJwYDVQQDDCBUaXplbiBQYXJ0
+bmVyIERpc3RyaWJ1dG9yIFNpZ25lcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAy9mg2x4B
+zxlK3LJL81GsLq/pJfK1evdCKG/IOBpdoRO0rLhYnsL5+KvToPFa5g9GTZo32LikpW1NZ7++3EHE
+fnO2IGLUau4kquvhmz1LNg5xBTx7IbucmwLMRGo1BPGdsAQQLyXeQKJ5PCERmVg4MIoiL2zT/JsL
+sZ9UPT6GEB8CAwEAATANBgkqhkiG9w0BAQUFAAOBgQAw5xPBFR1XKuZ8QpsCtSE0zXVHvwIa+Ha4
+YBdRtGwEoZmiKGZV/wAhPRdmR0kISkTz20kIGz/ZwRZCVGhsr5hkkpFknYlKeKkEJ/tJfZl4D7ec
+GFAnynOzlWZqSIPz+yxX8ah9E6lTv4Vs9DhNb08nxVvxLqlpyVdk9RUsCx/yIA==
+</X509Certificate>
+<X509Certificate>
+MIICtTCCAh6gAwIBAgIJAKORBcIiXygIMA0GCSqGSIb3DQEBBQUAMIGVMQswCQYDVQQGEwJLUjEO
+MAwGA1UECAwFU3V3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSIw
+IAYDVQQLDBlUaXplbiBEaXN0cmlidXRvciBUZXN0IENBMSowKAYDVQQDDCFUaXplbiBQYXJ0bmVy
+IERpc3RyaWJ1dG9yIFJvb3QgQ0EwHhcNMTIxMDI3MDc0NTIwWhcNMjIxMDI1MDc0NTIwWjCBkDEL
+MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6
+ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTElMCMGA1UEAwwc
+VGl6ZW4gUGFydG5lciBEaXN0cmlidXRvciBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+2ZQrdEowjqxUmB8FX8ej19VKY6jGHKNIRE5wrhBkuZ1b0FLRPiN3/Cl9wMkCnyJui4QhC28g1aBg
+w/JnaObcDqW1NgFVH3006+gZvCTDlw1nIEjvZa6P+uWOOi05xPPAE0feKPkO1POnOjnapfkkEVNU
+8TXsLbLYBylWT8rxZC8CAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBJ
+yJ7p6qs0JI+1iKOk/sYWVP6dMueY72qOc/wVj5c3ejOlgJNNXDMAQ14QcRRexffc68ipTwybU/3m
+tcNwydzKJe+GFa4b2zyKOvOgrfs4MKSR0T9XEPmTKeR+NDT2CbA6/kQoRYm0fSORzD2UXJzNZWe/
+WjwSA66hv4q+0QZQFQ==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#DistributorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#DistributorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-distributor"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#DistributorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tizen-manifest.xml b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..83bd202
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="smokehyb12" version="1.0.0">
+    <profile name="mobile"/>
+    <service-application appid="smokehyb12.service2" exec="service2" multiple="false" nodisplay="true" taskmanage="false" type="capp">
+        <label>service2</label>
+        <icon>service2.png</icon>
+    </service-application>
+</manifest>
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tmp/sth.txt b/src/unit_tests/test_samples/smoke/ManifestDirectInstallMode_Hybrid/smokehyb12/tmp/sth.txt
new file mode 100644 (file)
index 0000000..a3cc0b5
--- /dev/null
@@ -0,0 +1 @@
+Needed, because empty directories are skipped when copying, and directory structure will be invalid.
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode.wgt b/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode.wgt
new file mode 100644 (file)
index 0000000..2138fa0
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..f035a74
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ManifestDirectUpdateMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MigrateLegacyExternalImageMode.wgt b/src/unit_tests/test_samples/smoke/MigrateLegacyExternalImageMode.wgt
new file mode 100644 (file)
index 0000000..d1f6b78
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MigrateLegacyExternalImageMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode.wgt
new file mode 100644 (file)
index 0000000..d27eb6a
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..7c49ea6
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..f1cd2f4
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..5e6d044
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountInstallationMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode.wgt
new file mode 100644 (file)
index 0000000..d94ea71
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_2.wgt
new file mode 100644 (file)
index 0000000..3d2e340
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..7af2135
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..def598d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..5e18cf0
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt
new file mode 100644 (file)
index 0000000..c7a4744
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..149494d
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..18c190b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/MountUpdateMode_Rollback_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RDSMode.wgt b/src/unit_tests/test_samples/smoke/RDSMode.wgt
new file mode 100644 (file)
index 0000000..f3c1bea
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RDSMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/ReadonlyUpdateInstallMode.wgt b/src/unit_tests/test_samples/smoke/ReadonlyUpdateInstallMode.wgt
new file mode 100644 (file)
index 0000000..e21919f
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ReadonlyUpdateInstallMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/ReadonlyUpdateUninstallMode.wgt b/src/unit_tests/test_samples/smoke/ReadonlyUpdateUninstallMode.wgt
new file mode 100644 (file)
index 0000000..6699e37
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/ReadonlyUpdateUninstallMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta
new file mode 100644 (file)
index 0000000..78375e5
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.delta differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt
new file mode 100644 (file)
index 0000000..d97ecc6
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt
new file mode 100644 (file)
index 0000000..6f171db
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForDelta_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForInstallation.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForInstallation.wgt
new file mode 100644 (file)
index 0000000..7d11d9b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForInstallation.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountInstall.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountInstall.wgt
new file mode 100644 (file)
index 0000000..14c8562
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountInstall.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate.wgt
new file mode 100644 (file)
index 0000000..7fc53f1
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate_2.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate_2.wgt
new file mode 100644 (file)
index 0000000..257ef7b
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForMountUpdate_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate.wgt
new file mode 100644 (file)
index 0000000..6bebab8
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate_2.wgt b/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate_2.wgt
new file mode 100644 (file)
index 0000000..44b8372
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/RecoveryMode_ForUpdate_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes24.wgt b/src/unit_tests/test_samples/smoke/SharedRes24.wgt
new file mode 100644 (file)
index 0000000..782e7e9
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes24.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30.wgt b/src/unit_tests/test_samples/smoke/SharedRes30.wgt
new file mode 100644 (file)
index 0000000..e235841
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30Delta.delta b/src/unit_tests/test_samples/smoke/SharedRes30Delta.delta
new file mode 100644 (file)
index 0000000..26e28bf
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30Delta.delta differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30Delta.wgt b/src/unit_tests/test_samples/smoke/SharedRes30Delta.wgt
new file mode 100644 (file)
index 0000000..f73d723
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30Delta.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30Delta_2.wgt b/src/unit_tests/test_samples/smoke/SharedRes30Delta_2.wgt
new file mode 100644 (file)
index 0000000..6f52919
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30Delta_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30Hybrid.wgt b/src/unit_tests/test_samples/smoke/SharedRes30Hybrid.wgt
new file mode 100644 (file)
index 0000000..2aa90d3
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.delta b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.delta
new file mode 100644 (file)
index 0000000..93d0374
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.delta differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.wgt b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.wgt
new file mode 100644 (file)
index 0000000..b60b43c
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta_2.wgt b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta_2.wgt
new file mode 100644 (file)
index 0000000..6399c85
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SharedRes30HybridDelta_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/SimpleEchoPrivilege.wgt b/src/unit_tests/test_samples/smoke/SimpleEchoPrivilege.wgt
new file mode 100644 (file)
index 0000000..824502e
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/SimpleEchoPrivilege.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode.wgt b/src/unit_tests/test_samples/smoke/UpdateMode.wgt
new file mode 100644 (file)
index 0000000..a7a630c
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_2.wgt
new file mode 100644 (file)
index 0000000..21492f3
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid.wgt
new file mode 100644 (file)
index 0000000..e26ebbf
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..537f244
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Preload.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Preload.wgt
new file mode 100644 (file)
index 0000000..b7b4826
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Preload.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Preload2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Preload2.wgt
new file mode 100644 (file)
index 0000000..5d5cefa
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Preload2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback.wgt
new file mode 100644 (file)
index 0000000..13f1c3c
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_2.wgt
new file mode 100644 (file)
index 0000000..e7395b0
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt
new file mode 100644 (file)
index 0000000..ca92739
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt
new file mode 100644 (file)
index 0000000..3243c91
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/UpdateMode_Rollback_Hybrid_2.wgt differ
diff --git a/src/unit_tests/test_samples/smoke/delta_dir/.rds_delta b/src/unit_tests/test_samples/smoke/delta_dir/.rds_delta
new file mode 100644 (file)
index 0000000..7467bbe
--- /dev/null
@@ -0,0 +1,6 @@
+#add
+res/wgt/ADDED
+#modify
+res/wgt/MODIFIED
+#delete
+res/wgt/DELETED
diff --git a/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/ADDED b/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/ADDED
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/MODIFIED b/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/MODIFIED
new file mode 100644 (file)
index 0000000..0cfbf08
--- /dev/null
@@ -0,0 +1 @@
+2
diff --git a/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/config.xml b/src/unit_tests/test_samples/smoke/delta_dir/res/wgt/config.xml
new file mode 100644 (file)
index 0000000..2eb71f2
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/smokewgt11" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="smokewgt11.RDSMode" package="smokewgt11" required_version="2.3"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>smokewgt11</name>
+    <tizen:profile name="mobile"/>
+</widget>
diff --git a/src/unit_tests/test_samples/smoke/legacy_extimage_dir/app2sd_migrate.db b/src/unit_tests/test_samples/smoke/legacy_extimage_dir/app2sd_migrate.db
new file mode 100644 (file)
index 0000000..a1431ad
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/legacy_extimage_dir/app2sd_migrate.db differ
diff --git a/src/unit_tests/test_samples/smoke/legacy_extimage_dir/smokewgt36 b/src/unit_tests/test_samples/smoke/legacy_extimage_dir/smokewgt36
new file mode 100644 (file)
index 0000000..c440787
Binary files /dev/null and b/src/unit_tests/test_samples/smoke/legacy_extimage_dir/smokewgt36 differ
diff --git a/src/utils.c b/src/utils.c
deleted file mode 100644 (file)
index cc78b04..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "app-log.h"
-#include "utils.h"
-#include "analog-watch.h"
-
-/*
- * @brief Creates path to the given resource file by concatenation of the basic resource path and the given file_name.
- * @param[in] file_name File name or path relative to the resource directory.
- * @return: The absolute path to the resource with given file_name is returned.
- */
-char *utils_create_resource_path(const char *file_name)
-{
-       static char res_path_buff[PATH_MAX] = {0,};
-       char *res_path = NULL;
-
-       res_path = app_get_resource_path();
-       if (res_path == NULL) {
-               __E("failed to get resource path.");
-               return NULL;
-       }
-
-       snprintf(res_path_buff, PATH_MAX, "%s%s", res_path, file_name);
-       free(res_path);
-
-       return &res_path_buff[0];
-}
-
-
-
diff --git a/src/view.c b/src/view.c
deleted file mode 100644 (file)
index 578a1c1..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "data-provider.h"
-#include "comp-manager.h"
-#include "analog-watch.h"
-#include "app-log.h"
-#include "view.h"
-#include "utils.h"
-
-static void _view_create_base_gui(int, int);
-static void _view_destroy_base_gui(void);
-static Evas_Object *_view_create_layout_for_part(Evas_Object *parent, char *file_path, char *group_name, char *part_name);
-static void _view_set_watchface_layout(Evas_Object *layout);
-static Evas_Object* _view_add_parts(parts_type_e type);
-static Evas_Object *_view_create_parts(Evas_Object *parent, const char *image_path, int x, int y, int w, int h);
-static void _view_rotate_hand(Evas_Object *hand, double degree, Evas_Coord cx, Evas_Coord cy);
-static void _view_set_hand_color(const char *key, char *style);
-static void _view_set_hands_lr(Evas_Object *hands, parts_type_e type);
-
-static struct view_info {
-       int cur_min;
-       char *cur_dial;
-       char *cur_hands;
-       Eina_Bool min_hand_lr;
-       Eina_Bool hr_hand_lr;
-       Evas_Object *watchface_layout;
-       Evas_Object *hour_hand;
-       Evas_Object *min_hand;
-       Evas_Object *sec_hand;
-       Evas_Object *hour_hand_shadow;
-       Evas_Object *min_hand_shadow;
-       Evas_Object *sec_hand_shadow;
-       Evas_Object *center_pivot;
-} s_info = {
-       .cur_min = 0,
-       .cur_dial = "01",
-       .cur_hands = "01",
-       .min_hand_lr = 0,
-       .hr_hand_lr = 0,
-       .watchface_layout = NULL,
-       .hour_hand = NULL,
-       .min_hand = NULL,
-       .sec_hand = NULL,
-       .hour_hand_shadow = NULL,
-       .min_hand_shadow = NULL,
-       .sec_hand_shadow = NULL,
-       .center_pivot = NULL,
-};
-
-/*
- * @brief sets the dial style in view
- * @param selected style of dial
- */
-void view_set_dial_style(char *style)
-{
-       Evas_Object *layout = NULL;
-       Edje_Message_Int msg = {0,};
-       s_info.cur_dial = style;
-
-       layout = s_info.watchface_layout;
-       if (layout == NULL) {
-               __E("[%s:%d] Failed to get layout", __func__, __LINE__);
-               return;
-       }
-       __D("dial style set %s", style);
-
-       msg.val = (int)(s_info.cur_dial[1] - '0');
-       edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_INT,
-                                                       MSG_ID_SET_DIAL_STYLE, &msg);
-
-}
-
-static void _view_set_hands_lr(Evas_Object *hands, parts_type_e type)
-{
-       if (hands == NULL) {
-               __E("Failed to get Hands");
-               return;
-       }
-       char *image_path =  NULL;
-
-       switch (type) {
-       case PARTS_TYPE_HANDS_MIN:
-               image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_MIN, s_info.cur_hands, s_info.min_hand_lr);
-               elm_image_file_set(hands, image_path, NULL);
-               _view_set_hand_color(DATA_KEY_HANDS_MIN, s_info.cur_hands);
-               break;
-       case PARTS_TYPE_HANDS_HOUR:
-               image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_HOUR, s_info.cur_hands, s_info.hr_hand_lr);
-               elm_image_file_set(hands, image_path, NULL);
-               _view_set_hand_color(DATA_KEY_HANDS_HOUR, s_info.cur_hands);
-               break;
-       default:
-               __D("type error : %d", type);
-               return;
-       }
-}
-
-/*
- * @brief sets the hands style in view
- * @param selected style of hands
- */
-void view_set_hands_style(char *style)
-{
-       Evas_Object *layout = NULL;
-       Evas_Object *hands = NULL;
-       char *image_path =  NULL;
-
-       s_info.cur_hands = style;
-       layout = s_info.watchface_layout;
-       if (layout == NULL) {
-               __E("[%s:%d] Failed to get layout", __func__, __LINE__);
-               return;
-       }
-       __D("hand style set %s", style);
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_SEC);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_SEC, s_info.cur_hands, 0);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_SEC, s_info.cur_hands);
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_MIN);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_MIN, s_info.cur_hands, s_info.min_hand_lr);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_MIN, s_info.cur_hands);
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_HOUR);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_HOUR, s_info.cur_hands, s_info.hr_hand_lr);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_HOUR, s_info.cur_hands);
-
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_SEC_SHADOW);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_SEC_SHADOW, s_info.cur_hands, 0);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_SEC_SHADOW, s_info.cur_hands);
-
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_MIN_SHADOW);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_MIN_SHADOW, s_info.cur_hands, 0);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_MIN_SHADOW, s_info.cur_hands);
-
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_HOUR_SHADOW);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_HOUR_SHADOW, s_info.cur_hands, 0);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_HOUR_SHADOW, s_info.cur_hands);
-
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_CENTER_PIVOT);
-       image_path =  data_get_parts_image_path(PARTS_TYPE_HANDS_CENTER_PIVOT, s_info.cur_hands, 0);
-       elm_image_file_set(hands, image_path, NULL);
-       _view_set_hand_color(DATA_KEY_HANDS_CENTER_PIVOT, s_info.cur_hands);
-}
-
-/*
- * @brief shows the hands on watch according to the time on clock
- */
-void view_set_time(int hour, int min, int sec)
-{
-       Evas_Object *layout = NULL;
-       Evas_Object *hands = NULL;
-       double degree = 0.0f;
-
-       layout = s_info.watchface_layout;
-       if (layout == NULL) {
-               __E("[%s:%d] Failed to get layout", __func__, __LINE__);
-               return;
-       }
-
-       degree = sec * SEC_ANGLE;
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_SEC);
-       _view_rotate_hand(hands, degree, (BASE_WIDTH / 2), (BASE_HEIGHT / 2));
-
-       hands = evas_object_data_get(layout, DATA_KEY_HANDS_SEC_SHADOW);
-       _view_rotate_hand(hands, degree, (BASE_WIDTH / 2),
-                       data_get_hand_shadow_pivot(PARTS_TYPE_HANDS_SEC_SHADOW, s_info.cur_hands));
-
-       if (s_info.cur_min != min) {
-               degree = min * MIN_ANGLE;
-               hands = evas_object_data_get(layout, DATA_KEY_HANDS_MIN);
-               if (s_info.min_hand_lr == 0 && degree >= 0 && degree <= 180) {
-                       s_info.min_hand_lr = 1;
-                       _view_set_hands_lr(hands, PARTS_TYPE_HANDS_MIN);
-               } else if (s_info.min_hand_lr == 1 && degree >= 180 && degree < 360) {
-                       s_info.min_hand_lr = 0;
-                       _view_set_hands_lr(hands, PARTS_TYPE_HANDS_MIN);
-               }
-               _view_rotate_hand(hands, degree, (BASE_WIDTH / 2), (BASE_HEIGHT / 2));
-               hands = evas_object_data_get(layout, DATA_KEY_HANDS_MIN_SHADOW);
-               _view_rotate_hand(hands, degree, (BASE_WIDTH / 2),
-                               data_get_hand_shadow_pivot(PARTS_TYPE_HANDS_MIN_SHADOW, s_info.cur_hands));
-               s_info.cur_min = min;
-
-               degree = (hour * HOUR_ANGLE) + data_get_plus_angle(min);
-               hands = evas_object_data_get(layout, DATA_KEY_HANDS_HOUR);
-               if (s_info.hr_hand_lr == 0 && degree >= 0 && degree <= 180) {
-                       s_info.hr_hand_lr = 1;
-                       _view_set_hands_lr(hands, PARTS_TYPE_HANDS_HOUR);
-               } else if (s_info.hr_hand_lr == 1 && degree >= 180 && degree < 360) {
-                       s_info.hr_hand_lr = 0;
-                       _view_set_hands_lr(hands, PARTS_TYPE_HANDS_HOUR);
-               }
-               _view_rotate_hand(hands, degree, (BASE_WIDTH / 2), (BASE_HEIGHT / 2));
-               hands = evas_object_data_get(layout, DATA_KEY_HANDS_HOUR_SHADOW);
-               _view_rotate_hand(hands, degree, (BASE_WIDTH / 2),
-                               data_get_hand_shadow_pivot(PARTS_TYPE_HANDS_HOUR_SHADOW, s_info.cur_hands));
-       }
-}
-
-/*
- * @brief sets the battery value in view
- * @param battery level
- * @param user data
- */
-void view_set_battery_status(int battery_level, void *user_data)
-{
-       __D("%s", __func__);
-       Evas_Object*  watchface_layout;
-       Edje_Message_Int msg = {0,};
-
-       watchface_layout = view_get_watchface_layout();
-
-       msg.val = battery_level;
-       edje_object_message_send(elm_layout_edje_get(watchface_layout), EDJE_MESSAGE_INT,
-                                                       MSG_ID_SET_BATTERY_LEVEL, &msg);
-}
-
-/**
- * @brief Set the watch face layout.
- */
-void _view_set_watchface_layout(Evas_Object *layout)
-{
-       if (layout == NULL) {
-               __E("layout is NULL");
-               return;
-       }
-
-       s_info.watchface_layout = layout;
-}
-
-/**
- * @brief Get the watch face layout.
- */
-Evas_Object *view_get_watchface_layout(void)
-{
-       return s_info.watchface_layout;
-}
-
-/*
- * @brief creates layout for the view of parts
- * @param parent on which layout needed to be added
- * @param filepath of a file set to the layout
- * @param group The group that the layout belongs in edje file
- * @param part for which the layout needs to be added
- */
-Evas_Object *_view_create_layout_for_part(Evas_Object *parent, char *file_path, char *group_name, char *part_name)
-{
-       Evas_Object *layout = NULL;
-
-       if (parent == NULL) {
-               __E("parent is NULL.");
-               return NULL;
-       }
-
-       layout = elm_layout_add(parent);
-       elm_win_resize_object_add(parent, layout);
-       elm_layout_file_set(layout, file_path, group_name);
-       evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-       evas_object_size_hint_min_set(layout, BASE_WIDTH, BASE_HEIGHT);
-       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_show(layout);
-       return layout;
-}
-
-/*
- * @brief adds parts to the watch
- * @param type of the hands
- * @return part added to the watch
- */
-static Evas_Object* _view_add_parts(parts_type_e type)
-{
-       Evas_Object *parts = NULL;
-       Evas_Object *layout = NULL;
-       char *parts_image_path = NULL;
-       int x = 0, y = 0, w = 0, h = 0;
-
-       layout = s_info.watchface_layout;
-       parts_image_path = data_get_parts_image_path(type, s_info.cur_hands, 0);
-       data_get_parts_position(type, &x, &y);
-       w = data_get_parts_width_size(type);
-       h = data_get_parts_height_size(type);
-
-       __D("Part info: x = %d, y = %d, w = %d, h = %d", x, y, w, h);
-
-       parts = _view_create_parts(layout, parts_image_path, x, y, w, h);
-       if (parts == NULL) {
-               __E("Failed to create parts : %d", type);
-       }
-
-       return parts;
-}
-
-/*
- * @brief create view for parts of watch
- * @param creates a view for parts neede to add to the watch
- * @return returns the part added
- */
-Evas_Object *_view_create_parts(Evas_Object *parent, const char *image_path, int x, int y, int w, int h)
-{
-       Evas_Object *parts = NULL;
-       Eina_Bool ret = EINA_FALSE;
-
-       if (parent == NULL) {
-               __E("bg is NULL");
-               return NULL;
-       }
-
-       parts = elm_image_add(parent);
-       if (parts == NULL) {
-               __E("Failed to add part image");
-               return NULL;
-       }
-
-       ret = elm_image_file_set(parts, image_path, NULL);
-       if (ret != EINA_TRUE) {
-               __E("Failed to set part image");
-               evas_object_del(parts);
-               return NULL;
-       }
-       __D("Part Created successfully");
-       evas_object_move(parts, x, y);
-       evas_object_resize(parts, w, h);
-       evas_object_show(parts);
-
-       /*
-        * It makes events on this object to also be repeated for the next lower objects' stack.
-        */
-       evas_object_repeat_events_set(parts, EINA_TRUE);
-
-       return parts;
-}
-
-/*
- * @brief Sets opacity of shadow hand and other hands' colors
- * @param key Type of hand
- * @param style Hand Style
- */
-static void _view_set_hand_color(const char* key, char *style)
-{
-       Evas_Object *layout = NULL;
-       Evas_Object *hands = NULL;
-       layout = s_info.watchface_layout;
-       if (layout == NULL) {
-               __E("[%s:%d] Failed to get layout", __func__, __LINE__);
-               return;
-       }
-
-       hands = evas_object_data_get(layout, key);
-
-       if (!strcmp(style, "01")) {
-               if (!strcmp(key, DATA_KEY_HANDS_SEC)) {
-                       evas_object_color_set(hands, 255, 217, 0, 255);
-               } else if (!strcmp(key, DATA_KEY_HANDS_SEC_SHADOW) || !strcmp(key, DATA_KEY_HANDS_MIN_SHADOW)
-                                                                                       || !strcmp(key, DATA_KEY_HANDS_HOUR_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.5);
-               } else {
-                       evas_object_color_set(hands, 255, 255, 255, 255);
-               }
-       } else if (!strcmp(style, "02")) {
-               if (!strcmp(key, DATA_KEY_HANDS_MIN_SHADOW) || !strcmp(key, DATA_KEY_HANDS_HOUR_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.5);
-               } else if (!strcmp(key, DATA_KEY_HANDS_SEC_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.4);
-               }  else {
-                       evas_object_color_set(hands, 255, 255, 255, 255);
-               }
-       } else if (!strcmp(style, "03")) {
-               if (!strcmp(key, DATA_KEY_HANDS_MIN) || !strcmp(key, DATA_KEY_HANDS_HOUR)) {
-                       evas_object_color_set(hands, 237, 31, 34, 255);
-               } else if (!strcmp(key, DATA_KEY_HANDS_MIN_SHADOW) || !strcmp(key, DATA_KEY_HANDS_HOUR_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.3);
-               } else if (!strcmp(key, DATA_KEY_HANDS_SEC_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.2);
-               } else {
-                       evas_object_color_set(hands, 255, 255, 255, 255);
-               }
-       } else if (!strcmp(style, "04")) {
-               if (!strcmp(key, DATA_KEY_HANDS_SEC_SHADOW) || !strcmp(key, DATA_KEY_HANDS_MIN_SHADOW)
-                                                                                       || !strcmp(key, DATA_KEY_HANDS_HOUR_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.4);
-               } else {
-                       evas_object_color_set(hands, 255, 255, 255, 255);
-               }
-       } else if (!strcmp(style, "05")) {
-               if (!strcmp(key, DATA_KEY_HANDS_MIN_SHADOW) || !strcmp(key, DATA_KEY_HANDS_HOUR_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.5);
-               } else if (!strcmp(key, DATA_KEY_HANDS_SEC_SHADOW)) {
-                       evas_object_color_set(hands, 255, 255, 255, 255 * 0.6);
-               } else {
-                       evas_object_color_set(hands, 255, 255, 255, 255);
-               }
-       }
-}
-
-/*
- * @brief rotation of hands in view part is shown
- * @param Evas object for hand of clock
- * @param angle of the hand
- * @param x coord of hand
- * @param y coord of hand
- */
-void _view_rotate_hand(Evas_Object *hand, double degree, Evas_Coord cx, Evas_Coord cy)
-{
-       Evas_Map *m = NULL;
-
-       if (hand == NULL) {
-               __E("hand is NULL");
-               return;
-       }
-
-       m = evas_map_new(4);
-       evas_map_util_points_populate_from_object(m, hand);
-       evas_map_util_rotate(m, degree, cx, cy);
-       evas_object_map_set(hand, m);
-       evas_object_map_enable_set(hand, EINA_TRUE);
-       evas_map_free(m);
-}
-
-
-/*
- * @brief creates the base ui for clock
- */
-void _view_create_base_gui(int width, int height)
-{
-       Evas_Object *win;
-       Evas_Object *layout;
-       Evas_Object *hands_sec = NULL;
-       Evas_Object *hands_min = NULL;
-       Evas_Object *hands_hour = NULL;
-       Evas_Object *hands_sec_shadow = NULL;
-       Evas_Object *hands_min_shadow = NULL;
-       Evas_Object *hands_hour_shadow = NULL;
-       Evas_Object *hands_center_pivot = NULL;
-       char *layout_path = NULL;
-
-       int ret;
-       ret = watch_app_get_elm_win(&win);
-       if (ret != APP_ERROR_NONE) {
-               __E("failed to get window. err = %d", ret);
-               return;
-       }
-       evas_object_resize(win, width, height);
-       evas_object_show(win);
-
-       layout_path = utils_create_resource_path(MAIN_EDJ);
-       layout = _view_create_layout_for_part(win, layout_path, MAIN_GRP, NULL);
-       if (!layout) {
-               __E("failed to create view layout.");
-               return;
-       }
-       _view_set_watchface_layout(layout);
-
-       hands_hour_shadow = _view_add_parts(PARTS_TYPE_HANDS_HOUR_SHADOW);
-       evas_object_data_set(layout, DATA_KEY_HANDS_HOUR_SHADOW, hands_hour_shadow);
-       _view_set_hand_color(DATA_KEY_HANDS_HOUR_SHADOW, s_info.cur_hands);
-
-       hands_hour = _view_add_parts(PARTS_TYPE_HANDS_HOUR);
-       evas_object_data_set(layout, DATA_KEY_HANDS_HOUR, hands_hour);
-       _view_set_hand_color(DATA_KEY_HANDS_HOUR, s_info.cur_hands);
-
-       hands_min_shadow = _view_add_parts(PARTS_TYPE_HANDS_MIN_SHADOW);
-       evas_object_data_set(layout, DATA_KEY_HANDS_MIN_SHADOW, hands_min_shadow);
-       _view_set_hand_color(DATA_KEY_HANDS_MIN_SHADOW, s_info.cur_hands);
-
-       hands_min = _view_add_parts(PARTS_TYPE_HANDS_MIN);
-       evas_object_data_set(layout, DATA_KEY_HANDS_MIN, hands_min);
-       _view_set_hand_color(DATA_KEY_HANDS_MIN, s_info.cur_hands);
-
-
-       hands_sec_shadow = _view_add_parts(PARTS_TYPE_HANDS_SEC_SHADOW);
-       evas_object_data_set(layout, DATA_KEY_HANDS_SEC_SHADOW, hands_sec_shadow);
-       _view_set_hand_color(DATA_KEY_HANDS_SEC_SHADOW, s_info.cur_hands);
-
-       hands_sec = _view_add_parts(PARTS_TYPE_HANDS_SEC);
-       evas_object_data_set(layout, DATA_KEY_HANDS_SEC, hands_sec);
-       _view_set_hand_color(DATA_KEY_HANDS_SEC, s_info.cur_hands);
-
-       hands_center_pivot = _view_add_parts(PARTS_TYPE_HANDS_CENTER_PIVOT);
-       evas_object_data_set(layout, DATA_KEY_HANDS_CENTER_PIVOT, hands_center_pivot);
-       _view_set_hand_color(DATA_KEY_HANDS_CENTER_PIVOT, s_info.cur_hands);
-}
-
-/*
- * @brief initializes the watchface basic view
- */
-void view_init()
-{
-       _view_create_base_gui(BASE_WIDTH, BASE_HEIGHT);
-}
-
-/**
- * @brief Destroy base GUI.
- */
-void _view_destroy_base_gui(void)
-{
-       if (s_info.watchface_layout) {
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_SEC);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_MIN);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_HOUR);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_SEC_SHADOW);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_MIN_SHADOW);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_HOUR_SHADOW);
-               evas_object_data_del(s_info.watchface_layout, DATA_KEY_HANDS_CENTER_PIVOT);
-               evas_object_del(s_info.watchface_layout);
-               s_info.watchface_layout = NULL;
-       }
-       if (s_info.hour_hand) {
-               evas_object_del(s_info.hour_hand);
-               s_info.hour_hand = NULL;
-       }
-       if (s_info.min_hand) {
-               evas_object_del(s_info.min_hand);
-               s_info.min_hand = NULL;
-       }
-       if (s_info.sec_hand) {
-               evas_object_del(s_info.sec_hand);
-               s_info.sec_hand = NULL;
-       }
-       if (s_info.hour_hand_shadow) {
-               evas_object_del(s_info.hour_hand_shadow);
-               s_info.hour_hand_shadow = NULL;
-       }
-       if (s_info.min_hand_shadow) {
-               evas_object_del(s_info.min_hand_shadow);
-               s_info.min_hand_shadow = NULL;
-       }
-       if (s_info.sec_hand_shadow) {
-               evas_object_del(s_info.sec_hand_shadow);
-               s_info.sec_hand_shadow = NULL;
-       }
-       if (s_info.center_pivot) {
-               evas_object_del(s_info.center_pivot);
-               s_info.center_pivot = NULL;
-       }
-}
-
-/*
- * @brief Destroys the view
- */
-void view_destroy()
-{
-       _view_destroy_base_gui();
-}
-
diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..a9baf9b
--- /dev/null
@@ -0,0 +1,28 @@
+# Target - sources
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} WGT_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/configuration WGT_STEP_CONFIGURATION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/encryption WGT_STEP_ENCRYPTION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/filesystem WGT_STEP_FILESYSTEM_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/pkgmgr WGT_STEP_PKGMGR_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/security WGT_STEP_SECURITY_SRCS)
+
+# Target - definition
+ADD_LIBRARY(${TARGET_LIBNAME_WGT} STATIC
+  ${WGT_SRCS}
+  ${WGT_STEP_CONFIGURATION_SRCS}
+  ${WGT_STEP_ENCRYPTION_SRCS}
+  ${WGT_STEP_FILESYSTEM_SRCS}
+  ${WGT_STEP_PKGMGR_SRCS}
+  ${WGT_STEP_SECURITY_SRCS})
+# Target - includes
+TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_WGT} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
+# Target - deps
+APPLY_PKG_CONFIG(${TARGET_LIBNAME_WGT} PUBLIC
+  APP_INSTALLERS_DEPS
+  WGT_MANIFEST_HANDLERS_DEPS
+  MANIFEST_PARSER_DEPS
+  PKGMGR_INSTALLER_DEPS
+  ENCRYPTION_DEPS
+  Boost
+)
+SET_TARGET_PROPERTIES(${TARGET_LIBNAME_WGT} PROPERTIES COMPILE_FLAGS "-fPIC")
diff --git a/src/wgt/extension_config_parser.cc b/src/wgt/extension_config_parser.cc
new file mode 100755 (executable)
index 0000000..2409389
--- /dev/null
@@ -0,0 +1,192 @@
+// 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/extension_config_parser.h"
+#include <manifest_parser/utils/string_util.h>
+#include <manifest_parser/manifest_handler.h>
+
+#include <cassert>
+#include <utility>
+
+namespace wgt {
+
+namespace {
+
+const xmlChar kExtensionNodeKey[] = "extension";
+const xmlChar kNamePrivilegeKey[] = "privilege";
+const xmlChar kPrivigeNameAttributeKey[] = "name";
+const char kAttributePrefix[] = "@";
+const xmlChar kDirAttributeKey[] = "dir";
+const char kXmlTextKey[] = "#text";
+const char kNamespaceKey[] = "@namespace";
+const char kExtensionPath[] = "extension.privilege";
+const char kExtensionNameKey[] = "@name";
+
+}  // namespace
+
+ExtensionConfigParser::ExtensionConfigParser(std::string config_xml)
+    : config_xml_(config_xml) {}
+
+std::unique_ptr<parser::DictionaryValue>
+    ExtensionConfigParser::LoadExtensionConfig(const std::string& config_xml) {
+  xmlDoc *doc = nullptr;
+  xmlNode* root_node = nullptr;
+  doc = xmlReadFile(config_xml.c_str(), nullptr, XML_PARSE_NOENT);
+  if (!doc) {
+    LOG(ERROR) << "Failed to read xml document model from" << config_xml;
+    return nullptr;
+  }
+  root_node = xmlDocGetRootElement(doc);
+  std::unique_ptr<parser::DictionaryValue> dv = LoadXMLNode(root_node);
+  std::unique_ptr<parser::DictionaryValue> result(new parser::DictionaryValue);
+  if (dv)
+    result->Set(reinterpret_cast<const char*>(root_node->name), dv.release());
+  return result;
+}
+
+std::string ExtensionConfigParser::GetNodeDir(
+    xmlNode* node, const std::string& inherit_dir) {
+  std::string dir(inherit_dir);
+  for (xmlAttr* prop = node->properties; prop; prop = prop->next) {
+    if (xmlStrEqual(prop->name, kDirAttributeKey)) {
+      char* prop_value = reinterpret_cast<char*>(xmlNodeListGetString(
+          node->doc, prop->children, 1));
+      dir = prop_value;
+      xmlFree(prop_value);
+      break;
+    }
+  }
+  return dir;
+}
+std::string ExtensionConfigParser::GetNodeText(
+    xmlNode* root, const std::string& inherit_dir) {
+  if (root->type != XML_ELEMENT_NODE)
+    return std::string();
+  std::string current_dir(GetNodeDir(root, inherit_dir));
+  std::string text;
+  if (!current_dir.empty())
+    text += parser::utils::GetDirUTF8Start(current_dir);
+  for (xmlNode* node = root->children; node; node = node->next) {
+    if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE)
+      text = text + std::string(reinterpret_cast<char*>(node->content));
+    else
+      text += GetNodeText(node, current_dir);
+  }
+  if (!current_dir.empty())
+    text += parser::utils::GetDirUTF8End();
+  return text;
+}
+bool ExtensionConfigParser::IsPropSupportDir(xmlNode* root, xmlAttr* prop) {
+  if (xmlStrEqual(root->name, kNamePrivilegeKey)
+      && xmlStrEqual(prop->name, kPrivigeNameAttributeKey)) {
+    return true;
+  }
+  return false;
+}
+bool ExtensionConfigParser::IsTrimRequiredForElement(xmlNode* root) {
+  if (xmlStrEqual(root->name, kNamePrivilegeKey)) {
+    return true;
+  }
+  return false;
+}
+bool ExtensionConfigParser::IsTrimRequiredForProp(
+    xmlNode* root, xmlAttr* prop) {
+  if (xmlStrEqual(root->name, kNamePrivilegeKey) &&
+      xmlStrEqual(prop->name, kPrivigeNameAttributeKey)) {
+    return true;
+  }
+  return false;
+}
+std::unique_ptr<parser::DictionaryValue>
+    ExtensionConfigParser::LoadXMLNode(
+    xmlNode* root, const std::string& inherit_dir) {
+  std::unique_ptr<parser::DictionaryValue> value(new parser::DictionaryValue());
+  if (root->type != XML_ELEMENT_NODE)
+    return nullptr;
+
+  std::string current_dir(GetNodeDir(root, inherit_dir));
+
+  xmlAttr* prop = nullptr;
+  for (prop = root->properties; prop; prop = prop->next) {
+    xmlChar* value_ptr = xmlNodeListGetString(root->doc, prop->children, 1);
+    std::string prop_value(reinterpret_cast<char*>(value_ptr));
+    xmlFree(value_ptr);
+    if (IsPropSupportDir(root, prop))
+      prop_value = parser::utils::GetDirTextUTF8(prop_value, current_dir);
+
+    if (IsTrimRequiredForProp(root, prop))
+      prop_value = parser::utils::CollapseWhitespaceUTF8(prop_value);
+
+    value->SetString(
+        std::string(kAttributePrefix)
+        + reinterpret_cast<const char*>(prop->name),
+        prop_value);
+  }
+
+  if (root->ns)
+    value->SetString(kNamespaceKey,
+        reinterpret_cast<const char*>(root->ns->href));
+
+  for (xmlNode* node = root->children; node; node = node->next) {
+    std::string sub_node_name(reinterpret_cast<const char*>(node->name));
+    std::unique_ptr<parser::DictionaryValue> sub_value =
+        LoadXMLNode(node, current_dir);
+
+    if (!sub_value) {
+      continue;
+    }
+    if (!value->HasKey(sub_node_name)) {
+      value->Set(sub_node_name, sub_value.release());
+      continue;
+    }
+
+    parser::Value* temp;
+    value->Get(sub_node_name, &temp);
+
+    if (temp->IsType(parser::Value::TYPE_LIST)) {
+      parser::ListValue* list;
+      temp->GetAsList(&list);
+      list->Append(sub_value.release());
+    } else {
+      assert(temp->IsType(parser::Value::TYPE_DICTIONARY));
+      parser::DictionaryValue* dict;
+      temp->GetAsDictionary(&dict);
+      parser::DictionaryValue* prev_value = dict->DeepCopy();
+
+      parser::ListValue* list = new parser::ListValue();
+      list->Append(prev_value);
+      list->Append(sub_value.release());
+      value->Set(sub_node_name, list);
+    }
+  }
+
+  std::string text;
+  xmlChar* text_ptr = xmlNodeListGetString(root->doc, root->children, 1);
+  if (text_ptr) {
+    text = reinterpret_cast<char*>(text_ptr);
+    xmlFree(text_ptr);
+  }
+  if (IsTrimRequiredForElement(root))
+    text = parser::utils::CollapseWhitespaceUTF8(text);
+  if (!text.empty())
+    value->SetString(kXmlTextKey, text);
+
+  return value;
+}
+std::vector<std::string> ExtensionConfigParser::GetExtensionPrivilegeList() {
+  std::unique_ptr<parser::DictionaryValue> dic
+    = LoadExtensionConfig(config_xml_);
+  std::vector<std::string> privilege_list;
+
+  for (auto& item : parser::GetOneOrMany(dic.get(), kExtensionPath, "")) {
+    std::string privilege;
+    if (item->GetString(kExtensionNameKey, &privilege)) {
+      LOG(DEBUG) << "User defined extra privilege: " << privilege;
+      privilege_list.push_back(privilege);
+    }
+  }
+  return privilege_list;
+}
+
+}  // namespace wgt
diff --git a/src/wgt/extension_config_parser.h b/src/wgt/extension_config_parser.h
new file mode 100755 (executable)
index 0000000..915497e
--- /dev/null
@@ -0,0 +1,38 @@
+// 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_EXTENSION_CONFIG_PARSER_H_
+#define WGT_EXTENSION_CONFIG_PARSER_H_
+
+#include <libxml2/libxml/tree.h>
+#include <manifest_parser/utils/logging.h>
+#include <manifest_parser/values.h>
+#include <manifest_parser/manifest_util.h>
+
+#include <memory>
+#include <string>
+#include <map>
+#include <vector>
+
+namespace wgt {
+class ExtensionConfigParser {
+ public:
+  explicit ExtensionConfigParser(std::string config_xml);
+  std::vector<std::string> GetExtensionPrivilegeList();
+ private:
+  std::unique_ptr<parser::DictionaryValue> LoadExtensionConfig(
+      const std::string& config_xml);
+  std::string GetNodeDir(xmlNode* node, const std::string& inherit_dir);
+  std::string GetNodeText(xmlNode* root, const std::string& inherit_dir);
+  bool IsPropSupportDir(xmlNode* root, xmlAttr* prop);
+  bool IsTrimRequiredForElement(xmlNode* root);
+  bool IsTrimRequiredForProp(xmlNode* root, xmlAttr* prop);
+  std::unique_ptr<parser::DictionaryValue> LoadXMLNode(
+      xmlNode* root, const std::string& inherit_dir = "");
+  std::string config_xml_;
+};
+
+}  // namespace wgt
+
+#endif  // WGT_EXTENSION_CONFIG_PARSER_H_
diff --git a/src/wgt/shared_dirs.h b/src/wgt/shared_dirs.h
new file mode 100644 (file)
index 0000000..61bb319
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_SHARED_DIRS_H_
+#define WGT_SHARED_DIRS_H_
+
+#include <vector>
+
+namespace wgt {
+namespace filesystem {
+
+const std::vector<const char*> WgtAdditionalSharedDirs = {
+  {"tmp"},
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_SHARED_DIRS_H_
diff --git a/src/wgt/step/configuration/step_check_rds_manifest.cc b/src/wgt/step/configuration/step_check_rds_manifest.cc
new file mode 100644 (file)
index 0000000..560f015
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/configuration/step_check_rds_manifest.h"
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+namespace {
+
+const char kConfigInstalled[] = "res/wgt/config.xml";
+const char kConfigDeltaDir[] = "res/wgt/config.xml";
+
+}  // namespace
+
+namespace wgt {
+namespace configuration {
+
+common_installer::Step::Status StepCheckRDSManifest::process() {
+  bf::path target = context_->unpacked_dir_path.get() / kConfigDeltaDir;
+  if (!bf::exists(target)) {
+    bf::path source = context_->root_application_path.get() /
+        context_->pkgid.get() / kConfigInstalled;
+    if (!bf::exists(source)) {
+      LOG(ERROR) << "Cannot find old manifest file";
+      return Status::APP_DIR_ERROR;
+    }
+    bs::error_code error;
+    bf::create_directories(source.parent_path(), error);
+    if (error) {
+      LOG(ERROR) << "Failed to create directories for manifest file";
+      return Status::APP_DIR_ERROR;
+    }
+    bf::copy_file(source, target, error);
+    if (error) {
+      LOG(ERROR) << "Failed to copy old manifest file";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace wgt
diff --git a/src/wgt/step/configuration/step_check_rds_manifest.h b/src/wgt/step/configuration/step_check_rds_manifest.h
new file mode 100644 (file)
index 0000000..ff5e06f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_CONFIGURATION_STEP_CHECK_RDS_MANIFEST_H_
+#define WGT_STEP_CONFIGURATION_STEP_CHECK_RDS_MANIFEST_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace configuration {
+
+class StepCheckRDSManifest : 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(CheckRDSManifest)
+};
+
+}  // namespace configuration
+}  // namespace wgt
+
+#endif  // WGT_STEP_CONFIGURATION_STEP_CHECK_RDS_MANIFEST_H_
diff --git a/src/wgt/step/configuration/step_check_start_files.cc b/src/wgt/step/configuration/step_check_start_files.cc
new file mode 100644 (file)
index 0000000..6db5b8e
--- /dev/null
@@ -0,0 +1,52 @@
+// 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_check_start_files.h"
+
+#include <boost/filesystem/path.hpp>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+#include <wgt/wgt_backend_data.h>
+
+#include <wgt_manifest_handlers/w3c_pc_utils.h>
+#include <wgt_manifest_handlers/content_handler.h>
+
+namespace bf = boost::filesystem;
+
+namespace wgt {
+namespace configuration {
+
+common_installer::Step::Status StepCheckStartFiles::process() {
+  bool flag = false;  // it's not important in this step to use this flag
+  std::string error;
+  auto backend_data =
+      static_cast<WgtBackendData*>(context_->backend_data.get());
+  auto content = std::make_shared<parse::ContentInfo>();
+  if (!backend_data->content.get().src().empty()) {
+    content.reset(new parse::ContentInfo(backend_data->content.get()));
+  }
+
+  bool result_check = CheckStartFile(content, context_->unpacked_dir_path.get(),
+                                     &flag);
+  if (!result_check) {
+    LOG(ERROR) << "Could not find valid start file";
+    return common_installer::Step::Status::PARSE_ERROR;
+  }
+
+  result_check = CheckServicesStartFiles(backend_data->service_list.get(),
+      context_->unpacked_dir_path.get(),
+      &error);
+  if (!result_check) {
+    LOG(ERROR) << error;
+    return common_installer::Step::Status::PARSE_ERROR;
+  }
+
+  return common_installer::Step::Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace wgt
diff --git a/src/wgt/step/configuration/step_check_start_files.h b/src/wgt/step/configuration/step_check_start_files.h
new file mode 100644 (file)
index 0000000..7fc7025
--- /dev/null
@@ -0,0 +1,48 @@
+// 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_CHECK_START_FILES_H_
+#define WGT_STEP_CONFIGURATION_STEP_CHECK_START_FILES_H_
+
+#include <boost/filesystem.hpp>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+#include <manifest_parser/utils/logging.h>
+
+#include <wgt/wgt_backend_data.h>
+
+#include <type_traits>
+#include <cassert>
+#include <memory>
+#include <set>
+#include <string>
+
+namespace wgt {
+namespace configuration {
+
+/**
+ * \brief The StepCheckStartFiles class
+ *        Checks if valid start files exists.
+ *        It needs content info from wgt_backend_data.
+ *
+ * Step is used in delta mode.
+ */
+class StepCheckStartFiles : 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(CheckStartFiles)
+};
+
+}  // namespace configuration
+}  // namespace wgt
+
+#endif  // WGT_STEP_CONFIGURATION_STEP_CHECK_START_FILES_H_
diff --git a/src/wgt/step/configuration/step_parse.cc b/src/wgt/step/configuration/step_parse.cc
new file mode 100644 (file)
index 0000000..ec94a82
--- /dev/null
@@ -0,0 +1,1010 @@
+/* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
+// 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/configuration/step_parse.h"
+
+#include <boost/filesystem/path.hpp>
+
+#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 <manifest_parser/utils/version_number.h>
+#include <wgt_manifest_handlers/account_handler.h>
+#include <wgt_manifest_handlers/app_control_handler.h>
+#include <wgt_manifest_handlers/appdefined_privilege_handler.h>
+#include <wgt_manifest_handlers/application_icons_handler.h>
+#include <wgt_manifest_handlers/application_manifest_constants.h>
+#include <wgt_manifest_handlers/background_category_handler.h>
+#include <wgt_manifest_handlers/category_handler.h>
+#include <wgt_manifest_handlers/content_handler.h>
+#include <wgt_manifest_handlers/ime_handler.h>
+#include <wgt_manifest_handlers/metadata_handler.h>
+#include <wgt_manifest_handlers/provides_appdefined_privilege_handler.h>
+#include <wgt_manifest_handlers/service_handler.h>
+#include <wgt_manifest_handlers/setting_handler.h>
+#include <wgt_manifest_handlers/tizen_application_handler.h>
+#include <wgt_manifest_handlers/widget_handler.h>
+#include <wgt_manifest_handlers/w3c_pc_utils.h>
+
+#include <pkgmgr/pkgmgr_parser.h>
+#include <pkgmgrinfo_basic.h>
+
+#include <string.h>
+
+#include <chrono>
+#include <cstdio>
+#include <cstdlib>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+#include <utility>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+const char kCategoryWearableClock[] =
+    "http://tizen.org/category/wearable_clock";
+const char kCategoryWatchClock[] = "com.samsung.wmanager.WATCH_CLOCK";
+
+const char kManifestVersion[] = "1.0.0";
+const char kTizenPackageXmlNamespace[] = "http://tizen.org/ns/packages";
+const char kImeCategoryName[] = "http://tizen.org/category/ime";
+const char kDownloadableFontCategoryName[] =
+    "http://tizen.org/category/downloadable_font";
+const char kTTSCategoryName[] = "http://tizen.org/category/tts";
+
+const char kResWgt[] = "res/wgt";
+const char kConfigFileName[] = "config.xml";
+
+void FreeMetadataList(gpointer data) {
+  metadata_x* metadata = reinterpret_cast<metadata_x*>(data);
+  if (metadata) {
+    if (metadata->key)
+      free(const_cast<char*>(metadata->key));
+    if (metadata->value)
+      free(const_cast<char*>(metadata->value));
+    free(metadata);
+  }
+}
+
+GList* GenerateMetadataListX(const wgt::parse::MetaDataInfo& meta_info) {
+  GList* list = nullptr;
+  for (auto& meta : meta_info.metadata()) {
+    metadata_x* new_meta =
+        static_cast<metadata_x*>(calloc(1, sizeof(metadata_x)));
+    if (!new_meta) {
+      LOG(ERROR) << "Out of memory";
+      g_list_free_full(list, &FreeMetadataList);
+      return nullptr;
+    }
+    new_meta->key = strdup(meta.first.c_str());
+    if (!meta.second.empty())
+      new_meta->value = strdup(meta.second.c_str());
+    list = g_list_append(list, new_meta);
+  }
+  return list;
+}
+
+void AppendWidgetMetadata(GList** metadatas,
+    const std::vector<std::pair<std::string, std::string>> metadata) {
+  GList* list = *metadatas;
+  for (auto& meta : metadata) {
+    metadata_x* new_meta =
+        static_cast<metadata_x*>(calloc(1, sizeof(metadata_x)));
+    if (!new_meta) {
+      LOG(ERROR) << "Out of memory";
+      return;
+    }
+    new_meta->key = strdup(meta.first.c_str());
+    if (!meta.second.empty())
+      new_meta->value = strdup(meta.second.c_str());
+
+    list = g_list_append(list, new_meta);
+  }
+
+  *metadatas = list;
+}
+
+void SetApplicationXDefaults(application_x* application) {
+  application->effectimage_type = strdup("image");
+  application->guestmode_visibility = strdup("true");
+  application->hwacceleration = strdup("default");
+  application->indicatordisplay = strdup("true");
+  application->launchcondition = strdup("false");
+  application->permission_type = strdup("normal");
+  application->process_pool = strdup("false");
+  application->recentimage = strdup("false");
+  application->screenreader = strdup("use-system-setting");
+  application->submode = strdup("false");
+  application->support_disable = strdup("false");
+  application->ui_gadget = strdup("false");
+  application->multiple = strdup("false");
+}
+
+template<typename T>
+void AppendLabel(T* root, const std::string& label,
+                 const std::string& locale) {
+  label_x* label_item = reinterpret_cast<label_x*>(calloc(1, sizeof(label_x)));
+  if (!label_item) {
+    LOG(ERROR) << "Out of memory";
+    return;
+  }
+  label_item->name = strdup(label.c_str());
+  label_item->text = strdup(label.c_str());
+  label_item->lang = !locale.empty() ?
+      strdup(locale.c_str()) : strdup(DEFAULT_LOCALE);
+  root->label = g_list_append(root->label, label_item);
+}
+
+}  // namespace
+
+namespace wgt {
+namespace configuration {
+
+namespace app_keys = wgt::application_widget_keys;
+namespace sc = std::chrono;
+
+StepParse::StepParse(common_installer::InstallerContext* context,
+                     ConfigLocation config_location,
+                     bool check_start_file)
+    : Step(context),
+      config_location_(config_location),
+      check_start_file_(check_start_file) {
+}
+
+std::set<std::string> StepParse::ExtractPrivileges(
+    std::shared_ptr<const wgt::parse::PermissionsInfo> perm_info) const {
+  return perm_info->GetAPIPermissions();
+}
+
+std::string StepParse::GetPackageVersion(
+     const std::string& manifest_version) {
+  if (manifest_version.empty()) {
+    return kManifestVersion;
+  }
+  std::string version = manifest_version.substr(0,
+      manifest_version.find_first_not_of("1234567890."));
+
+  return version;
+}
+
+bool StepParse::FillInstallationInfo(manifest_x* manifest) {
+  manifest->root_path = strdup(
+      (context_->root_application_path.get() / manifest->package).c_str());
+  manifest->installed_time =
+      strdup(std::to_string(sc::system_clock::to_time_t(
+          sc::system_clock::now())).c_str());
+  return true;
+}
+
+bool StepParse::FillIconPaths(manifest_x* manifest) {
+  auto app_info =
+      GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
+             app_keys::kTizenApplicationKey);
+  if (!app_info) {
+    LOG(ERROR) << "Application info manifest data has not been found.";
+    return false;
+  }
+  auto icons_info =
+    GetManifestDataForKey<const wgt::parse::ApplicationIconsInfo>(
+           app_keys::kIconsKey);
+  if (!icons_info) {
+    icons_info.reset(new(std::nothrow) wgt::parse::ApplicationIconsInfo());
+    if (!icons_info) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+  }
+  wgt::parse::LocalizedApplicationIconsInfo localized_list =
+      wgt::parse::GetLocalizedIconList(*icons_info, widget_path_);
+  // We need to generate icon for each locale and icons are already set into
+  // lookup order. There isn't said that all icons should be received from
+  // one <icon> tag position so we iterate utils we run out of icons creating
+  // any icon element that are possible for given locale.
+  std::set<std::string> found_locales;
+  for (auto& application_icon : localized_list) {
+    const std::string& locale = application_icon.locale();
+    if (found_locales.find(locale) != found_locales.end())
+      continue;
+    found_locales.insert(locale);
+
+    icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
+    if (!icon) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+    bf::path icon_path = context_->root_application_path.get()
+        / app_info->package() / "res" / "wgt" / application_icon.path();
+    icon->text = strdup(icon_path.c_str());
+    if (!locale.empty())
+      icon->lang = strdup(locale.c_str());
+    else
+      icon->lang = strdup(DEFAULT_LOCALE);
+    manifest->icon = g_list_append(manifest->icon, icon);
+  }
+  return true;
+}
+
+bool StepParse::FillWidgetInfo(manifest_x* manifest) {
+  auto wgt_info =
+      GetManifestDataForKey<const wgt::parse::WidgetInfo>(
+             app_keys::kWidgetKey);
+
+  if (!wgt_info.get()) {
+    LOG(ERROR) << "Widget info manifest data has not been found.";
+    return false;
+  }
+
+  const std::string& version = wgt_info->version();
+
+  manifest->ns = strdup(kTizenPackageXmlNamespace);
+  manifest->version = strdup(GetPackageVersion(version).c_str());
+
+  for (auto& item : wgt_info->description_set()) {
+    description_x* description = reinterpret_cast<description_x*>
+        (calloc(1, sizeof(description_x)));
+    if (!description) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+    description->text = strdup(item.second.c_str());
+    description->lang = !item.first.empty() ?
+        strdup(item.first.c_str()) : strdup(DEFAULT_LOCALE);
+    manifest->description = g_list_append(manifest->description, description);
+  }
+
+  for (auto& item : wgt_info->name_set()) {
+    AppendLabel(manifest, item.second, item.first);
+  }
+
+  manifest->type = strdup("wgt");
+  manifest->appsetting = strdup("false");
+  manifest->nodisplay_setting = strdup("false");
+  manifest->installed_storage = strdup("installed_internal");
+
+  // For wgt package use the long name
+  application_x* app =
+      reinterpret_cast<application_x*>(manifest->application->data);
+  for (auto& item : wgt_info->name_set()) {
+    AppendLabel(app, item.second, item.first);
+  }
+
+  author_x* author = reinterpret_cast<author_x*>(calloc(1, sizeof(author_x)));
+  if (!author) {
+    LOG(ERROR) << "Out of memory";
+    return false;
+  }
+  if (!wgt_info->author().empty())
+    author->text = strdup(wgt_info->author().c_str());
+  if (!wgt_info->author_email().empty())
+    author->email = strdup(wgt_info->author_email().c_str());
+  if (!wgt_info->author_href().empty())
+    author->href = strdup(wgt_info->author_href().c_str());
+  author->lang = strdup(DEFAULT_LOCALE);
+  manifest->author = g_list_append(manifest->author, author);
+
+  auto settings_info =
+      GetManifestDataForKey<const wgt::parse::SettingInfo>(
+             wgt::application_widget_keys::kTizenSettingKey);
+  if (settings_info) {
+    switch (settings_info->install_location()) {
+    case wgt::parse::SettingInfo::InstallLocation::AUTO: {
+      manifest->installlocation = strdup("auto");
+      break;
+    }
+    case wgt::parse::SettingInfo::InstallLocation::INTERNAL: {
+      manifest->installlocation = strdup("internal-only");
+      break;
+    }
+    case wgt::parse::SettingInfo::InstallLocation::EXTERNAL: {
+      manifest->installlocation = strdup("prefer-external");
+      break;
+    }
+    }
+  } else {
+    manifest->installlocation = strdup("auto");
+  }
+
+  if (!context_->pkgid.get().empty()) {
+    // set update true if package is updated preload package
+    ci::RequestType req_type = context_->request_type.get();
+    ci::PkgQueryInterface pkg_query(manifest->package, context_->uid.get());
+    if (pkg_query.IsUpdatedPackage())
+      manifest->update = strdup("true");
+    else if (pkg_query.IsPreloadPackage() &&
+            (req_type == ci::RequestType::Update ||
+            req_type == ci::RequestType::Delta ||
+            req_type == ci::RequestType::MountUpdate ||
+            req_type == ci::RequestType::ReadonlyUpdateInstall))
+      manifest->update = strdup("true");
+    else
+      manifest->update = strdup("false");
+  }
+
+  return true;
+}
+
+bool StepParse::FillMainApplicationInfo(manifest_x* manifest) {
+  auto app_info =
+      GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
+             app_keys::kTizenApplicationKey);
+  if (!app_info) {
+    LOG(ERROR) << "Application info manifest data has not been found.";
+    return false;
+  }
+  bool has_watch_category = false;
+  bool has_ime = false;
+  bool has_downloadable_font = false;
+  bool has_tts = false;
+  auto category_info =
+      GetManifestDataForKey<const wgt::parse::CategoryInfoList>(
+             app_keys::kTizenCategoryKey);
+
+  if (category_info) {
+    has_watch_category = std::find_if(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       [](const std::string& category) {
+      return category == kCategoryWearableClock ||
+             category == kCategoryWatchClock;
+    }) != category_info->categories.end();
+    has_ime = std::find(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       kImeCategoryName)
+        != category_info->categories.end();
+    has_downloadable_font = std::find(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       kDownloadableFontCategoryName)
+        != category_info->categories.end();
+    has_tts = std::find(category_info->categories.begin(),
+                                       category_info->categories.end(),
+                                       kTTSCategoryName)
+        != category_info->categories.end();
+  }
+
+  // application data
+  application_x* application = reinterpret_cast<application_x*>(
+      calloc(1, sizeof(application_x)));
+  if (!application) {
+    LOG(ERROR) << "Out of memory";
+    return false;
+  }
+  application->component_type =
+      has_watch_category ? strdup("watchapp") : strdup("uiapp");
+  application->mainapp = strdup("true");
+  application->appid = strdup(app_info->id().c_str());
+  auto settings_info =
+      GetManifestDataForKey<const wgt::parse::SettingInfo>(
+             wgt::application_widget_keys::kTizenSettingKey);
+
+  bool no_display = settings_info ? settings_info->no_display() : false;
+  bool has_no_display_category =
+      has_watch_category || has_ime || has_tts || has_downloadable_font;
+
+  application->nodisplay = (has_no_display_category || no_display) ?
+      strdup("true") : strdup("false");
+  application->taskmanage = has_no_display_category ? strdup("false") :
+      strdup("true");
+
+  SetApplicationXDefaults(application);
+  if (has_watch_category)
+    application->support_ambient =
+        strdup(app_info->ambient_support() ? "true" : "false");
+  else
+    application->support_ambient = strdup("false");
+  application->package = strdup(app_info->package().c_str());
+
+  application->exec =
+      strdup((context_->root_application_path.get() / app_info->package()
+              / "bin" / application->appid).c_str());
+  application->type = strdup("webapp");
+  application->onboot = strdup("false");
+  application->autorestart = strdup("false");
+
+  application->launch_mode = strdup(app_info->launch_mode().c_str());
+  application->api_version = strdup(manifest->api_version);
+  for (auto& icon : GListRange<icon_x*>(manifest->icon)) {
+    icon_x* app_icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
+    if (!app_icon) {
+      LOG(ERROR) << "Out of memory";
+      pkgmgrinfo_basic_free_application(application);
+      return false;
+    }
+    app_icon->text = strdup(icon->text);
+    app_icon->lang = strdup(icon->lang);
+    application->icon = g_list_append(application->icon, app_icon);
+  }
+  // guarantees that the main app will be at the begining of the list
+  manifest->application = g_list_insert(manifest->application, application, 0);
+
+  manifest->package = strdup(app_info->package().c_str());
+  manifest->mainapp_id = strdup(app_info->id().c_str());
+  return true;
+}
+
+bool StepParse::FillServiceApplicationInfo(manifest_x* manifest) {
+  auto service_list =
+      GetManifestDataForKey<const wgt::parse::ServiceList>(
+             app_keys::kTizenServiceKey);
+  if (!service_list)
+    return true;
+  for (auto& service_info : service_list->services) {
+    application_x* application = reinterpret_cast<application_x*>
+        (calloc(1, sizeof(application_x)));
+    if (!application) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+    application->component_type = strdup("svcapp");
+    application->mainapp = strdup("false");
+    application->appid = strdup(service_info.id().c_str());
+    application->exec =
+        strdup((context_->root_application_path.get() / manifest->package
+                / "bin" / application->appid).c_str());
+    application->type = strdup("webapp");
+    application->onboot =
+        service_info.on_boot() ? strdup("true") : strdup("false");
+    application->autorestart =
+        service_info.auto_restart() ? strdup("true") : strdup("false");
+    application->nodisplay = strdup("false");
+    application->taskmanage = strdup("true");
+    SetApplicationXDefaults(application);
+    application->support_ambient = strdup("false");
+    application->package = strdup(manifest->package);
+    application->api_version = strdup(manifest->api_version);
+    for (auto& pair : service_info.names()) {
+      AppendLabel(application, pair.second, pair.first);
+    }
+
+    if (!service_info.icon().empty()) {
+      bf::path icon_path = context_->root_application_path.get()
+          / manifest->package / "res" / "wgt" / service_info.icon();
+      icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
+      if (!icon) {
+        LOG(ERROR) << "Out of memory";
+        pkgmgrinfo_basic_free_application(application);
+        return false;
+      }
+      icon->text = strdup(icon_path.c_str());
+      icon->lang = strdup(DEFAULT_LOCALE);
+      application->icon = g_list_append(application->icon, icon);
+    }
+
+    for (auto& category : service_info.categories()) {
+      application->category = g_list_append(application->category,
+                                            strdup(category.c_str()));
+    }
+
+    for (auto& pair : service_info.metadata_set()) {
+      metadata_x* item = reinterpret_cast<metadata_x*>(
+          calloc(1, sizeof(metadata_x)));
+      if (!item) {
+        LOG(ERROR) << "Out of memory";
+        pkgmgrinfo_basic_free_application(application);
+        return false;
+      }
+      item->key = strdup(pair.first.c_str());
+      if (!pair.second.empty())
+        item->value = strdup(pair.second.c_str());
+      application->metadata = g_list_append(application->metadata, item);
+    }
+
+    manifest->application = g_list_append(manifest->application, application);
+  }
+  return true;
+}
+
+bool StepParse::FillWidgetApplicationInfo(manifest_x* manifest) {
+  auto appwidget_info =
+      GetManifestDataForKey<const wgt::parse::AppWidgetInfo>(
+             wgt::application_widget_keys::kTizenAppWidgetFullKey);
+  if (!appwidget_info)
+    return true;
+
+  auto settings_info =
+      GetManifestDataForKey<const wgt::parse::SettingInfo>(
+              wgt::application_widget_keys::kTizenSettingKey);
+  bool no_display = settings_info ? settings_info->no_display() : false;
+
+  for (auto& app_widget : appwidget_info->app_widgets()) {
+    application_x* application = reinterpret_cast<application_x*>
+        (calloc(1, sizeof(application_x)));
+    if (!application) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+    application->component_type = strdup("widgetapp");
+    application->mainapp = strdup("false");
+    application->appid = strdup(app_widget.id.c_str());
+    application->exec =
+        strdup((context_->root_application_path.get() / manifest->package
+                / "bin" / application->appid).c_str());
+    application->type = strdup("webapp");
+    application->nodisplay = no_display ? strdup("true") : strdup("false");
+    application->taskmanage = strdup("false");
+    SetApplicationXDefaults(application);
+    application->support_ambient = strdup("false");
+    application->package = strdup(manifest->package);
+    application->api_version = strdup(manifest->api_version);
+    if (!app_widget.label.default_value.empty()) {
+      AppendLabel(application, app_widget.label.default_value, std::string());
+    }
+
+    for (auto& pair : app_widget.label.lang_value_map) {
+      AppendLabel(application, pair.second, pair.first);
+    }
+
+    if (!app_widget.icon_src.empty()) {
+      icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
+      if (!icon) {
+        LOG(ERROR) << "Out of memory";
+        pkgmgrinfo_basic_free_application(application);
+        return false;
+      }
+      icon->text = strdup(app_widget.icon_src.c_str());
+      icon->lang = strdup(DEFAULT_LOCALE);
+      application->icon = g_list_append(application->icon, icon);
+    }
+
+    if (!app_widget.metadata.empty())
+      AppendWidgetMetadata(&application->metadata, app_widget.metadata);
+
+    manifest->application = g_list_append(manifest->application, application);
+  }
+  return true;
+}
+
+
+bool StepParse::FillBackgroundCategoryInfo(manifest_x* manifest) {
+  auto manifest_data = parser_->GetManifestData(
+      app_keys::kTizenBackgroundCategoryKey);
+  std::shared_ptr<const wgt::parse::BackgroundCategoryInfoList> bc_list =
+      std::static_pointer_cast<const wgt::parse::BackgroundCategoryInfoList>(
+          manifest_data);
+
+  if (!bc_list)
+    return true;
+
+  application_x* app =
+      reinterpret_cast<application_x*>(manifest->application->data);
+
+  for (auto& background_category : bc_list->background_categories) {
+    app->background_category = g_list_append(
+        app->background_category, strdup(background_category.value().c_str()));
+  }
+
+  return true;
+}
+
+bool StepParse::FillTrustAnchorInfo(manifest_x* manifest) {
+  auto trust_anchor_info = parser_->GetManifestData(
+      app_keys::kTizenTrustAnchorKey);
+
+  if (!trust_anchor_info)
+    return true;
+
+  std::shared_ptr<const parse::TrustAnchorInfo> trust_anchor =
+      std::static_pointer_cast<const parse::TrustAnchorInfo>
+      (trust_anchor_info);
+
+  if (!trust_anchor)
+    return true;
+
+  std::string use_system_certs = trust_anchor->get_use_system_certs();
+  if (!use_system_certs.empty())
+    manifest->use_system_certs = strdup(use_system_certs.c_str());
+
+  return true;
+}
+
+bool StepParse::FillAppControl(manifest_x* manifest) {
+  auto app_info_list =
+      GetManifestDataForKey<const wgt::parse::AppControlInfoList>(
+             app_keys::kTizenApplicationAppControlsKey);
+
+  application_x* app =
+      reinterpret_cast<application_x*>(manifest->application->data);
+  if (app_info_list) {
+    for (const auto& control : app_info_list->controls) {
+      appcontrol_x* app_control =
+          static_cast<appcontrol_x*>(calloc(1, sizeof(appcontrol_x)));
+      if (!app_control) {
+        LOG(ERROR) << "Out of memory";
+        return false;
+      }
+      app_control->operation = strdup(control.operation().c_str());
+      app_control->mime = strdup(control.mime().c_str());
+      app_control->uri = strdup(control.uri().c_str());
+      app_control->visibility = strdup("local-only");
+      app_control->id = strdup("no-name-app-control");
+      app->appcontrol = g_list_append(app->appcontrol, app_control);
+    }
+  }
+  return true;
+}
+
+bool StepParse::FillPrivileges(manifest_x* manifest) {
+  auto perm_info =
+      GetManifestDataForKey<const wgt::parse::PermissionsInfo>(
+             app_keys::kTizenPermissionsKey);
+  std::set<std::string> privileges;
+  if (perm_info)
+    privileges = ExtractPrivileges(perm_info);
+
+  for (auto& priv : privileges) {
+    privilege_x* privilege =
+        reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
+    if (!privilege) {
+      LOG(ERROR) << "Out of memory";
+      return false;
+    }
+    privilege->type = strdup(common_installer::kWebPrivilegeType);
+    privilege->value = strdup(priv.c_str());
+    manifest->privileges = g_list_append(manifest->privileges, privilege);
+  }
+  return true;
+}
+
+bool StepParse::FillAppDefinedPrivileges(manifest_x* manifest) {
+  auto priv_info_list =
+      GetManifestDataForKey<const wgt::parse::AppDefinedPrivilegeInfoList>(
+          app_keys::kTizenAppDefinedPrivilegeKey);
+  if (!priv_info_list)
+    return true;
+
+  for (auto& priv : priv_info_list->appdefined_privileges) {
+    appdefined_privilege_x* privilege =
+        reinterpret_cast<appdefined_privilege_x*>(calloc(1,
+            sizeof(appdefined_privilege_x)));
+    if (privilege == nullptr) {
+      LOG(ERROR) << "Memory alloc failure";
+      return false;
+    }
+    privilege->value = strdup(priv.name().c_str());
+    privilege->type = strdup(common_installer::kWebPrivilegeType);
+    if (!priv.license().empty()) {
+      if (bf::path(priv.license()).is_absolute())
+        privilege->license = strdup(priv.license().c_str());
+      else
+        privilege->license = strdup((context_->root_application_path.get()
+            / manifest->package / priv.license()).c_str());
+    }
+    manifest->appdefined_privileges =
+        g_list_append(manifest->appdefined_privileges, privilege);
+  }
+  return true;
+}
+
+bool StepParse::FillProvidesAppDefinedPrivileges(manifest_x* manifest) {
+  auto priv_info_list =
+      GetManifestDataForKey<const wgt::parse::AppDefinedPrivilegeInfoList>(
+          app_keys::kTizenProvidesAppDefinedPrivilegeKey);
+  if (!priv_info_list)
+    return true;
+
+  for (auto& priv : priv_info_list->appdefined_privileges) {
+    appdefined_privilege_x* privilege =
+        reinterpret_cast<appdefined_privilege_x*>(calloc(1,
+            sizeof(appdefined_privilege_x)));
+    if (privilege == nullptr) {
+      LOG(ERROR) << "Memory alloc failure";
+      return false;
+    }
+    privilege->value = strdup(priv.name().c_str());
+    privilege->type = strdup(common_installer::kWebPrivilegeType);
+    if (!priv.license().empty()) {
+      if (bf::path(priv.license()).is_absolute())
+        privilege->license = strdup(priv.license().c_str());
+      else
+        privilege->license = strdup((context_->root_application_path.get()
+            / manifest->package / priv.license()).c_str());
+    }
+    manifest->provides_appdefined_privileges =
+        g_list_append(manifest->provides_appdefined_privileges, privilege);
+  }
+  return true;
+}
+
+bool StepParse::FillCategories(manifest_x* manifest) {
+  auto category_info =
+      GetManifestDataForKey<const wgt::parse::CategoryInfoList>(
+             app_keys::kTizenCategoryKey);
+  if (!category_info)
+    return true;
+
+  application_x* app =
+      reinterpret_cast<application_x*>(manifest->application->data);
+  // there is one app atm
+  for (auto& category : category_info->categories) {
+    app->category = g_list_append(app->category, strdup(category.c_str()));
+  }
+  return true;
+}
+
+bool StepParse::FillMetadata(manifest_x* manifest) {
+  auto meta_info =
+      GetManifestDataForKey<const wgt::parse::MetaDataInfo>(
+             app_keys::kTizenMetaDataKey);
+  if (!meta_info)
+    return true;
+
+  for (application_x* app : GListRange<application_x*>(manifest->application)) {
+    app->metadata = GenerateMetadataListX(*meta_info);
+  }
+  return true;
+}
+
+bool StepParse::FillAppWidget() {
+  // This is needed to store preview icons which are not saved into manifest_x
+  WgtBackendData* backend_data =
+      static_cast<WgtBackendData*>(context_->backend_data.get());
+
+  auto appwidget_info =
+      GetManifestDataForKey<const wgt::parse::AppWidgetInfo>(
+             wgt::application_widget_keys::kTizenAppWidgetFullKey);
+  if (appwidget_info)
+    backend_data->appwidgets.set(*appwidget_info);
+  return true;
+}
+
+bool StepParse::FillAccounts(manifest_x* manifest) {
+  auto account_info =
+      GetManifestDataForKey<const wgt::parse::AccountInfo>(
+             app_keys::kAccountKey);
+  if (!account_info)
+    return true;
+  common_installer::AccountInfo info;
+  for (auto& account : account_info->accounts()) {
+    common_installer::SingleAccountInfo single_info;
+    single_info.capabilities = account.capabilities;
+    single_info.icon_paths = account.icon_paths;
+    single_info.multiple_account_support = account.multiple_account_support;
+    single_info.names = account.names;
+    // wgt can contain only one app so this assumes mainapp_id is valid here
+    single_info.appid = manifest->mainapp_id;
+    info.set_account(single_info);
+  }
+  context_->manifest_plugins_data.get().account_info.set(info);
+  return true;
+}
+
+bool StepParse::FillImeInfo() {
+  auto ime_info =
+      GetManifestDataForKey<const wgt::parse::ImeInfo>(
+             app_keys::kTizenImeKey);
+  if (!ime_info)
+    return true;
+
+  common_installer::ImeInfo info;
+  info.setUuid(ime_info->uuid());
+
+  const auto &languages = ime_info->languages();
+  for (const auto &language : languages)
+    info.AddLanguage(language);
+
+  context_->manifest_plugins_data.get().ime_info.set(std::move(info));
+  return true;
+}
+
+bool StepParse::FillExtraManifestInfo(manifest_x* manifest) {
+  return FillAccounts(manifest) && FillImeInfo() && FillAppWidget();
+}
+
+bool StepParse::FillManifestX(manifest_x* manifest) {
+  // Fill data for main application
+  if (!FillIconPaths(manifest))
+    return false;
+  if (!FillMainApplicationInfo(manifest))
+    return false;
+  if (!FillWidgetInfo(manifest))
+    return false;
+  if (!FillInstallationInfo(manifest))
+    return false;
+  if (!FillPrivileges(manifest))
+    return false;
+  if (!FillAppDefinedPrivileges(manifest))
+    return false;
+  if (!FillProvidesAppDefinedPrivileges(manifest))
+    return false;
+  if (!FillAppControl(manifest))
+    return false;
+  if (!FillCategories(manifest))
+    return false;
+  if (!FillMetadata(manifest))
+    return false;
+  if (!FillBackgroundCategoryInfo(manifest))
+    return false;
+  if (!FillTrustAnchorInfo(manifest))
+    return false;
+
+  // Fill data for other applications
+  if (!FillAdditionalApplications(manifest))
+    return false;
+
+  // Fill extra data, other than manifest_x structure
+  if (!FillExtraManifestInfo(manifest))
+    return false;
+
+  return true;
+}
+
+
+bool StepParse::FillAdditionalApplications(manifest_x* manifest) {
+  if (!FillServiceApplicationInfo(manifest))
+    return false;
+  if (!FillWidgetApplicationInfo(manifest))
+    return false;
+  return true;
+}
+
+bool StepParse::LocateConfigFile() {
+  switch (config_location_) {
+    case ConfigLocation::PACKAGE:
+      return StepParse::Check(context_->unpacked_dir_path.get());
+    case ConfigLocation::INSTALLED:
+      return StepParse::Check(context_->GetPkgPath() / kResWgt);
+    case ConfigLocation::RECOVERY:
+      if (StepParse::Check(common_installer::GetBackupPathForPackagePath(
+          context_->GetPkgPath()) / kResWgt))
+        return true;
+      if (StepParse::Check(context_->GetPkgPath() / kResWgt))
+        return true;
+      return false;
+    case ConfigLocation::RESOURCE_WGT:
+      return StepParse::Check(context_->unpacked_dir_path.get() / kResWgt);
+    default:
+      LOG(ERROR) << "Unknown config location";
+      return false;
+  }
+}
+
+common_installer::Step::Status StepParse::process() {
+  if (!LocateConfigFile()) {
+    LOG(ERROR) << "No config.xml";
+    return common_installer::Step::Status::MANIFEST_NOT_FOUND;
+  }
+
+  parser_.reset(new(std::nothrow) wgt::parse::WidgetConfigParser());
+  if (!parser_) {
+    LOG(ERROR) << "Out of memory";
+    return common_installer::Step::Status::CONFIG_ERROR;
+  }
+  if (!parser_->ParseManifest(widget_path_ / kConfigFileName)) {
+    LOG(ERROR) << "[Parse] Parse failed. " <<  parser_->GetErrorMessage();
+    return common_installer::Step::Status::PARSE_ERROR;
+  }
+
+  WgtBackendData* backend_data =
+    static_cast<WgtBackendData*>(context_->backend_data.get());
+
+  if (check_start_file_) {
+    if (!parser_->CheckValidStartFile()) {
+      LOG(ERROR) << parser_->GetErrorMessage();
+      return common_installer::Step::Status::PARSE_ERROR;
+    }
+    if (!parser_->CheckValidServicesStartFiles()) {
+      LOG(ERROR) << parser_->GetErrorMessage();
+      return common_installer::Step::Status::PARSE_ERROR;
+    }
+  } else {
+    // making backup of content data and services content data
+    auto content_info =
+      GetManifestDataForKey<const wgt::parse::ContentInfo>(
+              wgt::application_widget_keys::kTizenContentKey);
+    auto service_list =
+      GetManifestDataForKey<const wgt::parse::ServiceList>(
+              wgt::application_widget_keys::kTizenServiceKey);
+    if (content_info)
+      backend_data->content.set(*content_info);
+    if (service_list)
+      backend_data->service_list.set(*service_list);
+  }
+
+  // Copy data from ManifestData to InstallerContext
+  auto info =
+      GetManifestDataForKey<const wgt::parse::TizenApplicationInfo>(
+              wgt::application_widget_keys::kTizenApplicationKey);
+  auto wgt_info =
+      GetManifestDataForKey<const wgt::parse::WidgetInfo>(
+              wgt::application_widget_keys::kTizenWidgetKey);
+
+  std::string name;
+  const auto& name_set = wgt_info->name_set();
+  if (name_set.find("") != name_set.end())
+    name = name_set.find("")->second;
+  if (name_set.begin() != name_set.end())
+    name = name_set.begin()->second;
+
+  std::string short_name;
+  const auto& short_name_set = wgt_info->short_name_set();
+  if (short_name_set.find("") != short_name_set.end())
+    short_name = short_name_set.find("")->second;
+  if (short_name_set.begin() != short_name_set.end())
+    short_name = short_name_set.begin()->second;
+
+  const std::string& package_version = wgt_info->version();
+  const std::string& required_api_version = info->required_version();
+
+  manifest_x* manifest =
+      static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
+  if (!manifest) {
+    LOG(ERROR) << "Out of memory";
+    return common_installer::Step::Status::ERROR;
+  }
+  manifest->api_version = strdup(required_api_version.c_str());
+
+  if (!FillManifestX(manifest)) {
+    LOG(ERROR) << "[Parse] Storing manifest_x failed. "
+               <<  parser_->GetErrorMessage();
+    pkgmgr_parser_free_manifest_xml(manifest);
+    return common_installer::Step::Status::PARSE_ERROR;
+  }
+
+  context_->pkgid.set(manifest->package);
+
+  // write pkgid for recovery file
+  if (context_->recovery_info.get().recovery_file) {
+    context_->recovery_info.get().recovery_file->set_pkgid(manifest->package);
+    context_->recovery_info.get().recovery_file->WriteAndCommitFileContent();
+  }
+
+  auto perm_info =
+      GetManifestDataForKey<const wgt::parse::PermissionsInfo>(
+              wgt::application_widget_keys::kTizenPermissionsKey);
+  parser::PermissionSet permissions;
+  if (perm_info)
+     permissions = perm_info->GetAPIPermissions();
+
+  auto settings_info =
+      GetManifestDataForKey<const wgt::parse::SettingInfo>(
+              wgt::application_widget_keys::kTizenSettingKey);
+  if (settings_info)
+    backend_data->settings.set(*settings_info);
+
+  LOG(DEBUG) << " Read data -[ ";
+  LOG(DEBUG) << "App id: " << info->id();
+  LOG(DEBUG) << "  package     = " <<  info->package();
+  LOG(DEBUG) << "  id          = " <<  info->id();
+  LOG(DEBUG) << "  name        = " <<  name;
+  LOG(DEBUG) << "  short_name  = " <<  short_name;
+  LOG(DEBUG) << "  aplication version     = " <<  package_version;
+  LOG(DEBUG) << "  api_version = " <<  info->required_version();
+  LOG(DEBUG) << "  launch_mode = " <<  info->launch_mode();
+  LOG(DEBUG) << "  privileges -[";
+  for (const auto& p : permissions) {
+    LOG(DEBUG) << "    " << p;
+  }
+  LOG(DEBUG) << "  ]-";
+  LOG(DEBUG) << "]-";
+
+  if (context_->manifest_data.get())
+    pkgmgr_parser_free_manifest_xml(context_->manifest_data.get());
+
+  context_->manifest_data.set(manifest);
+  return common_installer::Step::Status::OK;
+}
+
+bool StepParse::Check(const boost::filesystem::path& widget_path) {
+  LOG(DEBUG) << "unpacked widget path: " << widget_path;
+
+  widget_path_ = widget_path;
+
+  boost::filesystem::path config = widget_path / kConfigFileName;
+  LOG(DEBUG) << "config.xml path: " << config;
+  if (!boost::filesystem::exists(config))
+    return false;
+  return true;
+}
+
+}  // namespace configuration
+}  // namespace wgt
diff --git a/src/wgt/step/configuration/step_parse.h b/src/wgt/step/configuration/step_parse.h
new file mode 100644 (file)
index 0000000..e875f77
--- /dev/null
@@ -0,0 +1,97 @@
+// 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_CONFIGURATION_STEP_PARSE_H_
+#define WGT_STEP_CONFIGURATION_STEP_PARSE_H_
+
+#include <boost/filesystem.hpp>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+#include <manifest_parser/utils/logging.h>
+#include <wgt_manifest_handlers/permissions_handler.h>
+#include <wgt_manifest_handlers/widget_config_parser.h>
+
+#include <type_traits>
+#include <cassert>
+#include <memory>
+#include <set>
+#include <string>
+
+namespace wgt {
+namespace configuration {
+
+/**
+ * \brief This step parse config.xml configuration file of widget
+ */
+class StepParse : public common_installer::Step {
+ public:
+  enum class ConfigLocation {
+    PACKAGE,      // parse config file from unpacking diretory
+    INSTALLED,    // parse config file from current package installation
+    RECOVERY,     // parse config file from backup location or package location
+    RESOURCE_WGT  // parse config file from unpacking subdiretory "res/wgt"
+  };
+
+  explicit StepParse(common_installer::InstallerContext* context,
+      ConfigLocation config_location, bool check_start_file);
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+ protected:
+  virtual bool LocateConfigFile();
+  bool Check(const boost::filesystem::path& widget_path);
+
+  boost::filesystem::path widget_path_;
+
+ private:
+  std::set<std::string> ExtractPrivileges(
+      std::shared_ptr<const wgt::parse::PermissionsInfo> perm_info) const;
+
+  std::string GetPackageVersion(const std::string& manifest_version);
+
+  bool FillInstallationInfo(manifest_x* manifest);
+  bool FillIconPaths(manifest_x* manifest);
+  bool FillWidgetInfo(manifest_x* manifest);
+  bool FillMainApplicationInfo(manifest_x* manifest);
+  bool FillServiceApplicationInfo(manifest_x* manifest);
+  bool FillWidgetApplicationInfo(manifest_x* manifest);
+  bool FillAppControl(manifest_x* manifest);
+  bool FillPrivileges(manifest_x* manifest);
+  bool FillAppDefinedPrivileges(manifest_x* manifest);
+  bool FillProvidesAppDefinedPrivileges(manifest_x* manifest);
+  bool FillCategories(manifest_x* manifest);
+  bool FillMetadata(manifest_x* manifest);
+  bool FillExtraManifestInfo(manifest_x* manifest);
+  bool FillAccounts(manifest_x* manifest);
+  bool FillImeInfo();
+  bool FillAppWidget();
+  bool FillBackgroundCategoryInfo(manifest_x* manifest);
+  bool FillAdditionalApplications(manifest_x* manifest);
+  bool FillManifestX(manifest_x* manifest);
+  bool FillTrustAnchorInfo(manifest_x* manifest);
+
+  std::unique_ptr<wgt::parse::WidgetConfigParser> parser_;
+  ConfigLocation config_location_;
+  bool check_start_file_;
+
+  template<typename T>
+  std::shared_ptr<const T> GetManifestDataForKey(const std::string& key) {
+      assert(!key.empty());
+      static_assert(std::is_base_of<parser::ManifestData, T>::value,
+              "Type is not base of parser::ManifestData");
+      return std::static_pointer_cast<const T>(parser_->GetManifestData(key));
+  }
+
+  STEP_NAME(Parse)
+};
+
+}  // namespace configuration
+}  // namespace wgt
+
+#endif  // WGT_STEP_CONFIGURATION_STEP_PARSE_H_
diff --git a/src/wgt/step/configuration/step_parse_recovery.cc b/src/wgt/step/configuration/step_parse_recovery.cc
new file mode 100644 (file)
index 0000000..728a19e
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/configuration/step_parse_recovery.h"
+
+#include <common/paths.h>
+#include <common/installer_context.h>
+
+namespace {
+
+const char kResWgtPath[] = "res/wgt";
+
+}  // namespace
+
+namespace wgt {
+namespace configuration {
+
+StepParseRecovery::StepParseRecovery(
+    common_installer::InstallerContext* context)
+    : StepParse(context, StepParse::ConfigLocation::RECOVERY, false) {
+}
+
+common_installer::Step::Status StepParseRecovery::process() {
+  (void) StepParse::process();
+  return Status::OK;
+}
+
+common_installer::Step::Status StepParseRecovery::precheck() {
+  if (context_->root_application_path.get().empty()) {
+    LOG(ERROR) << "Root path of packages in not set";
+    return Status::INVALID_VALUE;
+  }
+  if (context_->pkgid.get().empty()) {
+    LOG(WARNING) << "Pkgid is not set. Parsing skipped";
+    return Status::OK;
+  }
+  return Status::OK;
+}
+
+}  // namespace configuration
+}  // namespace wgt
diff --git a/src/wgt/step/configuration/step_parse_recovery.h b/src/wgt/step/configuration/step_parse_recovery.h
new file mode 100644 (file)
index 0000000..5af4ce3
--- /dev/null
@@ -0,0 +1,56 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_
+#define WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "wgt/step/configuration/step_parse.h"
+
+namespace wgt {
+namespace configuration {
+/**
+ * \brief The StepParseRecovery class
+ *        Retrievies package information from config.xml during RECOVERY.
+ *
+ * Step is used in recovery mode.
+ *
+ * Parse config.xml file by guessing possible locations:
+ *  - backup package directory
+ *  - package installation directory
+ * to get information about widget package to be recovered.
+ *
+ */
+class StepParseRecovery : public StepParse {
+ public:
+  /**
+   * \brief Explicit constructor
+   *
+   * \param context installer context
+   */
+  explicit StepParseRecovery(common_installer::InstallerContext* context);
+
+  /**
+   * \brief Parse config.xml
+   *
+   * \return Status::OK
+   */
+  Status process() override;
+
+  /**
+   * \brief Validate requirements for this step
+   *
+   * \return Status::ERROR when root path of packages is missing,
+   *         Status::OK otherwise
+   */
+  Status precheck() override;
+
+  STEP_NAME(ParseRecovery)
+};
+
+}  // namespace configuration
+}  // namespace wgt
+
+#endif  // WGT_STEP_CONFIGURATION_STEP_PARSE_RECOVERY_H_
diff --git a/src/wgt/step/configuration/step_set_old_signature_files_location.cc b/src/wgt/step/configuration/step_set_old_signature_files_location.cc
new file mode 100644 (file)
index 0000000..11ec209
--- /dev/null
@@ -0,0 +1,35 @@
+// 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
diff --git a/src/wgt/step/configuration/step_set_old_signature_files_location.h b/src/wgt/step/configuration/step_set_old_signature_files_location.h
new file mode 100644 (file)
index 0000000..4d8b5e4
--- /dev/null
@@ -0,0 +1,30 @@
+// 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_
diff --git a/src/wgt/step/encryption/step_encrypt_resources.cc b/src/wgt/step/encryption/step_encrypt_resources.cc
new file mode 100644 (file)
index 0000000..dc4b6ec
--- /dev/null
@@ -0,0 +1,294 @@
+// 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/encryption/step_encrypt_resources.h"
+
+#include <web_app_enc.h>
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/utils/file_util.h>
+#include <common/utils/byte_size_literals.h>
+
+#include <manifest_parser/utils/logging.h>
+#include <sys/stat.h>
+
+#include <algorithm>
+#include <cstdio>
+#include <cstdlib>
+#include <set>
+#include <string>
+#include <memory>
+
+namespace {
+
+const std::size_t kEncryptionChunkMaxSize = 8_kB;  // bytes
+const std::set<std::string> encryptSet { ".html", ".htm", ".css", ".js"};
+
+FILE* OpenFile(const std::string& path, const std::string& mode) {
+  FILE* result = nullptr;
+
+  do {
+    result = fopen(path.c_str(), mode.c_str());
+  } while ((nullptr == result));
+
+  return result;
+}
+
+std::size_t ReadBytes(unsigned char* buffer, std::size_t count, FILE* stream) {
+  std::size_t result = std::fread(buffer,
+                                  1,
+                                  count,
+                                  stream);
+  if (result != count) {
+    if (0 != std::ferror(stream)) {
+      LOG(ERROR) << "Error while reading data";
+    }
+  }
+
+  return result;
+}
+
+void WriteBytes(unsigned char* buffer, std::size_t count, FILE* stream) {
+  // original file is treated as destination!
+  if (count <= 0) {
+    return;
+  }
+  std::size_t bytes_written = 0;
+  do {
+     std::size_t bytes_appended = std::fwrite(
+         buffer + bytes_written,
+         sizeof(unsigned char),
+         count - bytes_written,
+         stream);
+    if ((bytes_appended == 0)) {
+      LOG(ERROR) << "Error while writing data";
+      return;
+    }
+    bytes_written += bytes_appended;
+  } while ((bytes_written < count));
+}
+
+}  // namespace
+
+
+namespace wgt {
+namespace encryption {
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+common_installer::Step::Status StepEncryptResources::precheck() {
+  backend_data_ = static_cast<WgtBackendData*>(context_->backend_data.get());
+  if (!backend_data_) {
+    LOG(ERROR) << "no backend data";
+    return common_installer::Step::Status::ERROR;
+  }
+
+  SetEncryptionRoot();
+
+  if (input_.empty()) {
+    LOG(ERROR) << "unpacked_dir_path attribute is empty";
+    return Step::Status::INVALID_VALUE;
+  }
+  if (!bf::exists(input_)) {
+    LOG(ERROR) << "unpacked_dir_path (" << input_ << ") path does not exist";
+    return Step::Status::INVALID_VALUE;
+  }
+
+  return common_installer::Step::Status::OK;
+}
+
+common_installer::Step::Status StepEncryptResources::process() {
+  if (!backend_data_->settings.get().encryption_enabled()) {
+    LOG(DEBUG) << "no encryption";
+    return common_installer::Step::Status::OK;
+  }
+  LOG(DEBUG) << "Encrypting";
+
+  if (!Encrypt(input_)) {
+    LOG(ERROR) << "Error during encryption";
+    return common_installer::Step::Status::ERROR;
+  }
+
+  return common_installer::Step::Status::OK;
+}
+
+bool StepEncryptResources::Encrypt(const bf::path &src) {
+  // traversing through src dir (recurrence if subdir found)
+  // for every file found, check if it should be encrypted (ToBeEncrypted)
+  // if yes, encrypt it (and replace original one)
+  // if not, leave it
+  for (bf::directory_iterator file(src);
+       file != bf::directory_iterator();
+       ++file) {
+    bs::error_code error_code;
+    bf::path current(file->path());
+
+    bool is_dir = bf::is_directory(current, error_code);
+    if (error_code)
+      return false;
+    if (is_dir) {
+      if (!Encrypt(current))
+        return false;
+      continue;
+    }
+
+    bool is_sym = bf::is_symlink(symlink_status(current, error_code));
+    if (error_code)
+      return false;
+    if (is_sym)
+      continue;
+
+    // it is regular file (not dir, not symlink)
+    if (ToBeEncrypted(current)) {
+      LOG(INFO) << "File for encryption: " << current;
+      if (!EncryptFile(current))
+        return false;
+    }
+  }
+  return true;
+}
+
+bool StepEncryptResources::EncryptFile(const bf::path &src) {
+  bf::path encFile(src.string() + ".enc");
+  struct stat info;
+  memset(&info, 0, sizeof(info));
+  if (stat(src.string().c_str(), &info) != 0) {
+    LOG(ERROR) << "Could not access file " << src.string();
+    return false;
+  }
+  const std::size_t fileSize = info.st_size;
+  if (0 == fileSize) {
+    LOG(ERROR) << src.string().c_str() << " size is 0, so encryption is skiped";
+    return true;
+  }
+
+  FILE *input = OpenFile(src.string().c_str(), "rb");
+  if (input == nullptr) {
+    LOG(ERROR) << "Cannot open file for encryption: " << src.string();
+    return false;
+  }
+
+  FILE *output = OpenFile(encFile.string().c_str(), "wb");
+  if (output == nullptr) {
+    LOG(ERROR) << "Cannot create encrypted file: " << encFile.string();
+    fclose(input);
+    return false;
+  }
+
+  std::size_t chunkSize = (fileSize > kEncryptionChunkMaxSize
+                                 ? kEncryptionChunkMaxSize : fileSize);
+
+  std::unique_ptr<unsigned char[]> inChunk(new unsigned char[chunkSize]);
+  std::size_t bytesRead = 0;
+
+  do {
+    bytesRead = ReadBytes(inChunk.get(), chunkSize, input);
+    if (0 != bytesRead) {
+      unsigned char* encrypted_data = nullptr;
+      size_t encrypted_size = 0;
+      // TODO(p.sikorski) check if it is Preloaded
+      int ret;
+      if (context_->request_mode.get()
+              == common_installer::RequestMode::GLOBAL) {
+        ret = wae_encrypt_global_web_application(
+                context_->pkgid.get().c_str(),
+                context_->is_readonly_package.get() ?
+                true : false,
+                inChunk.get(),
+                (size_t)bytesRead,
+                &encrypted_data,
+                &encrypted_size);
+      } else {
+          ret = wae_encrypt_web_application(
+                  context_->uid.get(),
+                  context_->pkgid.get().c_str(),
+                  inChunk.get(),
+                  (size_t)bytesRead,
+                  &encrypted_data,
+                  &encrypted_size);
+      }
+
+      if (WAE_ERROR_NONE != ret) {
+        LOG(ERROR) << "Error during encrypting:";
+        switch (ret) {
+          case WAE_ERROR_INVALID_PARAMETER:
+            LOG(ERROR) << "WAE_ERROR_INVALID_PARAMETER";
+            break;
+          case WAE_ERROR_PERMISSION_DENIED:
+            LOG(ERROR) << "WAE_ERROR_PERMISSION_DENIED";
+            break;
+          case WAE_ERROR_NO_KEY:
+            LOG(ERROR) << "WAE_ERROR_NO_KEY";
+            break;
+          case WAE_ERROR_KEY_MANAGER:
+            LOG(ERROR) << "WAE_ERROR_KEY_MANAGER";
+            break;
+          case WAE_ERROR_CRYPTO:
+            LOG(ERROR) << "WAE_ERROR_CRYPTO";
+            break;
+          case WAE_ERROR_UNKNOWN:
+            LOG(ERROR) << "WAE_ERROR_UNKNOWN";
+            break;
+          default:
+            LOG(ERROR) << "UNKNOWN";
+            break;
+        }
+        fclose(output);
+        fclose(input);
+        return false;
+      }
+
+      if (encrypted_size <= 0) {
+        LOG(ERROR) << "Encryption Failed using TrustZone";
+        fclose(output);
+        fclose(input);
+        return false;
+      }
+
+      std::stringstream toString;
+      toString << encrypted_size;
+
+      WriteBytes((unsigned char*)toString.str().c_str(), sizeof(int), output);
+      WriteBytes((unsigned char*)encrypted_data, encrypted_size, output);
+      free(encrypted_data);
+    }
+    inChunk.reset(new unsigned char[chunkSize]);
+  } while (!std::feof(input));
+
+  fclose(output);
+  fclose(input);
+
+  LOG(DEBUG) << "File encrypted successfully";
+  if (0 != unlink(src.string().c_str())) {
+    return false;
+  }
+
+  LOG(DEBUG) << "Rename encrypted file";
+  if (0 != std::rename(encFile.c_str(), src.string().c_str())) {
+    return false;
+  }
+
+  return true;
+}
+
+void StepEncryptResources::SetEncryptionRoot() {
+  input_ = context_->unpacked_dir_path.get();
+}
+
+bool StepEncryptResources::ToBeEncrypted(const bf::path &file) {
+  size_t found_key = file.string().rfind(".");
+  if (std::string::npos != found_key) {
+    std::string mimeType = file.string().substr(found_key);
+    std::transform(mimeType.begin(), mimeType.end(), mimeType.begin(),
+                   ::tolower);
+    return encryptSet.count(mimeType) > 0;
+  }
+  return false;
+}
+
+}  // namespace encryption
+}  // namespace wgt
diff --git a/src/wgt/step/encryption/step_encrypt_resources.h b/src/wgt/step/encryption/step_encrypt_resources.h
new file mode 100644 (file)
index 0000000..6b420fd
--- /dev/null
@@ -0,0 +1,75 @@
+// 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_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
+#define WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
+
+#include <boost/filesystem/path.hpp>
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace wgt {
+namespace encryption {
+
+/**
+ * \brief Step that encrypt application resources files if flagged to do so
+ */
+class StepEncryptResources : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  explicit StepEncryptResources(common_installer::InstallerContext* context)
+      : Step(context), backend_data_(nullptr) {}
+
+  /**
+   * \brief Encrypt files
+   *
+   * \return Status::ERROR when error occurred during encryption,
+   *         Status::OK otherwise
+   */
+  Status process() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status clean() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status undo() override { return Status::OK; }
+
+  /**
+   * \brief Check requirements for this step
+   *
+   * \return Status::ERROR when manifest data are missing,
+   *         Status::INVALID_VALUE when requirements are not meet,
+   *         Status::OK otherwise
+   */
+  Status precheck() override;
+
+ protected:
+  boost::filesystem::path input_;
+
+ private:
+  virtual void SetEncryptionRoot();
+
+  bool Encrypt(const boost::filesystem::path &src);
+  bool EncryptFile(const boost::filesystem::path &src);
+  bool ToBeEncrypted(const boost::filesystem::path &file);
+  WgtBackendData* backend_data_;
+  STEP_NAME(EncryptResources)
+};
+
+}  // namespace encryption
+}  // namespace wgt
+
+#endif  // WGT_STEP_ENCRYPTION_STEP_ENCRYPT_RESOURCES_H_
diff --git a/src/wgt/step/encryption/step_remove_encryption_data.cc b/src/wgt/step/encryption/step_remove_encryption_data.cc
new file mode 100644 (file)
index 0000000..7b3e9ac
--- /dev/null
@@ -0,0 +1,57 @@
+// 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/encryption/step_remove_encryption_data.h"
+
+#include <web_app_enc.h>
+
+#include <manifest_parser/utils/logging.h>
+
+namespace wgt {
+namespace encryption {
+
+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;
+  if (context_->request_mode.get() == common_installer::RequestMode::GLOBAL)
+    ret = wae_remove_global_app_dek(context_->pkgid.get().c_str(),
+                context_->is_readonly_package.get() ?
+                true : false);
+  else
+    ret = wae_remove_app_dek(context_->uid.get(),
+                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 encryption
+}  // namespace wgt
diff --git a/src/wgt/step/encryption/step_remove_encryption_data.h b/src/wgt/step/encryption/step_remove_encryption_data.h
new file mode 100644 (file)
index 0000000..691760b
--- /dev/null
@@ -0,0 +1,40 @@
+// 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_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_
+#define WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/step/step.h>
+
+namespace wgt {
+namespace encryption {
+
+/**
+ * This step remove encryption keys used for encryption during installation
+ *
+ * This step is called during uninstallation process
+ */
+class StepRemoveEncryptionData : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \brief Remove encryption keys from database
+   *
+   * \return Status::OK
+   */
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+  STEP_NAME(RemoveEncryptionData)
+};
+
+}  // namespace encryption
+}  // namespace wgt
+
+#endif  // WGT_STEP_ENCRYPTION_STEP_REMOVE_ENCRYPTION_DATA_H_
diff --git a/src/wgt/step/filesystem/step_copy_preview_icons.cc b/src/wgt/step/filesystem/step_copy_preview_icons.cc
new file mode 100644 (file)
index 0000000..95710f8
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_copy_preview_icons.h"
+
+#include <boost/filesystem/path.hpp>
+#include <common/utils/file_util.h>
+
+#include <string>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace {
+
+const char kResWgt[] = "res/wgt";
+const char kSharedRes[] = "shared/res";
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status StepCopyPreviewIcons::process() {
+  WgtBackendData* backend_data =
+      static_cast<WgtBackendData*>(context_->backend_data.get());
+  for (auto& appwidget : backend_data->appwidgets.get().app_widgets()) {
+    for (auto& size : appwidget.content_size) {
+      if (!size.preview.empty()) {
+        bf::path icon_path =
+            context_->GetPkgPath() / kResWgt / size.preview;
+        std::string type = wgt::parse::AppWidgetSizeTypeToString(size.type);
+        std::string icon_name = appwidget.id + "." + type + "." + "preview" +
+            bf::path(size.preview).extension().string();
+        bf::path preview_icon =
+            context_->GetPkgPath() / kSharedRes / icon_name;
+        if (!ci::CopyFile(icon_path, preview_icon)) {
+          LOG(ERROR) << "Cannot create preview icon: " << preview_icon;
+          return Status::ICON_ERROR;
+        }
+      }
+    }
+  }
+  LOG(DEBUG) << "Preview icons created";
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_copy_preview_icons.h b/src/wgt/step/filesystem/step_copy_preview_icons.h
new file mode 100644 (file)
index 0000000..5a51d83
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_COPY_PREVIEW_ICONS_H_
+#define WGT_STEP_FILESYSTEM_STEP_COPY_PREVIEW_ICONS_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Step that create copy of preview icons in shared/res/ directory
+ */
+class StepCopyPreviewIcons : 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(CopyPreviewIcons)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_COPY_PREVIEW_ICONS_H_
diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_symbolic_link.cc
new file mode 100644 (file)
index 0000000..c1091d0
--- /dev/null
@@ -0,0 +1,86 @@
+/* 2014, Copyright © Eurogiciel Coporation, APACHE-2.0, see LICENSE file */
+// 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/filesystem/step_create_symbolic_link.h"
+
+#include <pkgmgr-info.h>
+#include <unistd.h>
+
+#include <boost/filesystem.hpp>
+#include <boost/system/error_code.hpp>
+#include <common/utils/file_util.h>
+#include <common/utils/glist_range.h>
+#include <cassert>
+#include <cstring>
+#include <cstdio>
+#include <string>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+namespace {
+
+const char kWrtServiceBinaryPath[] = "/usr/bin/wrt-service";
+const char kWebWidgetRuntimeBinaryPath[] = "/usr/bin/web-widget-runtime";
+const char kWRTPath[] = "/usr/bin/wrt";
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+bool StepCreateSymbolicLink::CreateSymlinksForApps() {
+  boost::system::error_code error;
+  for (application_x* app :
+       GListRange<application_x*>(context_->manifest_data.get()->application)) {
+    // filter out non-wgt apps as this step is run for hybrid backend too
+    if (strcmp("webapp", app->type) != 0)
+      continue;
+    // binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
+    bf::path exec_path = context_->GetPkgPath() / bf::path("bin");
+    common_installer::CreateDir(exec_path);
+
+    exec_path /= bf::path(app->appid);
+    common_installer::RemoveAll(exec_path);
+
+    if (strcmp(app->component_type, "uiapp") == 0) {
+      bf::create_symlink(bf::path(kWRTPath), exec_path, error);
+    } else if (strcmp(app->component_type, "watchapp") == 0) {
+      bf::create_symlink(bf::path(kWRTPath), exec_path, error);
+    } else if (strcmp(app->component_type, "widgetapp") == 0) {
+      bf::create_symlink(kWebWidgetRuntimeBinaryPath, exec_path, error);
+    } else {
+      bf::create_symlink(kWrtServiceBinaryPath, exec_path, error);
+    }
+    if (error) {
+      LOG(ERROR) << "Failed to set symbolic link "
+        << boost::system::system_error(error).what();
+      return false;
+    }
+  }
+  return true;
+}
+
+common_installer::Step::Status StepCreateSymbolicLink::process() {
+  assert(context_->manifest_data.get());
+
+  if (!CreateSymlinksForApps())
+    return Status::APP_DIR_ERROR;
+
+  LOG(DEBUG) << "Symlinks created successfully";
+  return Status::OK;
+}
+
+common_installer::Step::Status StepCreateSymbolicLink::undo() {
+  for (application_x* app :
+       GListRange<application_x*>(context_->manifest_data.get()->application)) {
+    bf::path exec_path = context_->GetPkgPath() / "bin" / app->appid;
+    common_installer::RemoveAll(exec_path);
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.h b/src/wgt/step/filesystem/step_create_symbolic_link.h
new file mode 100644 (file)
index 0000000..048c759
--- /dev/null
@@ -0,0 +1,64 @@
+// 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_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
+#define WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
+
+#include <boost/filesystem.hpp>
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Step that create symbolic link to application
+ */
+class StepCreateSymbolicLink : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \brief Create symbolic link
+   *
+   * \return Status::ERROR when failed to create symbolic link,
+   *         Status::OK otherwise
+   */
+  Status process() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status clean() override { return Status::OK; }
+
+  /**
+   * \brief Delete created symbolic link
+   *
+   * \return Status::OK
+   */
+  Status undo() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status precheck() override { return Status::OK; }
+
+ private:
+  bool CreateSymlinksForApps();
+
+  STEP_NAME(SymbolicLink)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
diff --git a/src/wgt/step/filesystem/step_wgt_patch_icons.cc b/src/wgt/step/filesystem/step_wgt_patch_icons.cc
new file mode 100644 (file)
index 0000000..b80263a
--- /dev/null
@@ -0,0 +1,106 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_patch_icons.h"
+
+#include <pkgmgr-info.h>
+
+#include "common/utils/file_util.h"
+#include "common/utils/glist_range.h"
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kDefaultIconPath[] = "/usr/share/wgt-backend/default.png";
+
+bool PatchIcon(icon_x* icon, const bf::path& dst_path) {
+  if (!icon)
+    return false;
+  bs::error_code error;
+  bf::path icon_text(icon->text);
+  bf::path icon_path = dst_path;
+  if (strcmp(icon->lang, DEFAULT_LOCALE)) {
+    icon_path += ".";
+    icon_path += icon->lang;
+  }
+  if (icon_text.has_extension())
+    icon_path += icon_text.extension();
+  else
+    icon_path += ".png";
+
+  bf::copy_file(icon->text, icon_path,
+      bf::copy_option::overwrite_if_exists, error);
+  if (error) {
+    LOG(ERROR) << "Failed to move icon from " << icon->text << " to "
+               << icon_path;
+    return false;
+  }
+  if (icon->text)
+    free(const_cast<char*>(icon->text));
+  icon->text = strdup(icon_path.c_str());
+
+  return true;
+}
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+common_installer::Step::Status StepWgtPatchIcons::process() {
+  bf::path common_icon_location = context_->GetPkgPath() / "shared" / "res";
+  bs::error_code error;
+  bf::create_directories(common_icon_location, error);
+  if (error) {
+    LOG(ERROR) << "Failed to create common icon location directory";
+    return Status::ICON_ERROR;
+  }
+  for (icon_x* icon :
+      GListRange<icon_x*>(context_->manifest_data.get()->icon)) {
+    bf::path icon_path = common_icon_location /
+        context_->manifest_data.get()->mainapp_id;
+    if (!PatchIcon(icon, icon_path))
+      return Status::ICON_ERROR;
+  }
+  for (application_x* app :
+      GListRange<application_x*>(context_->manifest_data.get()->application)) {
+    if (strcmp(app->type, "webapp") != 0)
+      continue;
+    if (app->icon) {
+      // edit icon->text and copy icons to common location
+      for (auto& icon : GListRange<icon_x*>(app->icon)) {
+        bf::path icon_path = common_icon_location / app->appid;
+        if (!PatchIcon(icon, icon_path))
+          return Status::ICON_ERROR;
+      }
+    } else {
+      LOG(INFO) << "Application provides no icon. Using Tizen default icon.";
+      // create default icon if there is no icon at all
+      bf::path icon_path = common_icon_location / app->appid;
+      icon_path += ".png";
+      bf::copy_file(kDefaultIconPath, icon_path,
+              bf::copy_option::overwrite_if_exists, error);
+      if (error) {
+        LOG(ERROR) << "Failed to create default icon for web application";
+        return Status::ICON_ERROR;
+      }
+      icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));
+      if (!icon) {
+        LOG(ERROR) << "Out of memory";
+        return Status::ICON_ERROR;
+      }
+      icon->text = strdup(icon_path.c_str());
+      icon->lang = strdup(DEFAULT_LOCALE);
+      app->icon = g_list_append(app->icon, icon);
+    }
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
+
diff --git a/src/wgt/step/filesystem/step_wgt_patch_icons.h b/src/wgt/step/filesystem/step_wgt_patch_icons.h
new file mode 100644 (file)
index 0000000..1f478a5
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/step/step.h>
+
+#include <string>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * @brief The StepWgtPatchIcons class
+ *        Copy widget icons to standard location of icons - shared/res/
+ *        where StepCreateIcons excepts icons to be.
+ */
+class StepWgtPatchIcons : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  Status process() override;
+  Status undo() override { return Status::OK; }
+  Status clean() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+  STEP_NAME(WgtPatchIcons)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_ICONS_H_
diff --git a/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.cc
new file mode 100644 (file)
index 0000000..ddcb9a5
--- /dev/null
@@ -0,0 +1,113 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kSharedLocation[] = "shared";
+const char kSharedResLocation[] = "shared/res";
+const char kResWgtSubPath[] = "res/wgt";
+const char kTemporaryData[] = "tmp";
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+common_installer::Step::Status StepWgtPatchStorageDirectories::process() {
+  if (!CreatePrivateTmpDir())
+    return Status::APP_DIR_ERROR;
+
+  int version = std::stoi(context_->manifest_data.get()->api_version);
+  if (version >= 3) {
+    LOG(DEBUG) <<
+        "Moving and linking widget's shared/res directory content in "
+        << context_->GetPkgPath();
+    if (!ShareDirFor3x())
+      return Status::APP_DIR_ERROR;
+  }
+
+  return Status::OK;
+}
+
+bool StepWgtPatchStorageDirectories::ShareDirFor3x() {
+  // check if ${pkg_path}/res/wgt/shared/res exists
+  bf::path wgt_shared_res_dir =
+      context_->GetPkgPath() / kResWgtSubPath / kSharedResLocation;
+  if (!bf::exists(wgt_shared_res_dir))
+    return true;
+  // create ${pkg_path}/shared/res
+  bf::path shared_dir = context_->GetPkgPath() / kSharedLocation;
+  if (!bf::exists(shared_dir)) {
+    bs::error_code error;
+    bf::create_directory(shared_dir, error);
+    if (error) {
+      LOG(ERROR) << "Failed to create directory: " << shared_dir;
+      return false;
+    }
+  }
+  bf::path shared_res_dir = context_->GetPkgPath() / kSharedResLocation;
+  if (!bf::exists(shared_res_dir)) {
+    bs::error_code error;
+    bf::create_directory(shared_res_dir, error);
+    if (error) {
+      LOG(ERROR) << "Failed to create directory: " << shared_res_dir;
+      return false;
+    }
+  }
+
+  // move and link all contents of ${pkg_path}res/wgt/shared/res
+  // to ${pkg_path}shared/res
+  bf::directory_iterator end_itr;
+  for (bf::directory_iterator itr(wgt_shared_res_dir); itr != end_itr; ++itr) {
+    bf::path current = itr->path();
+    if (bf::is_symlink(current)) {
+      continue;
+    }
+    bf::path dest = shared_res_dir / current.filename();
+    if (bf::is_directory(current)) {
+      if (!ci::MoveDir(current, dest, ci::FS_MERGE_OVERWRITE))
+        return false;
+    } else {
+      if (!ci::MoveFile(current, dest, true))
+        return false;
+    }
+    bs::error_code error;
+    bf::create_symlink(dest, current, error);
+    if (error) {
+      LOG(ERROR) << "linking failed for " << dest
+                 << ": " << boost::system::system_error(error).what();
+      return false;
+    }
+  }
+  return true;
+}
+
+bool StepWgtPatchStorageDirectories::CreatePrivateTmpDir() {
+  bf::path tmp_path = context_->GetPkgPath() / kTemporaryData;
+  if (bf::exists(tmp_path) && bf::is_directory(tmp_path)) {
+    return true;
+  }
+  bs::error_code error;
+  bf::create_directory(tmp_path, error);
+  if (error) {
+    LOG(ERROR) << "Failed to create private temporary directory for package";
+    return false;
+  }
+  return true;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h b/src/wgt/step/filesystem/step_wgt_patch_storage_directories.h
new file mode 100644 (file)
index 0000000..96c5da6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Installation (WGT).
+ *        Responsible for linking the content of widget's shared/res directory
+ *        into package's shared/res directory and vice versa for Tizen widget
+ *        with API version >= 3.0
+ */
+class StepWgtPatchStorageDirectories :
+    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; }
+
+ private:
+  bool ShareDirFor3x();
+  bool CreatePrivateTmpDir();
+
+  STEP_NAME(PatchWgtStorageDirectories)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_PATCH_STORAGE_DIRECTORIES_H_
diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc
new file mode 100644 (file)
index 0000000..3ac814c
--- /dev/null
@@ -0,0 +1,152 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
+
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/system_error.hpp>
+
+#include <common/paths.h>
+#include <common/utils/file_util.h>
+
+#include <vector>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kResWgtDirectory[] = "res/wgt";
+
+const std::vector<std::string> kExtractEntries = {
+  "config.xml",
+  "index.html",
+  "author-signature.xml",
+};
+
+const std::vector<std::string>& GetExtractEntries() {
+  return kExtractEntries;
+}
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status StepWgtPreparePackageDirectory::CreateSymlinks() {
+  bs::error_code error;
+  bf::path mount_point = ci::GetMountLocation(context_->GetPkgPath());
+  bf::path res_wgt_link = context_->GetPkgPath() / kResWgtDirectory;
+
+  std::vector<std::string> fileList;
+  std::vector<std::string> extractEntries = GetExtractEntries();
+  for (bf::directory_iterator iter(mount_point);
+      iter != bf::directory_iterator(); ++iter) {
+    bf::path current(iter->path());
+    if (std::find(extractEntries.begin(), extractEntries.end(),
+            current.filename()) != extractEntries.end())
+      continue;
+
+    bf::path destination = res_wgt_link / current.filename();
+    if (bf::exists(destination)) {
+      if (!bf::is_symlink(symlink_status(destination))) {
+        LOG(ERROR) << "Cannot proceed. "
+                   << "Location of link is used by another file";
+        return Status::APP_DIR_ERROR;
+      }
+      bf::remove(destination, error);
+      if (error) {
+        LOG(ERROR) << "Failed to remove previous symlink";
+        return Status::APP_DIR_ERROR;
+      }
+    }
+    bf::create_symlink(iter->path(), destination, error);
+    if (error) {
+      LOG(ERROR) << "Failed to create symlink to widget image :" <<
+          boost::system::system_error(error).what();
+      return Status::APP_DIR_ERROR;
+    }
+  }
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::ExtractEntries() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->GetPkgPath());
+  backupPath_ = backup_path;
+  if (context_->request_type.get() == ci::RequestType::MountUpdate &&
+      context_->recovery_info.get().recovery_file) {
+    context_->recovery_info.get().recovery_file->set_unpacked_dir(backup_path);
+    context_->recovery_info.get().recovery_file->WriteAndCommitFileContent();
+  }
+
+  bf::path resource_path = context_->GetPkgPath() / kResWgtDirectory;
+  bs::error_code error;
+  bf::create_directories(resource_path, error);
+  if (error) {
+    LOG(ERROR) << "Failed to create proper directory structure in widget";
+    return Status::APP_DIR_ERROR;
+  }
+
+  for (auto& entry : GetExtractEntries()) {
+    if (context_->request_type.get() == ci::RequestType::MountUpdate)
+      if (!ci::BackupDir(resource_path, backup_path, entry))
+        return Status::APP_DIR_ERROR;
+
+    if (!ci::ExtractToTmpDir(context_->file_path.get().c_str(),
+            resource_path.c_str(), entry)) {
+      LOG(ERROR) << "Failed to extract file";
+      return Status::UNZIP_ERROR;
+    }
+  }
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::process() {
+  Status status;
+
+  status = ExtractEntries();
+  if (status != Status::OK)
+    return status;
+
+  status = CreateSymlinks();
+  if (status != Status::OK)
+    return status;
+  LOG(DEBUG) << "Symlink to mount point created";
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::precheck() {
+  if (context_->GetPkgPath().empty()) {
+    LOG(ERROR) << "Package installation path is not set";
+    return Status::INVALID_VALUE;
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::undo() {
+  if (backupPath_.empty())
+    return Status::OK;
+
+  for (auto& entry : GetExtractEntries()) {
+    ci::RemoveAll(context_->GetPkgPath() / kResWgtDirectory / entry);
+    if (!bf::exists(backupPath_ / entry))
+      continue;
+    ci::MoveDir(backupPath_ / entry,
+        context_->GetPkgPath() / kResWgtDirectory / entry,
+        ci::FSFlag::FS_MERGE_OVERWRITE |
+        ci::FSFlag::FS_COMMIT_COPY_FILE |
+        ci::FSFlag::FS_PRESERVE_OWNERSHIP_AND_PERMISSIONS);
+  }
+  ci::RemoveAll(backupPath_);
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h
new file mode 100644 (file)
index 0000000..8b9f14c
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <boost/filesystem/path.hpp>
+#include <pkgmgrinfo_basic.h>
+
+#include <string>
+
+#include "common/installer_context.h"
+#include "common/step/step.h"
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Responsible for adjusting package directory after mounting zip package
+ *        by StepMountInstall or StepMountUpdate
+ *
+ * This step will preserve old application symlinks in bin/ directory.
+ */
+class StepWgtPreparePackageDirectory : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override;
+  Status precheck() override;
+
+ private:
+  boost::filesystem::path backupPath_;
+
+  Status ExtractEntries();
+  Status CreateSymlinks();
+
+  STEP_NAME(WgtPreparePackageDirectory)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
diff --git a/src/wgt/step/filesystem/step_wgt_resource_directory.cc b/src/wgt/step/filesystem/step_wgt_resource_directory.cc
new file mode 100644 (file)
index 0000000..cf2e57f
--- /dev/null
@@ -0,0 +1,44 @@
+// 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/filesystem/step_wgt_resource_directory.h"
+
+#include <boost/filesystem/path.hpp>
+
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+
+namespace wgt {
+namespace filesystem {
+
+common_installer::Step::Status StepWgtResourceDirectory::process() {
+  bf::path temp_path = context_->unpacked_dir_path.get();
+  temp_path += ".temp";
+  bf::path resource_path = context_->unpacked_dir_path.get() / "res/wgt";
+
+  if (!common_installer::MoveDir(context_->unpacked_dir_path.get(),
+                                        temp_path)) {
+    LOG(ERROR) << "Failed to move: " << context_->unpacked_dir_path.get()
+               << " to: " << temp_path;
+    return Status::APP_DIR_ERROR;
+  }
+  bs::error_code error;
+  bf::create_directories(resource_path.parent_path(), error);
+  if (error) {
+    LOG(ERROR) << "Failed to create proper directory structure in widget";
+    return Status::APP_DIR_ERROR;
+  }
+  if (!common_installer::MoveDir(temp_path, resource_path)) {
+    LOG(ERROR) << "Failed to move: " << temp_path << " to: " << resource_path;
+    return Status::APP_DIR_ERROR;
+  }
+
+  LOG(INFO) << "Widget content moved to res/wgt subdirectory";
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_resource_directory.h b/src/wgt/step/filesystem/step_wgt_resource_directory.h
new file mode 100644 (file)
index 0000000..f5437fd
--- /dev/null
@@ -0,0 +1,62 @@
+// 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_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief This step fixes unpacked directory structure so that all widget
+ * content is moved from root path to res/wgt before we copy whole directory in
+ * StepCopy
+ */
+class StepWgtResourceDirectory : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \brief Create directory structure and copy content of widget package
+   *
+   * \return Status::ERROR when failed to create proper directory structure or
+   *                       move source directory to destination directory,
+   *         Status::OK otherwise
+   */
+  Status process() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status clean() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status undo() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status precheck() override { return Status::OK; }
+
+  STEP_NAME(CreateWgtResourceDirectory)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_RESOURCE_DIRECTORY_H_
diff --git a/src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.cc b/src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.cc
new file mode 100644 (file)
index 0000000..4795137
--- /dev/null
@@ -0,0 +1,140 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kSharedLocation[] = "shared";
+const char kSharedResLocation[] = "shared/res";
+const char kResWgtSubPath[] = "res/wgt";
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status StepWgtUndoPatchStorageDirectories::process() {
+  int version = std::stoi(context_->manifest_data.get()->api_version);
+  if (version >= 3) {
+    LOG(DEBUG) <<
+        "Unlinking and moving widget's shared/res directory content back in "
+        << context_->GetPkgPath();
+    if (!UndoShareDirFor3x())
+      return Status::APP_DIR_ERROR;
+  }
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUndoPatchStorageDirectories::clean() {
+  if (!backup_dir_.empty())
+    ci::RemoveAll(backup_dir_);
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUndoPatchStorageDirectories::undo() {
+  if (!backup_dir_.empty()) {
+    LOG(DEBUG) << "Restore res/wgt/shared/res from backup dir";
+    // restore link
+    bf::path wgt_shared_res_dir =
+        context_->GetPkgPath() / kResWgtSubPath / kSharedResLocation;
+    bf::path backup_wgt_shared_res = backup_dir_ / "wgt_shared_res";
+    if (!backup_wgt_shared_res.empty()) {
+      if (!ci::RemoveAll(wgt_shared_res_dir)) {
+        LOG(ERROR) << "Failed to remove res/wgt/shared/res";
+        return Status::APP_DIR_ERROR;
+      }
+      if (!ci::CopyDir(backup_dir_, wgt_shared_res_dir,
+                       ci::FS_MERGE_OVERWRITE, false)) {
+        LOG(ERROR) << "Failed to copy from backup";
+        return Status::APP_DIR_ERROR;
+      }
+    }
+    // restore original contents
+    bf::path shared_res_dir = context_->GetPkgPath() / kSharedResLocation;
+    bf::path backup_shared_res = backup_dir_ / "shared_res";
+    if (!backup_shared_res.empty()) {
+      if (!ci::CopyDir(backup_dir_, shared_res_dir,
+                       ci::FS_MERGE_OVERWRITE, false)) {
+        LOG(ERROR) << "Failed to copy from backup";
+        return Status::APP_DIR_ERROR;
+      }
+    }
+  }
+  return Status::OK;
+}
+
+bool StepWgtUndoPatchStorageDirectories::UndoShareDirFor3x() {
+  // check if ${pkg_path}/shared/res exists
+  bf::path shared_res_dir = context_->GetPkgPath() / kSharedResLocation;
+  if (!bf::exists(shared_res_dir))
+    return true;
+  bf::path wgt_shared_res_dir =
+      context_->GetPkgPath() / kResWgtSubPath / kSharedResLocation;
+  if (!bf::exists(wgt_shared_res_dir))
+    return true;
+
+  if (bf::is_symlink(wgt_shared_res_dir)) {
+    LOG(ERROR) << "Can't support this step, pkg should be fully updated";
+    return false;
+  }
+
+  // backup for undo
+  backup_dir_ = context_->unpacked_dir_path.get();
+  backup_dir_ += ".SharedRes";
+  bf::path backup_shared_res = backup_dir_ / "shared_res";
+  if (!ci::CreateDir(backup_shared_res))
+    return false;
+  bf::path backup_wgt_shared_res = backup_dir_ / "wgt_shared_res";
+  if (!ci::CopyDir(wgt_shared_res_dir, backup_wgt_shared_res,
+                   ci::FS_MERGE_OVERWRITE, false)) {
+    backup_dir_.clear();
+    return false;
+  }
+
+  // unlink and move all linked contents from ${pkg_path}/shared/res
+  // to ${pkg_path}/res/wgt/shared/res
+  bf::directory_iterator end_itr;
+  for (bf::directory_iterator itr(wgt_shared_res_dir); itr != end_itr; ++itr) {
+    bf::path link_file = itr->path();
+    if (!bf::is_symlink(link_file)) {
+      continue;
+    }
+    bf::path link_target = bf::read_symlink(link_file);
+    if (link_target.native().substr(0, shared_res_dir.native().length()) !=
+        shared_res_dir.native()) {
+      continue;
+    }
+    if (!ci::Remove(link_file))
+      return false;
+    bf::path tmp_backup = backup_shared_res / link_target.filename();
+    if (bf::is_directory(link_target)) {
+      if (!ci::CopyDir(link_target, tmp_backup, ci::FS_MERGE_OVERWRITE, false))
+        return false;
+      if (!ci::MoveDir(link_target, link_file, ci::FS_MERGE_OVERWRITE))
+        return false;
+    } else {
+      if (!ci::CopyFile(link_target, tmp_backup))
+        return false;
+      if (!ci::MoveFile(link_target, link_file, true))
+        return false;
+    }
+  }
+
+  return true;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h b/src/wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h
new file mode 100644 (file)
index 0000000..e8494ad
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_UNDO_PATCH_STORAGE_DIRECTORIES_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_UNDO_PATCH_STORAGE_DIRECTORIES_H_
+
+#include <common/step/step.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Installation (WGT).
+ *        Responsible for unlinking the content of widget's shared/res directory
+ *        into package's shared/res directory and vice versa for Tizen widget
+ *        with API version >= 3.0
+ */
+class StepWgtUndoPatchStorageDirectories :
+    public common_installer::Step {
+ public:
+  using Step::Step;
+
+  Status process() override;
+  Status clean() override;
+  Status undo() override;
+  Status precheck() override { return Status::OK; }
+
+ private:
+  bool UndoShareDirFor3x();
+  boost::filesystem::path backup_dir_;
+
+  STEP_NAME(UndoPatchWgtStorageDirectories)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_UNDO_PATCH_STORAGE_DIRECTORIES_H_
diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.cc b/src/wgt/step/filesystem/step_wgt_update_package_directory.cc
new file mode 100644 (file)
index 0000000..76396db
--- /dev/null
@@ -0,0 +1,140 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_update_package_directory.h"
+
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/paths.h>
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char* kBackupEntries[] = {
+  "bin",
+  "shared/res"
+};
+
+bool MoveCreateDir(const bf::path& source, const bf::path& destination) {
+  if (!bf::exists(destination.parent_path())) {
+    bs::error_code error;
+    bf::create_directories(destination.parent_path(), error);
+    if (error) {
+      LOG(ERROR) << "Cannot create directory: " << destination.parent_path();
+      return false;
+    }
+  }
+  if (!ci::MoveDir(source, destination)) {
+    LOG(ERROR) << "Failed to move directory " << destination;
+    return false;
+  }
+  return true;
+}
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status
+StepWgtUpdatePackageDirectory::CreateBackupOfDirectories() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->GetPkgPath());
+  for (auto& entry : kBackupEntries) {
+    bf::path directory = context_->GetPkgPath() / entry;
+    if (!bf::exists(directory))
+      continue;
+    LOG(DEBUG) << "Backup directory entry: " << entry;
+    bf::path directory_backup = backup_path / entry;
+    if (!MoveCreateDir(directory, directory_backup)) {
+      LOG(ERROR) << "Failed to create backup directory "
+                 << directory_backup;
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status
+StepWgtUpdatePackageDirectory::RecoverBackupOfDirectories() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->GetPkgPath());
+
+  // skip if there is no backup of directories
+  if (!bf::exists(backup_path))
+    return Status::OK;
+
+  for (auto& entry : kBackupEntries) {
+    bf::path directory = context_->GetPkgPath() / entry;
+    bf::path directory_backup = backup_path / entry;
+    if (!bf::exists(directory_backup))
+        continue;
+    LOG(DEBUG) << "Recover directory entry: " << entry;
+    bs::error_code error;
+    bf::remove_all(directory, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remove fail-update directory: " << directory;
+      return Status::APP_DIR_ERROR;
+    }
+    if (!ci::MoveDir(directory_backup, directory)) {
+      LOG(ERROR) << "Failed to restore directory backup "
+                 << directory_backup;
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::process() {
+  auto status = CreateBackupOfDirectories();
+  if (status != Status::OK)
+    return status;
+  LOG(DEBUG) << "Directory backups created";
+
+  status = StepWgtPreparePackageDirectory::process();
+  if (status != Status::OK)
+    return status;
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::clean() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->GetPkgPath());
+  if (bf::exists(backup_path)) {
+    bs::error_code error;
+    bf::remove_all(backup_path, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remove backup directories";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::undo() {
+  Status status = RecoverBackupOfDirectories();
+  if (status != Status::OK)
+    return status;
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->GetPkgPath());
+  if (bf::exists(backup_path)) {
+    bs::error_code error;
+    bf::remove_all(backup_path, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remove backup directories";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.h b/src/wgt/step/filesystem/step_wgt_update_package_directory.h
new file mode 100644 (file)
index 0000000..b8aefbb
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
+
+namespace wgt {
+namespace filesystem {
+
+class StepWgtUpdatePackageDirectory : public StepWgtPreparePackageDirectory {
+ public:
+  using StepWgtPreparePackageDirectory::StepWgtPreparePackageDirectory;
+
+  Status process() override;
+  Status undo() override;
+  Status clean() override;
+
+ private:
+  Status CreateBackupOfDirectories();
+  Status RecoverBackupOfDirectories();
+
+  STEP_NAME(WgtUpdatePackageDirectory)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
diff --git a/src/wgt/step/pkgmgr/step_generate_xml.cc b/src/wgt/step/pkgmgr/step_generate_xml.cc
new file mode 100644 (file)
index 0000000..01a1a95
--- /dev/null
@@ -0,0 +1,695 @@
+/* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
+// 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/pkgmgr/step_generate_xml.h"
+
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/utils/file_util.h>
+#include <common/utils/glist_range.h>
+#include <common/privileges.h>
+
+#include <libxml/parser.h>
+#include <libxml/xmlreader.h>
+#include <pkgmgr-info.h>
+#include <pkgmgr_parser.h>
+#include <tzplatform_config.h>
+#include <unistd.h>
+
+#include <cassert>
+#include <cstring>
+#include <string>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace bs = boost::system;
+namespace bf = boost::filesystem;
+
+namespace {
+
+const char kResWgt[] = "res/wgt";
+const char kSharedRes[] = "shared/res";
+
+void WriteUIApplicationAttributes(
+    xmlTextWriterPtr writer, application_x *app) {
+  if (app->taskmanage)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "taskmanage",
+        BAD_CAST app->taskmanage);
+  if (app->nodisplay)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay",
+        BAD_CAST app->nodisplay);
+  if (app->multiple)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "multiple",
+        BAD_CAST app->multiple);
+  if (app->launch_mode && strlen(app->launch_mode))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "launch_mode",
+        BAD_CAST app->launch_mode);
+  if (app->ui_gadget && strlen(app->ui_gadget))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "ui-gadget",
+        BAD_CAST app->ui_gadget);
+  if (app->submode && strlen(app->submode))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "submode",
+        BAD_CAST app->submode);
+  if (app->submode_mainid && strlen(app->submode_mainid))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "submode-mainid",
+        BAD_CAST app->submode_mainid);
+  if (app->indicatordisplay && strlen(app->indicatordisplay))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "indicatordisplay",
+        BAD_CAST app->indicatordisplay);
+  if (app->portraitimg && strlen(app->portraitimg))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "portrait-effectimage",
+        BAD_CAST app->portraitimg);
+  if (app->landscapeimg && strlen(app->landscapeimg))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "landscape-effectimage",
+        BAD_CAST app->landscapeimg);
+  if (app->effectimage_type && strlen(app->effectimage_type))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "effectimage-type",
+        BAD_CAST app->effectimage_type);
+  if (app->hwacceleration && strlen(app->hwacceleration))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "hwacceleration",
+        BAD_CAST app->hwacceleration);
+}
+
+void WriteServiceApplicationAttributes(
+    xmlTextWriterPtr writer, application_x *app) {
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "auto-restart",
+      BAD_CAST(app->autorestart ? app->autorestart : "false"));
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "on-boot",
+      BAD_CAST(app->onboot ? app->onboot : "false"));
+  if (app->taskmanage)
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "taskmanage",
+         BAD_CAST app->taskmanage);
+}
+
+bool WriteWidgetApplicationAttributesAndElements(
+    xmlTextWriterPtr writer, application_x *app,
+    const wgt::parse::AppWidgetInfo& widget_info,
+    const bf::path& shared_path) {
+  if (app->nodisplay)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay",
+        BAD_CAST app->nodisplay);
+  if (app->multiple)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "multiple",
+        BAD_CAST app->multiple);
+  if (app->mainapp)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "main",
+        BAD_CAST app->mainapp);
+
+  auto& appwidgets = widget_info.app_widgets();
+  const auto& appwidget = std::find_if(appwidgets.begin(), appwidgets.end(),
+                                 [app](const wgt::parse::AppWidget& widget) {
+                                    return widget.id == app->appid;
+                                 });
+  if (appwidget == appwidgets.end()) {
+    return true;
+  }
+
+  // Add extra elements for wgt widget-application
+  if (!appwidget->update_period.empty()) {
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "update-period", BAD_CAST
+            std::to_string(static_cast<int>(
+                    appwidget->update_period.front())).c_str());
+  }
+
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "max-instance",
+      BAD_CAST std::to_string(appwidget->max_instance).c_str());
+
+  for (auto& size : appwidget->content_size) {
+    xmlTextWriterStartElement(writer, BAD_CAST "support-size");
+
+    std::string type = wgt::parse::AppWidgetSizeTypeToString(size.type);
+    if (!size.preview.empty()) {
+      std::string icon_name = shared_path.string() + "/"
+          + appwidget->id + "." + type + "." + "preview" +
+          bf::path(size.preview).extension().string();
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "preview",
+          BAD_CAST icon_name.c_str());  // NOLINT
+    }
+
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "frame",
+                                BAD_CAST "true");
+    xmlTextWriterWriteString(writer,
+        BAD_CAST type.c_str());
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (auto& pair : appwidget->metadata) {
+    xmlTextWriterStartElement(writer, BAD_CAST "metadata");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "key",
+                                BAD_CAST pair.first.c_str());
+    if (!pair.second.empty())
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "value",
+                                  BAD_CAST pair.second.c_str());
+    xmlTextWriterEndElement(writer);
+  }
+  return true;
+}
+
+void WriteWatchApplicationAttributes(
+    xmlTextWriterPtr writer, application_x* app) {
+  if (app->support_ambient)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "ambient-support",
+        BAD_CAST app->support_ambient);
+}
+
+}  // namespace
+
+namespace wgt {
+namespace pkgmgr {
+
+common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml(
+    application_x* app, xmlTextWriterPtr writer, AppCompType type) {
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "appid", BAD_CAST app->appid);
+
+  // binary is a symbolic link named <appid> and is located in <pkgid>/<appid>
+  bf::path exec_path = context_->GetPkgPath()
+      / bf::path("bin") / bf::path(app->appid);
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "exec",
+                              BAD_CAST exec_path.string().c_str());
+  if (app->type)
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "type", BAD_CAST app->type);
+  else
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "type", BAD_CAST "capp");
+
+  if (app->process_pool && strlen(app->process_pool))
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "process-pool",
+                                BAD_CAST app->process_pool);
+  // app-specific attributes
+  switch (type) {
+  case AppCompType::UIAPP:
+    WriteUIApplicationAttributes(writer, app);
+    break;
+  case AppCompType::SVCAPP:
+    WriteServiceApplicationAttributes(writer, app);
+    break;
+  case AppCompType::WIDGETAPP:
+    if (!WriteWidgetApplicationAttributesAndElements(writer, app,
+        static_cast<WgtBackendData*>(
+            context_->backend_data.get())->appwidgets.get(),
+        context_->GetPkgPath() / "shared" / "res"))
+      return Status::MANIFEST_ERROR;
+    break;
+  case AppCompType::WATCHAPP:
+    WriteWatchApplicationAttributes(writer, app);
+    break;
+  }
+
+  for (label_x* label : GListRange<label_x*>(app->label)) {
+    if (label->name && strcmp(label->name, "") != 0) {
+      xmlTextWriterStartElement(writer, BAD_CAST "label");
+      if (label->lang && strcmp(DEFAULT_LOCALE, label->lang) != 0) {
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                    BAD_CAST label->lang);
+      }
+      xmlTextWriterWriteString(writer, BAD_CAST label->name);
+      xmlTextWriterEndElement(writer);
+    }
+  }
+
+  for (auto& icon : GListRange<icon_x*>(app->icon)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "icon");
+    if (icon->lang && strcmp(DEFAULT_LOCALE, icon->lang) != 0) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                  BAD_CAST icon->lang);
+    }
+    xmlTextWriterWriteString(writer, BAD_CAST icon->text);
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (image_x* image : GListRange<image_x*>(app->image)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "image");
+    if (image->lang && strcmp(DEFAULT_LOCALE, image->lang) != 0) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+
+                                  BAD_CAST image->lang);
+    }
+    if (image->section)
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "section",
+                                  BAD_CAST image->section);
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (appcontrol_x* appc : GListRange<appcontrol_x*>(app->appcontrol)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "app-control");
+
+    if (appc->operation) {
+      xmlTextWriterStartElement(writer, BAD_CAST "operation");
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
+          BAD_CAST appc->operation);
+      xmlTextWriterEndElement(writer);
+    }
+
+    if (appc->uri) {
+      xmlTextWriterStartElement(writer, BAD_CAST "uri");
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
+          BAD_CAST appc->uri);
+      xmlTextWriterEndElement(writer);
+    }
+
+    if (appc->mime) {
+      xmlTextWriterStartElement(writer, BAD_CAST "mime");
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
+          BAD_CAST appc->mime);
+      xmlTextWriterEndElement(writer);
+    }
+
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (datacontrol_x* datacontrol :
+       GListRange<datacontrol_x*>(app->datacontrol)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "datacontrol");
+    if (datacontrol->access) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "access",
+          BAD_CAST datacontrol->access);
+    }
+    if (datacontrol->providerid) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "providerid",
+          BAD_CAST datacontrol->providerid);
+    }
+    if (datacontrol->type) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "type",
+          BAD_CAST datacontrol->type);
+    }
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (metadata_x* meta : GListRange<metadata_x*>(app->metadata)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "metadata");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "key",
+        BAD_CAST meta->key);
+    if (meta->value)
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "value",
+          BAD_CAST meta->value);
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (const char* category : GListRange<char*>(app->category)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "category");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "name", BAD_CAST category);
+    xmlTextWriterEndElement(writer);
+  }
+
+  for (const char* background_category : GListRange<char*>(
+      app->background_category)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "background-category");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "value",
+        BAD_CAST background_category);
+    xmlTextWriterEndElement(writer);
+  }
+
+  return Step::Status::OK;
+}
+
+common_installer::Step::Status StepGenerateXml::undo() {
+  common_installer::RequestType req_type = context_->request_type.get();
+  if (req_type == common_installer::RequestType::ManifestDirectUpdate ||
+      req_type == common_installer::RequestType::ManifestPartialUpdate)
+    return Status::OK;
+  common_installer::RemoveAll(context_->xml_path.get());
+  return Status::OK;
+}
+
+common_installer::Step::Status StepGenerateXml::precheck() {
+  if (!context_->manifest_data.get()) {
+    LOG(ERROR) << "manifest_data attribute is empty";
+    return Step::Status::INVALID_VALUE;
+  }
+  if (context_->pkgid.get().empty()) {
+    LOG(ERROR) << "pkgid attribute is empty";
+    return Step::Status::PACKAGE_NOT_FOUND;
+  }
+
+  if (!context_->manifest_data.get()->application) {
+    LOG(ERROR) << "No application in package";
+    return Step::Status::INVALID_VALUE;
+  }
+
+  return Step::Status::OK;
+}
+
+common_installer::Step::Status StepGenerateXml::process() {
+  bf::path xml_path =
+      bf::path(getUserManifestPath(context_->uid.get(),
+                  context_->is_readonly_package.get()))
+      / bf::path(context_->pkgid.get());
+  xml_path += ".xml";
+  context_->xml_path.set(xml_path.string());
+
+  bs::error_code error;
+  if (!bf::exists(xml_path.parent_path(), error)) {
+    if (!common_installer::CreateDir(xml_path.parent_path())) {
+      LOG(ERROR) <<
+          "Directory for manifest xml is missing and cannot be created";
+      return Status::MANIFEST_ERROR;
+    }
+  }
+
+  xmlTextWriterPtr writer;
+  writer = xmlNewTextWriterFilename(context_->xml_path.get().c_str(), 0);
+  if (!writer) {
+    LOG(ERROR) << "Failed to create new file";
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  xmlTextWriterStartDocument(writer, nullptr, nullptr, nullptr);
+  xmlTextWriterSetIndent(writer, 1);
+
+  Status status = GenerateManifestElement(writer);
+  if (status != Status::OK) {
+    return status;
+  }
+
+  xmlTextWriterEndDocument(writer);
+  xmlFreeTextWriter(writer);
+
+  if (pkgmgr_parser_check_manifest_validation(
+      context_->xml_path.get().c_str()) != 0) {
+    LOG(ERROR) << "Manifest is not valid";
+    return Step::Status::MANIFEST_ERROR;
+  }
+
+  LOG(DEBUG) << "Successfully create manifest xml "
+      << context_->xml_path.get();
+  return Status::OK;
+}
+
+common_installer::Step::Status StepGenerateXml::GenerateManifestElement(
+        xmlTextWriterPtr writer) {
+  xmlTextWriterStartElement(writer, BAD_CAST "manifest");
+
+  GenerateManifestElementAttributes(writer);
+  GenerateLangLabels(writer);
+  GenerateAuthor(writer);
+  GenerateDescription(writer);
+  Status status = GenerateApplications(writer);
+  if (status != Status::OK) {
+    return status;
+  }
+  GeneratePrivilege(writer);
+  GenerateProvidesAppDefinedPrivilege(writer);
+  GenerateAccount(writer);
+  GenerateIme(writer);
+  GenerateProfiles(writer);
+  GenerateShortcuts(writer);
+  GenerateTrustAnchor(writer);
+  xmlTextWriterEndElement(writer);
+  return Status::OK;
+}
+
+void StepGenerateXml::GenerateManifestElementAttributes(
+        xmlTextWriterPtr writer) {
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns",
+      BAD_CAST "http://tizen.org/ns/packages");
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "package",
+      BAD_CAST context_->manifest_data.get()->package);
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "type",
+      BAD_CAST context_->manifest_data.get()->type);
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "version",
+      BAD_CAST context_->manifest_data.get()->version);
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "api-version",
+      BAD_CAST context_->manifest_data.get()->api_version);
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "nodisplay-setting",
+      BAD_CAST context_->manifest_data.get()->nodisplay_setting);
+  if (context_->is_readonly_package.get()) {
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "readonly", BAD_CAST "true");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "preload", BAD_CAST "true");
+  } else if (context_->is_preload_rw_package.get()) {
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "preload", BAD_CAST "true");
+  }
+}
+
+void StepGenerateXml::GenerateLangLabels(xmlTextWriterPtr writer) {
+  for (label_x* label :
+       GListRange<label_x*>(context_->manifest_data.get()->label)) {
+    if (label->name && strcmp(label->name, "") != 0) {
+      xmlTextWriterStartElement(writer, BAD_CAST "label");
+      if (label->lang && strcmp(DEFAULT_LOCALE, label->lang) != 0) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                    BAD_CAST label->lang);
+      }
+      xmlTextWriterWriteString(writer, BAD_CAST label->name);
+      xmlTextWriterEndElement(writer);
+    }
+  }
+}
+
+void StepGenerateXml::GenerateAuthor(xmlTextWriterPtr writer) {
+  for (author_x* author :
+       GListRange<author_x*>(context_->manifest_data.get()->author)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "author");
+    if (author->email && strlen(author->email)) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "email",
+                                  BAD_CAST author->email);
+    }
+    if (author->href && strlen(author->href)) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "href",
+                                  BAD_CAST author->href);
+    }
+    xmlTextWriterWriteString(writer, BAD_CAST author->text);
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateDescription(xmlTextWriterPtr writer) {
+  for (description_x* description :
+       GListRange<description_x*>(context_->manifest_data.get()->description)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "description");
+    if (description->lang && strcmp(DEFAULT_LOCALE, description->lang) != 0) {
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                  BAD_CAST description->lang);
+    }
+    xmlTextWriterWriteString(writer, BAD_CAST description->text);
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+common_installer::Step::Status StepGenerateXml::GenerateApplications(
+        xmlTextWriterPtr writer) {
+  for (application_x* app :
+       GListRange<application_x*>(context_->manifest_data.get()->application)) {
+    AppCompType type;
+    if (strcmp(app->component_type, "uiapp") == 0) {
+      type = AppCompType::UIAPP;
+      xmlTextWriterStartElement(writer, BAD_CAST "ui-application");
+    } else if (strcmp(app->component_type, "svcapp") == 0) {
+      type = AppCompType::SVCAPP;
+      xmlTextWriterStartElement(writer, BAD_CAST "service-application");
+    } else if (strcmp(app->component_type, "widgetapp") == 0) {
+      type = AppCompType::WIDGETAPP;
+      xmlTextWriterStartElement(writer, BAD_CAST "widget-application");
+    } else if (strcmp(app->component_type, "watchapp") == 0) {
+      type = AppCompType::WATCHAPP;
+      xmlTextWriterStartElement(writer, BAD_CAST "watch-application");
+    } else {
+      LOG(ERROR) << "Unknown application component_type";
+      xmlFreeTextWriter(writer);
+      return Status::ERROR;
+    }
+    Status status = GenerateApplicationCommonXml(app, writer, type);
+    if (status != Status::OK) {
+      xmlFreeTextWriter(writer);
+      return status;
+    }
+    xmlTextWriterEndElement(writer);
+  }
+  return Status::OK;
+}
+
+void StepGenerateXml::GeneratePrivilege(xmlTextWriterPtr writer) {
+  if (context_->manifest_data.get()->privileges) {
+    xmlTextWriterStartElement(writer, BAD_CAST "privileges");
+    for (privilege_x* priv :
+         GListRange<privilege_x*>(context_->manifest_data.get()->privileges)) {
+      xmlTextWriterStartElement(writer, BAD_CAST "privilege");
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "type",
+                                  BAD_CAST priv->type);
+      xmlTextWriterWriteString(writer, BAD_CAST priv->value);
+      xmlTextWriterEndElement(writer);
+    }
+    if (context_->manifest_data.get()->appdefined_privileges) {
+      for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+           context_->manifest_data.get()->appdefined_privileges)) {
+        xmlTextWriterStartElement(writer, BAD_CAST "appdefined-privilege");
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "license",
+                                    BAD_CAST priv->license);
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "type",
+                                    BAD_CAST priv->type);
+        xmlTextWriterWriteString(writer, BAD_CAST priv->value);
+        xmlTextWriterEndElement(writer);
+      }
+    }
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateProvidesAppDefinedPrivilege(
+    xmlTextWriterPtr writer) {
+  if (context_->manifest_data.get()->provides_appdefined_privileges) {
+    xmlTextWriterStartElement(writer,
+                              BAD_CAST "provides-appdefined-privileges");
+    for (appdefined_privilege_x* priv : GListRange<appdefined_privilege_x*>(
+         context_->manifest_data.get()->provides_appdefined_privileges)) {
+      xmlTextWriterStartElement(writer, BAD_CAST "appdefined-privilege");
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "license",
+                                  BAD_CAST priv->license);
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "type",
+                                  BAD_CAST priv->type);
+      xmlTextWriterWriteString(writer, BAD_CAST priv->value);
+      xmlTextWriterEndElement(writer);
+    }
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateAccount(xmlTextWriterPtr writer) {
+  const auto& accounts =
+      context_->manifest_plugins_data.get().account_info.get().accounts();
+  if (!accounts.empty()) {
+    xmlTextWriterStartElement(writer, BAD_CAST "account");
+    // add account info
+    for (auto& account : accounts) {
+      xmlTextWriterStartElement(writer, BAD_CAST "account-provider");
+
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "appid",
+                                  BAD_CAST account.appid.c_str());
+
+      if (!account.providerid.empty())
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "providerid",
+                                    BAD_CAST account.providerid.c_str());
+
+      if (account.multiple_account_support)
+        xmlTextWriterWriteAttribute(writer,
+                                    BAD_CAST "multiple-accounts-support",
+                                    BAD_CAST "true");
+      else
+        xmlTextWriterWriteAttribute(writer,
+                                    BAD_CAST "multiple-accounts-support",
+                                    BAD_CAST "false");
+      for (auto& icon_pair : account.icon_paths) {
+        xmlTextWriterStartElement(writer, BAD_CAST "icon");
+        if (icon_pair.first == "AccountSmall")
+          xmlTextWriterWriteAttribute(writer, BAD_CAST "section",
+                                      BAD_CAST "account-small");
+        else
+          xmlTextWriterWriteAttribute(writer, BAD_CAST "section",
+                                      BAD_CAST "account");
+        xmlTextWriterWriteString(writer, BAD_CAST icon_pair.second.c_str());
+        xmlTextWriterEndElement(writer);
+      }
+
+      for (auto& name_pair : account.names) {
+        xmlTextWriterStartElement(writer, BAD_CAST "label");
+        if (!name_pair.second.empty())
+          xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                      BAD_CAST name_pair.second.c_str());
+        xmlTextWriterWriteString(writer, BAD_CAST name_pair.first.c_str());
+        xmlTextWriterEndElement(writer);
+      }
+
+      for (auto& capability : account.capabilities) {
+        xmlTextWriterWriteFormatElement(writer, BAD_CAST "capability",
+          "%s", BAD_CAST capability.c_str());
+      }
+
+      xmlTextWriterEndElement(writer);
+    }
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateIme(xmlTextWriterPtr writer) {
+  const auto &ime = context_->manifest_plugins_data.get().ime_info.get();
+  const auto ime_uuid = ime.uuid();
+  if (!ime_uuid.empty()) {
+    xmlTextWriterStartElement(writer, BAD_CAST "ime");
+
+    GListRange<application_x*> app_range(
+        context_->manifest_data.get()->application);
+    if (!app_range.Empty()) {
+      // wgt app have ui-application as first application element.
+      // there may be service-applications but not as first element.
+      application_x* app = *app_range.begin();
+      xmlTextWriterWriteAttribute(writer, BAD_CAST "appid",
+                                  BAD_CAST app->appid);
+    }
+
+    xmlTextWriterStartElement(writer, BAD_CAST "uuid");
+    xmlTextWriterWriteString(writer, BAD_CAST ime_uuid.c_str());
+    xmlTextWriterEndElement(writer);
+
+    xmlTextWriterStartElement(writer, BAD_CAST "languages");
+
+    for (auto it = ime.LanguagesBegin(); it != ime.LanguagesEnd(); ++it) {
+      xmlTextWriterStartElement(writer, BAD_CAST "language");
+      xmlTextWriterWriteString(writer, BAD_CAST it->c_str());
+      xmlTextWriterEndElement(writer);
+    }
+
+    xmlTextWriterEndElement(writer);
+
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateProfiles(xmlTextWriterPtr writer) {
+  for (const char* profile :
+       GListRange<char*>(context_->manifest_data.get()->deviceprofile)) {
+    xmlTextWriterStartElement(writer, BAD_CAST "profile");
+    xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
+                                BAD_CAST profile);
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateShortcuts(xmlTextWriterPtr writer) {
+  const auto& shortcuts =
+      context_->manifest_plugins_data.get().shortcut_info.get();
+  if (!shortcuts.empty()) {
+    xmlTextWriterStartElement(writer, BAD_CAST "shortcut-list");
+    for (auto& shortcut : shortcuts) {
+      xmlTextWriterStartElement(writer, BAD_CAST "shortcut");
+      if (!shortcut.app_id.empty())
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "appid",
+                                    BAD_CAST shortcut.app_id.c_str());
+      if (!shortcut.extra_data.empty())
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "extra_data",
+                                    BAD_CAST shortcut.extra_data.c_str());
+      if (!shortcut.extra_key.empty())
+        xmlTextWriterWriteAttribute(writer, BAD_CAST "extra_key",
+                                    BAD_CAST shortcut.extra_key.c_str());
+      if (!shortcut.icon.empty()) {
+        xmlTextWriterStartElement(writer, BAD_CAST "icon");
+        xmlTextWriterWriteString(writer, BAD_CAST shortcut.icon.c_str());
+        xmlTextWriterEndElement(writer);
+      }
+      for (auto& label : shortcut.labels) {
+        xmlTextWriterStartElement(writer, BAD_CAST "label");
+        if (!label.first.empty())
+          xmlTextWriterWriteAttribute(writer, BAD_CAST "xml:lang",
+                                      BAD_CAST label.first.c_str());
+        xmlTextWriterWriteString(writer, BAD_CAST label.second.c_str());
+        xmlTextWriterEndElement(writer);
+      }
+      xmlTextWriterEndElement(writer);
+    }
+    xmlTextWriterEndElement(writer);
+  }
+}
+
+void StepGenerateXml::GenerateTrustAnchor(xmlTextWriterPtr writer) {
+  if (!context_->manifest_data.get()->use_system_certs)
+    return;
+
+  xmlTextWriterStartElement(writer, BAD_CAST "trust-anchor");
+  xmlTextWriterWriteAttribute(writer, BAD_CAST "use-system-certs",
+      BAD_CAST context_->manifest_data.get()->use_system_certs);
+
+  xmlTextWriterEndElement(writer);
+}
+
+}  // namespace pkgmgr
+}  // namespace wgt
diff --git a/src/wgt/step/pkgmgr/step_generate_xml.h b/src/wgt/step/pkgmgr/step_generate_xml.h
new file mode 100644 (file)
index 0000000..f9a893f
--- /dev/null
@@ -0,0 +1,60 @@
+/* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
+// 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_PKGMGR_STEP_GENERATE_XML_H_
+#define  WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <libxml/xmlwriter.h>
+
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace pkgmgr {
+
+class StepGenerateXml : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override;
+  Status precheck() override;
+
+ private:
+  enum class AppCompType {
+    UIAPP,
+    SVCAPP,
+    WIDGETAPP,
+    WATCHAPP
+  };
+
+  Step::Status GenerateApplicationCommonXml(application_x* app,
+                                            xmlTextWriterPtr writer,
+                                            AppCompType type);
+
+  Step::Status GenerateManifestElement(xmlTextWriterPtr writer);
+  void GenerateManifestElementAttributes(xmlTextWriterPtr writer);
+  void GenerateLangLabels(xmlTextWriterPtr writer);
+  void GenerateAuthor(xmlTextWriterPtr writer);
+  void GenerateDescription(xmlTextWriterPtr writer);
+  Step::Status GenerateApplications(xmlTextWriterPtr writer);
+  void GeneratePrivilege(xmlTextWriterPtr writer);
+  void GenerateProvidesAppDefinedPrivilege(xmlTextWriterPtr writer);
+  void GenerateAccount(xmlTextWriterPtr writer);
+  void GenerateIme(xmlTextWriterPtr writer);
+  void GenerateProfiles(xmlTextWriterPtr writer);
+  void GenerateShortcuts(xmlTextWriterPtr writer);
+  void GenerateTrustAnchor(xmlTextWriterPtr writer);
+
+  STEP_NAME(GenerateXML)
+};
+
+}  // namespace pkgmgr
+}  // namespace wgt
+
+#endif  // WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_
diff --git a/src/wgt/step/security/step_add_default_privileges.cc b/src/wgt/step/security/step_add_default_privileges.cc
new file mode 100644 (file)
index 0000000..2718011
--- /dev/null
@@ -0,0 +1,50 @@
+// 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/security/step_add_default_privileges.h"
+#include <common/privileges.h>
+
+#include <pkgmgrinfo_basic.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+
+namespace wgt {
+namespace security {
+
+common_installer::Step::Status StepAddDefaultPrivileges::precheck() {
+  if (!context_->manifest_data.get()) {
+    LOG(ERROR) << "Manifest data is not set";
+    return Status::ERROR;
+  }
+  return Status::OK;
+}
+
+common_installer::Step::Status StepAddDefaultPrivileges::process() {
+  manifest_x* m = context_->manifest_data.get();
+  privilege_x* privilege =
+      reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
+  if (!privilege) {
+    LOG(ERROR) << "Out of memory";
+    return Status::ERROR;
+  }
+  privilege->type = strdup(common_installer::kWebPrivilegeType);
+  if (!privilege->type) {
+    LOG(ERROR) << "Out of memory";
+    common_installer::FreePrivilegeX(privilege);
+    return Status::ERROR;
+  }
+  privilege->value = strdup(common_installer::privileges::kPrivForWebApp);
+  if (!privilege->value) {
+    LOG(ERROR) << "Out of memory";
+    common_installer::FreePrivilegeX(privilege);
+    return Status::ERROR;
+  }
+  m->privileges = g_list_append(m->privileges, privilege);
+  return Status::OK;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_add_default_privileges.h b/src/wgt/step/security/step_add_default_privileges.h
new file mode 100644 (file)
index 0000000..84c7bca
--- /dev/null
@@ -0,0 +1,59 @@
+// 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_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_
+#define WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief Step that add default privileges during installation
+ */
+class StepAddDefaultPrivileges : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \brief Add default privileges
+   *
+   * \return Status::OK
+   */
+  Status process() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status clean() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status undo() override { return Status::OK; }
+
+  /**
+   * \brief Check requirements for this step
+   *
+   * \return Status::ERROR when rmanifest data are missing,
+   *         Status::OK otherwise
+   */
+  Status precheck() override;
+
+  STEP_NAME(AddDefaultPrivileges)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_ADD_DEFAULT_PRIVILEGES_H_
diff --git a/src/wgt/step/security/step_check_extension_privileges.cc b/src/wgt/step/security/step_check_extension_privileges.cc
new file mode 100755 (executable)
index 0000000..281c47e
--- /dev/null
@@ -0,0 +1,158 @@
+// 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/security/step_check_extension_privileges.h"
+
+#include <boost/scope_exit.hpp>
+
+#include <common/privileges.h>
+#include <common/certificate_validation.h>
+#include <common/utils/glist_range.h>
+#include <manifest_parser/values.h>
+
+#include <pkgmgrinfo_basic.h>
+#include <glib.h>
+#include <glob.h>
+#include <sys/utsname.h>
+
+#include <set>
+#include <vector>
+#include <cstdlib>
+#include <string>
+#include <memory>
+
+#include "wgt/extension_config_parser.h"
+
+namespace {
+
+const char kPluginsDirectory[] = "/res/wgt/plugin/";
+const char kArchArmv7l[] = "armv7l";
+const char kArchI586[] = "i586";
+const char kArchDefault[] = "default";
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+common_installer::Step::Status StepCheckExtensionPrivileges::precheck() {
+  if (!context_->manifest_data.get()) {
+    LOG(ERROR) << "Manifest data is not set";
+    return Status::ERROR;
+  }
+  return Status::OK;
+}
+common_installer::Step::Status StepCheckExtensionPrivileges::process() {
+  std::string app_ext_config_pattern(GetExtensionPath());
+
+  manifest_x* m = context_->manifest_data.get();
+  std::set<std::string> current_privileges;
+  for (privilege_x* priv : GListRange<privilege_x*>(m->privileges)) {
+    if (strcmp(priv->type, common_installer::kWebPrivilegeType) == 0)
+      current_privileges.insert(priv->value);
+  }
+
+  std::set<std::string> xmlFiles;
+  {
+    glob_t glob_result;
+    glob(app_ext_config_pattern.c_str(), GLOB_TILDE, NULL, &glob_result);
+    for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
+      xmlFiles.insert(glob_result.gl_pathv[i]);
+    }
+  }
+  GList* privileges = nullptr;
+  BOOST_SCOPE_EXIT_ALL(&) {
+    g_list_free_full(privileges, &common_installer::FreePrivilegeX);
+  };
+  for (auto it = xmlFiles.begin(); it != xmlFiles.end(); ++it) {
+    LOG(DEBUG) << "start to parse extension xml : " << *it;
+    ExtensionConfigParser extensionParser(*it);
+    std::vector<std::string> list = extensionParser.GetExtensionPrivilegeList();
+    for (const std::string& priv : list) {
+      if (current_privileges.find(priv) == current_privileges.end()) {
+        privilege_x* privilege =
+            reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
+        if (!privilege) {
+          LOG(ERROR) << "Out of memory";
+          g_list_free_full(privileges, &common_installer::FreePrivilegeX);
+          return Status::ERROR;
+        }
+        privilege->type = strdup(common_installer::kWebPrivilegeType);
+        if (!privilege->type) {
+          LOG(ERROR) << "Out of memory";
+          common_installer::FreePrivilegeX(privilege);
+          g_list_free_full(privileges, &common_installer::FreePrivilegeX);
+          return Status::ERROR;
+        }
+        privilege->value = strdup(priv.c_str());
+        if (!privilege->value) {
+          LOG(ERROR) << "Out of memory";
+          common_installer::FreePrivilegeX(privilege);
+          g_list_free_full(privileges, &common_installer::FreePrivilegeX);
+          return Status::ERROR;
+        }
+        privileges = g_list_append(privileges, privilege);
+      }
+    }
+  }
+
+  if (privileges) {
+    if (!CheckPrivilegeLevel(privileges)) {
+      LOG(DEBUG) << "Fail to validation of privilege";
+      return Status::ERROR;
+    }
+    m->privileges = g_list_concat(m->privileges, privileges);
+    privileges = nullptr;
+  }
+  return Status::OK;
+}
+
+std::string StepCheckExtensionPrivileges::GetExtensionPath() {
+  std::string app_ext_config_pattern(context_->GetPkgPath().string());
+  app_ext_config_pattern.append(kPluginsDirectory);
+  struct utsname u;
+  if (0 == uname(&u)) {
+    std::string machine = u.machine;
+    LOG(DEBUG) << "Machine archicture for user defined plugins: " << machine;
+    if (!machine.empty()) {
+      if (machine == kArchArmv7l) {
+        app_ext_config_pattern.append(kArchArmv7l);
+      } else if (machine == kArchI586) {
+        app_ext_config_pattern.append(kArchI586);
+      } else {
+        app_ext_config_pattern.append(kArchDefault);
+      }
+    } else {
+      LOG(ERROR) << "cannot get machine info";
+      app_ext_config_pattern.append(kArchDefault);
+    }
+    app_ext_config_pattern.append("/");
+  }
+  app_ext_config_pattern.append("*");
+  app_ext_config_pattern.append(".xml");
+  return app_ext_config_pattern;
+}
+
+bool StepCheckExtensionPrivileges::CheckPrivilegeLevel(
+    GList* privileges) {
+  if (g_list_length(privileges) == 0)
+    return true;
+
+  std::string error_message;
+  if (!common_installer::ValidatePrivilegeLevel(
+         context_->privilege_level.get(),
+         context_->uid.get(),
+         context_->manifest_data.get()->api_version,
+         privileges,
+         &error_message)) {
+    if (!error_message.empty()) {
+      LOG(ERROR) << "error_message: " << error_message;
+    }
+    return false;
+  }
+  return true;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_check_extension_privileges.h b/src/wgt/step/security/step_check_extension_privileges.h
new file mode 100755 (executable)
index 0000000..c390d3c
--- /dev/null
@@ -0,0 +1,56 @@
+// 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.
+// 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_SECURITY_STEP_CHECK_EXTENSION_PRIVILEGES_H_
+#define WGT_STEP_SECURITY_STEP_CHECK_EXTENSION_PRIVILEGES_H_
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+#include <glib.h>
+#include <manifest_parser/utils/logging.h>
+#include <manifest_parser/values.h>
+
+#include <vector>
+#include <string>
+#include <set>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief Step that add user extension privileges during installation
+ */
+class StepCheckExtensionPrivileges : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \Adds extra package privileges defined by extension manifest.
+   *
+   * \return Status::OK
+   */
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  /**
+   * \brief Check requirements for this step
+   *
+   * \return Status::ERROR when rmanifest data are missing,
+   *         Status::OK otherwise
+   */
+  Status precheck() override;
+ private:
+  std::string GetExtensionPath();
+  bool CheckPrivilegeLevel(GList* privileges);
+  STEP_NAME(CheckExtensionPrivileges)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_CHECK_EXTENSION_PRIVILEGES_H_
diff --git a/src/wgt/step/security/step_check_settings_level.cc b/src/wgt/step/security/step_check_settings_level.cc
new file mode 100644 (file)
index 0000000..b26f7ed
--- /dev/null
@@ -0,0 +1,101 @@
+// 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/security/step_check_settings_level.h"
+
+#include <common/utils/glist_range.h>
+#include <common/utils/profile_util.h>
+#include <manifest_parser/utils/logging.h>
+#include <manifest_parser/utils/version_number.h>
+#include <wgt_manifest_handlers/setting_handler.h>
+
+#include <map>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace wgt {
+namespace security {
+
+common_installer::Step::Status StepCheckSettingsLevel::process() {
+  if (!ValidateSettingsForLevel()) {
+    return Status::PRIVILEGE_ERROR;
+  }
+  LOG(INFO) << "Settings privilege level checked";
+  return Status::OK;
+}
+
+bool StepCheckSettingsLevel::ValidateSettingsForLevel() {
+  common_installer::PrivilegeLevel level = context_->privilege_level.get();
+  wgt::parse::SettingInfo& settings = static_cast<WgtBackendData*>(
+      context_->backend_data.get())->settings.get();
+  if (settings.background_vibration()) {
+    common_installer::PrivilegeLevel required_level =
+        common_installer::PrivilegeLevel::PARTNER;
+    if (!common_installer::SatifiesPrivilegeLevel(required_level, level)) {
+      LOG(ERROR) << "background_vibration requires visibility level: "
+                 << common_installer::PrivilegeLevelToString(required_level);
+      return false;
+    }
+    LOG(INFO) << "Setting: 'background-vibration' allowed";
+  }
+
+  if (settings.long_polling()) {
+    common_installer::PrivilegeLevel required_level =
+        common_installer::PrivilegeLevel::PARTNER;
+    if (!common_installer::SatifiesPrivilegeLevel(required_level, level)) {
+      LOG(ERROR) << "long-polling requires visibility level: "
+                 << common_installer::PrivilegeLevelToString(required_level);
+      return false;
+    }
+    LOG(INFO) << "Setting: 'long-polling' allowed";
+  }
+
+  if (settings.no_display()) {
+    common_installer::PrivilegeLevel required_level =
+        common_installer::PrivilegeLevel::PARTNER;
+    if (!common_installer::SatifiesPrivilegeLevel(required_level, level)) {
+      LOG(ERROR) << "nodisplay requires visibility level: "
+                 << common_installer::PrivilegeLevelToString(required_level);
+      return false;
+    }
+    LOG(INFO) << "Setting: 'nodisplay' allowed";
+  }
+
+  if (settings.sound_mode() != wgt::parse::SettingInfo::SoundMode::SHARED) {
+    common_installer::PrivilegeLevel required_level =
+        common_installer::PrivilegeLevel::PARTNER;
+    if (!common_installer::SatifiesPrivilegeLevel(required_level, level)) {
+      LOG(ERROR) << "sound-mode requires visibility level: "
+                 << common_installer::PrivilegeLevelToString(required_level);
+      return false;
+    }
+    LOG(INFO) << "Setting: 'sound-mode' allowed";
+  }
+
+  if ((level != common_installer::PrivilegeLevel::PARTNER) &&
+      (level != common_installer::PrivilegeLevel::PLATFORM)) {
+    utils::VersionNumber api_version =
+        utils::VersionNumber(context_->manifest_data.get()->api_version);
+    utils::VersionNumber platform_version =
+        utils::VersionNumber((common_installer::GetTizenProfile() ==
+        common_installer::TizenProfile::WEARABLE) ? "2.3.1" : "2.4.0");
+    if (api_version >= platform_version) {
+      for (const auto& app : GListRange<application_x*>(
+          context_->manifest_data.get()->application)) {
+        if (app->autorestart)
+          free(app->autorestart);
+        app->autorestart = strdup("false");
+
+        if (app->onboot)
+          free(app->onboot);
+        app->onboot = strdup("false");
+      }
+    }
+  }
+
+  return true;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_check_settings_level.h b/src/wgt/step/security/step_check_settings_level.h
new file mode 100644 (file)
index 0000000..772188b
--- /dev/null
@@ -0,0 +1,62 @@
+// 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_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_
+#define WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <common/app_installer.h>
+#include <common/installer_context.h>
+#include <common/step/step.h>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief Step that check privileges level for settings
+ */
+class StepCheckSettingsLevel : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  /**
+   * \brief Check privileges level for settings
+   *
+   * \return Status::ERROR when invalid privileges detected,
+   *         Status::OK otherwise
+   */
+  Status process() override;
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status clean() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status undo() override { return Status::OK; }
+
+  /**
+   * \brief Empty method
+   *
+   * \return Status::OK
+   */
+  Status precheck() override { return Status::OK; }
+
+ private:
+  bool ValidateSettingsForLevel();
+
+  STEP_NAME(CheckSettingsLevel)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_CHECK_SETTINGS_LEVEL_H_
diff --git a/src/wgt/step/security/step_check_wgt_background_category.cc b/src/wgt/step/security/step_check_wgt_background_category.cc
new file mode 100644 (file)
index 0000000..b3d6a2c
--- /dev/null
@@ -0,0 +1,32 @@
+// 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/security/step_check_wgt_background_category.h"
+
+#include <common/installer_context.h>
+#include <wgt_manifest_handlers/setting_handler.h>
+
+#include "wgt/wgt_backend_data.h"
+
+namespace {
+
+namespace ci_sec = common_installer::security;
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+StepCheckWgtBackgroundCategory::StepCheckWgtBackgroundCategory(
+    common_installer::InstallerContext* context) :
+        ci_sec::StepCheckBackgroundCategory(context) {}
+
+bool StepCheckWgtBackgroundCategory::GetBackgroundSupport() {
+  const wgt::parse::SettingInfo& settings = static_cast<WgtBackendData*>(
+      context_->backend_data.get())->settings.get();
+  return settings.background_support_enabled();
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_check_wgt_background_category.h b/src/wgt/step/security/step_check_wgt_background_category.h
new file mode 100644 (file)
index 0000000..dd21574
--- /dev/null
@@ -0,0 +1,31 @@
+// 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_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_
+#define WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_
+
+#include <common/step/security/step_check_background_category.h>
+#include <manifest_parser/utils/version_number.h>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief This step check background category value and modify it depending on
+ *        required version, cert level, background support, and value itself
+ */
+class StepCheckWgtBackgroundCategory :
+    public common_installer::security::StepCheckBackgroundCategory {
+ public:
+  explicit StepCheckWgtBackgroundCategory(
+      common_installer::InstallerContext* context);
+
+ protected:
+  bool GetBackgroundSupport() override;
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_CHECK_WGT_BACKGROUND_CATEGORY_H_
diff --git a/src/wgt/step/security/step_check_wgt_ime_privilege.cc b/src/wgt/step/security/step_check_wgt_ime_privilege.cc
new file mode 100644 (file)
index 0000000..2a6d325
--- /dev/null
@@ -0,0 +1,107 @@
+// 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/security/step_check_wgt_ime_privilege.h>
+
+#include <manifest_parser/utils/version_number.h>
+#include <manifest_parser/utils/logging.h>
+
+#include <common/utils/glist_range.h>
+#include <common/privileges.h>
+
+#include <string>
+
+namespace {
+
+const char kImeCategoryName[] = "http://tizen.org/category/ime";
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+common_installer::Step::Status StepCheckWgtImePrivilege::process() {
+  utils::VersionNumber apiVersion(context_->manifest_data.get()->api_version);
+
+  const auto version23 = apiVersion < utils::VersionNumber("2.4");
+  auto has_ime = false;
+
+  for (const auto app :
+      GListRange<application_x*>(context_->manifest_data.get()->application)) {
+    for (const auto category : GListRange<char *>(app->category)) {
+      if (!strcmp(category, kImeCategoryName)) {
+        has_ime = true;
+
+        const auto result = version23 ? Check23Api() : Check24Api();
+        if (result != Status::OK) {
+          LOG(ERROR) << "Insufficient privileges for IME application.";
+          return result;
+        }
+
+        break;
+      }
+    }
+  }
+
+  if (!has_ime) {
+    // be sure no ime data is present without the category
+    context_->manifest_plugins_data.get().ime_info.get().setUuid(std::string());
+  } else if (version23) {
+    // be sure there's a privilege in manifest
+    privilege_x* privilege =
+        reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
+    if (!privilege) {
+      LOG(ERROR) << "Out of memory";
+      return Status::ERROR;
+    }
+    privilege->type = strdup(common_installer::kWebPrivilegeType);
+    if (!privilege->type) {
+      LOG(ERROR) << "Out of memory";
+      common_installer::FreePrivilegeX(privilege);
+      return Status::ERROR;
+    }
+    privilege->value = strdup(common_installer::privileges::kImePrivilegeName);
+    if (!privilege->value) {
+      LOG(ERROR) << "Out of memory";
+      common_installer::FreePrivilegeX(privilege);
+      return Status::ERROR;
+    }
+    context_->manifest_data.get()->privileges =
+        g_list_append(context_->manifest_data.get()->privileges, privilege);
+  }
+
+  return Status::OK;
+}
+
+common_installer::Step::Status StepCheckWgtImePrivilege::Check23Api() const {
+  const auto &ime = context_->manifest_plugins_data.get().ime_info.get();
+  if (ime.uuid().empty()) {
+    LOG(ERROR) << "Missing IME tag.";
+    return Status::CONFIG_ERROR;
+  }
+
+  // ime priv not supported in 2.3
+  return CheckImePrivilege() != Status::OK ?
+      Status::OK : Status::PRIVILEGE_ERROR;
+}
+
+common_installer::Step::Status StepCheckWgtImePrivilege::Check24Api() const {
+  return CheckImePrivilege();
+}
+
+common_installer::Step::Status
+StepCheckWgtImePrivilege::CheckImePrivilege() const {
+  for (privilege_x* privilege :
+      GListRange<privilege_x*>(context_->manifest_data.get()->privileges)) {
+    if (!strcmp(privilege->value,
+                common_installer::privileges::kImePrivilegeName))
+      return Status::OK;
+  }
+
+  LOG(DEBUG) << "Missing IME privilege.";
+  return Status::PRIVILEGE_ERROR;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_check_wgt_ime_privilege.h b/src/wgt/step/security/step_check_wgt_ime_privilege.h
new file mode 100644 (file)
index 0000000..192ae2e
--- /dev/null
@@ -0,0 +1,40 @@
+// 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_SECURITY_STEP_CHECK_WGT_IME_PRIVILEGE_H_
+#define WGT_STEP_SECURITY_STEP_CHECK_WGT_IME_PRIVILEGE_H_
+
+#include <common/step/step.h>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief Checks if the app has IME privileges.
+ */
+class StepCheckWgtImePrivilege :
+  public common_installer::Step {
+ public:
+  using common_installer::Step::Step;
+  ~StepCheckWgtImePrivilege() override = default;
+
+  Status process() override;
+
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+ private:
+  Status Check23Api() const;
+  Status Check24Api() const;
+
+  Status CheckImePrivilege() const;
+
+  STEP_NAME(CheckWgtImePrivilege)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_CHECK_WGT_IME_PRIVILEGE_H_
diff --git a/src/wgt/step/security/step_check_wgt_notification_category.cc b/src/wgt/step/security/step_check_wgt_notification_category.cc
new file mode 100644 (file)
index 0000000..8057035
--- /dev/null
@@ -0,0 +1,43 @@
+// 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/security/step_check_wgt_notification_category.h>
+
+#include <common/utils/glist_range.h>
+
+#include <manifest_parser/utils/logging.h>
+
+namespace {
+
+const char kNotificationCategoryName[]
+    = "http://tizen.org/category/always_on_top";
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+common_installer::Step::Status StepCheckWgtNotificationCategory::process() {
+  const auto notificationAllowed = context_->privilege_level.get() >=
+    common_installer::PrivilegeLevel::PARTNER;
+
+  // no point in checking if priv is set
+  if (notificationAllowed)
+    return Status::OK;
+
+  for (const auto app :
+      GListRange<application_x *>(context_->manifest_data.get()->application)) {
+    for (const auto category : GListRange<char *>(app->category)) {
+      if (strcmp(category, kNotificationCategoryName) == 0) {
+          LOG(ERROR) << "Insufficient privileges for notification category.";
+          return Status::PRIVILEGE_ERROR;
+      }
+    }
+  }
+
+  LOG(INFO) << "No notification category present.";
+  return Status::OK;
+}
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_check_wgt_notification_category.h b/src/wgt/step/security/step_check_wgt_notification_category.h
new file mode 100644 (file)
index 0000000..1d52f71
--- /dev/null
@@ -0,0 +1,34 @@
+// 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_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_
+#define WGT_STEP_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_
+
+#include <common/step/step.h>
+
+namespace wgt {
+namespace security {
+
+/**
+ * \brief Checks if the app can show notifications, if it requires that feature.
+ */
+class StepCheckWgtNotificationCategory :
+  public common_installer::Step {
+ public:
+  using common_installer::Step::Step;
+  ~StepCheckWgtNotificationCategory() = default;
+
+  Status process() override;
+
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override { return Status::OK; }
+
+  STEP_NAME(CheckWgtNotificationCategory)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_CHECK_WGT_NOTIFICATION_CATEGORY_H_
diff --git a/src/wgt/step/security/step_direct_manifest_check_signature.cc b/src/wgt/step/security/step_direct_manifest_check_signature.cc
new file mode 100644 (file)
index 0000000..469a490
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/security/step_direct_manifest_check_signature.h"
+
+namespace bf = boost::filesystem;
+
+namespace {
+
+const char kResWgt[] = "res/wgt";
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+bf::path StepDirectManifestCheckSignature::GetSignatureRoot() const {
+  return StepCheckSignature::GetSignatureRoot() / kResWgt;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_direct_manifest_check_signature.h b/src/wgt/step/security/step_direct_manifest_check_signature.h
new file mode 100644 (file)
index 0000000..a56a998
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_SECURITY_STEP_DIRECT_MANIFEST_CHECK_SIGNATURE_H_
+#define WGT_STEP_SECURITY_STEP_DIRECT_MANIFEST_CHECK_SIGNATURE_H_
+
+#include <common/step/security/step_check_signature.h>
+#include <manifest_parser/utils/logging.h>
+
+namespace wgt {
+namespace security {
+
+class StepDirectManifestCheckSignature
+    : public common_installer::security::StepCheckSignature {
+ public:
+  using StepCheckSignature::StepCheckSignature;
+
+ private:
+  boost::filesystem::path GetSignatureRoot() const override;
+
+  STEP_NAME(StepDirectManifestCheckSignature)
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_DIRECT_MANIFEST_CHECK_SIGNATURE_H_
diff --git a/src/wgt/step/security/step_wgt_recover_signature.cc b/src/wgt/step/security/step_wgt_recover_signature.cc
new file mode 100644 (file)
index 0000000..e951b5b
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/security/step_wgt_recover_signature.h"
+
+namespace bf = boost::filesystem;
+
+namespace {
+
+const char kResWgt[] = "res/wgt";
+
+}  // namespace
+
+namespace wgt {
+namespace security {
+
+bf::path StepWgtRecoverSignature::GetSignatureRoot() {
+  return context_->GetPkgPath() / kResWgt;
+}
+
+}  // namespace security
+}  // namespace wgt
diff --git a/src/wgt/step/security/step_wgt_recover_signature.h b/src/wgt/step/security/step_wgt_recover_signature.h
new file mode 100644 (file)
index 0000000..66545d7
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_SECURITY_STEP_WGT_RECOVER_SIGNATURE_H_
+#define WGT_STEP_SECURITY_STEP_WGT_RECOVER_SIGNATURE_H_
+
+#include <common/step/security/step_recover_signature.h>
+
+#include <boost/filesystem/path.hpp>
+
+namespace wgt {
+namespace security {
+
+class StepWgtRecoverSignature
+    : public common_installer::security::StepRecoverSignature {
+ public:
+  using StepRecoverSignature::StepRecoverSignature;
+
+ private:
+  boost::filesystem::path GetSignatureRoot() override;
+};
+
+}  // namespace security
+}  // namespace wgt
+
+#endif  // WGT_STEP_SECURITY_STEP_WGT_RECOVER_SIGNATURE_H_
diff --git a/src/wgt/wgt_app_query_interface.cc b/src/wgt/wgt_app_query_interface.cc
new file mode 100644 (file)
index 0000000..c5abeda
--- /dev/null
@@ -0,0 +1,120 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/wgt_app_query_interface.h"
+
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/pkgmgr_interface.h>
+#include <common/pkgmgr_query.h>
+#include <common/recovery_file.h>
+#include <common/request.h>
+#include <common/utils/file_util.h>
+
+#include <manifest_parser/manifest_parser.h>
+#include <manifest_parser/utils/logging.h>
+#include <wgt_manifest_handlers/application_manifest_constants.h>
+#include <wgt_manifest_handlers/tizen_application_handler.h>
+#include <wgt_manifest_handlers/widget_handler.h>
+
+#include <tzplatform_config.h>
+
+#include <memory>
+#include <utility>
+#include <string>
+#include <vector>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kHybridConfigLocation[] = "res/wgt/config.xml";
+const char kTizenManifestLocation[] = "tizen-manifest.xml";
+
+std::string ReadPkgidFromRecovery(const std::string& recovery_path) {
+  std::unique_ptr<ci::recovery::RecoveryFile> recovery_file =
+      ci::recovery::RecoveryFile::OpenRecoveryFile(recovery_path);
+  recovery_file->Detach();
+  return recovery_file->pkgid();
+}
+
+}  // namespace
+
+namespace wgt {
+
+std::string WgtAppQueryInterface::GetManifestFileName() const {
+  return "config.xml";
+}
+
+std::string WgtAppQueryInterface::GetPkgIdFromPath(
+    const std::string& path) const {
+  bf::path tmp_path = ExtractManifest(path);
+  if (tmp_path.empty())
+    return {};
+  std::vector<std::shared_ptr<parser::ManifestHandler>> handlers = {
+    std::make_shared<wgt::parse::WidgetHandler>(),
+    std::make_shared<wgt::parse::TizenApplicationHandler>()
+  };
+  std::unique_ptr<parser::ManifestHandlerRegistry> registry(
+      new parser::ManifestHandlerRegistry(handlers));
+  std::unique_ptr<parser::ManifestParser> parser(
+      new parser::ManifestParser(std::move(registry)));
+  bf::path config_path = tmp_path / GetManifestFileName();
+  if (!parser->ParseManifest(config_path)) {
+    ci::RemoveAll(tmp_path);
+    return {};
+  }
+  auto info = std::static_pointer_cast<const wgt::parse::TizenApplicationInfo>(
+      parser->GetManifestData(
+          wgt::application_widget_keys::kTizenApplicationKey));
+  if (!info) {
+    ci::RemoveAll(tmp_path);
+    return {};
+  }
+  std::string pkg_id = info->package();
+
+  ci::RemoveAll(tmp_path);
+  return pkg_id;
+}
+
+bool WgtAppQueryInterface::IsHybridApplication(const std::string& arg,
+    uid_t uid) const {
+  std::string info;
+  bool is_recovery = arg.find("wgt-recovery-") != std::string::npos;
+  if (is_recovery)
+    info = ReadPkgidFromRecovery(arg);
+  else
+    info = arg;
+  bf::path rw_package_directory(ci::GetRootAppPath(false, uid));
+  bf::path ro_package_directory;
+  if (uid == tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) || uid == 0)
+    ro_package_directory = ci::GetRootAppPath(true, uid);
+  if ((bf::exists(rw_package_directory / info / kTizenManifestLocation) &&
+        bf::exists(rw_package_directory / info / kHybridConfigLocation)) ||
+       (bf::exists(ro_package_directory / info / kTizenManifestLocation) &&
+        bf::exists(ro_package_directory / info / kHybridConfigLocation))) {
+      return true;
+  } else if (!is_recovery) {
+    bool tizen_manifest_found = false;
+    bool config_xml_found = false;
+    if (!ci::CheckPathInZipArchive(info.c_str(), kTizenManifestLocation,
+                                   &tizen_manifest_found))
+      return false;
+    if (!ci::CheckPathInZipArchive(info.c_str(), kHybridConfigLocation,
+                                   &config_xml_found))
+      return false;
+    if (tizen_manifest_found && config_xml_found)
+      return true;
+  }
+  return false;
+}
+
+}  // namespace wgt
diff --git a/src/wgt/wgt_app_query_interface.h b/src/wgt/wgt_app_query_interface.h
new file mode 100644 (file)
index 0000000..c19d46a
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_WGT_APP_QUERY_INTERFACE_H_
+#define WGT_WGT_APP_QUERY_INTERFACE_H_
+
+#include <common/app_query_interface.h>
+
+#include <sys/types.h>
+
+#include <string>
+
+namespace wgt {
+
+/**
+ * \brief Helper functionalities used before
+ *        configuring app-installer steps.
+ *        Eg. it is used to check, if package is to be installed or updated
+ */
+class WgtAppQueryInterface : public common_installer::AppQueryInterface {
+ public:
+  /**
+   * \brief This method is workaround for detecting installation of hybrid
+   *        application.
+   *
+   * \return true if package is hybrid
+   */
+  bool IsHybridApplication(const std::string& arg, uid_t uid) const;
+
+ private:
+  std::string GetPkgIdFromPath(const std::string& path) const override;
+  std::string GetManifestFileName() const override;
+};
+
+}  // namespace wgt
+
+#endif  // WGT_WGT_APP_QUERY_INTERFACE_H_
diff --git a/src/wgt/wgt_backend_data.h b/src/wgt/wgt_backend_data.h
new file mode 100644 (file)
index 0000000..cd7651a
--- /dev/null
@@ -0,0 +1,41 @@
+// 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_WGT_BACKEND_DATA_H_
+#define WGT_WGT_BACKEND_DATA_H_
+
+#include <common/installer_context.h>
+#include <common/utils/property.h>
+
+#include <wgt_manifest_handlers/appwidget_handler.h>
+#include <wgt_manifest_handlers/content_handler.h>
+#include <wgt_manifest_handlers/service_handler.h>
+#include <wgt_manifest_handlers/setting_handler.h>
+#include <wgt_manifest_handlers/trust_anchor_handler.h>
+
+#include <string>
+#include <vector>
+
+namespace wgt {
+
+/**
+ * \brief Class that is used within specific backends to keep additional
+ *        information regarding package
+ */
+class WgtBackendData : public common_installer::BackendData {
+ public:
+  /**
+   * \brief Property of SettingInfo
+   */
+  Property<parse::SettingInfo> settings;
+
+  Property<parse::AppWidgetInfo> appwidgets;
+  Property<parse::ContentInfo> content;
+  Property<parse::ServiceList> service_list;
+  Property<parse::TrustAnchorInfo> trust_anchor;
+};
+
+}  // namespace wgt
+
+#endif  // WGT_WGT_BACKEND_DATA_H_
diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc
new file mode 100644 (file)
index 0000000..1c20ef8
--- /dev/null
@@ -0,0 +1,753 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/wgt_installer.h"
+
+#include <common/pkgmgr_interface.h>
+
+#include <common/privileges.h>
+#include <common/step/backup/step_backup_icons.h>
+#include <common/step/backup/step_backup_manifest.h>
+#include <common/step/backup/step_copy_backup.h>
+#include <common/step/configuration/step_block_cross_update.h>
+#include <common/step/configuration/step_check_install_location.h>
+#include <common/step/configuration/step_check_tizen_version.h>
+#include <common/step/configuration/step_configure.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_ownership_and_permission.h>
+#include <common/step/filesystem/step_copy.h>
+#include <common/step/filesystem/step_copy_storage_directories.h>
+#include <common/step/filesystem/step_copy_tep.h>
+#include <common/step/filesystem/step_create_icons.h>
+#include <common/step/filesystem/step_create_globalapp_symlinks.h>
+#include <common/step/filesystem/step_create_per_user_storage_directories.h>
+#include <common/step/filesystem/step_create_storage_directories.h>
+#include <common/step/filesystem/step_delta_patch.h>
+#include <common/step/filesystem/step_disable_external_mount.h>
+#include <common/step/filesystem/step_enable_external_mount.h>
+#include <common/step/filesystem/step_migrate_legacy_external_image.h>
+#include <common/step/filesystem/step_move_installed_storage.h>
+#include <common/step/filesystem/step_recover_change_owner.h>
+#include <common/step/filesystem/step_recover_files.h>
+#include <common/step/filesystem/step_recover_globalapp_symlinks.h>
+#include <common/step/filesystem/step_recover_icons.h>
+#include <common/step/filesystem/step_recover_manifest.h>
+#include <common/step/filesystem/step_recover_external_storage.h>
+#include <common/step/filesystem/step_recover_storage_directories.h>
+#include <common/step/filesystem/step_recover_per_user_storage_directories.h>
+#include <common/step/filesystem/step_remove_files.h>
+#include <common/step/filesystem/step_remove_icons.h>
+#include <common/step/filesystem/step_remove_globalapp_symlinks.h>
+#include <common/step/filesystem/step_remove_per_user_storage_directories.h>
+#include <common/step/filesystem/step_remove_temporary_directory.h>
+#include <common/step/filesystem/step_remove_tep.h>
+#include <common/step/filesystem/step_remove_user_data.h>
+#include <common/step/filesystem/step_remove_zip_image.h>
+#include <common/step/filesystem/step_unzip.h>
+#include <common/step/filesystem/step_update_per_user_storage_directories.h>
+#include <common/step/filesystem/step_update_storage_directories.h>
+#include <common/step/filesystem/step_update_tep.h>
+#include <common/step/mount/step_check_mount_path.h>
+#include <common/step/mount/step_mount_install.h>
+#include <common/step/mount/step_mount_recover.h>
+#include <common/step/mount/step_mount_unpacked.h>
+#include <common/step/mount/step_mount_update.h>
+#include <common/step/pkgmgr/step_check_force_clean.h>
+#include <common/step/pkgmgr/step_check_installable.h>
+#include <common/step/pkgmgr/step_check_removable.h>
+#include <common/step/pkgmgr/step_check_restriction.h>
+#include <common/step/pkgmgr/step_kill_apps.h>
+#include <common/step/pkgmgr/step_recover_application.h>
+#include <common/step/pkgmgr/step_recover_parser_plugins.h>
+#include <common/step/pkgmgr/step_register_app.h>
+#include <common/step/pkgmgr/step_remove_manifest.h>
+#include <common/step/pkgmgr/step_run_parser_plugins.h>
+#include <common/step/pkgmgr/step_unregister_app.h>
+#include <common/step/pkgmgr/step_update_app.h>
+#include <common/step/pkgmgr/step_update_pkg_disable_info.h>
+#include <common/step/rds/step_rds_modify.h>
+#include <common/step/rds/step_rds_parse.h>
+#include <common/step/recovery/step_open_recovery_file.h>
+#include <common/step/recovery/step_create_recovery_file.h>
+#include <common/step/security/step_check_old_certificate.h>
+#include <common/step/security/step_check_signature.h>
+#include <common/step/security/step_get_privilege_level.h>
+#include <common/step/security/step_privacy_privilege.h>
+#include <common/step/security/step_privilege_compatibility.h>
+#include <common/step/security/step_recover_privilege_compatibility.h>
+#include <common/step/security/step_recover_security.h>
+#include <common/step/security/step_recover_trust_anchor.h>
+#include <common/step/security/step_register_security.h>
+#include <common/step/security/step_revoke_security.h>
+#include <common/step/security/step_rollback_installation_security.h>
+#include <common/step/security/step_update_security.h>
+#include <common/step/security/step_register_trust_anchor.h>
+#include <common/step/security/step_revoke_trust_anchor.h>
+#include <common/step/security/step_save_signature.h>
+#include <common/step/security/step_unregister_trust_anchor.h>
+
+#include <wgt_manifest_handlers/widget_config_parser.h>
+
+#include "wgt/shared_dirs.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"
+#include "wgt/step/filesystem/step_create_symbolic_link.h"
+#include "wgt/step/filesystem/step_wgt_patch_icons.h"
+#include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
+#include "wgt/step/filesystem/step_wgt_resource_directory.h"
+#include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
+#include "wgt/step/filesystem/step_wgt_update_package_directory.h"
+#include "wgt/step/pkgmgr/step_generate_xml.h"
+#include "wgt/step/security/step_add_default_privileges.h"
+#include "wgt/step/security/step_check_settings_level.h"
+#include "wgt/step/security/step_check_wgt_background_category.h"
+#include "wgt/step/security/step_check_wgt_notification_category.h"
+#include "wgt/step/security/step_check_wgt_ime_privilege.h"
+#include "wgt/step/security/step_direct_manifest_check_signature.h"
+#include "wgt/step/security/step_check_extension_privileges.h"
+#include "wgt/step/security/step_wgt_recover_signature.h"
+
+namespace ci = common_installer;
+
+namespace wgt {
+
+WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
+    : AppInstaller("wgt", pkgrmgr) {
+  Init();
+  context_->backend_data.set(new WgtBackendData());
+}
+
+void WgtInstaller::InstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  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<wgt::encryption::StepEncryptResources>();
+  AddStep<wgt::filesystem::StepWgtResourceDirectory>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(false);
+  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<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::WgtAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::UpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  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::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::backup::StepCopyBackup>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<ci::filesystem::StepCopyStorageDirectories>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::UninstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::pkgmgr::StepCheckRemovable>();
+  AddStep<ci::pkgmgr::StepCheckForceClean>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+  AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+  AddStep<ci::pkgmgr::StepUnregisterApplication>();
+  AddStep<ci::filesystem::StepRemoveTep>();
+  AddStep<ci::filesystem::StepRemoveFiles>();
+  AddStep<ci::filesystem::StepRemoveZipImage>();
+  AddStep<ci::filesystem::StepRemoveIcons>();
+  AddStep<wgt::encryption::StepRemoveEncryptionData>();
+  AddStep<ci::security::StepUnregisterTrustAnchor>();
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
+  AddStep<ci::security::StepRevokeSecurity>();
+  AddStep<ci::pkgmgr::StepRemoveManifest>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ReinstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepCheckRDSManifest>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, false);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::rds::StepRDSParse>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::rds::StepRDSModify>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::DeltaSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::filesystem::StepUnzip>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::PACKAGE, false);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::filesystem::StepEnableExternalMount>();
+  AddStep<wgt::filesystem::StepWgtUndoPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepDeltaPatch>("res/wgt/");
+  AddStep<ci::filesystem::StepDisableExternalMount>();
+  AddStep<wgt::configuration::StepCheckStartFiles>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  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::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::backup::StepCopyBackup>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<ci::filesystem::StepCopyStorageDirectories>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::RecoverySteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::recovery::StepOpenRecoveryFile>();
+  AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::filesystem::StepRecoverIcons>();
+  AddStep<ci::pkgmgr::StepRecoverParserPlugin>();
+  AddStep<ci::filesystem::StepRecoverManifest>();
+  AddStep<ci::filesystem::StepRecoverExternalStorage>();
+  AddStep<ci::filesystem::StepRecoverStorageDirectories>();
+  AddStep<ci::filesystem::StepRecoverPerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepRecoverGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepRecoverFiles>();
+  AddStep<ci::mount::StepMountRecover>();
+  AddStep<wgt::security::StepWgtRecoverSignature>();
+  AddStep<ci::security::StepRecoverPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<ci::filesystem::StepRecoverChangeOwner>();
+  AddStep<ci::security::StepRecoverSecurity>();
+  AddStep<ci::pkgmgr::StepRecoverApplication>();
+  AddStep<ci::security::StepRecoverTrustAnchor>();
+}
+
+void WgtInstaller::MountInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::mount::StepMountUnpacked>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  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<wgt::encryption::StepEncryptResources>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::mount::StepMountInstall>();
+  AddStep<wgt::filesystem::StepWgtPreparePackageDirectory>();
+  AddStep<ci::filesystem::StepCopyTep>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateStorageDirectories>();
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::WgtAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::MountUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  AddStep<ci::mount::StepMountUnpacked>();
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  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<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::configuration::StepBlockCrossUpdate>();
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::backup::StepBackupManifest>();
+  AddStep<ci::backup::StepBackupIcons>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::mount::StepMountUpdate>();
+  AddStep<wgt::filesystem::StepWgtUpdatePackageDirectory>();
+  AddStep<ci::filesystem::StepUpdateTep>();
+  AddStep<ci::filesystem::StepUpdateStorageDirectories>();
+  AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<ci::filesystem::StepCreateIcons>();
+  AddStep<wgt::filesystem::StepCopyPreviewIcons>();
+  AddStep<wgt::security::StepCheckExtensionPrivileges>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ManifestDirectInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<ci::mount::StepCheckMountPath>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<wgt::security::StepDirectManifestCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::security::StepRollbackInstallationSecurity>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::WgtAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ManifestDirectUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::mount::StepCheckMountPath>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepCheckTizenVersion>();
+  AddStep<wgt::security::StepDirectManifestCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<wgt::security::StepCheckWgtNotificationCategory>();
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepCopyTep>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<wgt::filesystem::StepWgtPatchIcons>();
+  AddStep<wgt::pkgmgr::StepGenerateXml>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ReadonlyUpdateInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepCreateRecoveryFile>();
+  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::StepSaveSignature>();
+  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::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ReadonlyUpdateUninstallSteps() {
+  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<ci::configuration::StepParsePreload>();
+  AddStep<wgt::configuration::StepSetOldSignatureFilesLocation>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  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::filesystem::StepRemoveUserData>();
+  AddStep<ci::configuration::StepSwitchReadonlyMode>();
+  AddStep<ci::security::StepRevokeTrustAnchor>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRemoveManifest>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
+}
+
+void WgtInstaller::ManifestPartialInstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Install);
+  AddStep<ci::security::StepRegisterSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
+  AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
+      wgt::filesystem::WgtAdditionalSharedDirs);
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::ManifestPartialUpdateSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+  AddStep<ci::security::StepCheckSignature>();
+  AddStep<ci::security::StepSaveSignature>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::pkgmgr::StepUpdateApplication>();
+  AddStep<ci::security::StepRegisterTrustAnchor>(
+      ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Update);
+  AddStep<ci::security::StepUpdateSecurity>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Upgrade);
+  AddStep<ci::filesystem::StepUpdatePerUserStorageDirectories>();
+  AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
+}
+
+void WgtInstaller::PartialUninstallSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::pkgmgr::StepCheckRestriction>();
+  AddStep<ci::pkgmgr::StepCheckRemovable>();
+  AddStep<ci::pkgmgr::StepCheckForceClean>();
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
+  AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+  AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
+  AddStep<ci::pkgmgr::StepUnregisterApplication>();
+  AddStep<wgt::encryption::StepRemoveEncryptionData>();
+  AddStep<ci::security::StepUnregisterTrustAnchor>();
+  AddStep<ci::security::StepPrivacyPrivilege>(
+      ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
+  AddStep<ci::security::StepRevokeSecurity>();
+}
+
+void WgtInstaller::MoveSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::configuration::StepCheckInstallLocation>();
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::filesystem::StepMoveInstalledStorage>();
+  AddStep<ci::security::StepRegisterSecurity>();
+}
+
+void WgtInstaller::EnablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+      ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+}
+
+void WgtInstaller::DisablePkgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::configuration::StepParseManifest>(
+      ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+      ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+  AddStep<ci::pkgmgr::StepKillApps>();
+  AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
+      ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
+  AddStep<ci::pkgmgr::StepRunParserPlugin>(
+      ci::Plugin::ActionType::Uninstall);
+}
+
+void WgtInstaller::MigrateExtImgSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<ci::security::StepMigrateLegacyExtImage>();
+  AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
+}
+
+void WgtInstaller::RecoverDBSteps() {
+  AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+  AddStep<wgt::configuration::StepParse>(
+      wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
+  AddStep<ci::pkgmgr::StepCheckInstallable>();
+  AddStep<ci::mount::StepCheckMountPath>();
+  AddStep<ci::configuration::StepParsePreload>();
+  AddStep<ci::security::StepGetPrivilegeLevel>();
+  AddStep<ci::security::StepPrivilegeCompatibility>(
+      ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
+  AddStep<wgt::security::StepCheckWgtImePrivilege>();
+  AddStep<wgt::security::StepCheckSettingsLevel>();
+  AddStep<ci::pkgmgr::StepRegisterApplication>();
+}
+
+}  // namespace wgt
diff --git a/src/wgt/wgt_installer.h b/src/wgt/wgt_installer.h
new file mode 100644 (file)
index 0000000..8c0edcf
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_WGT_INSTALLER_H_
+#define WGT_WGT_INSTALLER_H_
+
+#include <common/app_installer.h>
+
+namespace wgt {
+
+/**
+ * \brief The WgtInstaller class
+ *        Subclass of AppInstaller class dedicated for handling wgt request
+ *
+ * Performs all types of requests of wgt packages and sets required sequence of
+ * steps
+ */
+class WgtInstaller : public common_installer::AppInstaller {
+ public:
+  /**
+   * \brief Explicit constructor
+   *
+   * \param pkgmgr pointer to pkgmgr
+   */
+  explicit WgtInstaller(common_installer::PkgMgrPtr pkgrmgr);
+
+ private:
+  void InstallSteps() override;
+  void UpdateSteps() override;
+  void UninstallSteps() override;
+  void ReinstallSteps() override;
+  void DeltaSteps() override;
+  void MoveSteps() override;
+  void RecoverySteps() override;
+  void MountInstallSteps() override;
+  void MountUpdateSteps() override;
+  void ManifestDirectInstallSteps() override;
+  void ManifestDirectUpdateSteps() override;
+  void ManifestPartialInstallSteps() override;
+  void ManifestPartialUpdateSteps() override;
+  void PartialUninstallSteps() override;
+  void ReadonlyUpdateInstallSteps() override;
+  void ReadonlyUpdateUninstallSteps() override;
+  void DisablePkgSteps() override;
+  void EnablePkgSteps() override;
+  void MigrateExtImgSteps() override;
+  void RecoverDBSteps() override;
+};
+
+}  // namespace wgt
+
+#endif  // WGT_WGT_INSTALLER_H_
diff --git a/src/wgt_backend/CMakeLists.txt b/src/wgt_backend/CMakeLists.txt
new file mode 100644 (file)
index 0000000..79807f6
--- /dev/null
@@ -0,0 +1,13 @@
+# Target - definition
+ADD_EXECUTABLE(${TARGET_WGT_BACKEND} "wgt_backend.cc")
+# Target - includes
+TARGET_INCLUDE_DIRECTORIES(${TARGET_WGT_BACKEND} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
+
+# Target - in-package deps
+TARGET_LINK_LIBRARIES(${TARGET_WGT_BACKEND} PRIVATE ${TARGET_LIBNAME_WGT})
+TARGET_LINK_LIBRARIES(${TARGET_WGT_BACKEND} PRIVATE ${TARGET_LIBNAME_HYBRID})
+SET_TARGET_PROPERTIES(${TARGET_WGT_BACKEND} PROPERTIES COMPILE_FLAGS ${CFLAGS} "-fPIE")
+SET_TARGET_PROPERTIES(${TARGET_WGT_BACKEND} PROPERTIES LINK_FLAGS "-pie")
+
+# Install
+INSTALL(TARGETS ${TARGET_WGT_BACKEND} DESTINATION ${BINDIR})
diff --git a/src/wgt_backend/wgt_backend.cc b/src/wgt_backend/wgt_backend.cc
new file mode 100644 (file)
index 0000000..f0633b4
--- /dev/null
@@ -0,0 +1,36 @@
+/* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
+// 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 <common/pkgmgr_interface.h>
+#include <cerrno>
+
+#include "hybrid/hybrid_installer.h"
+#include "wgt/wgt_app_query_interface.h"
+#include "wgt/wgt_installer.h"
+
+namespace ci = common_installer;
+
+int main(int argc, char** argv) {
+  ci::PkgmgrInstaller pkgmgr_installer;
+  wgt::WgtAppQueryInterface query_interface;
+  auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer,
+                                            &query_interface);
+  if (!pkgmgr) {
+    LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
+    return EINVAL;
+  }
+
+  // This is workaround for hybrid apps as they requires much different flow
+  // but installer does not branch at all in current design
+  if (query_interface.IsHybridApplication(
+      pkgmgr->GetRequestInfo(), pkgmgr->GetUid())) {
+    LOG(INFO) << "Hybrid package detected";
+    hybrid::HybridInstaller installer(pkgmgr);
+    return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
+  } else {
+    wgt::WgtInstaller installer(pkgmgr);
+    return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
+  }
+}
diff --git a/tizen-manifest.xml b/tizen-manifest.xml
deleted file mode 100644 (file)
index e91526b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.analog-watch" version="1.0.0">
-    <profile name="wearable"/>
-    <watch-application setup-appid="org.tizen.watch-face-editor" ambient-support="true" appid="org.tizen.analog-watch" exec="analog-watch">
-        <label>analog-watch</label>
-        <icon>analog-watch.png</icon>
-        <metadata key="clocktype" value="function"/>
-    </watch-application>
-    <privileges>
-        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
-        <privilege>http://tizen.org/privilege/display</privilege>
-        <privilege>http://tizen.org/privilege/alarm.get</privilege>
-        <privilege>http://tizen.org/privilege/alarm.set</privilege>
-        <privilege>http://tizen.org/privilege/datasharing</privilege>
-    </privileges>
-</manifest>
diff --git a/tools/check-coding-style b/tools/check-coding-style
new file mode 100755 (executable)
index 0000000..fd60481
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+if [ ! `which cpplint.py` ]; then
+   echo -e "\nPlease make sure cpplint.py is in your PATH. It is part of depot_tools inside Chromium repository."
+   exit 1
+fi
+
+OLDPWD=$PWD
+BASE=`dirname $0`
+cd $BASE/..
+
+# filters
+FILTERS="-readability/streams,-build/c++11"
+
+cpplint.py --root=src --filter="$FILTERS" $(find . \( -name '*.h' -o -name '*.cc' \) )
+RET=$?
+
+JS_RET_VAL=$?
+cd $OLDPWD
+
+if [ "x$RET" == "x0" ]; then
+  exit 0
+else
+  exit 1
+fi