Simply put this script into a folder with your unsigned apk and release key file and double click the icon to sign your unsigned android apk file with your own release key.
It just saves having to keep typing commands into a dos prompt if you use a different key to the debug or B4A generated one and hopefully it will be of use to someone else too.
All it does is
1. Ask you for the name of the unsigned apk (eg temp.ap_)
2. Sign the apk file with the release key
3. Verify the file is signed
Simply save the attached txt file with a .bat extension or copy the following code into notepad and save as signapk.bat
Dave
It just saves having to keep typing commands into a dos prompt if you use a different key to the debug or B4A generated one and hopefully it will be of use to someone else too.
All it does is
1. Ask you for the name of the unsigned apk (eg temp.ap_)
2. Sign the apk file with the release key
3. Verify the file is signed
Simply save the attached txt file with a .bat extension or copy the following code into notepad and save as signapk.bat
B4X:
@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
Dave