Skip to content

Instantly share code, notes, and snippets.

@junaidk
Created December 26, 2014 14:12
Show Gist options
  • Select an option

  • Save junaidk/5d7f3ca2b7a93de15b87 to your computer and use it in GitHub Desktop.

Select an option

Save junaidk/5d7f3ca2b7a93de15b87 to your computer and use it in GitHub Desktop.
Sign and align multiple unaligned apks
# java and sdk tools should be on system path
# it needs zipalign and jarsigner tools
# http://developer.android.com/tools/publishing/app-signing.html
from subprocess import call
keyPass = ""
storepass = ""
alias = ""
keyStorePath = ""
ins = open( "apksList.txt", "r" )
array = []
for line in ins:
line = line.strip()
array.append( line )
print("starting => " + line )
call("jarsigner -verbose -keystore " +keyStorePath+ " -storepass "+storepass+" -keypass " +keypass +" "+line +" "+alias)
print("====== ending =====")
ins.close()
print("### signing")
for line in array:
line = line.strip()
print("starting => " + line )
call("zipalign -v 4 " + line + " signed/" +line)
print("====== ending =====")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment