如何查找我的 Android 应用程序的 MD5 指纹

发布于 2024-11-16 20:14:58 字数 114 浏览 3 评论 0 原文

我正在尝试注册 Android Google 地图,它要求 MD5 指纹。如何从我的应用程序中获取指纹?

我是密钥库的新手,无法理解我在网上找到的东西。非常简单的说明,

谢谢提前致谢

I'm trying to sign up for Android Google Maps and which requests MD5 fingerprint. How to get the fingerprint out of my application??

I'm newbie to keystore and couldn't understand a thing i find online. so simple instructions appreciated

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

陪你搞怪i 2024-11-23 20:14:59

对于 Windows 用户:如果遇到问题,请确保周围没有其他 debug.keystore 文件。我按照说明进行操作,但只有当我发现我的 Eclipse 安装使用位于此处的不同 debug.keystore 时才设法让它工作:

android-sdk-windows.android

(不是我的 Windows 用户目录中的那个)

For Windows Users: If you have problems, make sure there are no other debug.keystore files around. I followed the instructions, but only managed to get it to work when I discovered my Eclipse installation was using a different debug.keystore located here:

android-sdk-windows.android

(not the one in my Windows User directory)

夏见 2024-11-23 20:14:58

您将需要两个密钥库。

一个用于调试目的,
一个用于发布目的。

当您通过 eclipse 开发应用程序并在模拟器或设备上调试它时。您将需要调试密钥库。否则你将看不到地图。
调试密钥库已存在于您的系统中。

尝试在

Windows Vista: C:\Users\<user>\.android\debug.keystore

Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore

OS X and Linux: ~/.android/debug.keystore

打开控制台/终端到上面存在 debug.keystore 文件的位置找到它们并执行

keytool -list -keystore debug.keystore

输出将类似于(在询问密码时只需按 Enter 键)

rohit@Desktop:~/.android$ keytool -list -keystore debug.keystore
Enter keystore password:  

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

androiddebugkey, 19 Apr, 2011, PrivateKeyEntry, 
Certificate fingerprint (MD5): 00:35:C2:48:65:43:CG:55:41:11:16:F1:4C:11:82:C5
rohit@Desktop:~/.android$ 

复制此 MD5 指纹值并转到

http://code.google.com/android/maps-api-signup.html

成功注册后您将获得地图密钥。将它们放入视图的 MapView 元素中。

对于发布,

您需要生成自己的密钥库,并需要获取相同的映射密钥。
否则,您将无法在将 apk 部署到设备上时看到地图。

创建您自己的新密钥库,并对生成的密钥库执行相同的过程。
生成密钥库也很容易。
我只需通过 eclipse 导出我的 Android 应用程序,然后它会自行完成所有操作。

希望它有帮助:)

You will be needing two keystores.

One for debug purpose and
One for release purpose.

While you are developing your application via eclipse and debugging it on simulator or device. You will be needing debug keystores. Otherwise you will not be able to see the map.
debug keystore is already present into your system.

Try finding them at

Windows Vista: C:\Users\<user>\.android\debug.keystore

Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore

OS X and Linux: ~/.android/debug.keystore

Open console/terminal on to the above location where debug.keystore file is present and execute

keytool -list -keystore debug.keystore

Output will be like (press simply enter when password is asked)

rohit@Desktop:~/.android$ keytool -list -keystore debug.keystore
Enter keystore password:  

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

androiddebugkey, 19 Apr, 2011, PrivateKeyEntry, 
Certificate fingerprint (MD5): 00:35:C2:48:65:43:CG:55:41:11:16:F1:4C:11:82:C5
rohit@Desktop:~/.android$ 

Copy this MD5 fingerprint value and go to

http://code.google.com/android/maps-api-signup.html

You will get Map Keys On successful signup. Put those in the MapView Element of your view.

For release

You need to generate your own keystore and need to get Map keys for the same.
else you will not be able to see map on deployment of your apk onto the device.

Create a new keystore of your own and follow the same procedure for the generated keystore.
Its very easy to generate keystore also.
I simply export my android application via eclipse and it then do everything by itself.

Hope it helps :)

洛阳烟雨空心柳 2024-11-23 20:14:58

http://code.google.com/android/add -ons/google-apis/mapkey.html#getfingerprint

如果您正确遵循此操作,您应该能够获取您的 MD5 指纹。有说明在签名时和签名后获取指纹。

如果您已经签署:
您首先需要使用命令提示符导航到自动创建的配置文件 android 文件夹中的调试密钥库,如链接中所述。然后,您可以粘贴此内容(不带美元符号)并在命令提示符中运行它:

$ keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore \
-storepass android -keypass android

否则,您可以使用命令提示符导航到 Java SDK 文件夹中的 jarsigner 并使用它:

$ keytool -list -alias alias_name -keystore my-release-key.keystore

按照提示符说明进行操作后,您应该收到您的 MD5

http://code.google.com/android/add-ons/google-apis/mapkey.html#getfingerprint

If you follow this correctly, you should be able to get your MD5 fingerprint. There are instructions to both get your fingerprint at the time of signing as well as afterwards.

If you've signed already:
You would first use your command prompt to navigate to your debug keystore in your automatically made profile android folder as described in the link. You would then paste this (without the dollar sign) and run it in your command prompt:

$ keytool -list -alias androiddebugkey -keystore <path_to_debug_keystore>.keystore \
-storepass android -keypass android

Otherwise, you can use your command prompt to navigate to your jarsigner in your Java SDK folder and use this:

$ keytool -list -alias alias_name -keystore my-release-key.keystore

After following the on prompt instructions, you should receive your MD5

