-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfindP3.py
52 lines (39 loc) · 1.17 KB
/
findP3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#coding=utf-8
#description: https://www.jianshu.com/p/7658f8700a1d
#./findP3.py ipa_path
import os,sys
import json
import getpass
ipa = sys.argv[1]
des = './cer.zip'
f_name = os.path.basename(ipa).split(".")[0]
def remove_res():
os.system('rm -r ./Assets.car')
os.system('rm -r ./cer.zip' )
os.system('rm -r ./Payload' )
remove_res()
os.system('rm -r ./Assets.json' )
os.system('cp '+ipa+' ' +des)
os.system('unzip ' +des)
os.chdir('./Payload/'+f_name+'.app')
os.system('cp '+ 'Assets.car' + ' ../../Assets.car' )
os.chdir('../../')
os.system('xcrun --sdk iphoneos assetutil --info ./Assets.car > ./Assets.json')
remove_res()
with open('./Assets.json') as f:
data = json.loads(f.read())
hasError = False
for dict in data:
if dict.has_key('Encoding') :
if dict['Encoding'] == 'ARGB-16':
print 'error pic------------->'+ dict['RenditionName']
hasError = True
if dict.has_key('DisplayGamut'):
if dict['DisplayGamut'] == 'P3':
print 'error pic------------->'+ dict['RenditionName']
hasError = True
if hasError:
os.system('open ./Assets.json' )
else:
os.system('rm -r ./Assets.json')
print '---------没有找到错误图片------\n'*3