2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file InstallerUtil.h
19 * @brief This is the header file for the %InstallerUtil class.
21 * This header file contains the declarations of the %InstallerUtil class.
23 #ifndef _INSTALLER_UTIL_H_
24 #define _INSTALLER_UTIL_H_
26 #include <FAppTypes.h>
28 namespace Tizen { namespace Base
33 namespace Tizen { namespace Base { namespace Collection
40 * @class InstallerUtil
41 * @brief This class represents the class of InstallerUtil.
44 * This class represents the class of InstallerUtil.
51 virtual ~InstallerUtil(void);
53 static bool Remove(const Tizen::Base::String& filePath);
54 static bool Copy(const Tizen::Base::String& srcFilePath, const Tizen::Base::String& destFilePath);
55 static bool CopyDirectory(const Tizen::Base::String& srcFilePath, const Tizen::Base::String& destFilePath);
56 static bool IsSymlink(const Tizen::Base::String& filePath);
57 static bool GetRealPath(const Tizen::Base::String& filePath, Tizen::Base::String& realPath);
59 static bool CreateSymlink(const Tizen::Base::String& oldPath, const Tizen::Base::String& newPath, bool SmackLabelToRealPath = true);
60 static bool ChangeMode(const Tizen::Base::String& filePath, int mode);
61 static bool ChangeOwner(const Tizen::Base::String& filePath);
62 static bool ChangeDirectoryPermission(const Tizen::Base::String& filePath, int mode, bool appOwner);
64 static bool IsDrmFile(const Tizen::Base::String& path);
65 static bool DecryptPackage(const Tizen::Base::String& path, const Tizen::Base::String& decryptedPath);
67 static Tizen::Base::String GetCategory(int categoryType);
68 static int GetCategoryType(char* pCategory);
70 static bool CreateSymlinkForAppDirectory(const Tizen::Base::String& inPath, Tizen::Base::String& outPath);
71 static bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext);
73 static bool DumpLog(const char* pBuf);
74 static bool DumpLogData(char *pData, int dataLen);
76 static bool CreateLog(const Tizen::Base::String& logFile);
77 static bool AppendLog(const char* pFunction, int lineNumber, bool fatal, const char* pFormat, ...);
78 static bool PrintLog(const Tizen::Base::String& logFile);
79 static bool GetRdsList(const Tizen::App::PackageId& packageId,
80 Tizen::Base::Collection::IList* pDeletedList,
81 Tizen::Base::Collection::IList* pAddedList,
82 Tizen::Base::Collection::IList* pModifiedList);
84 static const char* GetInstallerOperationString(int operation);
85 static bool GetFileDigest(const Tizen::Base::String& filePath, Tizen::Base::String& digestValue);
87 static Tizen::Base::Collection::IMap* ParseN(const Tizen::Base::String& str, const Tizen::Base::String& tokenDelimiter);
89 static bool TerminateApp(const Tizen::App::AppId& appId);
90 static bool TerminateApps(const Tizen::App::PackageId& packageId);
92 static bool IsUninstallable(const Tizen::App::PackageId& packageId);
93 static bool IsCscPackage(const Tizen::App::PackageId& packageId, Tizen::Base::String& cscInfo);
95 static bool IsDefaultExternalStorage();
96 static bool IsSignatureVerificationEnabled();
99 static char LogChangeHexToStr(int hex);
100 InstallerUtil(const InstallerUtil& value);
101 InstallerUtil& operator =(const InstallerUtil& source);
107 #endif // _INSTALLER_UTIL_H_