platform/core/appfw/app-installers.git
3 years agoRelocate some utility files 08/237608/2
Junghyun Yeon [Thu, 2 Jul 2020 00:43:16 +0000 (09:43 +0900)]
Relocate some utility files

Relocating some files to reduce modular circular dependency ratio.

Change-Id: I3aeaef2af1b341a0b09b94282d37adc1b8d8e77c
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement recovery for uninstallation 65/235765/5
Junghyun Yeon [Tue, 9 Jun 2020 11:28:27 +0000 (20:28 +0900)]
Implement recovery for uninstallation

Change-Id: Idd134cf3418de715fa1ced02962483a52de7e85b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix coding rule 38/237138/1
Junghyun Yeon [Thu, 25 Jun 2020 08:31:36 +0000 (17:31 +0900)]
Fix coding rule

Change-Id: Iffa9accd3a51c663d7d426f10be1d5c0c5f9cd04
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoCreate empty directory when running backup in smoke test 30/236530/2
Ilho Kim [Thu, 18 Jun 2020 01:56:55 +0000 (10:56 +0900)]
Create empty directory when running backup in smoke test

When run test with empty directory, there is posibility causing error
- Multi install case : installer can't create unified recovery file

Change-Id: Ifba13001ed047d54aa941bdbd694c85bab73f3a8
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoAdd smoke util function for multi install 59/235159/5
Ilho Kim [Tue, 2 Jun 2020 08:13:05 +0000 (17:13 +0900)]
Add smoke util function for multi install

Change-Id: Idbe2867e50f61aae2d26074845245cb2c6d24309
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRelease version 1.32.10 35/236035/1 accepted/tizen/unified/20200616.171022 submit/tizen/20200612.081636 submit/tizen/20200615.005642
Junghyun Yeon [Fri, 12 Jun 2020 06:58:03 +0000 (15:58 +0900)]
Release version 1.32.10

Changes:
 - Implement unified recovery feature
 - Add ZipInterface and MountBase class for exandability
 - Refactor StepUnregisterApplication
 - Fix locating manifest when recovery mode
 - Set unpacked_dir to recovery file at StepMountUnpacked
 - Fix InstallerRunner
 - Change recovery files priority
 - Remove a outdated comment

Change-Id: Ie6fb6520a59d37ed39a39ea003a8f7b56d624d3c
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRemove a outdated comment 06/236006/1
Sangyoon Jang [Fri, 12 Jun 2020 02:29:00 +0000 (11:29 +0900)]
Remove a outdated comment

Change-Id: I63bcd683c1dd5fc7fe732502e4635e2c0310e766
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
3 years agoChange recovery files priority 42/235242/2
Ilho Kim [Wed, 3 Jun 2020 04:17:53 +0000 (13:17 +0900)]
Change recovery files priority

If there are a recovery file with backup, backup file is used for recovery

Change-Id: Iaf6bf7a8b46e7279a6e71ab7aa864d2106557a34
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix InstallerRunner 02/235502/2
Junghyun Yeon [Fri, 5 Jun 2020 05:50:20 +0000 (14:50 +0900)]
Fix InstallerRunner

InstallerRunner will not try to add installer instance into installer list
if InstallerFactory failed to create installer instance.

Change-Id: Iad149945a2d399a6c2f11902004f4a597e358409
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoSet unpacked_dir to recovery file at StepMountUnpacked 30/235430/1
Sangyoon Jang [Thu, 4 Jun 2020 10:46:30 +0000 (19:46 +0900)]
Set unpacked_dir to recovery file at StepMountUnpacked

The unpacked dir path should be set for recovery mode.

Change-Id: I4fafbb4ffb9d48cbb3ce753041b1fde11c118e55
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
3 years agoFix locating manifest when recovery mode 61/235361/3
Sangyoon Jang [Thu, 4 Jun 2020 05:48:04 +0000 (14:48 +0900)]
Fix locating manifest when recovery mode

Search backup manifest at manifest directory first.

Change-Id: I9ab4e28bb9e273a0e82640283ab233ecafe1ec93
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
3 years agoRefactor StepUnregisterApplication 50/228550/10
Junghyun Yeon [Tue, 24 Mar 2020 01:27:26 +0000 (10:27 +0900)]
Refactor StepUnregisterApplication

- Apply early-return policy.
- Fix coding rule.
- Adjust debug message for consistency.
- Remove unnecessary namespace declaration.

Change-Id: I140538bc5aee1028dacfbc2c6ae3d53791a30926
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdd ZipInterface and MountBase class for exandability 46/235346/3
Junghyun Yeon [Thu, 4 Jun 2020 04:42:30 +0000 (13:42 +0900)]
Add ZipInterface and MountBase class for exandability

Inherits MountBase and implementing CreateZipInterface which returns
IZipInterface enables using other zip interface instead of TZip.

Change-Id: Ie33b9e0b18c2a5d677fa8634f1a25d34dc3ee1e6
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement unified recovery feature 03/234403/13
Junghyun Yeon [Tue, 26 May 2020 06:14:46 +0000 (15:14 +0900)]
Implement unified recovery feature

