1
4
默认情况下,Eclipse使用的androiddebugkey(例如)具有
PackageInfo pkgInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES); for (Signature appSignature : pkgInfo.signatures) { // javax.security - NOT java.security! X509Certificate appCertificate = X509Certificate.getInstance(appSignature.toByteArray()); // appCertificate.getNotAfter() can give you the date & time the cert expires // appCertificate.getPublicKey() can give you the public key you sign the RPC requests with. // appCertificate.getSubjectDN() will give you a Principal named "CN=Android Debug,O=Android,C=US" for any debug certificate that hasn't been handcrafted by the developer. } |
2
4
复制编码的密钥,并替换DEBUGKEY的值“key”,它将正常工作。 |