adapt query

Signed-off-by: qu-xianfei <quxianfei1@huawei.com>
This commit is contained in:
qu-xianfei 2023-12-11 13:23:41 +08:00
parent 482091b6b6
commit 671a348904
3 changed files with 226 additions and 244 deletions

View File

@ -196,23 +196,16 @@ static void RunTestSuite(const char* suite_name)
}
}
void LiteTestPrint(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
printf(fmt, ap);
va_end(ap);
}
void ObtainProductParams(void)
{
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != NULL) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != NULL) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *abiList = GetAbiList();
if (abiList != NULL) {
printf("AbiList = %s\n", abiList);
}
int sdkApiVersion = GetSdkApiVersion();
if (sdkApiVersion != 0) {
printf("SdkApiVersion = %d\n", sdkApiVersion);
@ -223,16 +216,16 @@ void ObtainProductParams(void)
printf("firstApiVersion = %d\n", firstApiVersion);
}
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != NULL) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *incrementalVersion = GetIncrementalVersion();
if (incrementalVersion != NULL) {
printf("incrementalVersion = %s\n", incrementalVersion);
}
const char *versionId = GetVersionId();
if (versionId != NULL) {
printf("VersionID = %s\n", versionId);
}
const char *buildType = GetBuildType();
if (buildType != NULL) {
printf("buildType = %s\n", buildType);
@ -253,15 +246,9 @@ void ObtainProductParams(void)
printf("buildTime = %s\n", buildTime);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != NULL) {
printf("BuildRootHash = %s\n", buildRootHash);
}
char udid[UDIDSIZE_LEN + 1] = { 0 };
int retUdid = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (retUdid == 0) {
printf("DevUdid = %s\n", udid);
const char *abiList = GetAbiList();
if (abiList != NULL) {
printf("AbiList = %s\n", abiList);
}
}
@ -277,10 +264,6 @@ void ObtainAttestResultParams(void)
}
printf("authResult = %d\n",attestResultInfo.authResult);
printf("softwareResult = %d\n",attestResultInfo.softwareResult);
for (int i = 0; i < 5; i++) {
printf("softwareResultDetail[%d] = %d\n",
i, attestResultInfo.softwareResultDetail[i]);
}
}
#endif
@ -292,49 +275,9 @@ void ObtainSystemParams(void)
printf("Device Type = %s\n", productType);
}
const char *manuFacture = GetManufacture();
if (manuFacture != NULL) {
printf("manuFacture = %s\n", manuFacture);
}
const char *brand = GetBrand();
if (brand != NULL) {
printf("brand = %s\n", brand);
}
const char *marketName = GetMarketName();
if (marketName != NULL) {
printf("marketName = %s\n", marketName);
}
const char *productSeries = GetProductSeries();
if (productSeries != NULL) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != NULL) {
printf("softwareModel = %s\n", softwareModel);
}
const char *productModel = GetProductModel();
if (productModel != NULL) {
printf("productModel = %s\n", productModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != NULL) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *hardWareProfile = GetHardwareProfile();
if (hardWareProfile != NULL) {
printf("HardwareProfile = %s\n", hardWareProfile);
}
const char *serial = GetSerial();
if (serial != NULL) {
printf("serial = %s\n", serial);
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != NULL) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *osName = GetOSFullName();
@ -347,11 +290,68 @@ void ObtainSystemParams(void)
printf("DisplayVersion = %s\n", displayVersion);
}
ObtainProductParams();
const char *versionId = GetVersionId();
if (versionId != NULL) {
printf("VersionID = %s\n", versionId);
}
#ifdef INTER_ATTEST_MINI_MODULE
ObtainAttestResultParams();
#endif
char udid[UDIDSIZE_LEN + 1] = { 0 };
int retUdid = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (retUdid == 0) {
printf("DevUdid = %s\n", udid);
}
const char *manuFacture = GetManufacture();
if (manuFacture != NULL) {
printf("manuFacture = %s\n", manuFacture);
}
const char *productModel = GetProductModel();
if (productModel != NULL) {
printf("productModel = %s\n", productModel);
}
const char *serial = GetSerial();
if (serial != NULL) {
printf("serial = %s\n", serial);
}
const char *brand = GetBrand();
if (brand != NULL) {
printf("brand = %s\n", brand);
}
const char *productSeries = GetProductSeries();
if (productSeries != NULL) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != NULL) {
printf("softwareModel = %s\n", softwareModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != NULL) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != NULL) {
printf("BuildRootHash = %s\n", buildRootHash);
}
const char *marketName = GetMarketName();
if (marketName != NULL) {
printf("marketName = %s\n", marketName);
}
ObtainProductParams();
printf("******To Obtain Product Params End ******\n");
return;
}

View File

