Code example for ApplicationInfo

0
 
        @Override 
        public ApplicationInfo getApplicationInfo() {
            ApplicationInfo containingInfo = context.getApplicationInfo();
 
            ApplicationInfo info = new ApplicationInfo();
            info.sourceDir = getFile().getParent();
            info.packageName = packageName;
            info.uid = containingInfo.uid;
            //info.sharedLibraryFiles = containingInfo.sharedLibraryFiles; 
            //info.dataDir = containingInfo.dataDir; 
            info.targetSdkVersion = containingInfo.targetSdkVersion;
 
            info.className = android.app.Application.class.getName();;
            info.descriptionRes = 0;
            info.theme = 0; // populate later on from apk?
            info.manageSpaceActivityName = null;
            info.flags = 0;
            info.publicSourceDir = info.sourceDir;
            info.sharedLibraryFiles = null;
            info.dataDir = null;
            info.enabled = false;
 
            // newer stuff? not sure if we need it 
            //info.backupAgentName = null; 
            //info.resourceDirs = null; 
            //info.nativeLibraryDir = null; 
            //info.installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; 
 
            if (Build.VERSION.SDK_INT >= 9) {
                Object value = Rxn.getFieldValue(containingInfo, "nativeLibraryDir");
                Rxn.setFieldValue(info, "nativeLibraryDir", value);
            } 
 
            return info;
        } 
    }