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