Android Question SignKey Signature 'Alias' doesn't use value in ...\Basic4android\b4xV5.ini

CStorSupport

Member
Licensed User
Longtime User
B4A 13.0 Beta installed
Android4 and Java folders newly created
Paths configured appropriately
Mainfest edited appropriately
APK sent to friend through email and installs and works.
B4A saved & closed
Edited SignKey settings in C:\Users\[my user name]\AppData\Roaming\Anywhere Software\Basic4android\b4xV5.ini:
SignKeyAlias=Bob
SignKeyFile=
SignKeyPassword=
Loaded same project that was sent to friend
Clicked Tools > Private Sign Key, Create new key was bulleted by default as this is my 1st use
First and last name:---------------Bob Bob
Organization:----------------------Bob
Country (two letters):-------------BO
Password (at least 6 characters):--BoB0BoB0
File:------------------------------C:\B4A\Bob\SignKeyFile\Bob_SignKey.keystore
Signature (read-only):
Create or load a key and reopen this dialog to see the signatures.
Clicked Ok
Logs windows reads:
[IDE message - 1:34:53]​
Keystore was created successfully.​
It is highly recommended to backup this file.​
If this file is lost you will not be able to update your application in Google Play.​
Clicked Tools > Private Sign Key (which now defaults to Load existing key)
First and last name:---------------disabled/grayed out
Organization:----------------------disabled/grayed out
Country (two letters):-------------disabled/grayed out
Password (at least 6 characters):--BoB0BoB0
File:------------------------------C:\B4A\Bob\SignKeyFile\Bob_SignKey.keystore
Signature (read-only):
Alias name: b4a
…​
How can I make the SignKey Signature setting of “Alias name” read “Bob”, as is set in the .ini file?​
 

DonManfred

Expert
Licensed User
Longtime User
Edited SignKey settings in C:\Users\[my user name]\AppData\Roaming\Anywhere Software\Basic4android\b4xV5.ini:
SignKeyAlias=BobSignKeyFile=SignKeyPassword=
sounds wrong

SignKeyAlias, SignKeyFile and SignKeyPassword are commands to use in you mainmodule.
 
Upvote 0

CStorSupport

Member
Licensed User
Longtime User
Erel, thank you for your response.

But in a post titled "Tutorial - How to sign apk with non-B4A keystore", post #9, you said

"Follow these steps:
- Close the IDE
- Go to: C:\Users\<user name>\AppData\Roaming\Anywhere Software\Basic4android
- Open the INI file
- Change the keystore alias (SignKeyAlias property)"

And echoed by MaFu in post #20

I thought it would also be true for keystores created using B4A Private Sign Key tool.
My lack of experience is evident.

Does that only apply to non-B4A keystores?
What is the purpose or under what circumstances does editing the SignKeyAlias property in the .INI file become important/necessary?

What should I do?

------------------

Don, thank you also for your response.

I hadn't got that far yet.

So, I put
#SignKeyAlias: Bob​
in the Project Attributes, at the bottom of that #Region.
Saved my project.
Then I created a new SignKey file
using the same values mentioned in my opening post,
clicked Ok,
opened Private Sign Key again
and in the Signature the Alias still reads b4a.

What should I do?


Again, thank you both for your help.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
putting the #signKeyAlias property in your main module does not change the keystore file, it only applies to the signkey that gets encrypted into your APK...
The alias in the keystore is, I think, not modifiable, if you create your signkey through B4a IDE. That helps you, in a way, to know that that particular key was created using the B4a IDE, and not a third party key creation tool.
The #SignKey properties exist in order for a dev to be able to, imagine, during development, use personal key, but in release, use a definitive key, either his, or the client's, if he develops for someone else.
 
Upvote 0

CStorSupport

Member
Licensed User
Longtime User
Thank you, Cableguy, for your help.

In the post titled "B4A v8.0 has been released!" Erel announces that
  • #SignKeyAlias attribute - Allows overriding the default signing key alias.
In the File > New > Default project I created (above) it 1st tried
#SignKeyAlias: b4a​
in the Project Attributes region and it compiled successfully.

I changed it to
#SignKeyAlias: Bob​
and compiling failed:
Failed to load signer "signer #1": C:\B4A\Bob\SignKeyFile\Bob_SignKey.keystore entry "Bob" does not contain a key​

I can't use the same alias for all clients.
How do I override the default signing key alias that Erel mentioned?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
You need to create a (or several ) new keys, and reference them, in the app attributes... this helps not forgetting to change from debugging keys to release keys, specially when used with the #if debug or #if release functions!
something like:
#if debug
#SignKeyAlias : "use the debug key"
#SignKeyxxxx :
......
#if release
#signKeyAlias : " use the clients sign key"
......
End If
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
How do I override the default signing key alias that Erel mentioned?
also, an Alias is just a replacement name for something that already exists, but that may be too complex to reference... Like our NickNames, that replace our real names...
So an Alias that refences an object that doesnt exists, throws an error
 
Upvote 0

CStorSupport

Member
Licensed User
Longtime User
Thank again Cableguy, and I'm sorry, but I still don't see how I can generate a private sign key per app where each of them has it's own unique alias.

I need to do this:
each app needs
it's own private sign key (I'm doing this successfully)​
and
it's own unique alias (right now, they will only compile with the alias of 'b4a', either in Debug mode or Release mode)​
for placement on Google Play Store.

Is there a tutorial you could point me to?
 
Upvote 0
Top