Unified recovery file will be parsed at pkg recovery tool and
passed into unified backend to handle multi recovery scenario.

Change-Id: I50d7b4b89af0864fde2e137677900aff1b3d5c6b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoRelease version 1.32.9 31/235031/1 accepted/tizen/unified/20200603.150218 submit/tizen/20200602.012953
Ilho Kim [Tue, 2 Jun 2020 01:12:50 +0000 (10:12 +0900)]
Release version 1.32.9

Changes:
 - Check dependency when the request type is required

Change-Id: I62f273f7577de280e6fd71c70f239f7c785bcb36
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoCheck dependency when the request type is required 31/234731/4
Ilho Kim [Thu, 28 May 2020 06:53:24 +0000 (15:53 +0900)]
Check dependency when the request type is required

Change-Id: I184f7b7100efd9baae5070c058871b811de53f4e
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoRelease version 1.32.8 37/234937/1 submit/tizen/20200601.023448
Ilho Kim [Mon, 1 Jun 2020 02:29:02 +0000 (11:29 +0900)]
Release version 1.32.8

Changes:
 - Fix InstallerRunner::Run()
 - Change path of directory for mount point of MountInstall mode
 - Add GetArchiveInfo
 - Add GetIndex() funtion to AppInstallers
 - Fix smoke utils to test unified installer
 - Add StepCrash class at smoke utils
 - Modify ReadonlyUpdateInstall CreateStorageDirectories
 - Fix updating shared data directories
 - Fix installing shared/data directory of ReadonlyUpdateUninstall
 - Fix coding rule
 - Set CMAKE_VERBOSE_MAKEFILE=OFF as default
 - Fix StepCheckBackgroundCategory
 - Add Uninstall function to smoke utils for multi uninstall
 - Add Dependency Checker
 - Remove manifest backup when update recover with cleanup

Change-Id: I1feb0281bca99853ce7243c4b4b254b00a066923
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoRemove manifest backup when update recover with cleanup 58/234858/1
Ilho Kim [Fri, 29 May 2020 08:10:08 +0000 (17:10 +0900)]
Remove manifest backup when update recover with cleanup

In case update, installer create backup xml file
This backup file should be removed when run recovery with cleanup flag

Change-Id: If517d33729d83c2a7625621c0db17ec52a8fbebb
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd Dependency Checker 46/228146/20
Ilho Kim [Thu, 2 Apr 2020 04:56:51 +0000 (13:56 +0900)]
Add Dependency Checker

In case multi install,
there is need to sort the install requests according to dependencies

This class sort Installers in dependency order

[example]
A pkg requires B pkg : A -> B
B pkg requires C pkg : B -> C
- Full dependencies : A -> B -> C

This class sorts A,B,C into C,B,A

Change-Id: Icd48374060d2a6b013fac9f68cbafc638eb416fb
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd Uninstall function to smoke utils for multi uninstall 19/230719/4
Ilho Kim [Tue, 14 Apr 2020 00:26:35 +0000 (09:26 +0900)]
Add Uninstall function to smoke utils for multi uninstall

Change-Id: Ia5ee2c64e1703a4108f2944ee4f4772057a7aa57
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix StepCheckBackgroundCategory 34/218634/9
Junghyun Yeon [Tue, 26 Nov 2019 07:17:31 +0000 (16:17 +0900)]
Fix StepCheckBackgroundCategory

- Summarize variable name.
- Add functions to find category from list.
- Adjust return value of some functions.
- Change function name for readability.
- Separate some operations for readability.

Change-Id: Icee52f93df3039c8864bae913d2da66c020c2bdf
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoSet CMAKE_VERBOSE_MAKEFILE=OFF as default 98/233898/1
Sangyoon Jang [Wed, 20 May 2020 06:45:10 +0000 (15:45 +0900)]
Set CMAKE_VERBOSE_MAKEFILE=OFF as default

To set verbose makefile on, define "verbose_make" when gbs build.
 $ gbs build --define "verbose_make 1"

Change-Id: Idd69ad139052c57ee39a84811f7ea88e111395d9
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix coding rule 36/233736/1
Junghyun Yeon [Tue, 19 May 2020 00:44:23 +0000 (09:44 +0900)]
Fix coding rule

Change-Id: I89b6f8330072b8e88a16ab4f6b2787be03249eae
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoFix installing shared/data directory of ReadonlyUpdateUninstall 74/233374/1
Sangyoon Jang [Thu, 14 May 2020 07:33:34 +0000 (16:33 +0900)]
Fix installing shared/data directory of ReadonlyUpdateUninstall

Add StepUpdateStorageDirectories to set shared_ro flag of
security-manager properly.

Change-Id: I3669b10d58566643fdfc45456244015644c9b13b
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix updating shared data directories 23/232723/2
Sangyoon Jang [Thu, 7 May 2020 08:39:12 +0000 (17:39 +0900)]
Fix updating shared data directories

