苹果开发账户仅同步enable设备

pull/6/head
nineven 4 years ago
parent 21fe5665e2
commit b4a1cb47ae
  1. 16
      fir_ser/api/utils/app/iossignapi.py
  2. 9
      fir_ser/api/utils/app/supersignutils.py
  3. 2
      fir_ser/api/utils/apple/appleapiv3.py

@ -100,7 +100,7 @@ class AppDeveloperApi(object):
self.cmd = self.cmd + " device get '%s' " % (self.file_format_path_name(user_obj)) self.cmd = self.cmd + " device get '%s' " % (self.file_format_path_name(user_obj))
return exec_shell(self.cmd) return exec_shell(self.cmd)
def add_app(self, bundleId, app_id): def create_app(self, bundleId, app_id):
self.cmd = self.cmd + " app add '%s' '%s'" % (bundleId, app_id) self.cmd = self.cmd + " app add '%s' '%s'" % (bundleId, app_id)
result = exec_shell(self.cmd) result = exec_shell(self.cmd)
@ -288,3 +288,17 @@ class AppDeveloperApiV2(object):
logger.error("ios developer delete profile Failed Exception:%s" % e) logger.error("ios developer delete profile Failed Exception:%s" % e)
result['return_info'] = "%s" % e result['return_info'] = "%s" % e
return False, result return False, result
def create_app(self, bundleId, app_id):
result = {}
try:
apple_obj = AppStoreConnectApi(self.issuer_id, self.private_key_id, self.p8key)
bundle_obj = apple_obj.register_bundle_id_enable_capability(app_id, bundleId + app_id)
developer_app_id = bundle_obj.id
result['aid'] = developer_app_id
return True, result
except Exception as e:
logger.error("ios developer create app Failed Exception:%s" % e)
result['return_info'] = "%s" % e
return False, result

@ -242,6 +242,11 @@ class IosUtils(object):
return get_api_obj(self.auth).get_profile(bundleId, app_id, device_udid, device_name, return get_api_obj(self.auth).get_profile(bundleId, app_id, device_udid, device_name,
self.get_profile_full_path(), self.get_profile_full_path(),
self.auth, developer_app_id, device_id_list) self.auth, developer_app_id, device_id_list)
# 开启超级签直接在开发者账户创建
def create_app(self, app_obj):
bundleId = self.app_obj.bundle_id
app_id = self.app_obj.app_id
return get_api_obj(self.auth).create_app(bundleId, app_id)
def get_profile_full_path(self): def get_profile_full_path(self):
cert_dir_name = make_app_uuid(self.user_obj, get_apple_udid_key(self.auth)) cert_dir_name = make_app_uuid(self.user_obj, get_apple_udid_key(self.auth))
@ -261,14 +266,12 @@ class IosUtils(object):
return return
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))
fcount = 3 fcount = 3
result={}
while fcount > 0: while fcount > 0:
# apptodev_obj = APPToDeveloper.objects.filter(developerid=self.developer_obj, app_id=self.app_obj).first() # apptodev_obj = APPToDeveloper.objects.filter(developerid=self.developer_obj, app_id=self.app_obj).first()
device_id_list = DeveloperDevicesID.objects.filter(app_id=self.app_obj, device_id_list = DeveloperDevicesID.objects.filter(app_id=self.app_obj,
developerid=self.developer_obj).values_list('did') developerid=self.developer_obj).values_list('did')
# first_sign = True
# if apptodev_obj:
# first_sign = False
developer_app_id = None developer_app_id = None
developer_appid_obj = DeveloperAppID.objects.filter(developerid=self.developer_obj, developer_appid_obj = DeveloperAppID.objects.filter(developerid=self.developer_obj,
app_id=self.app_obj).first() app_id=self.app_obj).first()

@ -679,7 +679,7 @@ class AppStoreConnectApi(DevicesAPI, BundleIDsAPI, BundleIDsCapabilityAPI, Profi
return self.__device_store(req) return self.__device_store(req)
def list_enabled_devices(self): def list_enabled_devices(self):
req = self.list_devices() req = super().list_enabled_devices()
return self.__device_store(req) return self.__device_store(req)
def get_all_bundle_ids(self): def get_all_bundle_ids(self):

Loading…
Cancel
Save