mirror of
https://gitee.com/openharmony/hiviewdfx_hiview
synced 2024-11-26 18:50:39 +00:00
commit
9f28b74fd4
3
OAT.xml
3
OAT.xml
@ -68,6 +68,7 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<filteritem type="filename" name="libfaultlogger.map" desc=" version script config file, not support comments"/>
|
||||
<filteritem type="filename" name="XperfPlugin" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="CERT.SF" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="CERT_PRE.config" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="0-0-123456" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="0-1-123456" desc="build and load config file, not support comments"/>
|
||||
</filefilter>
|
||||
@ -84,6 +85,7 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<filteritem type="filename" name="libfaultlogger.map" desc=" version script config file, not support comments"/>
|
||||
<filteritem type="filename" name="XperfPlugin" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="CERT.SF" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="CERT_PRE.config" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="0-0-123456" desc="build and load config file, not support comments"/>
|
||||
<filteritem type="filename" name="0-1-123456" desc="build and load config file, not support comments"/>
|
||||
</filefilter>
|
||||
@ -92,7 +94,6 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<filteritem type="filename" name="TEST_VERSION1-1-CRITICAL-1.db" desc="the binary file for test, the file is self-developed"/>
|
||||
<filteritem type="filename" name="TEST_VERSION2-1-CRITICAL-1.db" desc="the binary file for test, the file is self-developed"/>
|
||||
<filteritem type="filename" name="TEST_VERSION3-1-CRITICAL-1.db" desc="the binary file for test, the file is self-developed"/>
|
||||
<filteritem type="filename" name="CERT.ENC" desc="the binary file for test, the file is self-developed"/>
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
</oatconfig>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
* 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
* 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
|
||||
@ -117,6 +117,7 @@ int32_t WritePracelableToMessage(MessageParcel& dest, Parcelable& data)
|
||||
int32_t HiviewServiceAbilityStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
|
||||
MessageOption &option)
|
||||
{
|
||||
HIVIEW_LOGI("cmd = %{public}d, flags= %{public}d", code, option.GetFlags());
|
||||
std::u16string descripter = HiviewServiceAbilityStub::GetDescriptor();
|
||||
std::u16string remoteDescripter = data.ReadInterfaceToken();
|
||||
if (descripter != remoteDescripter) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* 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
|
||||
* 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,
|
||||
|
@ -23,6 +23,42 @@ using namespace OHOS::HiviewDFX;
|
||||
namespace {
|
||||
const std::string TEST_CONFIG_FILE = "/data/system/hiview/test.txt";
|
||||
const std::string TEST_ANCO_CONFIG_PATH = "/data/system/hiview/anco/";
|
||||
const std::string CERT_CONFIG_FILE_FULL_NAME = "/data/test/test_data/CERT_PRE.config";
|
||||
const std::string CERT_ENC_FILE_FULL_NAME =
|
||||
"/data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/CERT.ENC";
|
||||
constexpr int CHAR_0 = 48; // '0'
|
||||
constexpr int CHAR_9 = 57; // '9'
|
||||
constexpr int CHAR_A = 65; // 'A'
|
||||
constexpr int CHAR_F = 70; // 'F'
|
||||
constexpr int HEX_BASE = 10;
|
||||
|
||||
int ToNum(char a)
|
||||
{
|
||||
if (a >= CHAR_0 && a <= CHAR_9) {
|
||||
return static_cast<int>(a - '0');
|
||||
}
|
||||
|
||||
if (a >= CHAR_A && a <= CHAR_F) {
|
||||
return (static_cast<int>(a - 'A') + HEX_BASE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CreateEncFile()
|
||||
{
|
||||
std::string content;
|
||||
FileUtil::LoadStringFromFile(CERT_CONFIG_FILE_FULL_NAME, content);
|
||||
std::vector<char> saveContent;
|
||||
const int hightBit = 4;
|
||||
const int hexLen = 2;
|
||||
const int secondHex = 1;
|
||||
for (int i = 0; i < content.length();) {
|
||||
saveContent.push_back(static_cast<char>(ToNum(content[i]) << hightBit) + (ToNum(content[i + secondHex])));
|
||||
i += hexLen;
|
||||
}
|
||||
|
||||
FileUtil::SaveBufferToFile(CERT_ENC_FILE_FULL_NAME, saveContent, true);
|
||||
}
|
||||
}
|
||||
|
||||
void ParamUpdateTest::SetUp()
|
||||
@ -36,6 +72,7 @@ void ParamUpdateTest::SetUp()
|
||||
} else {
|
||||
std::cout << "init environment successful" << std::endl;
|
||||
}
|
||||
CreateEncFile();
|
||||
}
|
||||
|
||||
void ParamUpdateTest::TearDown()
|
||||
|
@ -101,7 +101,7 @@
|
||||
<option name="push" value="base/hiview_platform_config -> /data/test/test_data/" src="res"/>
|
||||
<option name="shell" value="mkdir /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/anco/"/>
|
||||
<option name="push" value="param_update/anco/anco_test.txt -> /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/anco/" src="res"/>
|
||||
<option name="push" value="param_update/CERT.ENC -> /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/" src="res"/>
|
||||
<option name="push" value="param_update/CERT_PRE.config -> /data/test/test_data/" src="res"/>
|
||||
<option name="push" value="param_update/CERT.SF -> /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/" src="res"/>
|
||||
<option name="push" value="param_update/MANIFEST.MF -> /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/" src="res"/>
|
||||
<option name="push" value="param_update/test.txt -> /data/service/el1/public/update/param_service/install/system/etc/HIVIEWPARA/DEFAULT/" src="res"/>
|
||||
|
Binary file not shown.
1
test/resource/param_update/CERT_PRE.config
Normal file
1
test/resource/param_update/CERT_PRE.config
Normal file
@ -0,0 +1 @@
|
||||
942B8EB470A486FDD22F3EDBFCD8AF931F83BD5690A4EE19E06477E25A630AAD820E4A0EB5B62DBBE33C4511A26C17B7AFC590D069650D77B0C5DCA8C4617CD3AF596939F9E8BD29AB2252A639162AE734A0D30399334008CB1EDFA24FFB6805512EADE27696107B662C157C4EEB5FC7AE4092AED96AC346F021149A0720A0C9B95E3B612EFB065FF9EE892543B3997444E08024CE206B3FDE441EBBCCBB69BB35862B37DB2CAEB012968ED436DC8B2C54470D22FEE717388B6878C80CC95E1BC6391CD3FD761D30E71668826DC835C2480946CFCB658A1BE0713F741BC2EC297139A3A4720528CC5146BA1BA584173EB450814A7098FE82A92B931FBEEF0B4F453D0D61AAC06C9FF153AF6D9608CD9BECD987EE88E39D1F1FE4184D755C943DB9C267FB70EEB3F8324F8052ECB0C038EC44C7206546014692142C8C969A1F815191B46331EF14BBFD1704A9015A27B2240E78ABC72DF1796D3A3301996E1FE753AA1D51E4F2F9282AA0F07FCFB108B6A580698229E1448F25711812867E6622A52CAF9095B1FDFA189B5E31D90DF9F580A9EC694081B569CD506BDEEC2C65EA441E5E8F7A8021184AFA040EE95AF5C86978018F61CF4A4E6AE0C0EB236A5B38523DDE919D04DCB951A8262AFBA46561A95E84069C2B7D9B9497080300C10440AEB6C4194EA9CCAE183F9A4A2F942829E6A020DCCEFBAA19C252D756CB5DB1C1
|
Loading…
Reference in New Issue
Block a user