@echo off
Title Sign an unsigned apk
set OLDDIR=%CD%
cls
echo.
echo You will need to copy your keystore file
echo eg. my-release-key.keystore
echo into the same folder as this script.
echo.
echo Please place your unsigned app in the same
echo directory as this program, when you have
echo done this please type in its name below:
echo.
echo.
set /p apk= What is the filename (including the .apk at the end)?
echo Your app is named %apk%
echo.
echo.
echo while creating your Private Key, what did you put as your ALIASNAME?
set /p alias= Aliasname
echo.
echo Is the Java JDK in your path?
echo if you do not know what this means, please type "N"
CHOICE /C:YN /M "Java JDK in path?"
If errorlevel 2 goto nojdk
If errorlevel 1 goto jdk
:nojdk
echo.
echo.
echo It is recommended that you put the jdk in your path
echo To see how please visit this web page:
echo http://www.oracle.com/technetwork/java/javase/documentation/install-windows-152927.html
echo.
echo.
pause
cls
echo.
echo.
:jdk
echo ok, you will need to type in your password when prompted
jarsigner.exe -verbose -keystore my-release-key.keystore %apk% %alias%
echo.
echo.
echo Checking it is signed correctly
jarsigner -verify %apk%
echo.
echo If you got an error you probably
echo compiled your apk with a key
echo (probably the debug key).
echo Try recompiling it without signing
echo and then copy and paste the
echo resulting temp.ap_ file here.
echo.
echo.
Pause