Talk:Build D for Android

From D Wiki
Revision as of 12:50, 16 October 2020 by Little Wally (talk | contribs) (Youtube NDK presentations)
Jump to: navigation, search

Creating a keystore for signing APKs

It's actually possible to create a keystore using the 'keytool' utility shipped with the Oracle JRE:

keytool -genkeypair -validity 365 -keystore -keyalg RSA -keysize 2048

This will create a keystore in the file called '', which can then be used with apksigner to sign an APK:

apksigner sign --ks myapp.unaligned.apk

(This step has to be done before the APK is aligned, otherwise it may break the alignment.)

If you set a password during the creation step, you can put the password in a file and specify it as argument to the 'apksigner' command:

apksigner sign --ks-pass file:mypasswordfile --ks myapp.unaligned.apk

I've successfully used this method to create and sign an APK without using Android Studio. However, I'm not sure whether keytool is available on Android. You may have to generate the keystore on a PC and copy it over to Android if you're compiling natively.—Quickfur (talk) 04:00, 20 October 2018 (UTC)

P.S. Correction: 'keytool' is actually part of the JDK, not the JRE.—Quickfur (talk) 04:07, 20 October 2018 (UTC)

Slightly useful

I found this series of youtube presentations slightly useful:

Not exactly recent, older Eclipse-based IDE, but it gives you more than just a gist of what you need to know.