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


Java ApplicationInfo.FLAG_HAS_CODE属性代码示例

本文整理汇总了Java中android.content.pm.ApplicationInfo.FLAG_HAS_CODE属性的典型用法代码示例。如果您正苦于以下问题:Java ApplicationInfo.FLAG_HAS_CODE属性的具体用法?Java ApplicationInfo.FLAG_HAS_CODE怎么用?Java ApplicationInfo.FLAG_HAS_CODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.pm.ApplicationInfo的用法示例。


在下文中一共展示了ApplicationInfo.FLAG_HAS_CODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processRestarted

@Override
public void processRestarted(String packageName, String processName, int userId) {
    int callingPid = getCallingPid();
    int appId = VAppManagerService.get().getAppId(packageName);
    int uid = VUserHandle.getUid(userId, appId);
    synchronized (this) {
        ProcessRecord app = findProcessLocked(callingPid);
        if (app == null) {
            ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
            appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
            String stubProcessName = getProcessName(callingPid);
            int vpid = parseVPid(stubProcessName);
            if (vpid != -1) {
                performStartProcessLocked(uid, vpid, appInfo, processName);
            }
        }
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:18,代码来源:VActivityManagerService.java

示例2: initApplicationInfoBase

public static void initApplicationInfoBase(PackageSetting ps, VPackage p) {
    ApplicationInfo ai = p.applicationInfo;
    ai.flags |= ApplicationInfo.FLAG_HAS_CODE;
    if (TextUtils.isEmpty(ai.processName)) {
        ai.processName = ai.packageName;
    }
    ai.enabled = true;
    ai.nativeLibraryDir = ps.libPath;
    ai.uid = ps.appId;
    ai.name = ComponentFixer.fixComponentClassName(ps.packageName, ai.name);
    ai.publicSourceDir = ps.apkPath;
    ai.sourceDir = ps.apkPath;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ai.splitSourceDirs = new String[]{ps.apkPath};
        ai.splitPublicSourceDirs = ai.splitSourceDirs;
        ApplicationInfoL.scanSourceDir.set(ai, ai.dataDir);
        ApplicationInfoL.scanPublicSourceDir.set(ai, ai.dataDir);
        String hostPrimaryCpuAbi = ApplicationInfoL.primaryCpuAbi.get(VirtualCore.get().getContext().getApplicationInfo());
        ApplicationInfoL.primaryCpuAbi.set(ai, hostPrimaryCpuAbi);
    }

    if (ps.dependSystem) {
        String[] sharedLibraryFiles = sSharedLibCache.get(ps.packageName);
        if (sharedLibraryFiles == null) {
            PackageManager hostPM = VirtualCore.get().getUnHookPackageManager();
            try {
                ApplicationInfo hostInfo = hostPM.getApplicationInfo(ps.packageName, PackageManager.GET_SHARED_LIBRARY_FILES);
                sharedLibraryFiles = hostInfo.sharedLibraryFiles;
                if (sharedLibraryFiles == null) sharedLibraryFiles = new String[0];
                sSharedLibCache.put(ps.packageName, sharedLibraryFiles);
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        }
        ai.sharedLibraryFiles = sharedLibraryFiles;
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:37,代码来源:PackageParserEx.java

示例3: fixApplicationInfo

public static void fixApplicationInfo(AppSetting setting, ApplicationInfo applicationInfo, int userId) {
	applicationInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
	if (TextUtils.isEmpty(applicationInfo.processName)) {
		applicationInfo.processName = applicationInfo.packageName;
	}
	applicationInfo.name = fixComponentClassName(setting.packageName, applicationInfo.name);
	applicationInfo.publicSourceDir = setting.apkPath;
	applicationInfo.sourceDir = setting.apkPath;
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
		applicationInfo.splitSourceDirs = new String[]{setting.apkPath};
		applicationInfo.splitPublicSourceDirs = applicationInfo.splitSourceDirs;
		ApplicationInfoL.scanSourceDir.set(applicationInfo, applicationInfo.dataDir);
		ApplicationInfoL.scanPublicSourceDir.set(applicationInfo, applicationInfo.dataDir);
           String hostPrimaryCpuAbi = ApplicationInfoL.primaryCpuAbi.get(VirtualCore.get().getContext().getApplicationInfo());
		ApplicationInfoL.primaryCpuAbi.set(applicationInfo, hostPrimaryCpuAbi);
	}
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
		ApplicationInfoN.deviceEncryptedDataDir.set(applicationInfo, applicationInfo.dataDir);
		ApplicationInfoN.deviceProtectedDataDir.set(applicationInfo, applicationInfo.dataDir);
		ApplicationInfoN.credentialEncryptedDataDir.set(applicationInfo, applicationInfo.dataDir);
		ApplicationInfoN.credentialProtectedDataDir.set(applicationInfo, applicationInfo.dataDir);
	}
	applicationInfo.enabled = true;
	applicationInfo.nativeLibraryDir = setting.libPath;
	applicationInfo.dataDir = VEnvironment.getDataUserPackageDirectory(userId, setting.packageName).getPath();
	applicationInfo.uid = setting.appId;
	if (setting.dependSystem) {
		String[] sharedLibraryFiles = sSharedLibCache.get(setting.packageName);
		if (sharedLibraryFiles == null) {
			PackageManager hostPM = VirtualCore.get().getUnHookPackageManager();
			try {
				ApplicationInfo hostInfo = hostPM.getApplicationInfo(setting.packageName, PackageManager.GET_SHARED_LIBRARY_FILES);
				sharedLibraryFiles = hostInfo.sharedLibraryFiles;
				if (sharedLibraryFiles == null) sharedLibraryFiles = new String[0];
				sSharedLibCache.put(setting.packageName, sharedLibraryFiles);
			} catch (PackageManager.NameNotFoundException e) {
				e.printStackTrace();
			}
		}
		applicationInfo.sharedLibraryFiles = sharedLibraryFiles;
	}
}
 
开发者ID:codehz,项目名称:container,代码行数:42,代码来源:ComponentFixer.java


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