[GUIDE] Signing and zipaligning your app

Search This thread

seen_bawl

Senior Member
Sep 21, 2012
192
16
can you please help me i use a website to make an app and i got this problem when i try to upload the file to play store i have the apk file and i have android studio can you please tell me how to import the apk file inside the android studio and make the zipaligning the app thank you
 

nikwen

Senior Member
Feb 1, 2013
3,142
1,597
Berlin, Germany
www.nikwen.de
can you please help me i use a website to make an app and i got this problem when i try to upload the file to play store i have the apk file and i have android studio can you please tell me how to import the apk file inside the android studio and make the zipaligning the app thank you

You can do the following to sign an already existing APK: https://developer.android.com/tools/publishing/app-signing.html#signing-manually
It's not supported by Android Studio.
 
  • Like
Reactions: seen_bawl

seen_bawl

Senior Member
Sep 21, 2012
192
16
You can do the following to sign an already existing APK: https://developer.android.com/tools/publishing/app-signing.html#signing-manually
It's not supported by Android Studio.

thank you i already did the step and it work but still cannot upload the file because i got another error tell now im still looking i didnt find any easyway to do by using dos command


Upload failed
You uploaded an APK that is signed with a restricted certificate. You need to upload an APK signed with your own certificate.

Upload another APK
 

seen_bawl

Senior Member
Sep 21, 2012
192
16
after 8 hours trying my result is

Upload failed
You uploaded an APK signed with a certificate that is not yet valid. You need to sign your APK with a certificate that is currently valid. Learn more about signing.
Your APK has been signed with multiple certificates. Please only sign it with one certificate and upload it again.
:((
 

nikwen

Senior Member
Feb 1, 2013
3,142
1,597
Berlin, Germany
www.nikwen.de
after 8 hours trying my result is

Upload failed
You uploaded an APK signed with a certificate that is not yet valid. You need to sign your APK with a certificate that is currently valid. Learn more about signing.
Your APK has been signed with multiple certificates. Please only sign it with one certificate and upload it again.
:((

So you want to take another developer's apk and sign it with your own key? That's not possible, and there's a reason for that.
 

seen_bawl

Senior Member
Sep 21, 2012
192
16
So you want to take another developer's apk and sign it with your own key? That's not possible, and there's a reason for that.

no i dont have another person apk i made this apk using this site
http://www.appsgeyser.com/create/start/

all what the apk have is my work website when you click on it it take you to the web page

im trying to upload the apk to play store app
but i keep getting erros

---------- Post added at 11:12 PM ---------- Previous post was at 11:06 PM ----------

this is the command i use at the begin
keytool -genkey -v -keystore my-key.keystore -alias company-keyalg RSA -keysize 2048 -validity 10000

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-key.keystore my_application.apk company

jarsigner -verify -verbose -certs mycompanyweb.apk

Zipalign -f -v 4 mycompanyweb.apk mycompanyweb.apk

after i inter this command
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-key.keystore my_application.apk company
i get this
No -tsa or -tsacert is provided and this jar is not timestamped.
Without a timestamp, users may not be able to validate this jar after the signer certificate's
expiration date (2042-07-02) or after any future revocation date.
 

nikwen

Senior Member
Feb 1, 2013
3,142
1,597
Berlin, Germany
www.nikwen.de
no i dont have another person apk i made this apk using this site
http://www.appsgeyser.com/create/start/

all what the apk have is my work website when you click on it it take you to the web page

im trying to upload the apk to play store app
but i keep getting erros

---------- Post added at 11:12 PM ---------- Previous post was at 11:06 PM ----------

this is the command i use at the begin


after i inter this command
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-key.keystore my_application.apk company
i get this
No -tsa or -tsacert is provided and this jar is not timestamped.
Without a timestamp, users may not be able to validate this jar after the signer certificate's
expiration date (2042-07-02) or after any future revocation date
.

Have you tried contacting the owners of the site? They should know how to upload the apks their site produces to Google Play.

Otherwise, did you set an expiration date for your certificate? That's needed as far as I know.
 

seen_bawl

Senior Member
Sep 21, 2012
192
16
i contact them they never answer me back
so right now im gonna do the same apk file using android studio a little hard but im sure it well not have any problems when i try to upload it
thanks for trying to help me ill add my result here after i done
 

johnread2

New member
May 21, 2015
1
1
This is my tutorial on how to sign and zipalign apps for publishing:

If you run an app in Eclipse or Android Studio, it is signed with a standard debug certificate. This is perfect for testing. However, do never release an app signed with the standard debug certificate. Users will be able to install the app for just 365 days and people can easily decompile your apk.
Signing is an easy way of preventing this and to identify the developer. You will not be able to upload an apk signed with the Eclipse or Android Studio debug certificate to Google Play.
Signing means creating a keystore which is a container for your keys. Then you will create a key and sign your application with that.

You will also need to zipalign your app. This optimizes the apk in some ways.

These two things can be done using Eclipse and its export wizard or Android Studio. This will sign and zipalign your app:

Eclipse:

1) Develop your app. ;)

2) Open the project in Eclipse and select Files -> Export.

4) Select "Android" -> "Export Android Application":

