修改超级签方式,isign 部分包无法签名,使用zsign 进行签名

pull/28/head
youngS 3 years ago
parent ed841bc8fb
commit e6f8b2f628
  1. 9
      fir_client/src/components/apps/FirAppInfosBase.vue
  2. 26
      fir_client/src/components/apps/FirAppInfossupersign.vue
  3. 18
      fir_ser/api/migrations/0003_apps_new_bundle_name.py
  4. 2
      fir_ser/api/models.py
  5. 8
      fir_ser/api/utils/app/iossignapi.py
  6. 4
      fir_ser/api/utils/app/supersignutils.py
  7. 10
      fir_ser/api/views/apps.py
  8. 8
      fir_ser/cli.py

@ -17,7 +17,14 @@
<el-tooltip content="下载量" placement="top">
<span><i class="el-icon-cloudy"/><b class="short">{{ appinfos.count_hits }}</b></span>
</el-tooltip>
<span class="bundleid ng-binding">BundleID<b class="ng-binding">&nbsp;&nbsp;{{ appinfos.bundle_id }}</b></span>
<span class="bundleid ng-binding">BundleID<b class="ng-binding">
<el-tooltip content="复制到剪切板" placement="top">
<span class="bundleid short"
v-clipboard:copy="appinfos.bundle_id"
v-clipboard:success="copy_success"
>&nbsp;{{appinfos.bundle_id }}</span>
</el-tooltip>
</b></span>
<span class="version ng-scope">{{ master_release.minimum_os_version }}&nbsp; 或者高版本</span>
<span class="short ng-scope" v-if="appinfos.issupersign">超级签</span>

@ -29,8 +29,7 @@
<el-tooltip content="本应用签名使用额度,超过该额度,新设备将无法安装本应用。0代表不限额" placement="top">
<el-input-number v-model="currentapp.supersign_limit_number" :disabled="supersign_disable"
:placeholder="defualt_dtitle" :min="0"
<el-input-number v-model="currentapp.supersign_limit_number" :disabled="supersign_disable" :min="0"
style="width: 40%;margin-right: 10px" label="签名限额"/>
</el-tooltip>
@ -72,6 +71,16 @@
</el-button>
</el-form-item>
<el-form-item label-width="200px" label="自定义应用名称">
<el-input v-model="currentapp.new_bundle_name" clearable :disabled="supersign_disable"
style="width: 60%;margin-right: 10px" prefix-icon="el-icon-s-data"
:placeholder="defualt_dtitle_name"/>
<el-button @click="saveappinfo({new_bundle_name:currentapp.new_bundle_name})"
:disabled="supersign_disable"
>保存
</el-button>
</el-form-item>
</el-form>
<el-link v-else :underline="false" type="warning"> 该用户暂未开通超级签权限,请联系管理员申请开通</el-link>
</div>
@ -94,7 +103,8 @@
supersign_disable: true,
sign_type_list: [],
sign_type: 0,
defualt_dtitle: ''
defualt_dtitle: '',
defualt_dtitle_name: ''
}
},
methods: {
@ -170,6 +180,11 @@
} else {
this.defualt_dtitle = currentapp.bundle_id
}
if (this.currentapp.new_bundle_name && currentapp.new_bundle_name.length > 0) {
this.defualt_dtitle_name = currentapp.new_bundle_name
} else {
this.defualt_dtitle_name = currentapp.name
}
},
appinit() {
this.currentapp = this.$store.state.currentapp;
@ -193,6 +208,11 @@
if (!this.currentapp.new_bundle_id || this.currentapp.new_bundle_id.length === 0) {
this.defualt_dtitle = this.currentapp.bundle_id
}
},
'currentapp.new_bundle_name': function () {
if (!this.currentapp.new_bundle_name || this.currentapp.new_bundle_name.length === 0) {
this.defualt_dtitle_name = this.currentapp.name
}
}
}, computed: {}
}

@ -0,0 +1,18 @@
# Generated by Django 3.2.3 on 2021-06-24 11:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20210607_1743'),
]
operations = [
migrations.AddField(
model_name='apps',
name='new_bundle_name',
field=models.CharField(blank=True, help_text='应用新名称', max_length=64, null=True,
verbose_name='new_bundle_name'),
),
]

