使用代码获得项目的SHA1
来源:互联网 发布:http是什么 java题 编辑:程序博客网 时间:2024/06/05 17:24
//获得发布版sha1public static String sHA1(Context context) { try { PackageInfo info = context.getPackageManager().getPackageInfo( context.getPackageName(), PackageManager.GET_SIGNATURES); byte[] cert = info.signatures[0].toByteArray(); MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] publicKey = md.digest(cert); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < publicKey.length; i++) { String appendString = Integer.toHexString(0xFF & publicKey[i]) .toUpperCase(Locale.US); if (appendString.length() == 1) hexString.append("0"); hexString.append(appendString); hexString.append(":"); } String result = hexString.toString(); Log.e("=====",result.substring(0, result.length()-1)); return result.substring(0, result.length()-1); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null;}
0 0
- 使用代码获得项目的SHA1
- android通过代码获得sha1的值
- 获得KeyStore的sha1值
- 获得电脑的sha1签名
- Android使用代码生成SHA1
- 获得android keystore的SHA1值
- 获得android keystore的SHA1值
- 获得android keystore的SHA1值
- 获得android keystore的SHA1值
- android studio 获得SHA1 码的步骤
- Android Studio中获得SHA1的方法
- Android Studio 获得 SHA1签名的方法
- MAC下Android Studio生成获得发布版sha1和获得debug的sha1
- SHA1和md5的使用
- android studio 获得sha1
- as 获得sha1
- android获得准确sha1
- Android学习笔记--获得Android studio的SHA1的方法
- centos使用CP命令不提示覆盖
- 大型网站架构系列:20本技术书籍推荐
- cocos2d-x lua 使用自定义消息EventCustom
- Web.xml
- Discuz! 3.2 中各数据库表的作用
- 使用代码获得项目的SHA1
- dubbo拓展点机制的IOC特性
- 尺度不变特征变换匹配算法详解
- 数字在排序数组中出现的次数
- Android Drawable 那些不为人知的高效用法
- org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection解决办法
- 视频转换格式 qlv 转 mp4 详解
- 关于Android下FFmpeg配合libx264 NEON默认开启的验证
- 静态代码扫描