支持Ad Hoc发类型

Signed-off-by: sunjiakun <sunjiakun5@huawei.com>
This commit is contained in:
sunjiakun 2024-07-01 19:39:12 +08:00
parent 9110171313
commit d6abc26c70
4 changed files with 9 additions and 3 deletions

View File

@ -36,6 +36,7 @@ enum AppDistType {
CROWDTESTING = 4,
ENTERPRISE_NORMAL = 5,
ENTERPRISE_MDM = 6,
INTERNALTESTING = 7,
};
struct BundleInfo {

View File

@ -62,6 +62,7 @@ const string VALUE_DIST_TYPE_APP_GALLERY = "app_gallery";
const string VALUE_DIST_TYPE_ENTERPRISE = "enterprise";
const string VALUE_DIST_TYPE_ENTERPRISE_NORMAL = "enterprise_normal";
const string VALUE_DIST_TYPE_ENTERPRISE_MDM = "enterprise_mdm";
const string VALUR_DIST_TYPE_INTERNALTESTING = "internaltesting";
const string VALUE_DIST_TYPE_OS_INTEGRATION = "os_integration";
const string VALUE_DIST_TYPE_CROWDTESTING = "crowdtesting";
const string VALUE_DEVICE_ID_TYPE_UDID = "udid";
@ -126,7 +127,8 @@ const std::map<std::string, int32_t> distTypeMap = {
{VALUE_DIST_TYPE_ENTERPRISE_NORMAL, AppDistType::ENTERPRISE_NORMAL},
{VALUE_DIST_TYPE_ENTERPRISE_MDM, AppDistType::ENTERPRISE_MDM},
{VALUE_DIST_TYPE_OS_INTEGRATION, AppDistType::OS_INTEGRATION},
{VALUE_DIST_TYPE_CROWDTESTING, AppDistType::CROWDTESTING}
{VALUE_DIST_TYPE_CROWDTESTING, AppDistType::CROWDTESTING},
{VALUR_DIST_TYPE_INTERNALTESTING, AppDistType::INTERNALTESTING}
};
static bool g_isRdDevice = false;
@ -351,7 +353,8 @@ AppProvisionVerifyResult ParseAndVerify(const string& appProvision, ProvisionInf
}
#ifndef X86_EMULATOR_MODE
HAPVERIFY_LOG_DEBUG("rd device status is %{public}d", g_isRdDevice);
if (info.type == ProvisionType::DEBUG && !g_isRdDevice) {
if ((info.type == ProvisionType::DEBUG && !g_isRdDevice)
|| info.distributionType == Security::Verify::AppDistType::INTERNALTESTING) {
ret = CheckDeviceID(info);
if (ret != PROVISION_OK) {
return ret;

View File

@ -322,6 +322,7 @@ bool HapVerifyV2::IsAppDistributedTypeAllowInstall(const AppDistType& type, cons
case AppDistType::ENTERPRISE_MDM:
case AppDistType::OS_INTEGRATION:
case AppDistType::CROWDTESTING:
case AppDistType::INTERNALTESTING:
return true;
default:
return false;

View File

@ -26,6 +26,7 @@ const char ENTERPRISE[] = "enterprise";
const char ENTERPRISE_NORMAL[] = "enterprise_normal";
const char ENTERPRISE_MDM[] = "enterprise_mdm";
const char OS_INTEGRATION[] = "os_integration";
const char INTERNALTESTING[] = "internaltesting";
static void ProfInit(ProfileProf *pf)
{
@ -348,7 +349,7 @@ static int32_t VerifyAppTypeAndDistribution(const ProfileProf *pf)
if (strcmp(pf->type, RELEASE_TYPE) == 0) {
if ((strcmp(pf->appDistType, APP_GALLERY) != 0) && (strcmp(pf->appDistType, ENTERPRISE) != 0) &&
(strcmp(pf->appDistType, ENTERPRISE_NORMAL) != 0) && (strcmp(pf->appDistType, ENTERPRISE_MDM) != 0) &&
(strcmp(pf->appDistType, OS_INTEGRATION) != 0)) {
(strcmp(pf->appDistType, INTERNALTESTING) != 0) && (strcmp(pf->appDistType, OS_INTEGRATION) != 0)) {
LOG_PRINT_STR("invalid app dis type: %s", pf->appDistType);
return V_ERR;
}