account arrowhead-down arrowhead-up mobile-menu search sm-bold-x x-skinny-rounded x-skinny arrowhead-right social-facebook social-googleplus social-instagram social-linkedin social-pinterest social-qzone social-renren social-tencent social-twitter social-vkontakt social-weibo social-youku social-youtube

Please help us improve our website

Take our customer survey to evaluate your visit.

It should only take a few minutes to answer five quick questions. Just click the Launch survey button at the end of your visit to begin.

cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the Theme Creator forum. 

If you have a question, search the forum to see if the answer is already available, or post your question or comment in a new thread.

How do I add certificate to my unsigned APK file/xperia theme?

Apprentice
Message 1 of 10
3,901 Views
Message 1 of 10

How do I add certificate to my unsigned APK file/xperia theme?

I've spent days going over countless tutorials and google searches. I am so very lost and getting worse.

I feel like i've been given steps 1 and 3 and someone forgot to explain step 2 to me.

 

How do I open up the APK file using Android Studio? 

 

I've tried dragging and dropping the unsigned apk file to an empty project on android studio, then changing the debug to release and then going straight to generating a certificate with an apk.

 

However, the apk produced with this format is only 900kb and has almost nothing on there, so I know I'm doing something wrong.

 

I then tried decompressing the apk file into sections and trying the above again, still a failure, am i not selecting or highlighting certain things?

 

Someone please help me get from A-unsigned apk, to B-opening it in android studio, then to C-adding certificate.

 

Please, if there is any way you can help me understand I would appreicate it.

 

EDIT: AHHH... it submitted twice, sorry everyone.

9 REPLIES 9
Highlighted
Inhabitant
Message 2 of 10
3,868 Views
Message 2 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Hi HolyItsaRaccoon!

 

The part of preparing a theme for publishing on Google Play by signing the apk, contains steps using the command line on your computer.

 

Here is a link that is more specific to the procedure which I hope will guide you more; Signing Your App Manually:

http://developer.android.com/tools/publishing/app-signing.html#signing-manually

 

After having followed those steps, you will have an APK that you can use for publishing, for instance on Google Play.

 

If you have problems with the procedure, please note which step is causing issues and we can take it from there.

sony_sign_logo.png - Developer World Support


If you're new to our forums make sure that you have read our discussion guidelines.
For general information on how to get in contact with us please visit our contact page.

Apprentice
Message 3 of 10
3,860 Views
Message 3 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Okay.

 

I've gotten futher but now I've hit a snag.

 

keytool -genkey -v -keystore my-release-key.keystore -alias racoon -keyalg RSA -keysize 2048 -validity 10000

WORKS (along with hitting RETURN to have the same password)

 

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore holyitsaraccoon-lovecats.apk raccoon

FAILS

jarsigner: Certificate chain not found for: raccoon. raccoon must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.

 

So I tried this:

jarsigner -verbose my-release-key.keystore -signedjar holyitsaraccoon-lovecats.apk raccoon

FAILS-

jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore for
mat

 

I'm using C:\Program Files\Java\jdk1.8.0_40\bin> in Command Prompt

 

I could cry...

 

EDIT: Sorry, i actually managed to produce two different errors.

 

EDIT: Part 2: tried getting JDK 6.0 in case this was the issue, no dice, same problem

Inhabitant
Message 4 of 10
3,849 Views
Message 4 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Hi again HolyItsaRaccoon!

 

I noticed that you had a difference between the first and second command that could be causing issues.

In the first command you provide an alias as racoon (highlighted in bold below):

 

keytool -genkey -v -keystore my-release-key.keystore -alias racoon -keyalg RSA -keysize 2048 -validity 10000

 

In the second command you provide the alias raccoon (highlighted in bold below):

 

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore holyitsaraccoon-lovecats.apk raccoon

 

My suggestion would be to try and run the second command as you have been doing, but instead of raccoon, you provide racoon with just a single c.

 

See if this makes it work out for you, and if you still hit issues please keep including the errors you are getting as it makes it easier for me to troubleshoot.

sony_sign_logo.png - Developer World Support


If you're new to our forums make sure that you have read our discussion guidelines.
For general information on how to get in contact with us please visit our contact page.

Apprentice
Message 5 of 10
3,842 Views
Message 5 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Hello, and thankyou!

 

Never try to learn and attempt code while suffering from sleep deprivation huh?

 

I wish it was smooth sailing after that, but as it turned out none of my java folders included zipalign so I got the dreaded command not found error, so managed to download zipalign.exe along with mgwz.dll from somewhere else and place them into the java bin folder my key and apk was in and it worked.

 

Did this all with java 6 because I heard stories of the others and got paranoid.

 

It loaded just fine into the Google Play Developer Console, but haven't 100% tested it out yet.

 

Thought I'd add the above in case anyone else hit the same snags as I did.

 

Thanks again.

One time poster
Message 6 of 10
3,623 Views
Message 6 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Hi,

 

 

I have used the Theme Creator Beta to create a theme for the Xperia phone. I get an unsigned apk. file, which I then manually sign and align using jarsigner and zipalign in the command prompt. Everything seems to go successfully, however when I try to upload the signed apk. file to the play store I get this error:

Upload failed Your APK cannot be analyzed using aapt. Error output: Failed to run aapt dump badging: ERROR getting 'android:versionName' attribute: attribute is not a string value

I am totally lost now, I have tried almost everything, uninstalled and reinstalled stuff. I have absolutely no idea how to fix this as the apk file is generated by the Theme Creator.

Apprentice
Message 7 of 10
3,607 Views
Message 7 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Hello
I'm theme creator. It is not good idea to signed app manually. Why?
First you can't update theme in future.
Second some features you see only in Android Studio software.
You will not see it in theme creator.
Apprentice
Message 8 of 10
3,596 Views
Message 8 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

Last can't copy ready app to Android Studio.
It's only my opinion Slightly smiling Face Good luck Themes
Visitor
Message 9 of 10
3,516 Views
Message 9 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

I am getting the same error. What do I do?

Regular
Message 10 of 10
3,486 Views
Message 10 of 10

Re: How do I add certificate to my unsigned APK file/xperia theme?

I want to sign my theme's apk using Android Studio. But how do I import/open an apk in Android Studio?

Theme creator does not create a project file readable by Android Studio. What are we supposed to do?