简体   繁体   中英

get SHA1 fingerprint in android

I am using sketchware IDE on my android phone to make an app. I want to enable google sign in so the user's daata on the app gets backed up to google and restore after a reinstall but it seems I need to get my app's SHA1 fingerprint and the only way i managed to find online is only valid if I use android studio as my IDE as it requires typing commands into CMD on windows or mac.

How can I get that fingerprint on my android phone instead of a PC?

From what I can see on their First Time Publishing Guide , Sketchware handles signing for release APKs. This means you aren't the one who has the release keystore file. In the Firebase guide, they ask to skip providing a debug key.

I think it would be best if you contacted their support to get an understanding of how they handle APK signing. Integration of Google Sign In is quite common, so they should have a method in place.

I am not sure it will work with Your IDE or not you can generate the SHA-1 grammatically also . please try it atleast once might be work.

private void getKeyHash(String hashStretagy) {
    PackageInfo info;
    try {
        info = getPackageManager().getPackageInfo(BuildConfig.APPLICATION_ID, PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md;
            md = MessageDigest.getInstance(hashStretagy);
            md.update(signature.toByteArray());
            String something = new String(Base64.encode(md.digest(), 0));
            Log.e("KeyHash  -->>>>>>>>>>>>" , something);

           // Notification.registerGCM(this);
        }
    } catch (PackageManager.NameNotFoundException e1) {
        Log.e("name not found" , e1.toString());
    } catch (NoSuchAlgorithmException e) {
        Log.e("no such an algorithm" , e.toString());
    } catch (Exception e) {
        Log.e("exception" , e.toString());
    }
}

getKeyHash("SHA");

getKeyHash("MD5");

Simply use Dev tools to get SHA-1 or SHA-256 , Download devtools from google play. Click on app info. Select your app and You'll get SHA-1 OR 256 . Devtools link below https://play.google.com/store/apps/details?id=cn.trinea.android.developertools

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM