resign.bat:
set curdir=resign
set zipalign=C:\android-sdk\tools\zipalign.exe
set filename=%~n1
set fullpath=%~f1
cd /d %curdir%
rmdir /S /Q unpack
mkdir unpack
cd unpack
copy %fullpath% .\%filename%.apk
REM extract apk file and remove the existing signature
jar xf %filename%.apk
del /F /Q META-INF\CERT.*
del /F /Q %filename%.apk
REM re-create the apk file
jar cf %filename%.apk .
REM add the debug signature and the allias name should be androiddebugkey
jarsigner -verbose -keystore ..\debug.keystore -storepass android -keypass android %filename%.apk androiddebugkey
%zipalign% -v -f 4 %filename%.apk %filename%-signed-aligned.apk