picture.php


5) Choose the project you want to export:

picture.php


6) Select "Create a new keystore". Enter the location of the keystore and the password and confirm it:


picture.php


7) Enter the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

picture.php


8) Select the destination to which the apk should be exported:

picture.php


9) Click finish.

10) You are done! :good: :D


Android Studio:

1) Develop your app. ;)

2) Open the project in Android Studio and select Build -> Generate Signed APK...

3) Enter the path of the keystore and hit Create new... :

picture.php


4) Enter the password for the keystore, the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

picture.php


5) The form will be filled out automatically:

picture.php


6) Select the destination to which the apk should be exported:

picture.php


7) Click finish.

picture.php


8) You are done! :good: :D

Some tips:

  • Keep your keystore at a secure location and do not tell anybody else the passwords. If they knew the password, they would be able to decompile your apk and sign it with your certificate. Everybody would think that you are the developer. So keep your key secure. ;)
  • Sign all of your apps with one certificate. It will be used to identify you. You will need it for some features like two applications sharing one Dalvik VM or a data directory.
  • Remember: You will not be able to change the certificate after releasing it through Google Play once.

Happy coding! ;)

This was featured on the XDA portal on April 28, 2013. :D


I am an iphone app developer, Thanks for publishing this informative guide publicly
 
  • Like
Reactions: abhishekraval

00various

Member
Mar 7, 2014
8
0
You maybe forget to tell us how to zipalign apps. Could you add?

从我的 Moto G 2014 LTE 上通过 xda Forums PRO 发送
 

md.sazidul islam

New member
Mar 10, 2017
1
0
This is my tutorial on how to sign and zipalign apps for publishing:

If you run an app in Eclipse or Android Studio, it is signed with a standard debug certificate. This is perfect for testing. However, do never release an app signed with the standard debug certificate. Users will be able to install the app for just 365 days and people can easily decompile your apk.
Signing is an easy way of preventing this and to identify the developer. You will not be able to upload an apk signed with the Eclipse or Android Studio debug certificate to Google Play.
Signing means creating a keystore which is a container for your keys. Then you will create a key and sign your application with that.

You will also need to zipalign your app. This optimizes the apk in some ways.

These two things can be done using Eclipse and its export wizard or Android Studio. This will sign and zipalign your app:

Eclipse:

1) Develop your app. ;)

2) Open the project in Eclipse and select Files -> Export.

4) Select "Android" -> "Export Android Application":

picture.php


5) Choose the project you want to export:

picture.php


6) Select "Create a new keystore". Enter the location of the keystore and the password and confirm it:


picture.php


7) Enter the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

picture.php


8) Select the destination to which the apk should be exported:

picture.php


9) Click finish.

10) You are done! :good: :D


Android Studio:

1) Develop your app. ;)

2) Open the project in Android Studio and select Build -> Generate Signed APK...

3) Enter the path of the keystore and hit Create new... :

picture.php


4) Enter the password for the keystore, the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

picture.php


5) The form will be filled out automatically:

