fix app plist files

storage_cloud
nineven 5 years ago
parent 173d28c615
commit d6abf32a82
  1. 2
      fir_client/src/components/FirAppInfostimeline.vue
  2. 123
      fir_ser/api/utils/app/apputils.py
  3. 4
      fir_ser/api/views/download.py

@ -12,7 +12,7 @@
<i class="el-icon-cloudy" v-if="! app.is_master"></i>
<i class="el-icon-cloudy" style="background-color: #409eff" v-else></i>
<b class="ng-binding">{{app.build_version}} (Build {{app.app_version}})</b>
<b class="ng-binding">{{app.app_version}} (Build {{app.build_version}})</b>
<div class="release-metainfo ng-hide"
v-if="app.release_type === 0">
<small>

@ -8,80 +8,55 @@ from api.models import AppReleaseInfo,Apps
import random,xmltodict,json
from api.utils.storage.storage import Storage
def make_resigned(bin_url,img_url,bundle_id,bundle_version,name):
ios_plist_tem = """
{
"plist": {
"@version": "1.0",
"dict": {
"key": "items",
"array": {
"dict": {
"key": [
"assets",
"metadata"
],
"array": {
"dict": [
{
"key": [
"kind",
"url"
],
"string": [
"software-package",
"%s"
]
},
{
"key": [
"kind",
"needs-shine",
"url"
],
"string": [
"display-image",
"%s"
],
"integer": "0"
},
{
"key": [
"kind",
"needs-shine",
"url"
],
"string": [
"full-size-image",
"%s"
],
"true": null
}
]
},
"dict": {
"key": [
"bundle-identifier",
"bundle-version",
"kind",
"title"
],
"string": [
"%s",
"%s",
"software",
"%s"
]
}
}
}
}
}
}
""" % (bin_url, img_url, img_url, bundle_id, bundle_version, name)
return xmltodict.unparse(json.loads(ios_plist_tem),pretty=True)
def make_resigned(bin_url,img_url,bundle_id,app_version,name):
ios_plist_tem = """<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0"><dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string><![CDATA[%s]]></string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<integer>0</integer>
<key>url</key>
<string><![CDATA[%s]]></string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string><![CDATA[%s]]></string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>%s</string>
<key>bundle-version</key>
<string><![CDATA[%s]]></string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string><![CDATA[%s]]></string>
</dict>
</dict>
</array>
</dict>
</plist>""" % (bin_url, img_url, img_url, bundle_id, app_version, name)
return ios_plist_tem
def bytes2human(n):
symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')

@ -50,9 +50,9 @@ class DownloadView(APIView):
if release_obj:
storage = Storage(release_obj.app_id.user_id)
bundle_id = release_obj.app_id.bundle_id
bundle_version = release_obj.build_version
app_version = release_obj.app_version
name = release_obj.app_id.name
ios_plist_bytes = make_resigned(storage.get_download_url(filename),storage.get_download_url(release_obj.icon_url),bundle_id,bundle_version,name)
ios_plist_bytes = make_resigned(storage.get_download_url(filename),storage.get_download_url(release_obj.icon_url),bundle_id,app_version,name)
response = FileResponse(ios_plist_bytes)
response['content_type'] = "application/x-plist"
response['Content-Disposition'] = 'attachment; filename=' + make_random_uuid()

Loading…
Cancel
Save