当前位置: 首页>>代码示例>>Java>>正文


Java PackageParserCompat类代码示例

本文整理汇总了Java中com.lody.virtual.helper.compat.PackageParserCompat的典型用法代码示例。如果您正苦于以下问题:Java PackageParserCompat类的具体用法?Java PackageParserCompat怎么用?Java PackageParserCompat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PackageParserCompat类属于com.lody.virtual.helper.compat包,在下文中一共展示了PackageParserCompat类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:codehz,项目名称:container,代码行数:27,代码来源:VPackageManagerService.java

示例2: queryReceivers

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public List<ReceiverInfo> queryReceivers(String processName, int uid, int flags) {
	int userId = VUserHandle.getUserId(uid);
	checkUserId(userId);
	ArrayList<ReceiverInfo> finalList = new ArrayList<>(3);
	synchronized (mPackages) {
		for (PackageParser.Activity a : mReceivers.mActivities.values()) {
			if (a.info.processName.equals(processName)) {
				ActivityInfo receiverInfo = PackageParserCompat.generateActivityInfo(a, flags);
				if (receiverInfo != null) {
					AppSetting settings = (AppSetting) mPackages.get(receiverInfo.packageName).mExtras;
					ComponentFixer.fixComponentInfo(settings, receiverInfo, userId);
					ComponentName component = ComponentUtils.toComponentName(receiverInfo);
					IntentFilter[] filters = null;
					if (a.intents != null) {
						filters = a.intents.toArray(new IntentFilter[a.intents.size()]);
					}
					finalList.add(new ReceiverInfo(component, filters, receiverInfo.permission));
				}
			}
		}
	}
	return finalList;
}
 
开发者ID:codehz,项目名称:container,代码行数:25,代码来源:VPackageManagerService.java

示例3: queryContentProviders

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public VParceledListSlice<ProviderInfo> queryContentProviders(String processName, int vuid, int flags) {
	int userId = VUserHandle.getUserId(vuid);
	checkUserId(userId);
	ArrayList<ProviderInfo> finalList = new ArrayList<>(3);
	// reader
	synchronized (mPackages) {
		for (PackageParser.Provider p : mProvidersByComponent.values()) {
			AppSetting setting = (AppSetting) p.owner.mExtras;
			if (processName == null || setting.appId == VUserHandle.getAppId(vuid) && p.info.processName.equals(processName)) {
				ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(p, flags);
				ComponentFixer.fixApplicationInfo(setting, providerInfo.applicationInfo, userId);
				finalList.add(providerInfo);
			}
		}
	}
	if (!finalList.isEmpty()) {
		Collections.sort(finalList, mProviderInitOrderSorter);
	}
	return new VParceledListSlice<>(finalList);
}
 
开发者ID:codehz,项目名称:container,代码行数:22,代码来源:VPackageManagerService.java

示例4: newResult

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
protected ResolveInfo newResult(PackageParser.ActivityIntentInfo info, int match) {
	final PackageParser.Activity activity = info.activity;
	ActivityInfo ai = PackageParserCompat.generateActivityInfo(activity, mFlags);
	if (ai == null) {
		return null;
	}
	final ResolveInfo res = new ResolveInfo();
	res.activityInfo = ai;
	if ((mFlags & PackageManager.GET_RESOLVED_FILTER) != 0) {
		res.filter = info;
	}
	res.priority = info.getPriority();
	res.preferredOrder = activity.owner.mPreferredOrder;
	// System.out.println("Result: " + res.activityInfo.className +
	// " = " + res.priority);
	res.match = match;
	res.isDefault = info.hasDefault;
	res.labelRes = info.labelRes;
	res.nonLocalizedLabel = info.nonLocalizedLabel;
	res.icon = info.icon;
	return res;
}
 
开发者ID:codehz,项目名称:container,代码行数:24,代码来源:VPackageManagerService.java