Even if installer doesn't need to update shared data directories,
installer should request registering shared data directories to
security-manager.

Change-Id: I6ef5d492f7263ac3bfd9acbf06f3f8fe393e1328
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoModify ReadonlyUpdateInstall CreateStorageDirectories 53/230753/3
Ilho Kim [Tue, 14 Apr 2020 04:20:35 +0000 (13:20 +0900)]
Modify ReadonlyUpdateInstall CreateStorageDirectories

Modify StepCreateStorageDirectories to StepUpdateStorageDirectories

In case install fail after StepCreateDirectories
this step's undo() will remove storage directories

Change-Id: I7fe14f149249a71737b16bef017ea3cf5686fa51
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd StepCrash class at smoke utils 21/228721/7
Sangyoon Jang [Wed, 25 Mar 2020 02:59:47 +0000 (11:59 +0900)]
Add StepCrash class at smoke utils

This class is moved from each tpk, wgt smoke utils.

Change-Id: I15b36064e618acc929981b6b931698db8b352608
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix smoke utils to test unified installer 25/228325/9
Sangyoon Jang [Thu, 19 Mar 2020 08:47:38 +0000 (17:47 +0900)]
Fix smoke utils to test unified installer

Change-Id: I172bc7b450f590cce906ccfb0cda7f6409513e38
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd GetIndex() funtion to AppInstallers 04/231104/1
Ilho Kim [Fri, 17 Apr 2020 07:18:35 +0000 (16:18 +0900)]
Add GetIndex() funtion to AppInstallers

Change-Id: Ia4ead65854b454659a1cbdd68e478aad0ae89f74
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd GetArchiveInfo 45/228145/6
Ilho Kim [Thu, 19 Mar 2020 08:15:04 +0000 (17:15 +0900)]
Add GetArchiveInfo

Change-Id: I411ab3cac599dda1b168043e539b6577ad940e16
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoChange path of directory for mount point of MountInstall mode 46/229846/2
Sangyoon Jang [Mon, 6 Apr 2020 03:55:41 +0000 (12:55 +0900)]
Change path of directory for mount point of MountInstall mode

Change-Id: I6752b57f2cd856c800d548a9eab065e784f64b48
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix InstallerRunner::Run() 69/229869/2
Sangyoon Jang [Mon, 6 Apr 2020 06:57:33 +0000 (15:57 +0900)]
Fix InstallerRunner::Run()

When Undo() fails 2nd installer or later, the returned result should be
UNDO_ERROR.

Change-Id: I1cda23a4656d710888ed7e1e8372607e9a78d5ee
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRelease version 1.32.7 44/229744/1 accepted/tizen/unified/20200413.012234 submit/tizen/20200403.082852 submit/tizen/20200410.073851
Ilho Kim [Fri, 3 Apr 2020 06:24:19 +0000 (15:24 +0900)]
Release version 1.32.7

Changes:
 - Add ArchiveInfo class
 - Fix build error
 - Detach Umount operation from mount install's clean
 - Fix coding style
 - All step's success are regarded as installation's success
 - Split Run() method
 - Add SetAppQueryInterface()
 - Adjust for multi-package installer
 - Add InstallerFactory, InstallerRunner classes for multi pkg install
 - Fix static analysis issue
 - Change error code to UNZIP_ERROR when GetUnpackedPackageSize() failed
 - Move including vconf.h into source code
 - Reset is_app_installed flag when setting new query interface

Change-Id: I1b24e9ec118368cbd529e15b575efc2cc1d31f35
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoReset is_app_installed flag when setting new query interface 74/228874/3
Sangyoon Jang [Thu, 26 Mar 2020 06:38:31 +0000 (15:38 +0900)]
Reset is_app_installed flag when setting new query interface

Change-Id: I53b883748c10c4881b111626eef241e54a84311a
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoMove including vconf.h into source code 20/228720/3
Sangyoon Jang [Wed, 25 Mar 2020 05:18:49 +0000 (14:18 +0900)]
Move including vconf.h into source code

This patch is for removing unnecessary dependency for tpk, wgt smoke
utils.

Change-Id: Ia90fdaa3690707734658ef9848bd8cbce3481a15
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoChange error code to UNZIP_ERROR when GetUnpackedPackageSize() failed 59/228159/3
Sangyoon Jang [Thu, 19 Mar 2020 08:48:33 +0000 (17:48 +0900)]
Change error code to UNZIP_ERROR when GetUnpackedPackageSize() failed

Returning APPDIR_ERROR is ambiguous to user, and GetUnpackedPackageSize()
returns -1 when unzip APIs fail.

Change-Id: Ic0e567250eca8afbb94afe0ba37c3a4ada00189f
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix static analysis issue 61/219761/8
Ilho Kim [Tue, 10 Dec 2019 00:36:08 +0000 (09:36 +0900)]
Fix static analysis issue

Fix using of invalid iterator

