androidcordovajarzipalignsigned-apk

Generated signed Android APK (Cordova)


I am trying to build a signed apk for Android platform using cordova. I have already created unsigned apk using cordova --release android. But i am unable to sign usejarsigner and zipalign. kindly help.


Solution

  • I have already solved my problem. I am explaining its steps for the people who are still stuck in it:

    1. Create a unsigned apk. Run this command cordova --release android after getting to the location of the project.

    2. You can find the unsigned apk in project_name\platforms\android\build\outputs\apk\android-release-unsigned.apk

    3. Copy this apk and keystore tool in one folder. Navigate to the folder and sign it using jarsigner present in java. Run this command, jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystorename <Unsigned APK file> <Keystore Alias name>

    4. After this you will be prompt to enter password of keystore.

    5. Go to location of zipalign. (it is present in Android\SDK\build-tools\version)

    6. Run this command zipalign -v 4 "location of signed apk" "location of aligned apk"