复制代码 代码如下:
这是获取apk包的签名信息
private String getSign(Context context) {
PackageManager pm = context.getPackageManager();
List<PackageInfo> apps = pm.getInstalledPackages(PackageManager.GET_SIGNATURES);
Iterator<PackageInfo> iter = apps.iterator();
while(iter.hasNext()) {
PackageInfo packageinfo = iter.next();
String packageName = packageinfo.packageName;
return packageinfo.signatures[0].toCharsString();
if (packageName.equals(instance.getPackageName())) {
MediaApplication.logD(DownloadApk.class, packageinfo.signatures[0].toCharsString());
return packageinfo.signatures[0].toCharsString();
}
}
return null;
}
返回的签名信息结果为很长的一串数据
时间: 2024-12-02 08:27:54