Change-Id: I63268f34caf3917737f69ae0dea1620665fce35c
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd InstallerFactory, InstallerRunner classes for multi pkg install 55/225055/11
Sangyoon Jang [Fri, 7 Feb 2020 06:14:44 +0000 (15:14 +0900)]
Add InstallerFactory, InstallerRunner classes for multi pkg install

These new classes are for multi pkg install feature.
The backend which wants to handle multiple install request at once
should implement its own factory class. The main function of backend
should create instance of InstallerRunner class with its own factory
class and invoke Run() method of InstallerRunner class.

Change-Id: I57da804ede61e793e64cb1b8fc4765a8b75b90c3
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdjust for multi-package installer 48/223948/12
Sangyoon Jang [Wed, 5 Feb 2020 07:12:53 +0000 (16:12 +0900)]
Adjust for multi-package installer

Requires:
 - https://review.tizen.org/gerrit/c/platform/core/appfw/slp-pkgmgr/+/222677

Change-Id: Icc96ba9e83db3ec4c5af4f94237235cfc5bf813a
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd SetAppQueryInterface() 65/217565/18
Sangyoon Jang [Fri, 8 Nov 2019 07:49:56 +0000 (16:49 +0900)]
Add SetAppQueryInterface()

Change-Id: I43290ce458f4cf89328d35efd9fa83c328a8c2ca
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoSplit Run() method 57/216857/22
Sangyoon Jang [Mon, 21 Oct 2019 11:02:50 +0000 (20:02 +0900)]
Split Run() method

Change-Id: Iaa5d720bfac4c302ef7d3bb5ebc6087d4e0e7917
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAll step's success are regarded as installation's success 90/225290/5
Ilho Kim [Tue, 18 Feb 2020 05:57:10 +0000 (14:57 +0900)]
All step's success are regarded as installation's success

After all steps succeed, send finish signal and set recovery file's cleanup flag

Related:
 [app-installers] https://review.tizen.org/gerrit/#/c/platform/core/appfw/app-installers/+/223113/
 [tpk-backend] https://review.tizen.org/gerrit/#/c/platform/core/appfw/tpk-backend/+/223114/
 [wgt-backend] https://review.tizen.org/gerrit/#/c/platform/core/appfw/wgt-backend/+/223115/

Change-Id: Iaac1d3db7c4a8d5a3fdae68acb962945a09d6769
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix coding style 62/228262/1
Ilho Kim [Fri, 20 Mar 2020 04:15:08 +0000 (13:15 +0900)]
Fix coding style

Change-Id: I6eccc84db472e308e124b50a1be7746ecb51d740
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoDetach Umount operation from mount install's clean 17/225317/6
Ilho Kim [Wed, 19 Feb 2020 05:02:46 +0000 (14:02 +0900)]
Detach Umount operation from mount install's clean

Change-Id: I2b92cbaf952a5eb6258ad24a05f91746bffa9dac

4 years agoFix build error 31/227431/1
Sangyoon Jang [Thu, 12 Mar 2020 03:25:01 +0000 (12:25 +0900)]
Fix build error

Fix typo.

Change-Id: Ied23a5574081dd3e81645fe7016956811307a316
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd ArchiveInfo class 96/226596/12
Sangyoon Jang [Tue, 3 Mar 2020 09:36:29 +0000 (18:36 +0900)]
Add ArchiveInfo class

ArchiveInfo class is base class for TpkArchiveInfo, WgtArchiveInfo.
The derived classes have to implement LoadArchiveInfo() which parses
manifest of given archive file and fills the information.

Change-Id: I767ff3af4d9a4ebe2f3be8a71222c343e1d29f91
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRelease version 1.32.6 05/226905/1 accepted/tizen/unified/20200309.031500 submit/tizen/20200306.075320
Ilho Kim [Fri, 6 Mar 2020 07:43:35 +0000 (16:43 +0900)]
Release version 1.32.6

Changes:
 - Add a test that crashed while running clean operation
 - Fix a build warning
 - Fix StepRecoverSignature

Change-Id: I4fdbd4cec4f91cb0830158479a2a7da52e24e1b9
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix StepRecoverSignature 40/226440/2
Ilho Kim [Tue, 3 Mar 2020 00:09:09 +0000 (09:09 +0900)]
Fix StepRecoverSignature

Delete backup file correctly

Change-Id: I5df5292b227842b0367ca307fd05e14b3e907df1
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix a build warning 43/226743/1
Sangyoon Jang [Thu, 5 Mar 2020 05:51:37 +0000 (14:51 +0900)]
Fix a build warning

Fix to compare with same signedness.

Change-Id: If9db78addaee27e9dfc9eabc791a58065cef0153
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd a test that crashed while running clean operation 93/226093/3
Ilho Kim [Thu, 27 Feb 2020 00:17:24 +0000 (09:17 +0900)]
Add a test that crashed while running clean operation

