I compiled successful project HTML5 to Android by Cordova, it produced some files as HelloWorld-debug.apk, HelloWorld-debug-unaligned.apk ...
Really I don't know meaning of debug, unaligned, I want upload file apk to Android market, this files met enough requirements of Google?
the -debug apk is you app unsigned with debug info. It can be installed on your device. (need to allow installation of unknown apps)
If you want to have a release app you need to run
platforms\android\cordova\build.bat --release
(replace \ with / and remove .bat for unix based computers)
and then to sign the app :
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore pathtoyourkeystorefile.keystore platforms\android\bin\yourapp-release-unsigned.apk nameofthekeyinkeystore
replace pathtoyourkeystorefile.keystore with the path to your previously created keystore file, yourapp with the name of your app and nameofthekeyinkeystore with the name of your key in the keystore
and then your file will still be named -release-unsigned.apk so you can rename it to -release-signed.apk or just .apk and it will be ready to be uploaded to the store.
Related
I just wanted to upload my app on xiaomi app store and steps to create a signature build is not clear on develop dashboard there.
I googled but couldn't fine anything useful, can someone please help me to find any doc or steps I need to follow in order to create a xiaomi app store compatible apk file.
Following are the steps to get the signature from MI dev website.
1.jarsigner signature method
You can use the jarsigner tool that comes with the JDK to complete the signing. The command format of the jarsigner tool is as follows:
jarsigner -verbose -keystore [path to your private key] -signedjar [path to file after signing] [path to unsigned file] [name of your certificate]
#jarsigner parameter description: The keystore parameter specifies the absolute path of your private key, for example: c:\mykeystore -signedjar The parameter specifies the absolute path where the signed apk file is stored, such as c:\signed.apk [unsigned file path] Specify the absolute path of the apk file to be signed, which is the one you downloaded from us. For example, c:\unsigned.apk [your certificate name] refers to the certificate name you set when you created the key.
Signing methods for Linux and Mac OS X platforms
Open the Terminal program and enter the decompressed directory of verification.zip downloaded from Xiaomi Developer Station, such as cd ~/Downloads/verification Use jarsigner to sign the command example:
jarsigner -verbose -keystore~/Workspace/mykeystore -signedjar ./signed.apk ./unsigned.apk xiaomi
Windows platform signature method
Open the "Command Prompt" program and enter the decompressed directory of verification.zip downloaded from the Xiaomi developer station, for example, cd C:\Downloads\verification
Example of signing command using jarsigner:
jarsigner -verbose -keystoreC:\Downloads\verification\mykeystore -signedjar signed.apk unsigned.apk xiaomi
The acquisition of the above signature methods should be completed with the assistance of R&D personnel.
How to sign your APK or Android App Bundle in release mode in Visual Studio Native-Activity Application (Android) project?
When I rebuild solution and deploy solution in release ARM target, navigate to Release folder and drag and drop apk file to play.google.com (Play Store), there is following error message.
Upload failed
You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs or Android App Bundles.
You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode. Learn more about signing.
I have manged to generate and download deployment_cert.der on play store, but not sure how it can be added to apk in Visual Studio Native-Activity Application (Android) project.
Figered it out now.
Built APK file can be signed by using command line (without need of installing Android Studio). This can be done as follows:
1.) Bellow will allow to build unsigned APK in release mode:
.packing project Properties --> Ant --> Ant Build Target --> Release (Release Mode)
2.) Add JDK and Android SDK to PATH. In my case (installed by VS installer) those paths are:
C:\Program Files\Java\jdk1.8.0_172\bin
C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3
3.) Create keystore with key:
keytool -genkey -v -keystore my_app.keystore -alias alias_name -keyalg PSA -keysize 2048 -validity 10000
4.) Sign APK:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my_app.keystore My.App.Packaging-release-unsigned.apk alias_name
5.) ZIP align:
zipalign -f -v 4 My.App.Packaging-release-unsigned.apk My.App.apk
6.) Drag and drop to Play Store
My game is developed by Unity3d, I need to encrypt the DLL in APK.I add the following steps in build pipeline:
unzip the APK file
encrypt the managed dlls and replace with modified libmono.so (same Unity version, same ABI)
zip & jarsigner & zipalign
jarsigner -verbose -keystore debug.keystore -signedjar "%1"_unaligned.apk "%1".apk %alias%
zipalign -f 4 "%1"_unaligned.apk "%1"_release.apk
The resulting APK can install, but dies immediately after startup, no useful logcat, any helps?
So i'm about to publish my apps new version to android store, there was an old version of it in play store but i make a completely different project from it so i didn't use the folders which contains the project on itself.
Because of that my private key is not in my new version right now. When i looked the documentation of ionic it says that :
Now, we need to sign the unsigned APK and run an alignment utility on
it to optimize it and prepare it for the app store. If you already
have a signing key, skip these steps and use that one instead.
Actually "If you already have a signing key, skip these steps and use that one instead." part is not clear enough for me.
I have the .keystore file from old version but I'm little bit lost right now.
What does this "skip those steps and use that one instead" means? What am I supposed to do right now?
Where should I place that .keystore file?
Am I done after placing the .keystore file or should I do something
else?
What is that code($ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name) for? Should I use it?
What is that alias_name part?
Should I do something else?
I would appreciate a help, I'm totally lost right now
The procedure is the same as when you first time published app (build the release app file - signing the APK file - optimize the APK). This time you do not have to create keystore file because you already have one. You'll reuse the same keystore for the entire life of the app, so you need to keep it for as long as you plan to support the app.
1.) If you already have keystore file you do not have to do new one.
2.) Put android-release-unsigned.apk and keystore in same folder. First rename android-release-unsigned.apk to example MyApp.apk
3.) You need to sign your app with that file.
4.) Yes, you should. In step 2 after you put MyApp.apk and MyApp.keystore in same folder.
$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore MyApp.keystore MyApp.apk MyApp
5.) This is the name of your application.
6.) And then just optimize the app. $ zipalign -v 4 MyApp.apk MyAppNew.apk
I'am trying to build the final release version of my app that using phonegap 3.0 and a few plugins. I have followed this answer on SO to link my keystore file to the app however I am not sure this is working.
Everything runs locally when I use phonegap run android.
Into myapp/platforms/android I have placed ant.properties
key.store=/Users/XXXXX/Desktop/keystore/my-release-key.keystore
key.alias=FishAppKey //I wasn't sure as it is suggested this can be whatever.
When I build my app instead of placing the .apk files into platforms/android/bin they are put into platforms/android/ant-build?
When I move into platforms/android and run ant release I get Build failed ...tools/ant/build.xml:698:null returned 1
Really I am trying to figure out how to go from phonegap run android to a apk file I can upload to google play.
As answer to your comment, you use jarsigner and pass the full path to your keystore in the -keystore argument. So let's say your keystore is on the desktop and named yourkeystore.keystore,
On Windows you would :
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore %userprofile%\Desktop\yourkeystore.keystore yourappname-release-unsigned.apk youraliasforthekeystore
On linux (and probably OSX also):
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $HOME/Desktop/yourkeystore.keystore yourappname-release-unsigned.apk youraliasforthekeystore
And of course you can replace yourappname-release-unsigned.apk with the full path of your apk in case it's not in the current directory.