@@ -36,6 +36,10 @@ def main(name, argv):
36
36
37
37
38
38
build_output_path = './app/build/outputs/apk'
39
+ # Create folder for saving build artifacts
40
+ artifacts_path = './builds'
41
+ if not os .path .exists (artifacts_path ):
42
+ os .makedirs (artifacts_path )
39
43
40
44
# Sign APKs
41
45
for apk in glob .glob (build_output_path + "/*/*/*-unsigned.apk" ):
@@ -50,24 +54,10 @@ def main(name, argv):
50
54
"-o" , target ,
51
55
"-H" , "Authorization: " + token ,
52
56
sign_url ])
53
-
54
- # Run zipalign
55
- for apk in glob .glob (build_output_path + "/*/*/*-signed.apk" ):
56
- split = os .path .splitext (apk )
57
- print subprocess .check_output (["zipalign" , "-f" , "-v" , "-p" , "4" , apk , split [0 ] + "-aligned" + split [1 ]])
58
-
59
- # Create folder for saving build artifacts
60
- artifacts_path = './builds'
61
- if not os .path .exists (artifacts_path ):
62
- os .makedirs (artifacts_path )
63
-
64
- # Verify signature and move APK to artifact path
65
- for apk in glob .glob (build_output_path + "/*/*/*-signed-*.apk" ):
66
- print "Verifying" , apk
67
- print subprocess .check_output (['apksigner' , 'verify' , apk ])
68
-
69
- print "Archiving" , apk
70
- os .rename (apk , artifacts_path + "/" + os .path .basename (apk ))
57
+ print "Verifying" , target
58
+ print subprocess .check_output (['apksigner' , 'verify' , target ])
59
+ print "Archiving" , target
60
+ os .rename (target , artifacts_path + "/" + os .path .basename (target ))
71
61
72
62
if __name__ == "__main__" :
73
63
main (sys .argv [0 ], sys .argv [1 :])
0 commit comments