Related:
- [tpk-backend]https://review.tizen.org/gerrit/#/c/platform/core/appfw/tpk-backend/+/226102/
- [wgt-backend]https://review.tizen.org/gerrit/#/c/platform/core/appfw/wgt-backend/+/226105/

Change-Id: I7ffe0981d586d70778413841e6baacd1f530aabd
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoRelease version 1.32.5 78/226378/1 accepted/tizen/unified/20200303.032612 submit/tizen/20200302.075610
Ilho Kim [Mon, 2 Mar 2020 05:43:05 +0000 (14:43 +0900)]
Release version 1.32.5

Changes:
 - Fix permission value correctly
 - Fix StepUnzip to checking free space before creating tmp directory
 - Fix smoke util
 - Fix static analysis issue
 - Fix memory leak

Change-Id: I4c274eeb4b6fb8d202c6e7483d146fe01e2f1a9e
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix memory leak 12/225912/3
Ilho Kim [Tue, 25 Feb 2020 08:35:34 +0000 (17:35 +0900)]
Fix memory leak

Change-Id: I3b3b52f983a14a82e5e188b33cdf1acbec495d24
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix static analysis issue 01/226001/2
Sangyoon Jang [Wed, 26 Feb 2020 06:13:23 +0000 (15:13 +0900)]
Fix static analysis issue

Fix resource leak.

Change-Id: I5f3f5cd640e76c11c50310470326dc3f9e069c53
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix smoke util 84/225084/7
Ilho Kim [Mon, 17 Feb 2020 07:54:23 +0000 (16:54 +0900)]
Fix smoke util

- Fix behavior to get StepCount at test utils
- Fix smoke test helper's path

Change-Id: Ic58cb47cf2150ea27f10028b1b7eb77b6a524e2e
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix StepUnzip to checking free space before creating tmp directory 54/225054/2
Sangyoon Jang [Mon, 17 Feb 2020 05:41:37 +0000 (14:41 +0900)]
Fix StepUnzip to checking free space before creating tmp directory

Change-Id: I4024cf9f7d74d5d1f281de54c91ed79f25f33288
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix permission value correctly 13/225413/2
Ilho Kim [Wed, 19 Feb 2020 23:52:14 +0000 (08:52 +0900)]
Fix permission value correctly

Change-Id: I4f0015a58edf3483a20993406af20396bc805cc2
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoRelease version 1.32.4 50/224950/1 accepted/tizen/unified/20200217.213824 submit/tizen/20200214.080724
Ilho Kim [Fri, 14 Feb 2020 07:53:50 +0000 (16:53 +0900)]
Release version 1.32.4

Changes:
 - Fix static analysis issue
 - Refactor creating shared data logic
 - Fix some error logs
 - Fix StepRecoverSignature
 - Change clean operations not to return failure

Change-Id: I96125a56030c1d157419e52fa055b4356cfbedbc
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoChange clean operations not to return failure 13/223113/7
Ilho Kim [Thu, 23 Jan 2020 01:38:06 +0000 (10:38 +0900)]
Change clean operations not to return failure

Change-Id: I1d8f931c39853133252161b433fe5722fae45b55
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix StepRecoverSignature 02/224502/3
Junghyun Yeon [Tue, 11 Feb 2020 06:21:52 +0000 (15:21 +0900)]
Fix StepRecoverSignature

- RecoverReadonlyUpdateInstall does not require restoring signature file.
- Newly implement Cleanup() to simply remove backed up signature file.

Change-Id: I5bcfe1a8d1218b758423c81a7a76601826285933
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoFix some error logs 50/224650/1
Sangyoon Jang [Wed, 12 Feb 2020 06:25:43 +0000 (15:25 +0900)]
Fix some error logs

Change-Id: I9a98ee4f1a53a5e532e87081400466f3a6697c6d
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRefactor creating shared data logic 29/221429/23
Sangyoon Jang [Thu, 2 Jan 2020 08:16:49 +0000 (17:16 +0900)]
Refactor creating shared data logic

Creating shared data logic is fragmented.
The shared data directories are created by using base directory(apps_rw) and
some flags. This patch also fixes that installer can set setgid bit
rwdata only.

Change-Id: I997f401bd0d4dcad355422e36b51df03ed07201d
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix static analysis issue 99/224399/4
Junghyun Yeon [Mon, 10 Feb 2020 08:21:14 +0000 (17:21 +0900)]
Fix static analysis issue

Change codes to return result

Change-Id: I1a4e790aa7d0694c6de19192f18ca48e835fa90e
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoRelease version 1.32.3 05/224405/1 accepted/tizen/unified/20200212.125947 submit/tizen/20200210.091657 submit/tizen/20200211.010149
Ilho Kim [Mon, 10 Feb 2020 08:34:13 +0000 (17:34 +0900)]
Release version 1.32.3

Changes:
 - Fix build warning
 - Keep removable attribute when package update
 - Fix install failure of user package
 - Remove packaged RW directories before copying unpacked directories
 - Fix Remove(), RemoveAll() to delete symlink properly
 - Fix backup/restore shared/shared_tmp directories
 - Fix create shared data directory during update
 - Fix build error

