I have integrated LinkedIn SDk. It worked fine on debug mode but in release mode it giving invalid request.
I have used this command to create release key hash:
keytool -exportcert -keystore D:\path\keystore.jks -alias Password | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64
followed this: https://developer.linkedin.com/docs/android-sdk
Not able find a solution ,Please help
Here're two of possible solutions about your problem.
Check and add both hashes (release and debug) and don't see any problems maybe you have some problem with proguard.
If you match your requests' query strings or posted jsons' object labels with your classes' property names and you proguard your domain classes you may have problems with your requests. Check your requests and if you see problem use #SerializedName annotation in your domain classes or request bean classes.
Related
In the README of MSAL, a configuration file is discussed, containing what is referred to by "YOUR_BASE64_URL_ENCODED_PACKAGE_SIGNATURE".
They also advise the user to store this as a "raw" resource.
This is the template given:
{
"client_id" : "<YOUR_CLIENT_ID>",
"redirect_uri" : "msauth://<YOUR_PACKAGE_NAME>/<YOUR_BASE64_URL_ENCODED_PACKAGE_SIGNATURE>",
"broker_redirect_uri_registered": true,
}
Won't the contents of this file affect the signature? How is it possible to have a static asset containing the signature?
I'm led to believe that this is not, as I thought, a cryptographic signature of the APK.
I couldn't figure out what it is.
I think it makes sense, it shouldn't be static. You want Microsoft to be able to prove that it is authenticating against your real app and not a modified or different application. This is the signed application for release with apk.
You need to sign your app in order to be able to put it on the play store or to have it validate: https://developer.android.com/studio/publish/app-signing
Per the Microsoft documentation:
https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-android#integrate-with-microsoft-authentication-library
it tells you how to generate the hash. in the portal when you set up the authentication on app reg it will give you a command like
keytool -exportcert -alias SIGNATURE_ALIAS -keystore PATH_TO_KEYSTORE | openssl sha1 -binary | openssl base64 to generate the signature it just gets gets the signature of the android keystore keys.
I have an application that uses FirebaseAuthUI, it enables Facebook sign in, everything works fine in Debug, but when I upload the application in release mode, the application crashes with this log:
Facebook provider cannot be configured without dependency. Did you forget to add 'com.facebook.android:facebook-login:VERSION' dependency?
com.firebase.ui.auth.AuthUI$IdpConfig$FacebookBuilder.<init>
I have debuged the application, and the error is produced in this line:
if (!ProviderAvailability.IS_FACEBOOK_AVAILABLE) {
throw new RuntimeException(
"Facebook provider cannot be configured " +
"without dependency. Did you forget to add " +
"'com.facebook.android:facebook-login:VERSION' dependency?");
}
This means that Facebook is not available, however I've setup the Facebook hash value with the release key store and key store path using this code:
keytool -exportcert -alias <aliasName> -keystore <keystoreFilePath> | openssl sha1 -binary | openssl base64
Which gave the hash that I've put into the Facebook app settings.
I'm using this library as a dependency in my build.gradle file : 'com.facebook.android:facebook-android-sdk:5.+'.
Extra info The Facebook application is installed in my phone.
Inside ProviderAvailability checks are performed using the reflection API. If you are using Proguard, add the below line in your proguard-rules.pro file to prevent class name obfuscation:
-keepnames class com.facebook.login.LoginManager
I am trying desperately to export my signed APK after building my Unity project for Android as a "Google development build" and opening it in Android Studio.
I have looked at several other questions and am trying to follow https://developer.android.com/studio/publish/app-signing.html but am having a problem creating my keystore. I have followed the tutorial verbatim but can't create a valid path for the keystone -
I don't understand what I need to do. I have tried /home/users/keystores/android.jks I have tried /home/users/keystores/myprojectname.jks and just sticking it on my desktop. These are the errors Im getting-
I have tried locating android.jks but can't find anything using finder. Is it because I am on a mac? What am I doing wrong here? How can I generate my keystore so I can publish?
/home/users/keystores/ is most likely not a valid path on your mac. Try to create the keystore in a valid location like in your user's home directory:
/home/YOUR_USERNAME/
Verify that the keystore file has been created in that location.
#skyguy You have to create a keystore first using the keytool.
The keygen tool can be accessed via command line and is already included in the JDK.
If you scroll down that link I posted in my comment above, you will see the following example -
Suppose you want to create a keystore for managing your public/private key pair and certificates from entities you trust.
Generating Your Key Pair The first thing you need to do is create a
keystore and generate the key pair. You could use a command such as
the following:
keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US"
-alias business -keypass kpi135 -keystore /working/mykeystore
-storepass ab987c -validity 180 (Please note: This must be typed as a single line. Multiple lines are used in the examples just for legibility purposes.)
This command creates the keystore named "mykeystore" in the "working"
directory (assuming it doesn't already exist), and assigns it the
password "ab987c". It generates a public/private key pair for the
entity whose "distinguished name" has a common name of "Mark Jones",
organizational unit of "JavaSoft", organization of "Sun" and
two-letter country code of "US". It uses the default "DSA" key
generation algorithm to create the keys, both 1024 bits long.
It creates a self-signed certificate (using the default "SHA1withDSA"
signature algorithm) that includes the public key and the
distinguished name information. This certificate will be valid for 180
days, and is associated with the private key in a keystore entry
referred to by the alias "business". The private key is assigned the
password "kpi135".
The command could be significantly shorter if option defaults were
accepted. As a matter of fact, no options are required; defaults are
used for unspecified options that have default values, and you are
prompted for any required values. Thus, you could simply have the
following:
keytool -genkeypair
In this case, a keystore entry with alias "mykey" is created, with a newly-generated key pair and a certificate
that is valid for 90 days. This entry is placed in the keystore named
".keystore" in your home directory. (The keystore is created if it
doesn't already exist.) You will be prompted for the distinguished
name information, the keystore password, and the private key password.
The rest of the examples assume you executed the -genkeypair command
without options specified, and that you responded to the prompts with
values equal to those given in the first -genkeypair command, above (a
private key password of "kpi135", etc.)
Once you have created a keystore, you can point to its location and sign your apk.
Good morning
I'm trying to build an Android application on release mode using Visual Studio Tools for Apache Cordova CTP3.1
After I create my myreleasekey.keystore using android tools
http://developer.android.com/tools/publishing/app-signing.html
I set data in ant.properties
key.store=C:\\Users\\myreleasekey.keystore
key.alias=MoayadMyro
key.store.password=password
key.alias.password=password
I got error :
Error : BLD00213 : Signing key MoayadMyro not found. Verify the alias in ant.properties is correct.
cmd: Command failed with exit code 8
Thanks
I had exactly the same problem and no matter the permutations of keystore alias I tried, I kept getting the same error in visual studio for Apache Cordova.
To resolve I simply repeated the generation process.
Generate a new key store using keytool:
C:\myChosenDir> keytool -genkey -keyalg RSA -alias selfsigned -keystore mykeystorename.keystore -storepass mykeystorepass -validity 10000 -keysize 2048
Enter the information requested as part of the keygen:
When requested to enter the password for <selfsigned> reenter the password above. Hitting return suggests it uses the same but this is what I did before and it didn't work. [This was the only thing I did different]
Add the keystore to the project:
I placed the keystore in the same folder as the ant.properties file
Update the ant properties file:
key.store=mykeystorename.keystore
key.alias=selfsigned
key.store.password=mykeystorepass
key.alias.password=mykeystorepass
[NB: preserve the line breaks can't get them to play correctly in markdown]
I know this a bit of a turn it off and turn it on again answer but it worked for me. Best of luck.
I've followed the steps delineated in Lee's android book on generating an MD5 fingerprint:
At a command prompt, I navigated to: C:\Program Files\Java\jre7\bin
I then entered:
keytool.exe ... C:\Users\Clay.android\debug.keystore
... (etc. - from p. 112 of "Beginning Android Tablet Application Development" by Wei-Meng Lee)
It generates a code like this:
:
CC:AB:1E:GD:E8:18:29:3A:25:3D:B9:19:23:F1:10:3C:15:14:CF:2B
When I enter this at http://code.google.com/android/add-ons/google-apis/maps-api-signup.html, it takes me to another page that tells me that the entered value is invalid ("The fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint")
Note: I did not add the "" portion. I tried it with and without the colon separators.
As it says it is MD5 that is needed, and the values is apparently SHA1, do I need to convert this SHA1 to MD5? If so, how?
If you use JDK 7 keytool, add the -v option. It will include the MD5 fingerprint in it's output.
You need to generate the key with the JDK6 keytool.
EDIT after answer was accepted:
As stated in the other answer, you can also use JDK7 keytool with the -v parameter.
Go to: http://www.cafewebmaster.com/online_tools/sha1
Put your sha1(fingerprint) value into the textbox and the tool will automatically convert it into MD5 Fingerprint. Hope this will solve your issue.