Page 1 of 2

Free simple tool for creating keystore file

Posted: Wed Nov 16, 2016 10:31 am
by kroka
Hello everybody,

I just built a little tool that might be helpful for beginners - but it can also save time for advanced developers deploying their apps on Android.

"Keymaker" does what its name says: It creates a valid keystore file you need to sign your LiveCode-app with if you want to distribute it through Google PlayStore.

You enter all the data - most important the App Alias Name and the Password (will be used both for keystore and private) and the personal data. The tool will save your personal data so it appears automatically next time you use it. All you need to fill in then is alias name and password. After klick on "Generate keystore file" you can save the file wherever you like and use it to sign your LiveCode app with.

No more searching for the complex keytool-command, entering it in the console, going through the prompts and so on. This can save time and pain each time you create an Android app.

Image

Of course it is required to have JDK and Android SDK installed beforehand.

It's still kind of beta but it works for me.

http://www.fehr-media.de/downloads/Keymaker_Windows.zip

http://www.fehr-media.de/downloads/Keymaker_Mac.zip

Try it out if you like - any feedback welcome!

Regards

Kroka

Re: Simple tool for creating keystore file

Posted: Wed Nov 16, 2016 5:48 pm
by jacque
What a good idea. Wish I'd thought of that. Thanks!

Re: Free simple tool for creating keystore file

Posted: Thu Nov 17, 2016 7:33 pm
by Ledigimate
Thank you, Kroka!

I'm just curious, though... Does Google Play Store really accept apps signed with a self-signed key instead of one issued by a Certificate Authority?

Re: Free simple tool for creating keystore file

Posted: Thu Nov 17, 2016 7:35 pm
by kroka
Simple answer: Yes.

Re: Free simple tool for creating keystore file

Posted: Fri Dec 30, 2016 1:03 pm
by AxWald
Hi,

for some strange reasons it creates a 0-Byte file "releasekey.keystore" here, which, when used to sign a StandAlone-to-be, results in an error:

There was an error saving the standalone application
signing failed - keystore load: null


Tested on 2 Machines running Win 10-64,
LC (community) 6.7.10 or 9.0 dp3,
JDK 1.8.0_91 or _92,
compiling for Android 4.0 IceCream Sandwich.

Compiling with "Sign for development only" results in functional apk's.

Any idea what's wrong here with this otherwise great & promising tool?

Have fun!

Re: Free simple tool for creating keystore file

Posted: Fri Dec 30, 2016 1:28 pm
by kroka
It's working fine for me and for some others who reported using it.

If it is creating a 0-byte-file, it means the app hasn't found the keytool.exe - are you sure you have installed the Android SDK (and the JDK) properly?

Kroka

Re: Free simple tool for creating keystore file

Posted: Fri Dec 30, 2016 5:31 pm
by AxWald
Hi,

thx for the quick reply!
Well, just updated Android Studio (2.2.3 now), was quite old ;-)
Updated to JDK 8u112 too, seems I missed some in between ...

No difference - 0-Byte file as result. Livecode compiles the StandAlone (dev_signed) happily, and it runs on my tablet. Ah, forgot to mention that I'm actually compiling for 4.0.3, API 15.

To make sure all is OK on my machine I created a cert by hand:

Code: Select all

C:\Program Files\Java\jdk1.8.0_112\bin>keytool.exe -genkey -v -keystore release.keystore -alias MyAppName -keyalg RSA -keysize 2048 -validity 10000
Keystore-Kennwort eingeben:
Neues Kennwort erneut eingeben:
Wie lautet Ihr Vor- und Nachname?
  [Unknown]:  My Name
Wie lautet der Name Ihrer organisatorischen Einheit?
  [Unknown]:  CEO
Wie lautet der Name Ihrer Organisation?
  [Unknown]:  AWC
Wie lautet der Name Ihrer Stadt oder Gemeinde?
  [Unknown]:  Munich
Wie lautet der Name Ihres Bundeslands?
  [Unknown]:  Bavaria
Wie lautet der Ländercode (zwei Buchstaben) für diese Einheit?
  [Unknown]:  DE
Ist CN=My Name, OU=CEO, O=AWC, L=Munich, ST=Bavaria, C=DE richtig?
  [Nein]:  Ja

Generieren von Schlüsselpaar (Typ RSA, 2.048 Bit) und selbst signiertem Zertifikat (SHA256withRSA) mit einer Gültigkeit von 10.000 Tagen
        für: CN=My Name, OU=CEO, O=AWC, L=Munich, ST=Bavaria, C=DE
Schlüsselkennwort für <MyAppName> eingeben
        (RETURN, wenn identisch mit Keystore-Kennwort):
[release.keystore wird gesichert]
And - it works :)

Assume there's a new quirk somewhere in the communication, thus I added the whole cmd line junk (only minimally altered). May it be of help to you :)

Have a good time, und einen guten Rutsch!

Re: Free simple tool for creating keystore file

Posted: Fri Dec 30, 2016 6:49 pm
by kroka
I'll have another look at the tool. Maybe the regkey I am using to locate the keytool.exe isn't working for your version. Thank you for the report - so I can fix the problem.

Und wenn schon auf Deutsch, dann...

Schau gerne mal bei livecode-blog.de rein! :-)

Viele Grüße - und ein gutes Neues Jahr!

Kroka

Re: Free simple tool for creating keystore file (EDITED)