Change-Id: I9c9e526c61f846e652e8c5c8bbe7fb1230e38880
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix build error 86/223486/4
Junghyun Yeon [Thu, 30 Jan 2020 08:03:17 +0000 (17:03 +0900)]
Fix build error

Fix build error caused by upgrading boost library
into version 1.71.0.

Change-Id: I27f995c53da3623860edfab5f05e0719d4f0fbcf
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoFix create shared data directory during update 84/224184/3
Ilho Kim [Fri, 7 Feb 2020 03:32:09 +0000 (12:32 +0900)]
Fix create shared data directory during update

When updating from a package without privilege to a package with
need to set owner and permission

Change-Id: Ifa7732231f147723dfbee63f4739a35467cd1545
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix backup/restore shared/shared_tmp directories 77/224177/1
Sangyoon Jang [Fri, 7 Feb 2020 02:27:58 +0000 (11:27 +0900)]
Fix backup/restore shared/shared_tmp directories

Not only .shared/pkgid/data but also .shared/pkgid should be removed.

Change-Id: I2e266160d346e8cdef35947eb6f4ea839a137e77
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix Remove(), RemoveAll() to delete symlink properly 75/224175/1
Sangyoon Jang [Fri, 7 Feb 2020 01:48:12 +0000 (10:48 +0900)]
Fix Remove(), RemoveAll() to delete symlink properly

Even if the file or directory that symlink points not exist, Remove()
and RemoveAll() should delete symlink file.
Note that bf::remove() and bf::remove_all() delete symbolic link itself.

Change-Id: I37fbeea897dc12f3b355e24b8763abaa304c5a02
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRemove packaged RW directories before copying unpacked directories 77/224077/2
Sangyoon Jang [Thu, 6 Feb 2020 05:59:33 +0000 (14:59 +0900)]
Remove packaged RW directories before copying unpacked directories

Change-Id: I7afa8a50a72ebbd755518a90bedd8f352dbcd122
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix install failure of user package 69/223969/3
Sangyoon Jang [Wed, 5 Feb 2020 08:08:56 +0000 (17:08 +0900)]
Fix install failure of user package

Because wrong path was given for security registration, the install of
user package was failed.

Change-Id: Ifb9c9e90ea801ee012988df1b123d7f606e856be
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoKeep removable attribute when package update 33/219733/5
Sangyoon Jang [Mon, 9 Dec 2019 12:04:58 +0000 (21:04 +0900)]
Keep removable attribute when package update

Change-Id: I3e6bcd8103d2d5bf9a8b2c79fa36242437b86bfc
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix build warning 91/223591/1
Junghyun Yeon [Fri, 31 Jan 2020 05:07:27 +0000 (14:07 +0900)]
Fix build warning

Switch-case statement without break causes
"Implicit fallthrough" warning with updated gcc.

Change-Id: Ieb4f47ffb14c8f7596d4c975e6de1396a0652b5e
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoRelease version 1.32.2 82/223582/1 submit/tizen/20200131.050227
Ilho Kim [Fri, 31 Jan 2020 04:32:39 +0000 (13:32 +0900)]
Release version 1.32.2

Changes:
 - Fix minor coding rules
 - Add SmokeTestHelperRunner for smoke test
 - Add function 'CopyAndRemove' for smoke test

Change-Id: Iec05b5ccc02edf3ba70272aecf35a16e506dce6b
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd function 'CopyAndRemove' for smoke test 37/217537/13
Ilho Kim [Mon, 11 Nov 2019 22:55:28 +0000 (07:55 +0900)]
Add function 'CopyAndRemove' for smoke test

This patch for supporting backup option "copy and remove"

Change-Id: I036da1e1d10f9cdaf6ae9403f7c9f60a8e6c32b6
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd SmokeTestHelperRunner for smoke test 04/220004/13
Ilho Kim [Thu, 12 Dec 2019 08:46:14 +0000 (17:46 +0900)]
Add SmokeTestHelperRunner for smoke test

This class for test using subprocess

Change-Id: I8ac6f89f028807f3c0b719dc2456b956b78e33a9
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix minor coding rules 16/218116/15
Junghyun Yeon [Tue, 19 Nov 2019 10:48:31 +0000 (19:48 +0900)]
Fix minor coding rules

- Fix some minor coding rule.
- Fix storage requirement calculation logic to reduce unnecessary if statement.
- Remove unnecessary dlerror() call.
- Integrate some if statements.
- Remove implementation of undo function info header.
- Apply return early pattern.
- Remove unnecessary constructor implementation.

Change-Id: Iffddaa6fe5e0803883393174cf9805ceeb5802af
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoRelease version 1.32.1 09/222709/1 accepted/tizen/unified/20200120.133140 submit/tizen/20200117.084916
Ilho Kim [Fri, 17 Jan 2020 08:42:18 +0000 (17:42 +0900)]
Release version 1.32.1