木有鱼丸 2024-11-23 20:14:58

任何来这里寻找

YouTube OAuthAPI 的 MD5 或 SHA1 的人都是这个命令:

Windows Vista: C:\Users\<user>\.android\debug.keystore

Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore

OS X and Linux: ~/.android/debug.keystore

这个 cmd:

keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v

debug.keystore 的默认密码是 android

取自

YouTube API

Anyone coming here looking for the

MD5 or SHA1 for the YouTube OAuthAPI this is the command:

Windows Vista: C:\Users\<user>\.android\debug.keystore

Windows XP: C:\Documents and Settings\<user>\.android\debug.keystore

OS X and Linux: ~/.android/debug.keystore

This cmd:

keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v

The default password for the debug.keystore is android

Taken from

YouTube API

打小就很酷 2024-11-23 20:14:58

哇,我永远不会得到上面的答案,不得不阅读一本最终清晰的教程!

调试密钥库的文件名是 debug.keystore。这是 Eclipse 用于签名的证书
您的应用程序,以便它可以在 Android 模拟器或设备上运行。
使用调试密钥库,您需要使用 Keytool.exe 应用程序提取其 MD5 指纹
包含在您的 JDK 安装中。申请免费 Google 地图需要此指纹
钥匙。

您通常可以在 C:\Program Files\Java\\bin 中找到 Keytool.exe

发出以下命令(参见图 9-4)来提取 MD5 指纹:
keytool.exe -list -alias androiddebugkey -keystore
“C:\Users\.android\debug.keystore” -storepass android
-keypass Android

Wow I would have never gotten it with the answers above, had to read a book tutorial which is CLEAR finally!

The filename of the debug keystore is debug.keystore. This is the certifi cate that Eclipse uses to sign
your application so that it may be run on the Android Emulator or devices.
Using the debug keystore, you need to extract its MD5 fi ngerprint using the Keytool.exe application
included with your JDK installation. This fi ngerprint is needed to apply for the free Google Maps
key.

You can usually find the Keytool.exe in the C:\Program Files\Java\\bin
folder.

Issue the following command (see Figure 9-4) to extract the MD5 fi ngerprint:
keytool.exe -list -alias androiddebugkey -keystore
“C:\Users\.android\debug.keystore” -storepass android
-keypass android

日记撕了你也走了 2024-11-23 20:14:58

2015 更新:

确保您当前位于终端中的 jdk/bin

对于 Linux 或 OS X,打开终端窗口并输入以下内容:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

对于 Windows Vista 和 Windows 7 ,运行:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

如果您成功完成上述步骤,您将得到:

Alias name: androiddebugkey
Creation date: Jan 01, 2013
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: 4aa9b300
Valid from: Mon Jan 01 08:04:04 UTC 2013 until: Mon Jan 01 18:04:04 PST 2033
Certificate fingerprints:
     MD5:  AE:9F:95:D0:A6:86:89:BC:A8:70:BA:34:FF:6A:AC:F9
     SHA1: BB:0D:AC:74:D3:21:E1:43:07:71:9B:62:90:AF:A1:66:6E:44:5D:75
     Signature algorithm name: SHA1withRSA
     Version: 3

2015 Update:

Make sure your are currently in jdk/bin in your terminal

For Linux or OS X, open a terminal window and enter the following:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

For Windows Vista and Windows 7, run:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

If you are successful in above step you will get:

Alias name: androiddebugkey
Creation date: Jan 01, 2013
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: 4aa9b300
Valid from: Mon Jan 01 08:04:04 UTC 2013 until: Mon Jan 01 18:04:04 PST 2033
Certificate fingerprints:
     MD5:  AE:9F:95:D0:A6:86:89:BC:A8:70:BA:34:FF:6A:AC:F9
     SHA1: BB:0D:AC:74:D3:21:E1:43:07:71:9B:62:90:AF:A1:66:6E:44:5D:75
     Signature algorithm name: SHA1withRSA
     Version: 3
掐死时间 2024-11-23 20:14:58

以下内容或许可以帮助您:

public String convert(String str){
        String a=null;
         char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
                  'a', 'b', 'c', 'd', 'e', 'f' }; 
        try {
            a=new   String(str.getBytes("ISO8859_1"),"UTF-8");
            byte[] strTemp = str.getBytes(); 
            MessageDigest mdTemp = MessageDigest.getInstance("MD5"); 
               mdTemp.update(strTemp); 
               byte[] md = mdTemp.digest(); 
               int j = md.length; 
               char str1[] = new char[j * 2]; 
               int k = 0; 
               for (int i = 0; i < j; i++) { 
                byte b = md[i]; 
                //System.out.println((int)b);  
                str1[k++] = hexDigits[b >> 4 & 0xf]; 
                str1[k++] = hexDigits[b & 0xf]; 
               } 


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
 return new String(str1); 

}

The following may be able to help you:

public String convert(String str){
        String a=null;
         char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
                  'a', 'b', 'c', 'd', 'e', 'f' }; 
        try {
            a=new   String(str.getBytes("ISO8859_1"),"UTF-8");
            byte[] strTemp = str.getBytes(); 
            MessageDigest mdTemp = MessageDigest.getInstance("MD5"); 
               mdTemp.update(strTemp); 
               byte[] md = mdTemp.digest(); 
               int j = md.length; 
               char str1[] = new char[j * 2]; 
               int k = 0; 
               for (int i = 0; i < j; i++) { 
                byte b = md[i]; 
                //System.out.println((int)b);  
                str1[k++] = hexDigits[b >> 4 & 0xf]; 
                str1[k++] = hexDigits[b & 0xf]; 
               } 


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
 return new String(str1); 

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文