@ -119,6 +119,8 @@ class Apps(models.Model):
supersign_type = models.SmallIntegerField(choices=supersign_type_choices, default=1, verbose_name="签名类型")
new_bundle_id = models.CharField(max_length=64, blank=True, null=True, verbose_name="new_bundle_id",
help_text="用于超级签某些因素下需要修改包名")
new_bundle_name = models.CharField(max_length=64, blank=True, null=True, verbose_name="new_bundle_name",
help_text="应用新名称")
supersign_limit_number = models.IntegerField(verbose_name="签名使用限额", default=0)
wxredirect = models.BooleanField(verbose_name="微信内第三方链接自动跳转", default=True)
wxeasytype = models.BooleanField(verbose_name="微信内简易模式,避免微信封停", default=True)

@ -44,7 +44,7 @@ class ResignApp(object):
def __init__(self, my_local_key, app_dev_pem):
self.my_local_key = my_local_key
self.app_dev_pem = app_dev_pem
self.cmd = "isign -c '%s' -k '%s' " % (self.app_dev_pem, self.my_local_key)
self.cmd = "zsign -c '%s' -k '%s' " % (self.app_dev_pem, self.my_local_key)
@staticmethod
def sign_mobileconfig(mobilconfig_path, sign_mobilconfig_path, ssl_pem_path, ssl_key_path):
@ -58,10 +58,8 @@ class ResignApp(object):
info_plist_properties = {}
properties = ""
for k, v in info_plist_properties.items():
properties += "%s=%s," % (k, v)
if properties:
properties = " -i '%s' " % properties[0:-1]
self.cmd = self.cmd + " %s -p '%s' -o '%s' '%s'" % (properties, new_profile, new_ipa, org_ipa)
properties += " %s '%s' " % (k, v)
self.cmd = self.cmd + " %s -m '%s' -o '%s' -z 9 '%s'" % (properties, new_profile, new_ipa, org_ipa)
return exec_shell(self.cmd)

@ -367,7 +367,9 @@ class IosUtils(object):
new_file = os.path.join(MEDIA_ROOT, random_file_name + ".ipa")
properties_info = {}
if app_obj.new_bundle_id:
properties_info = {'CFBundleIdentifier': app_obj.new_bundle_id}
properties_info = {'-b': app_obj.new_bundle_id}
if app_obj.new_bundle_name:
properties_info = {'-n': app_obj.new_bundle_name}
status, result = resign_app_obj.sign(get_profile_full_path(developer_obj, app_obj), org_file, new_file,
properties_info)
if status:

@ -192,6 +192,7 @@ class AppInfoView(APIView):
do_sign_flag = 1
apps_obj.supersign_type = data.get("supersign_type", apps_obj.supersign_type)
new_bundle_id = data.get("new_bundle_id", None)
new_bundle_name = data.get("new_bundle_name", None)
if new_bundle_id and new_bundle_id != apps_obj.bundle_id and len(new_bundle_id) > 3:
if new_bundle_id != apps_obj.new_bundle_id:
do_sign_flag = 2
@ -201,6 +202,15 @@ class AppInfoView(APIView):
do_sign_flag = 2
apps_obj.new_bundle_id = None
if new_bundle_name and new_bundle_name != apps_obj.name and len(new_bundle_name) > 0:
if new_bundle_name != apps_obj.new_bundle_name:
do_sign_flag = 2
apps_obj.new_bundle_name = new_bundle_name
if new_bundle_name == '':
if new_bundle_name != apps_obj.new_bundle_name:
do_sign_flag = 2
apps_obj.new_bundle_name = None
apps_obj.wxredirect = data.get("wxredirect", apps_obj.wxredirect)
if apps_obj.type == 1 and data.get('issupersign', -1) != -1:
# 为啥注释掉,就是该udid已经在该平台使用了,虽然已经没有余额,但是其他应用也是可以超级签名的

@ -15,6 +15,14 @@ import oss2
import requests
from androguard.core.bytecodes import apk
'''
pip install --upgrade pip
pip install setuptools-rust
pip install oss2
pip install requests-toolbelt
pip install androguard
'''
def upload_aliyunoss(access_key_id, access_key_secret, security_token, endpoint, bucket, file_path, file_name):
stsauth = oss2.StsAuth(access_key_id, access_key_secret, security_token)

Loading…
Cancel
Save