|
|
@ -28,7 +28,7 @@ def resign_by_app_obj(app_obj, need_download_profile=True): |
|
|
|
d_time = time.time() |
|
|
|
d_time = time.time() |
|
|
|
if need_download_profile: |
|
|
|
if need_download_profile: |
|
|
|
IosUtils.modify_capability(developer_obj, app_obj, developer_app_id) |
|
|
|
IosUtils.modify_capability(developer_obj, app_obj, developer_app_id) |
|
|
|
download_flag, result = IosUtils.exec_download_profile(app_obj, developer_obj, 2) |
|
|
|
download_flag, result = IosUtils.exec_download_profile(app_obj, developer_obj, None, 2) |
|
|
|
else: |
|
|
|
else: |
|
|
|
download_flag = True |
|
|
|
download_flag = True |
|
|
|
IosUtils.run_sign(user_obj, app_obj, developer_obj, download_flag, None, d_time, {}, True) |
|
|
|
IosUtils.run_sign(user_obj, app_obj, developer_obj, download_flag, None, d_time, {}, True) |
|
|
@ -296,7 +296,7 @@ class IosUtils(object): |
|
|
|
return provision_name + '.mobileprovision' |
|
|
|
return provision_name + '.mobileprovision' |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def exec_download_profile(app_obj, developer_obj, sign_try_attempts=3): |
|
|
|
def exec_download_profile(app_obj, developer_obj, udid_info, sign_try_attempts=3): |
|
|
|
result = {} |
|
|
|
result = {} |
|
|
|
developer_app_id = None |
|
|
|
developer_app_id = None |
|
|
|
auth = get_auth_form_developer(developer_obj) |
|
|
|
auth = get_auth_form_developer(developer_obj) |
|
|
@ -311,7 +311,7 @@ class IosUtils(object): |
|
|
|
if developer_appid_obj: |
|
|
|
if developer_appid_obj: |
|
|
|
developer_app_id = developer_appid_obj.aid |
|
|
|
developer_app_id = developer_appid_obj.aid |
|
|
|
|
|
|
|
|
|
|
|
status, result = get_api_obj(auth).get_profile(app_obj, None, |
|
|
|
status, result = get_api_obj(auth).get_profile(app_obj, udid_info, |
|
|
|
get_profile_full_path(developer_obj, app_obj), |
|
|
|
get_profile_full_path(developer_obj, app_obj), |
|
|
|
auth, developer_app_id, [did[0] for did in device_id_list]) |
|
|
|
auth, developer_app_id, [did[0] for did in device_id_list]) |
|
|
|
|
|
|
|
|
|
|
@ -443,7 +443,7 @@ class IosUtils(object): |
|
|
|
d_result['msg'] = msg |
|
|
|
d_result['msg'] = msg |
|
|
|
return True, d_result |
|
|
|
return True, d_result |
|
|
|
|
|
|
|
|
|
|
|
def sign(self, sign_try_attempts=3, resign=False): |
|
|
|
def sign(self, sign_try_attempts=3): |
|
|
|
d_result = {'code': 0, 'msg': 'success'} |
|
|
|
d_result = {'code': 0, 'msg': 'success'} |
|
|
|
state, used_num = check_app_sign_limit(self.app_obj) |
|
|
|
state, used_num = check_app_sign_limit(self.app_obj) |
|
|
|
if not state: |
|
|
|
if not state: |
|
|
@ -459,7 +459,6 @@ class IosUtils(object): |
|
|
|
d_result['msg'] = msg |
|
|
|
d_result['msg'] = msg |
|
|
|
logger.error(d_result) |
|
|
|
logger.error(d_result) |
|
|
|
return False, d_result |
|
|
|
return False, d_result |
|
|
|
if not resign: |
|
|
|
|
|
|
|
app_udid_obj = AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).first() |
|
|
|
app_udid_obj = AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).first() |
|
|
|
if app_udid_obj and app_udid_obj.is_signed: |
|
|
|
if app_udid_obj and app_udid_obj.is_signed: |
|
|
|
apptodev_obj = APPToDeveloper.objects.filter(app_id=self.app_obj).first() |
|
|
|
apptodev_obj = APPToDeveloper.objects.filter(app_id=self.app_obj).first() |
|
|
@ -471,8 +470,7 @@ class IosUtils(object): |
|
|
|
logger.info(d_result) |
|
|
|
logger.info(d_result) |
|
|
|
return True, d_result |
|
|
|
return True, d_result |
|
|
|
logger.info("udid %s not exists app_id %s ,need sign" % (self.udid_info.get('udid'), self.app_obj)) |
|
|
|
logger.info("udid %s not exists app_id %s ,need sign" % (self.udid_info.get('udid'), self.app_obj)) |
|
|
|
else: |
|
|
|
|
|
|
|
logger.info("resign app_id %s ,need resign" % self.app_obj) |
|
|
|
|
|
|
|
call_flag = True |
|
|
|
call_flag = True |
|
|
|
download_flag = False |
|
|
|
download_flag = False |
|
|
|
count = 1 |
|
|
|
count = 1 |
|
|
@ -483,7 +481,7 @@ class IosUtils(object): |
|
|
|
"call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count)) |
|
|
|
"call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count)) |
|
|
|
if self.developer_obj: |
|
|
|
if self.developer_obj: |
|
|
|
download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj, |
|
|
|
download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj, |
|
|
|
sign_try_attempts) |
|
|
|
self.udid_info, sign_try_attempts) |
|
|
|
if download_flag: |
|
|
|
if download_flag: |
|
|
|
call_flag = False |
|
|
|
call_flag = False |
|
|
|
else: |
|
|
|
else: |
|
|
|