示例5: newResult

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
protected ResolveInfo newResult(PackageParser.ProviderIntentInfo filter, int match) {
	final PackageParser.Provider provider = filter.provider;
	ProviderInfo pi = PackageParserCompat.generateProviderInfo(provider, mFlags);
	if (pi == null) {
		return null;
	}
	final ResolveInfo res = new ResolveInfo();
	res.providerInfo = pi;
	if ((mFlags & PackageManager.GET_RESOLVED_FILTER) != 0) {
		res.filter = filter;
	}
	res.priority = filter.getPriority();
	res.preferredOrder = provider.owner.mPreferredOrder;
	res.match = match;
	res.isDefault = filter.hasDefault;
	res.labelRes = filter.labelRes;
	res.nonLocalizedLabel = filter.nonLocalizedLabel;
	res.icon = filter.icon;
	return res;
}
 
开发者ID:codehz,项目名称:container,代码行数:23,代码来源:ProviderIntentResolver.java

示例6: 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);
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:15,代码来源:PackageParserEx.java

示例7: getActivityInfo

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ActivityInfo getActivityInfo(ComponentName component, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		PackageParser.Activity a = mActivities.mActivities.get(component);
		if (a != null) {
			ActivityInfo activityInfo = PackageParserCompat.generateActivityInfo(a, flags);
			PackageParser.Package p = mPackages.get(activityInfo.packageName);
			AppSetting settings = (AppSetting) p.mExtras;
			ComponentFixer.fixComponentInfo(settings, activityInfo, userId);
			return activityInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:VPackageManagerService.java

示例8: getReceiverInfo

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ActivityInfo getReceiverInfo(ComponentName component, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		PackageParser.Activity a = mReceivers.mActivities.get(component);
		if (a != null) {
			ActivityInfo receiverInfo = PackageParserCompat.generateActivityInfo(a, flags);
			PackageParser.Package p = mPackages.get(receiverInfo.packageName);
			AppSetting settings = (AppSetting) p.mExtras;
			ComponentFixer.fixComponentInfo(settings, receiverInfo, userId);
			return receiverInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:VPackageManagerService.java

示例9: getServiceInfo

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ServiceInfo getServiceInfo(ComponentName component, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		PackageParser.Service s = mServices.mServices.get(component);
		if (s != null) {
			ServiceInfo serviceInfo = PackageParserCompat.generateServiceInfo(s, flags);
			PackageParser.Package p = mPackages.get(serviceInfo.packageName);
			AppSetting settings = (AppSetting) p.mExtras;
			ComponentFixer.fixComponentInfo(settings, serviceInfo, userId);
			return serviceInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:VPackageManagerService.java

示例10: getProviderInfo

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ProviderInfo getProviderInfo(ComponentName component, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		PackageParser.Provider p = mProvidersByComponent.get(component);
		if (p != null) {
			ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(p, flags);
			PackageParser.Package pkg = mPackages.get(providerInfo.packageName);
			AppSetting settings = (AppSetting) pkg.mExtras;
			ComponentFixer.fixComponentInfo(settings, providerInfo, userId);
			return providerInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:VPackageManagerService.java

示例11: resolveContentProvider

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ProviderInfo resolveContentProvider(String name, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		final PackageParser.Provider provider = mProvidersByAuthority.get(name);
		if (provider != null) {
			ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(provider, flags);
			PackageParser.Package p = mPackages.get(providerInfo.packageName);
			AppSetting settings = (AppSetting) p.mExtras;
			ComponentFixer.fixComponentInfo(settings, providerInfo, userId);
			return providerInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:16,代码来源:VPackageManagerService.java

示例12: getApplicationInfo

import com.lody.virtual.helper.compat.PackageParserCompat; //导入依赖的package包/类
@Override
public ApplicationInfo getApplicationInfo(String packageName, int flags, int userId) {
	checkUserId(userId);
	synchronized (mPackages) {
		PackageParser.Package pkg = mPackages.get(packageName);
		if (pkg != null) {
			ApplicationInfo applicationInfo = PackageParserCompat.generateApplicationInfo(pkg, flags);
			AppSetting settings = (AppSetting) pkg.mExtras;
			ComponentFixer.fixApplicationInfo(settings, applicationInfo, userId);
			return applicationInfo;
		}
	}
	return null;
}
 
开发者ID:codehz,项目名称:container,代码行数:15,代码来源:VPackageManagerService.java

示例13: 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);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:7,代码来源:PackageParserEx.java


注:本文中的com.lody.virtual.helper.compat.PackageParserCompat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。