I want to get the same functionality in a script I’m writing as re-sign.jar (a simple app that allows you to resign android apps for testing and debugging).
To do this, I’m following the these instructions:
Un-‐zip the apk file
Delete the META-‐INF folder
Re-‐zip the apk file
In Dos prompt /Command prompt
> jarsigner -keystore ~/.android/debug.keystore -storepass android -keypass android ApplicationToTest.apk androiddebugkey
> zipalign 4 ApplicationToTest.apk TempApplicationToTest.apk
Then rename TempApplicationToTest.apk to ApplicationToTest.apk
What kills me is when I get to the ‘jarsigner’ part, I get the error
jarsigner error: java.lang.NullPointerException
I can run the re-signer.jar fine so I don’t think I’m missing anything, and I have all the permissions to boot. Any suggestions?
Well… Figured that out. When I was zipping the file it put contents of the file a directory down. It was returning null because it couldn’t find the app files (manifest and such). I feel dumb.