Changes:
 - Add fallback logic when api-version of app not found
 - Fix minor coding rule on pkgmgr_signal
 - Resolve static analysis issue

Change-Id: Icf9eb601a0c665da8fea3e30043e652dfd336d1e
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoResolve static analysis issue 53/222653/1
Ilho Kim [Fri, 17 Jan 2020 04:46:08 +0000 (13:46 +0900)]
Resolve static analysis issue

Change-Id: Ia2ccce1511ec117ea2682c4a5dd5b981fd50ae1f
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix minor coding rule on pkgmgr_signal 18/218918/8
Junghyun Yeon [Fri, 29 Nov 2019 04:49:01 +0000 (13:49 +0900)]
Fix minor coding rule on pkgmgr_signal

Change-Id: I870154f0f689810428f29106ebb7a6a095ea0295
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoAdd fallback logic when api-version of app not found 78/221878/4
Sangyoon Jang [Wed, 8 Jan 2020 06:51:29 +0000 (15:51 +0900)]
Add fallback logic when api-version of app not found

Some package may not include any applications.

Change-Id: I8cfe8e540a5113c56175ec373a6252d438230978
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRelease version 1.32.0 55/221755/1 accepted/tizen/unified/20200108.131451 submit/tizen/20200107.095413
Ilho Kim [Tue, 7 Jan 2020 08:58:05 +0000 (17:58 +0900)]
Release version 1.32.0

Changes:
 - Fix minor coding rule
 - Remove widget from plugins_list.txt
 - Add default steps for each operations
 - Remove compile warning messages

Change-Id: If2222fac9ae4820a31df55f7a7e175ad88971a49
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoRemove compile warning messages 23/221223/2
Ilho Kim [Mon, 30 Dec 2019 07:31:43 +0000 (16:31 +0900)]
Remove compile warning messages

Change-Id: Id2b52bd30ff2d4cf3415690e6027bd3cd8bb6dad
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoAdd default steps for each operations 15/207215/23
Sangyoon Jang [Wed, 29 May 2019 10:01:47 +0000 (19:01 +0900)]
Add default steps for each operations

Change-Id: I64e708b089ae9d9cc329c17c44c9a41922fee2b6
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRemove widget from plugins_list.txt 00/220500/2
hyunho [Thu, 19 Dec 2019 02:25:19 +0000 (11:25 +0900)]
Remove widget from plugins_list.txt

It will be handled by widget_service's widget.info config file
https://review.tizen.org/gerrit/#/c/platform/core/appfw/widget-service/+/220498/

Change-Id: I2b9a53669bbf9c56dc32343b67b74fb16ea0a79c
Signed-off-by: hyunho <hhstark.kang@samsung.com>
4 years agoFix minor coding rule 27/217427/4
Junghyun Yeon [Mon, 11 Nov 2019 12:16:59 +0000 (21:16 +0900)]
Fix minor coding rule

- Integrate if statements.
- Reduce indentation hierachy by applying early return policy.

Change-Id: Iba51f4910404d730ac4e381374e9e033d3ac14b6
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoRelease version 1.31.1 06/220106/2 accepted/tizen/5.5/unified/20200105.221114 accepted/tizen/unified/20191216.222210 submit/tizen/20191213.074937 submit/tizen_5.5/20200103.002242 submit/tizen_5.5/20200103.003447
Ilho Kim [Fri, 13 Dec 2019 07:02:00 +0000 (16:02 +0900)]
Release version 1.31.1

Changes:
 - Fix smoke-test functions for rollback cases
 - Add smoke-util functions to check existance of shared/data
 - Fix StepUpdateStorageDirectories
 - Change header path to be included
 - Change the way to delete "shared/data" directory
 - Fix FindRecoveryFile
 - Fix static analysis issue
 - Add null checking before setting cleanup flag
 - Fix StepRecoverChangeOwner
 - Fix StepRecoverStorageDirectories

Change-Id: Iec2faac95ac9cc7123c237ecc6c4c2c47733d3e8
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix StepRecoverStorageDirectories 50/218450/12
Sangyoon Jang [Thu, 21 Nov 2019 08:27:20 +0000 (17:27 +0900)]
Fix StepRecoverStorageDirectories

Recover when shared data directory updated.

Change-Id: Id72db565a8f6668f10990e128d78d4a6f48e50f0
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix StepRecoverChangeOwner 51/218451/15
Sangyoon Jang [Fri, 22 Nov 2019 10:06:42 +0000 (19:06 +0900)]
Fix StepRecoverChangeOwner

Recover ownership, permission when per user directories updated.

Change-Id: Ic5b52a56b29dddfd6464e99ae48fc05497932a93
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd null checking before setting cleanup flag 06/219806/3
Sangyoon Jang [Tue, 10 Dec 2019 07:21:18 +0000 (16:21 +0900)]
Add null checking before setting cleanup flag