@ -24,21 +24,6 @@ const int UDIDSIZE_LEN = 64;
void ObtainProductParms()
{
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != nullptr) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != nullptr) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *abiList = GetAbiList();
if (abiList != nullptr) {
printf("AbiList = %s\n", abiList);
}
int sdkApiVersion = GetSdkApiVersion();
if (sdkApiVersion != 0) {
printf("SdkApiVersion = %d\n", sdkApiVersion);
@ -49,16 +34,16 @@ void ObtainProductParms()
printf("firstApiVersion = %d\n", firstApiVersion);
}
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != nullptr) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *incrementalVersion = GetIncrementalVersion();
if (incrementalVersion != nullptr) {
printf("incrementalVersion = %s\n", incrementalVersion);
}
const char *versionId = GetVersionId();
if (versionId != nullptr) {
printf("VersionID = %s\n", versionId);
}
const char *buildType = GetBuildType();
if (buildType != nullptr) {
printf("buildType = %s\n", buildType);
@ -79,28 +64,9 @@ void ObtainProductParms()
printf("buildTime = %s\n", buildTime);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != nullptr) {
printf("BuildRootHash = %s\n", buildRootHash);
}
char udid[UDIDSIZE_LEN + 1] = { 0 };
int retUdid = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (retUdid == 0) {
printf("DevUdid = %s\n", udid);
}
AttestResultInfo attestResultInfo = { 0 };
attestResultInfo.ticket = NULL;
int32_t retStatus = GetAttestStatus(&attestResultInfo);
if (retStatus != DEVATTEST_SUESS) {
printf("[CLIENT MAIN] wrong. retStatus:%d\n", retStatus);
}
printf("authResult = %d\n",attestResultInfo.authResult);
printf("softwareResult = %d\n",attestResultInfo.softwareResult);
for (int i = 0; i < 5; i++) {
printf("softwareResultDetail[%d] = %d\n",
i, attestResultInfo.softwareResultDetail[i]);
const char *abiList = GetAbiList();
if (abiList != nullptr) {
printf("AbiList = %s\n", abiList);
}
}
@ -112,49 +78,9 @@ int main()
printf("Device Type = %s\n", productType);
}
const char *manuFacture = GetManufacture();
if (manuFacture != nullptr) {
printf("manuFacture = %s\n", manuFacture);
}
const char *brand = GetBrand();
if (brand != nullptr) {
printf("brand = %s\n", brand);
}
const char *marketName = GetMarketName();
if (marketName != nullptr) {
printf("marketName = %s\n", marketName);
}
const char *productSeries = GetProductSeries();
if (productSeries != nullptr) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != nullptr) {
printf("softwareModel = %s\n", softwareModel);
}
const char *productModel = GetProductModel();
if (productModel != nullptr) {
printf("productModel = %s\n", productModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != nullptr) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *hardWareProfile = GetHardwareProfile();
if (hardWareProfile != nullptr) {
printf("HardwareProfile = %s\n", hardWareProfile);
}
const char *serial = GetSerial();
if (serial != nullptr) {
printf("serial = %s\n", serial);
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != nullptr) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *osName = GetOSFullName();
@ -167,6 +93,71 @@ int main()
printf("DisplayVersion = %s\n", displayVersion);
}
const char *versionId = GetVersionId();
if (versionId != nullptr) {
printf("VersionID = %s\n", versionId);
}
AttestResultInfo attestResultInfo = { 0 };
attestResultInfo.ticket = NULL;
int32_t retStatus = GetAttestStatus(&attestResultInfo);
if (retStatus != DEVATTEST_SUESS) {
printf("[CLIENT MAIN] wrong. retStatus:%d\n", retStatus);
}
printf("authResult = %d\n",attestResultInfo.authResult);
printf("softwareResult = %d\n",attestResultInfo.softwareResult);
char udid[UDIDSIZE_LEN + 1] = { 0 };
int retUdid = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (retUdid == 0) {
printf("DevUdid = %s\n", udid);
}
const char *manuFacture = GetManufacture();
if (manuFacture != nullptr) {
printf("manuFacture = %s\n", manuFacture);
}
const char *productModel = GetProductModel();
if (productModel != nullptr) {
printf("productModel = %s\n", productModel);
}
const char *serial = GetSerial();
if (serial != nullptr) {
printf("serial = %s\n", serial);
}
const char *brand = GetBrand();
if (brand != nullptr) {
printf("brand = %s\n", brand);
}
const char *productSeries = GetProductSeries();
if (productSeries != nullptr) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != nullptr) {
printf("softwareModel = %s\n", softwareModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != nullptr) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != nullptr) {
printf("BuildRootHash = %s\n", buildRootHash);
}
const char *marketName = GetMarketName();
if (marketName != nullptr) {
printf("marketName = %s\n", marketName);
}
ObtainProductParms();
printf("******To Obtain Product Params End ******\n");

View File

