Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same Certificate Fingerprint on two Android Studio installations?

I'm using Android Studio 0.4.6 on two different machines. I'm using the maps v2 in my application, so I need the Certificate Fingerprint to be the same on both machines. Is there a way to accomplish this?

like image 630
ioan ghip Avatar asked Feb 26 '14 19:02

ioan ghip


People also ask

How do I get a SHA1 signing certificate fingerprint?

If you've published your app using Play App Signing, a requirement when using Android App Bundle, you can get your SHA-1 from the Google Play Console on the Release > Setup > App Integrity page.

What is SHA1 certificate fingerprint?

SHA-1 also referred to as the Secure Hash Algorithm. It is a cryptographic hash function that will take input and it produces a 160-bit hash value.


2 Answers

There are two possible ways you can accomplish this :

1.By creating your own certificate

Create your own own certificate by following the steps mentioned here using the standrad java keytool

http://developer.android.com/tools/publishing/app-signing.html#cert

Now share your certificate between machines and configure it for builds in your build.gradle file like this

android {
    signingConfigs {
        debug {
            storeFile file("debug.keystore")
        }

        myConfig {
            storeFile file("other.keystore")
            storePassword "certificate_password_here"
            keyAlias "alias_key_here"
            keyPassword "key_password_here"
        }
    }

    buildTypes {
        yourbuildtypename {
            debuggable true
            jniDebugBuild true
            signingConfig signingConfigs.myConfig
        }
    }
}

This will create a new build type under Build Variant tab in left side panel select the one you want.

If you are on windows you can share your debug certificate among people from the location

C:\Users\your_user_name\.android\debug.keystore

Copy it somewhere in other machines and give the path inside debug signingConfigs as shown above. In this way you don't need to define an extra buildType, your debug build automatically sign the application with the debug certificate located at path you have given.

2.Replacing the debug certificate in other machines :

Replace the debug certificate in other machines by what you have in your machine. Location is mentioned above in first method .

like image 177
Piyush Agarwal Avatar answered Nov 14 '22 23:11

Piyush Agarwal


What you need to do is get the debug certificate used by the IDEs to sign your sample applications on both computers, usually the certificate is stored in:

~/.android/debug.keystore

All you might need to do is replace that debug key in one of your computers, and both apps will be signed with the same key(automatically by the IDE).

Regards!

like image 34
Martin Cazares Avatar answered Nov 14 '22 22:11

Martin Cazares