Change-Id: Ib80ccd3a48c1d392b11ab081a6050de82fcf6d97
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix static analysis issue 70/220070/3
Ilho Kim [Fri, 13 Dec 2019 01:57:17 +0000 (10:57 +0900)]
Fix static analysis issue

- Fix uninitialized scalar field

Change-Id: I89771d1ea4be2e096932e9826dae4ab3448ff202
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoFix FindRecoveryFile 34/219134/4
Ilho Kim [Mon, 2 Dec 2019 08:42:00 +0000 (17:42 +0900)]
Fix FindRecoveryFile

If path is not exist, directory_iterator throw exception

Change-Id: Ic0821c2e4f34f7cb9a71219764d492aeecb1485c
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoMerge "Change header path to be included" into tizen
Junghyun Yeon [Thu, 12 Dec 2019 23:49:32 +0000 (23:49 +0000)]
Merge "Change header path to be included" into tizen

4 years agoChange the way to delete "shared/data" directory 63/219763/2
Ilho Kim [Tue, 10 Dec 2019 01:32:18 +0000 (10:32 +0900)]
Change the way to delete "shared/data" directory

If a package being installed has "shared/data" directory and there is some file
remove fail because that directory is not empty

and the way to delete "shared/data" files is chaged from "remove" to "remove all"

Change-Id: I22428504749dbae981c28e612fac84e15ac7a475
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
4 years agoChange header path to be included 07/219607/2
Junghyun Yeon [Fri, 6 Dec 2019 08:26:52 +0000 (17:26 +0900)]
Change header path to be included

Its path has changed

Related changes:
[tpk-manifest-handlers] : https://review.tizen.org/gerrit/#/c/platform/core/appfw/tpk-manifest-handlers/+/219481/

Change-Id: I3933d2ae6e5c8ea90329752fa3de0054ea862e8a
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoFix StepUpdateStorageDirectories 22/218222/16
Sangyoon Jang [Tue, 19 Nov 2019 04:23:51 +0000 (13:23 +0900)]
Fix StepUpdateStorageDirectories

The step StepUpdateStorageDirectories is for adding / removing
shareddata directory when the package updated with / without privilege
for shareddata. This process can be revoked when the package update is
failed.

Change-Id: Ibef2c65807682bc720f53fe8a3f78d9ca82d3c8c
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoAdd smoke-util functions to check existance of shared/data 18/218218/7
Sangyoon Jang [Wed, 20 Nov 2019 10:00:51 +0000 (19:00 +0900)]
Add smoke-util functions to check existance of shared/data

Change-Id: I0a8a7bb5cd8a2ff9889948b2d9d12566761c54c1
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoFix smoke-test functions for rollback cases 93/218093/3
Sangyoon Jang [Tue, 19 Nov 2019 09:10:04 +0000 (18:10 +0900)]
Fix smoke-test functions for rollback cases

The custom step cannot be added outside of installer, because steps are
initialized when Run() invoked.
(If some step added outside of installer, that step will be executed at
first, ignoring original steps)
This patch defines a new virtual function creating overridden installer
object which is fail at the end of steps or specific stage.

Change-Id: I00eed98d51bb4d083c421baa6a83f4b8ca17e90d
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoRelease version 1.31.0 00/218500/1 accepted/tizen/unified/20191201.221510 submit/tizen/20191128.101053 submit/tizen_5.5/20191204.061724 submit/tizen_5.5/20191205.065343
Junghyun Yeon [Mon, 25 Nov 2019 02:11:29 +0000 (11:11 +0900)]
Release version 1.31.0

Changes:
 - Fix build warning
 - Separate dotnet app existance checking logic
 - Make PkgQuery class as inner class of PkgQueryInterface
 - Reset data of PkgQuery at beginning of process
 - Change shared/data handle logic

Change-Id: I436bd47db2326ef9ba710dc25a8f119ba693719c
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoChange shared/data handle logic 03/210403/22
Junghyun Yeon [Fri, 19 Jul 2019 00:47:03 +0000 (09:47 +0900)]
Change shared/data handle logic

- Create shared data directory for each package at
  certain directory to prevent creation of N^2 smack labels.
- Create symlink at previous location for backward compatibility.

Change-Id: Ibb52bfef6843e3d38f91eabb418d87b46a4e918b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
4 years agoReset data of PkgQuery at beginning of process 59/218059/4
Sangyoon Jang [Tue, 19 Nov 2019 06:36:10 +0000 (15:36 +0900)]
Reset data of PkgQuery at beginning of process

The installer process can run multiple instance of same pkgid, so
PkgQuery should be reset.

Change-Id: Ibc2f6369e70831d10439cacbdaccbb9c94601906
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
4 years agoMake PkgQuery class as inner class of PkgQueryInterface 38/218038/2
Sangyoon Jang [Tue, 19 Nov 2019 04:27:38 +0000 (13:27 +0900)]
Make PkgQuery class as inner class of PkgQueryInterface

PkgQuery class should be accessed by PkgQueryInterface only.

Change-Id: I9752fe4528fb24ff74e24d190d230b799a61fa96
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>