Posted: Tue Feb 11, 2020 10:50 pm
by simon.schvartzman
Hi guys, in spite the fact that this is a relatively old thread may be @kroka and/or @AxWald are still reading the forum.

I have been using this extremely helpful tool but suddenly it is failing to generate the file exactly the same as reported by @AxWald. I wonder if a solution was ever found to the problem...

Otherwise does any one have an alternative to advice?

Many thanks in advance

Regards

EDIT: it seems the tool has some difficulties handling passwords with too many special characters (like $!@). Once I choose a PW with just letters and numbers everything worked fine.

Re: Free simple tool for creating keystore file

Posted: Thu Feb 13, 2020 8:25 pm
by AxWald
Hi,

I never got it to work. Unfortunately it's a SA so I cannot debug it, additionally.
Though I remembered that once I had collected all the information about keys, and even started a stack for myself.

So I searched, found and finalized my own Keystore generator - it's, after all, nothing more than a few parameter collected in a GUI & thrown at a shell, using 'keytool.exe' from the android package.
I need some more time for testing (first APK signed already) & GUI scrubbing, then I'll post it here.

Quick Info: To do it the hard way, open a shell & go to the directory where your '.keystore' shall be created. Then run this:

Code: Select all

"[F:\Trash can\jdk1.8.0_824]\bin\keytool.exe" -genkeypair -keystore [yourAppAlias].keystore -storepass [yourPassword] -keypass [yourPassword] -dname "CN=[Your Name], OU=[yourOrgaUnit], O=[yourOrga], L=[yourCity],S=[yourState], C=[yourCountryCode]" -alias [yourAppAlias] -keyalg RSA -keysize 2048 -validity 100000
Replace anything in (and including) square brackets with the correct values. This makes a certificate valid for 100000 days (last value). For non-Win systems you'll want to replace the complete FilePath of the keytool.exe (at the beginning).

Have fun!

Re: Free simple tool for creating keystore file

Posted: Thu Feb 13, 2020 8:33 pm
by simon.schvartzman
Hi many thanks for replying but after all I got the original tool working
EDIT: it seems the tool has some difficulties handling passwords with too many special characters (like $!@). Once I choose a PW with just letters and numbers everything worked fine.
Cheers!

Re: Free simple tool for creating keystore file

Posted: Fri Feb 14, 2020 5:37 pm
by AxWald
Hi Simon,

I read it. Nevertheless I decided to finish mine, and there's a reason:

We're in quite sensitive area here - we're generating certificates that should provide security to the users of our software. Using a closed source tool (that, above all, contains a tsNet lib ...) doesn't look, IMHO, like the proper way to do it. Especially if it is just a wrapper for a shell command.
Thus I want another solution.

The attached stack here works for Windows. There's no plan to make versions for Linux (my Mint doesn't work with Android SDK ...) and Mac (I don't code for muggers*), but the code is open & GPL, so whoever wants should have no problem. At least this shows how it is done. There's Help ("?") and Info ("i") included, it gives more explanations.

Have fun!
awa_KeyMaker.zip
Quick & Dirty Windows stack for Android KeyStore Creation
(10.14 KiB) Downloaded 387 times
*) This doesn't mean the users. It means the company telling me:
"If you want to write software for our platforms, you must shell out heavy $$$ 'cause we don't allow you to use other equipment. And you must shell out more $$$ annually, else we don't allow you the use of our required SDK. And last, you must give us near a third of all your earnings! HarHar!"
Muggers. That they don't ask for my firstborn - maybe they shy the feeding costs ...

Re: Free simple tool for creating keystore file

Posted: Thu Sep 23, 2021 8:41 pm
by simon.schvartzman
Dear @AxWald I have been using your really helpful Key Generator since I uploaded my first version to Google Play.

Unfortunately today when I tried to use it again with my upgraded Mac running Big Sur I get the following error
Screen Shot 2021-09-23 at 16.38.42.png
Screen Shot 2021-09-23 at 16.38.42.png (25.55 KiB) Viewed 14159 times
Could you please fix it? Or maybe give some hints how to overcome the issue.

Your app is really of great help and it would be a pity not being able to use it anymore.

Many thanks in advance

Re: Free simple tool for creating keystore file

Posted: Thu Sep 23, 2021 9:31 pm
by AxWald
Hi,

my KeyMaker is targeted for Windows, and the classic Android SDK tools. It searches for an installed Oracle Java 8 using Win paths, uses backslashes all over the place, and, finally, tries to interpret a Win shell reply. In the code, it doesn't do much but creating a long shell command like this:

Code: Select all

"[F:\Trash can\jdk1.8.0_824]\bin\keytool.exe" -genkeypair -keystore [yourApp].keystore -storepass [yourPassword] -keypass [yourPassword] -dname "CN=[Your Name], OU=[yourOrgaUnit], O=[yourOrga], L=[yourCity],S=[yourState], C=[yourCC]" -alias [yourApp] -keyalg RSA -keysize 2048 -validity 100000
This is what's thrown to the shell. Look at the code, it's extensively commented.

No idea what's required to do this on a Mac, sry.

Have fun!

Re: Free simple tool for creating keystore file

Posted: Thu Sep 23, 2021 10:27 pm
by simon.schvartzman
@AxWald I'm sorry I thought I was writing to the author of the original post in the chain, @kroka

Hopefully he is reading the thread as well..

Anyway many thanks for your reply