No signatures files found in META-INF. Cannot proceed. (RuntimeError) - ruby

Resign
D:\test>bundle exec calabash-android resign app-staging.apk
D:\test>
When i do run/build
D:\test>bundle exec calabash-android run app-staging.apk
No test server found for this combination of app and calabash version. Recreating test server.
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
WARNING: skipped META-INF/CERT.RSA as unsafe
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:188:in block (2 levels) in fingerprint_from_apk': No s re files found in META-INF. Cannot proceed. (RuntimeError) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:170:inchdir'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:170:in block in fingerprint_from_apk' from C:/Ruby23-x64/lib/ruby/2.3.0/tmpdir.rb:89:inmktmpdir'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:169:in fingerprint_from_apk' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android-build.rb:2:incalabash_build'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/lib/calabash-android/helpers.rb:107:in build_test_server_if_needed' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android-run.rb:16:incalabash_run'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/calabash-android-0.9.6/bin/calabash-android:86:in <top (required)>' from C:/Ruby23-x64/bin/calabash-android:22:inload'
from C:/Ruby23-x64/bin/calabash-android:22:in

If you do not have debug.keystore file create it bu the following command, you need keytool which is in JAVA_HOME/bin:
keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
Then run the calabash-android setup to assign this debug.keystore:
$ calabash-android setup
Please enter keystore information to use a custom keystore instead of the default
Please enter keystore location
...

Related

Accidentally removed my app keystore file

I have an application on Google Play, and I want to release an update but I accidentally clicked the - button on the Signing Identity tab in the Distribute manager and now I cannot find the old keystore file, even not in the trash. Is this file totally lost?
For Windows:
Locate the Xamarin debug.keystore file used to sign the app. By default, the keystore used to sign debug versions of a Xamarin.Android application can be found in the following location:
C: \ Users \ USERNAME \ AppData \ Local \ Xamarin \ Mono for Android \ debug.keystore
Information about a key store is obtained by running the command keytool.exefrom the JDK. This tool is typically located in the following location:
C: \ Program Files (x86) \ Java \ jdk VERSION \ bin \ keytool.exe
Add the directory containing keytool.exe to the environment variable. Open a command prompt and run using the following command:
keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
When run, keytool.exe should return the following text. The MD5: and SHA1: labels identify the respective signatures:
Alias name: androiddebugkey
Creation date: Aug 19, 2014
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 53f3b126
Valid from: Tue Aug 19 13:18:46 PDT 2014 until: Sun Nov 15 12:18:46 PST 2043
Certificate fingerprints:
MD5: 27:78:7C:31:64:C2:79:C6:ED:E5:80:51:33:9C:03:57
SHA1: 00:E5:8B:DA:29:49:9D:FC:1D:DA:E7:EE:EE:1A:8A:C7:85:E7:31:23
SHA256: 21:0D:73:90:1D:D6:3D:AB:4C:80:4E:C4:A9:CB:97:FF:34:DD:B4:42:FC:
08:13:E0:49:51:65:A6:7C:7C:90:45
Signature algorithm name: SHA1withRSA
Version: 3
The Documents here: Mention the same Steps for Mac if u want to have a read through that, Otherwise From my Knowledge if you have completely lost the Upload Key, You have to contact the app store to generate you a new one.

Xamarin UI testing - preinstalled apk

There is an apk installed on the emulator manually. I want to start testing this application. You cannot reinstall it using Xamarin UI Tests. AppInitializer.cs contains :
string keyStore = #"C:\...\Certificate\Mycompany.keystore";
return ConfigureApp
.Android
.InstalledApp("com.myapk.test")
.PreferIdeSettings()
.KeyStore(
keyStore,
"passw",
"passw",
"\"alias\"")
.EnableLocalScreenshots()
.StartApp();
When I run the test through Test Explorer, I catch the Exception:
System.Exception : Failed to execute: C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25\bin\jarsigner.exe -sigalg SHA1withRSA -digestalg SHA1 -signedjar "C:\Users\user\AppData\Local\Temp\uitest\a-287A94...D0807\23248\SignedTestServer.apk" -storepass passw -keypass passw -keystore "C:\...\Certificate\Mycompany.keystore" "C:\Users\user\AppData\Local\Temp\uitest\a-287A...D0807\TestServer.apk" ""alias"" - exit code: 1
Only one alias can be specified
Please type jarsigner -help for usage
Ok, I've just executed it manually :
jarsigner.exe -sigalg SHA1withRSA -digestalg SHA1 -signedjar "C:\Users\user\AppData\Local\Temp\uitest\a-287A94...D0807\23248\SignedTestServer.apk" -storepass passw -keypass passw -keystore "C:...\Certificate\Mycompany.keystore" "C:\Users\user\AppData\Local\Temp\uitest\a-287A...D0807\TestServer.apk" "alias"
After that I got a new apk file called SignedTestServer.apk. I've copied it into folder :
C:\Users\user\AppData\Local\Temp\uitest\a-287A943C412ED6ED5DEB1675E7FDF91843FD0807
and rerun tests.

Unable to sign apk with jarsigner

