本文整理汇总了Java中com.lody.virtual.helper.compat.PackageParserCompat.collectCertificates方法的典型用法代码示例。如果您正苦于以下问题:Java PackageParserCompat.collectCertificates方法的具体用法?Java PackageParserCompat.collectCertificates怎么用?Java PackageParserCompat.collectCertificates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lody.virtual.helper.compat.PackageParserCompat
的用法示例。
在下文中一共展示了PackageParserCompat.collectCertificates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPackageInfo
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
@Override
public PackageInfo getPackageInfo(String packageName, int flags, int userId) {
synchronized (mPackages) {
PackageParser.Package pkg = mPackages.get(packageName);
if (pkg != null) {
AppSetting setting = (AppSetting) pkg.mExtras;
if ((flags & PackageManager.GET_SIGNATURES) != 0 && pkg.mSignatures == null) {
if (pkg.mAppMetaData != null && pkg.mAppMetaData.containsKey(Constants.FEATURE_FAKE_SIGNATURE)) {
String sig = pkg.mAppMetaData.getString("fake-signature");
if (sig != null) {
pkg.mSignatures = new Signature[] {new Signature(sig)};
}
} else {
PackageParserCompat.collectCertificates(setting.parser, pkg, PackageParser.PARSE_IS_SYSTEM);
}
}
PackageInfo packageInfo = PackageParserCompat.generatePackageInfo(pkg, flags,
getFirstInstallTime(pkg), getLastInstallTime(pkg));
if (packageInfo != null) {
ComponentFixer.fixApplicationInfo(setting, packageInfo.applicationInfo, userId);
return packageInfo;
}
}
}
return null;
}
示例2: parsePackage
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
public static VPackage parsePackage(File packageFile) throws Throwable {
PackageParser parser = PackageParserCompat.createParser(packageFile);
PackageParser.Package p = PackageParserCompat.parsePackage(parser, packageFile, 0);
if (p.requestedPermissions.contains("android.permission.FAKE_PACKAGE_SIGNATURE")
&& p.mAppMetaData != null
&& p.mAppMetaData.containsKey("fake-signature")) {
String sig = p.mAppMetaData.getString("fake-signature");
p.mSignatures = new Signature[]{new Signature(sig)};
VLog.d(TAG, "Using fake-signature feature on : " + p.packageName);
} else {
PackageParserCompat.collectCertificates(parser, p, PackageParser.PARSE_IS_SYSTEM);
}
return buildPackageCache(p);
}
示例3: parsePackage
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
public static VPackage parsePackage(File packageFile) throws Throwable {
PackageParser parser = PackageParserCompat.createParser(packageFile);
PackageParser.Package p = PackageParserCompat.parsePackage(parser, packageFile, 0);
PackageParserCompat.collectCertificates(parser, p, PackageParser.PARSE_IS_SYSTEM);
return buildPackageCache(p);
}