picture.php


6) Select the destination to which the apk should be exported:

picture.php


7) Click finish.

picture.php


8) You are done! :good: :D

Some tips:

  • Keep your keystore at a secure location and do not tell anybody else the passwords. If they knew the password, they would be able to decompile your apk and sign it with your certificate. Everybody would think that you are the developer. So keep your key secure. ;)
  • Sign all of your apps with one certificate. It will be used to identify you. You will need it for some features like two applications sharing one Dalvik VM or a data directory.
  • Remember: You will not be able to change the certificate after releasing it through Google Play once.

Happy coding! ;)

This was featured on the XDA portal on April 28, 2013. :D

Otg

Sent from my Lenovo A6000 using XDA Free mobile app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    This is my tutorial on how to sign and zipalign apps for publishing:

    If you run an app in Eclipse or Android Studio, it is signed with a standard debug certificate. This is perfect for testing. However, do never release an app signed with the standard debug certificate. Users will be able to install the app for just 365 days and people can easily decompile your apk.
    Signing is an easy way of preventing this and to identify the developer. You will not be able to upload an apk signed with the Eclipse or Android Studio debug certificate to Google Play.
    Signing means creating a keystore which is a container for your keys. Then you will create a key and sign your application with that.

    You will also need to zipalign your app. This optimizes the apk in some ways.

    These two things can be done using Eclipse and its export wizard or Android Studio. This will sign and zipalign your app:

    Eclipse:

    1) Develop your app. ;)

    2) Open the project in Eclipse and select Files -> Export.

    4) Select "Android" -> "Export Android Application":

    picture.php


    5) Choose the project you want to export:

    picture.php


    6) Select "Create a new keystore". Enter the location of the keystore and the password and confirm it:


    picture.php


    7) Enter the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

    picture.php


    8) Select the destination to which the apk should be exported:

    picture.php


    9) Click finish.

    10) You are done! :good: :D


    Android Studio:

    1) Develop your app. ;)

    2) Open the project in Android Studio and select Build -> Generate Signed APK...

    3) Enter the path of the keystore and hit Create new... :

    picture.php


    4) Enter the password for the keystore, the name for the key, a password for the key, your name and the validity (the period of time users will be able to install your app for):

    picture.php


    5) The form will be filled out automatically:

    picture.php


    6) Select the destination to which the apk should be exported:

    picture.php


    7) Click finish.

    picture.php


    8) You are done! :good: :D

    Some tips:

    • Keep your keystore at a secure location and do not tell anybody else the passwords. If they knew the password, they would be able to decompile your apk and sign it with your certificate. Everybody would think that you are the developer. So keep your key secure. ;)
    • Sign all of your apps with one certificate. It will be used to identify you. You will need it for some features like two applications sharing one Dalvik VM or a data directory.
    • Remember: You will not be able to change the certificate after releasing it through Google Play once.

    Happy coding! ;)

    This was featured on the XDA portal on April 28, 2013. :D
    2
    Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Cool

    You are welcome. ;)
    2
    nice man i was luking for a guide lyk this....
    im a beginner
    cud u tell me more about keystore ...lyk how to male or get one ??

    Sent from my GT-S5360 using xda app-developers app

    What? This is a guide about making one, what else would you want? Also: it needs to stay secure, what's the point in mailing one?
    1
    Where is the zipaligning part?

    I think that's included when you export it.
    Never had to do it myself, nor have I heard of having to do so.


    okay got it...

    newbie to apps .... :D

    No problems, glad to help and have fun making apps :).

    Sent from my GT-I9300 using Tapatalk 2
    1
    What? This is a guide about making one, what else would you want? Also: it needs to stay secure, what's the point in mailing one?

    If someone else has your key and the password, he will be able to sign his apps with your key. Everyone will think that it is your app. If there is malicious code, you will be responsible for it unless you can prove that it is not created by you.
    If someone has just the password, he will be able to decompile your apps.

    And for mailing: It is a security risk because somebody could hack your or the other one's account.

    So keep your keys and passwords secure. ;)

    Btw, thank you for helping the others when I was not at home. :good: