Android, Facebook and key hashes, how does it work? - java

When releasing my first android app using the facebook sdk, what are all the steps involved to get it working? The process is confusing me, the Key Hashes in particular.
1. Take the App ID from my facebook App and put it into my AndroidManifest.xml
2. Add the platform: Android in the developers.facebook.com App-Settings
3. Copy my Package Name to the Android-form at developers.facebook.com
4. ?
EDIT:
By releasing an app to Google Play without facebook in it and then reading this:
Key hash for Android-Facebook app
I learned everything I needed to know. I will answer my own post eventually with all the steps needed, if someone else don't beat me to it.

Related

How to update android app without google play

I'm developing an android app that won't be downloaded via the Google Play store but instead through an APK listed on my website. I was looking for a way to update this app.
I've done some research and I think the best way would be to run an API at the start of the app that checks the downloaded app's version against the version of the APK listed on the website (at the time of app launch). If the version of the website APK is higher, then I prompt the user for an update. Ideally the API would get the APK itself without the user needing to go to the website.
I have some doubts about this that I hope someone can answer however:
First - Once I download the new APK does the old one get deleted or do I have to do that?
Second - How do I keep User Preferences?
If this isn't the right way to do it I'd appreciate any tips.
If it is the right way and you know of some good resources to build an API like this I'd appreciate those too!

How to change the signing key of an app already published on play store? Is there another efficient alternative to contentProvider?

I had exactly the same issue like in that question: java.lang.SecurityException: Permission Denial: opening provider when implement content provider
I have solved it using: the answer of #CommonsWare
Where He says:
App B has identical <permission> elements as App A and both App A and App B are signed by the same signing key
But When generating the app bundles of my applications, I have forgotten to sign them with the same signing key
According to the research I have done:
It is not possible to change the singing key of an application once it is on play store.
My actual problem:
I have recently put two apps on play store which have the same <permission> element. When I install first the app A from play store, I will not be able to install the app B. When I first install the app B from play store, I will not be able to install the app A. One of my apps is not able to install when I install the other app first.
According to #commonware answer:
you would need to remove one of the two apps from the Play Store and
submit a replacement, with a new application ID, that is signed by the
same signing key as the other shipping app.
But I don't want to change the application ID of any of these two applications
Any idea about how to solve that issue?
Is there any other efficient alternative to ContentProvider to share data between two applications of the same author?
I have momentarily accepted the #Warlock answer but I am looking for a better answer.
It's possible to change singing key for app already in Play Store. But it has now major disadvantage which will be gone in few years. It will be working only on devices running Android 9 and above. So your mindSkdVersion has to be 28+. It's called key rotation and it's part of APK Signature Scheme v3. See this link.
Also I don't know other way how to 100% securely change data between two apps than trust same signing keys. Less secure way is only to depend on known applicationId (just sent Intent with "com.myapp.someaction") which attacker can of course use and sideload app or use other distribution. Bit harder way to break can be usage of Android IPC / AIDL directly.

Google Sign-In not working on published app

THIS didn't solve my problem
THIS didn't solve my problem
THIS didn't make any sense to me but doesn't seem to fix my problem anyway.
So, I've release my app on the PlayStore and the google sign in doesn't work.
I've tried to run my app with the debug and release sha1, and that got me an ApiException: 12500:
After like 2 hours of research I figured I had to use the Google Play Signin SHA-1. I did, now I get an ApiException: 10:, at least that's some progress.
But there I am stuck.
As my knowledge goes, the ApiException 10 is either a SHA or client Id problem.
It can't be a SHA problem since I now use Play's SHA (In the firebase console I have the release and play sha-1 and updated services.json, adding the debug sha just brings me back to apiexception 12500).
So I thought and still think the problem is my client Id BUT
Using the default_web_client_id doesn't work. Both client ID's for both SHA's extracted from google-services don't work. The client Id I created in Google Developers Console won't work.
So I'm begging you to help me understand what I'm missing.
Thanks.
What I tried first :
I want through this error ApiException: 12500 for a long time. I tried everthing :
remove my debugkeystore, recreate one
add support email on firebase console
change versions of plugin
update google on my device
But when I was browsing stackoverflow, I found a solution :
Maybe the solution :
I went to this page (https://console.developers.google.com/apis/credentials)
Do not forget to select your project on the list (top left). Then go on "Oauth consent screen"
I filled almost all the fields : the application logo, the email support, the application homepage link, application privacy policy link (with the project.firebaseapp.com); and I saved.
Now it's working, I can login.
Hope this will help
Source
Thanks to answer of Pranjal Gupta : Google Sign In error 12500

Failed to sign in. Google Play Games Libgdx

I wanted to update an app I already published in the playstore to add achievements and leaderboard.
I have created the game in the Developer Console and everything was fine, everything worked with the debug SHA1 I have entered in the Google API for my app.
But now I have generated a signed APK with a different SHA1 (of course), and I have changed the debug SHA1 in Google API with the SHA1 for my signed APK.
I have pushed the APK to the playstore and published the game from the Developer Console. But now that my game is available in the store, when people try to connect to the Google Play Games they get "Failed to Sign in. Please check you network connection and try again".
I already looked at this link
but I am doing everything correctly.
Is it possible that I need to wait several hours before Google API handle the new SHA1 I have entered ? I have no idea of what is going on
You may refer with this thread. Try to move the app ID and leaderboard ID from strings.xml to ids.xml in values folder. You may also try to delete all client ids then add them again for debug keystore and release keystore.
Here's an additional reference which might also help: LIBGDX game configuration with google Play game services Errors
Here are a few points that might help you.
It takes several hours before your changes on Developer Console are actually published. Test the game after a few hours.
You don't need to publish in order to test it. You can do that by adding tester accounts in your developer console.
You can't "test" Google Play Services with developer account. You will need another account for that.
Edit:
Very Important:
Make sure you added required permissions to AndroidManifest.xml in
your Android project.
Ok so for everyone having the same problem as me.
Don't forget that now Google can sign your app.
The SHA1 fingerprint i needed was in the developer console, no need to get the SHA1 fingerprint of my APK.

Can you "doublesign" an android apk file?

I did search the forum for a while but i did not find an answer for this. Recently, Google has changed its Maps API for android from v1 to v2. Since i started the project way before March, i was not aware they would not accept new apps working on the old API. Hence, it's just after i finished my app that i realized the Maps API key was tied to the keystore, and i cannot get a new Map API key for v1 now. And i would have to recode the entire thing to translate it to v2, which i cannot do right now.
My question is, is it possible to doublesign the .apk file and submit it to Google Play. Let's say i have a working .apk signed with my debug keystore. However, the .apk will not be accepted by Google because it uses the debug key. Can i then "resign" it with jarsigner to force Google Play to accept it? Will the app still work if i do this? Really would appreciate help for this asap. I don't have a timeline to recode the app now, and i really want to get visibility for the app in Google Play :/
Can you “doublesign” an android apk file?
No. You can always sign the APK with any key, but that will just override old key.
And i would have to recode the entire thing to translate it to v2
Unfortunatelly there is nothing else you can do except just that if you don't have a signing key and Maps v1 API key.

Categories

Resources