1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SYS_INSTALLER_COMMON_H
17 #define SYS_INSTALLER_COMMON_H
18 
19 #include <string>
20 #include <cstdlib>
21 #include <cstdio>
22 #include <cstring>
23 #include <iostream>
24 
25 namespace OHOS {
26 namespace SysInstaller {
27 constexpr const char *SYS_LOG_DIR = "/data/updater/log";
28 constexpr const char *SYS_LOG_FILE = "/data/updater/log/sys_installer.log";
29 constexpr const char *SYS_STAGE_FILE = "/data/updater/log/sys_installer_stage.log";
30 constexpr const char *SYS_ERROR_FILE = "/data/updater/log/sys_installer_error_code.log";
31 
32 enum InstallerErrCode {
33     SYS_UPDATE_SUCCESS = 0,
34     SYS_PKG_NOT_EXIST,
35     SYS_AUTH_CHECK_FAIL = 10,
36     SYS_SIGN_VERIFY_FAIL = 20,
37     SYS_VERSION_VERIFY_FAIL = 30,
38     SYS_PACKAGE_TRANS_FAIL = 40,
39     SYS_INSTALL_FAIL = 50,
40     SYS_INSTALL_PARA_FAIL = 60,
41 };
42 } // namespace SysInstaller
43 } // namespace OHOS
44 #endif // SYS_INSTALLER_COMMON_H
45