#echo off
set spassw="password"
set kpassw="password"
cordova build android --release --keystore="developer.keystore" --storePassword=%spassw% --alias=developer --password=%kpassw% --prod
del app-release-unsigned.apk
move e:\MobileJs\chatapp\ChatApp\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk e:\MobileJs\chatapp\ChatApp\
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore developer.keystore app-release-unsigned.apk developer
ERROR: jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format
I wrote a cordova build script and I cant seem to sign the APK
this is what my keystore generation looks like
keytool -genkey -v -keystore developer.keystore -alias developer -keyalg RSA -keysize 2048 -validity 10000
Password: password
What is your first and last name?
[Unknown]: First Last
What is the name of your organizational unit?
[Unknown]: n/a
What is the name of your organization?
[Unknown]: n/a
What is the name of your City or Locality?
[Unknown]: City
What is the name of your State or Province?
[Unknown]: State
What is the two-letter country code for this unit?
[Unknown]: US
could it be the n/a
you can refer here for keystore generation. enter link description here after generating keystore you can sign enter link description here your apk. After following these procedure if you are not able to generate feel free to ask.

OpenSSL Keystore Generation for Trinidad

I am trying to use openSSL to set up an https connection for my application. I'm running a Neo4j 1.2.2 database, with a Trinidad 1.3.5 web server, using the Rails 3.1 and ruby 1.9.
I have a Thawte trial certificate, ca_cert.crt, their intermediate and root certificates, ca_intermediate.crt and ca_root.crt respectively, and my own private key, ca_private.pem. What openssl command do I need to run to create a keystore, which I can specify in my app's trinidad.yaml config file?
So far the "looks-closest-to-right" thing I've tried is:
pkcs12 –export –in ca_cert.crt inkey ca_private.pem –out keystore.p12 –name tomcat
and it gives me the error:
unable to load certificates
6380:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\as
n1\tasn_dec.c:1319:
6380:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\
crypto\asn1\tasn_dec.c:381:Type=X509_CINF
6380:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 e
rror:.\crypto\asn1\tasn_dec.c:751:Field=cert_info, Type=X509
6380:error:0907400D:PEM routines:PEM_X509_INFO_read_bio:ASN1 lib:.\crypto\pem\pe
m_info.c:258:
error in pkcs12
It looks to me like openssl doesn't like the format I have the files in, though I have tried nearly every combination of the .pem, .crt, .cer, and .key extensions I can think of to no avail. I'm new to SSL entirely, so I hope I'm just doing something stupid and its an easy fix...
Here is the example I've been trying to follow: https://github.com/trinidad/trinidad/wiki/ssl-end-to-end-example
From this answer it seems that Thawte certificates are formatted as PKCS#7, while openssl pkcs12 -export command expects PEM. Certificate in PKCS#7 can be converted using modified version of command from previously linked answer.
$ openssl pkcs7 -in ca_cert.crt -print_certs | openssl x509 -outform PEM > ca_cert.pem
Then executing command, that you provided, creates PKCS#12 keystore.
$ openssl pkcs12 –export –in ca_cert.pem -inkey ca_private.pem –out keystore.p12 –name tomcat

How do you sign a mono for android application

I am attempting to add google map functionality to my mono for android application by following these instructions.
I have created a public.keystore and I am trying to use this keystore to sign the application by following these instructions, which I do not find explicit enough.
1) I gather I must add the following block into the csproj file. Is this correct?
<PropertyGroup>
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>public.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>public</AndroidSigningStorePass>
<AndroidSigningKeyAlias>public</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>public</AndroidSigningKeyPass>
</PropertyGroup>
2) What is the correct location of the public.keystore file?
I completely failed to register that there was full sample solution, as part of the instructions I was trying to follow that, that answered my questions.
I am a giddy goat.
1) You should, but I don't know if you must. If you do then you may need to change some of the values.
Consider a keystore that is created by the command:
keytool.exe -genkey -v -alias public -keyalg RSA -keysize 2048 -validity 10000 -keystore public.keystore
Then:
<AndroidSigningKeyStore>public.keystore</AndroidSigningKeyStore>
Defines the filename of the keystore ie. public.keystore
<AndroidSigningKeyAlias>public</AndroidSigningKeyAlias>
Is the alias of the key within the keysotre that you want to use. ie. public
<AndroidSigningStorePass>public</AndroidSigningStorePass>
Is the keystore's password. This will be the first password that you were prompted for.
<AndroidSigningKeyPass>public</AndroidSigningKeyPass>
Is the key's password. This will be the second password that you were prompted for.
References
http://developer.android.com/guide/publishing/app-signing.html#cert
http://android.xamarin.com/Documentation/Build_Process#Signing
2) You can place public.keystore in the root of the project, but you don't have to add it to the solution.
To location of the keystore file is defined by the following element from Question 1:
<AndroidSigningKeyStore>public.keystore</AndroidSigningKeyStore>
I am using command file to sign the package.
"C:\Program Files\Java\jdk1.6.0_25\bin\jarsigner.exe" -verbose -keystore key.keystore myapplication.apk keyalias
"C:\Program Files\Android\android-sdk\tools\zipalign.exe" -v 4 myapplication.apk myapplication-Signed.apk

Resources