@ -27,21 +27,6 @@ using namespace OHOS;
void ObtainProductParms(void)
{
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != nullptr) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != nullptr) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *abiList = GetAbiList();
if (abiList != nullptr) {
printf("AbiList = %s\n", abiList);
}
int sdkApiVersion = GetSdkApiVersion();
if (sdkApiVersion != 0) {
printf("SdkApiVersion = %d\n", sdkApiVersion);
@ -52,16 +37,16 @@ void ObtainProductParms(void)
printf("firstApiVersion = %d\n", firstApiVersion);
}
const char *bootloaderVersion = GetBootloaderVersion();
if (bootloaderVersion != nullptr) {
printf("bootloaderVersion = %s\n", bootloaderVersion);
}
const char *incrementalVersion = GetIncrementalVersion();
if (incrementalVersion != nullptr) {
printf("incrementalVersion = %s\n", incrementalVersion);
}
const char *versionId = GetVersionId();
if (versionId != nullptr) {
printf("VersionID = %s\n", versionId);
}
const char *buildType = GetBuildType();
if (buildType != nullptr) {
printf("buildType = %s\n", buildType);
@ -82,24 +67,9 @@ void ObtainProductParms(void)
printf("buildTime = %s\n", buildTime);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != nullptr) {
printf("BuildRootHash = %s\n", buildRootHash);
}
char udid[UDIDSIZE_LEN + 1] = { 0 };
int ret = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (ret == 0) {
printf("DevUdid = %s\n", udid);
}
AttestResultInfo attestResultInfo;
(void)DelayedSingleton<DevAttestClient>::GetInstance()->GetAttestStatus(attestResultInfo);
printf("authResult = %d\n",attestResultInfo.authResult_);
printf("softwareResult = %d\n",attestResultInfo.softwareResult_);
for (int i = 0; i < 5; i++) {
printf("softwareResultDetail[%d] = %d\n",
i, attestResultInfo.softwareResultDetail_[i]);
const char *abiList = GetAbiList();
if (abiList != nullptr) {
printf("AbiList = %s\n", abiList);
}
}
@ -111,49 +81,9 @@ int main()
printf("Device Type = %s\n", productType);
}
const char *manuFacture = GetManufacture();
if (manuFacture != nullptr) {
printf("manuFacture = %s\n", manuFacture);
}
const char *brand = GetBrand();
if (brand != nullptr) {
printf("brand = %s\n", brand);
}
const char *marketName = GetMarketName();
if (marketName != nullptr) {
printf("marketName = %s\n", marketName);
}
const char *productSeries = GetProductSeries();
if (productSeries != nullptr) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != nullptr) {
printf("softwareModel = %s\n", softwareModel);
}
const char *productModel = GetProductModel();
if (productModel != nullptr) {
printf("productModel = %s\n", productModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != nullptr) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *hardWareProfile = GetHardwareProfile();
if (hardWareProfile != nullptr) {
printf("HardwareProfile = %s\n", hardWareProfile);
}
const char *serial = GetSerial();
if (serial != nullptr) {
printf("serial = %s\n", serial);
const char *securityPatchTag = GetSecurityPatchTag();
if (securityPatchTag != nullptr) {
printf("Security Patch = %s\n", securityPatchTag);
}
const char *osName = GetOSFullName();
@ -166,6 +96,67 @@ int main()
printf("DisplayVersion = %s\n", displayVersion);
}
const char *versionId = GetVersionId();
if (versionId != nullptr) {
printf("VersionID = %s\n", versionId);
}
AttestResultInfo attestResultInfo;
(void)DelayedSingleton<DevAttestClient>::GetInstance()->GetAttestStatus(attestResultInfo);
printf("authResult = %d\n",attestResultInfo.authResult_);
printf("softwareResult = %d\n",attestResultInfo.softwareResult_);
char udid[UDIDSIZE_LEN + 1] = { 0 };
int ret = GetDevUdid(udid, UDIDSIZE_LEN + 1);
if (ret == 0) {
printf("DevUdid = %s\n", udid);
}
const char *manuFacture = GetManufacture();
if (manuFacture != nullptr) {
printf("manuFacture = %s\n", manuFacture);
}
const char *productModel = GetProductModel();
if (productModel != nullptr) {
printf("productModel = %s\n", productModel);
}
const char *serial = GetSerial();
if (serial != nullptr) {
printf("serial = %s\n", serial);
}
const char *brand = GetBrand();
if (brand != nullptr) {
printf("brand = %s\n", brand);
}
const char *productSeries = GetProductSeries();
if (productSeries != nullptr) {
printf("productSeries = %s\n", productSeries);
}
const char *softwareModel = GetSoftwareModel();
if (softwareModel != nullptr) {
printf("softwareModel = %s\n", softwareModel);
}
const char *hardWareModel = GetHardwareModel();
if (hardWareModel != nullptr) {
printf("HardwareModel = %s\n", hardWareModel);
}
const char *buildRootHash = GetBuildRootHash();
if (buildRootHash != nullptr) {
printf("BuildRootHash = %s\n", buildRootHash);
}
const char *marketName = GetMarketName();
if (marketName != nullptr) {
printf("marketName = %s\n", marketName);
}
ObtainProductParms();
printf("******To Obtain Product Params End ******\n");