Android Question The private key was not properly encrypted or is not a type of key we support.

ArminKh1993

Active Member
Hi
A few minutes ago I created a new sign key using b4a.
Then I went to the Play Store and created and uploaded the zip file according to what you see in the picture.
1616679918696.png


Then I clicked on "Continue" as shown below.
1616679990475.png



But unfortunately it gives the error you see in the image above.
It says: The private key was not properly encrypted or is not a type of key we support.
It's a new key which is created by b4a v10.7
how can i to do?
@MarcoRome are you solved this issue? if yes, how?
thanks in advance
 

MarcoRome

Expert
Licensed User
Longtime User
Create the upload key is: ...--output=encrypted_private_key_path ( you have different thing )
next
First that you click on "Continue" you must on click on "Manage app signing"
etc.
Read carefully.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
I was having the same problem and could not solve it. Am watching this space for resolution

Edit: Creating New key using java keytool and cmd with these parameters will work though

c:\java\jdk-11.0.1\bin\keytool -genkey -v -keystore new-key.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias b4a
 
Upvote 0

ArminKh1993

Active Member
Which other options do you see in addition to "export and upload a key..." ?

1616786712789.png


1616786726491.png


1616786739892.png


1616786750029.png




Option 2 is inactive for me because this is my new developer account and there is not any app in it
It seems option 1,2,5 is not relevant
so it's just 3,4 which we can use
 
Upvote 0

ArminKh1993

Active Member
Use Play App Signing
With Play App Signing, Google manages and protects your app's signing key for you and uses it to sign your APKs for distribution. It’s a secure way to store your app signing key that helps protect you if your key is ever lost or compromised.
 
Upvote 0

ArminKh1993

Active Member
By using opt 1 we have not access to our sign key
so for example if a user install our app from samsung galaxy store then he/she can not to update it from play store
 
Upvote 0

ArminKh1993

Active Member
In that case, use the workaround suggested in post #4: https://www.b4x.com/android/forum/t...t-a-type-of-key-we-support.129071/post-810150

If you encounter issues during compilation then you can use the new #SignKeyAlgorithm to change the algorithm parameter as needed.
Will you make this clearer soon maybe in a tutorial? I mean, we should not use b4a signkey anymore? Will you update b4a? is This a bug? Or what?
As you know this is not my personal issue
i will test it based on post4 and will post result here
thank u
 
Upvote 0

ArminKh1993

Active Member
It seems that the problem is with the sign key that b4a makes. I created a sign key with the code which is exist in post4 and then created and uploaded the zip file according to the instructions given by Google and everything was OK.
If this is a bug in b4a , will you fix it soon? And if not, what is the difference between the key that b4a makes and the key that I made with keytool?
 
Last edited:
Upvote 0

ArminKh1993

Active Member
OK. I think I finally realized what the story is.
From what I understand, the b4a Sign key is not usable for AAB.
So we must create a new sign key using Keytool.
And the important thing that I and maybe other people did not pay attention to is that the zip file, that according to Google's instructions to sign should be created from the new sign key, not the key that we used to sign the APK(made by b4a).

There are currently two ways:
First, erel modifies the key made by b4a and makes it like what Keytool makes.
Second, apart from the b4a key, we can create the signkey ourselves and enter its file as follows.
B4X:
#IF AAB
    #SignKeyFile: ../SignKey/signkey1.jks
    #SignKeyPassword: signkey1
    #SignKeyAlgorithm: -digestalg SHA1 -sigalg SHA256withRSA
    #SignKeyAlias: b4a
#END IF

Note:
Since the Signkey is made by Keytool is compatible with b4a (I tested and the file was loaded) so we can use a key for both apk and aab.
This means that in fact, we have to create the signkey by keytool and enter it into b4a without any conditions like this.
B4X:
#SignKeyFile: ../SignKey/signkey1.jks
#SignKeyPassword: signkey1
#SignKeyAlgorithm: -digestalg SHA1 -sigalg SHA256withRSA
#SignKeyAlias: b4a

@Erel If I have misunderstood something please tell me to correct
And if what I understand is true, tell me so that I can create a separate tutorial for it so that other people do not face the same problem as me.
Or if you are going to solve this problem automatically in b4a, tell us to wait for the new update.

This is what I finally uploaded.
1616836137552.png
 
Last edited:
Upvote 0
Top