protected AndroidManifest getAppManifest(Config config) {
        if (config.manifest().equals(Config.NONE)) {
            return null;
        }

        String manifestProperty = System.getProperty("android.manifest");
        String resourcesProperty = System.getProperty("android.resources");
        String assetsProperty = System.getProperty("android.assets");
        String packageName = System.getProperty("android.package");

        FsFile baseDir;
        FsFile manifestFile;
        FsFile resDir;
        FsFile assetDir;

        boolean defaultManifest = config.manifest().equals(Config.DEFAULT);
        if (defaultManifest && manifestProperty != null) {
            manifestFile = Fs.fileFromPath(manifestProperty);
            baseDir = manifestFile.getParent();
        } else {
            manifestFile = getBaseDir().join(defaultManifest ? AndroidManifest.DEFAULT_MANIFEST_NAME : config.manifest());
            baseDir = manifestFile.getParent();
        }

        boolean defaultRes = Config.DEFAULT_RES_FOLDER.equals(config.resourceDir());
        if (defaultRes && resourcesProperty != null) {
            resDir = Fs.fileFromPath(resourcesProperty);
        } else {
            resDir = baseDir.join(config.resourceDir());
        }

        boolean defaultAssets = Config.DEFAULT_ASSET_FOLDER.equals(config.assetDir());
        if (defaultAssets && assetsProperty != null) {
            assetDir = Fs.fileFromPath(assetsProperty);
        } else {
            assetDir = baseDir.join(config.assetDir());
        }

        String configPackageName = config.packageName();
        if (configPackageName != null && !configPackageName.isEmpty()) {
            packageName = configPackageName;
        }

        List<FsFile> libraryDirs = null;
        if (config.libraries().length > 0) {
            libraryDirs = new ArrayList<>();
            for (String libraryDirName : config.libraries()) {
                libraryDirs.add(baseDir.join(libraryDirName));
            }
        }

        ManifestIdentifier identifier = new ManifestIdentifier(manifestFile, resDir, assetDir, packageName, libraryDirs);
        synchronized (appManifestsByFile) {
            AndroidManifest appManifest;
            appManifest = appManifestsByFile.get(identifier);
            if (appManifest == null) {
                appManifest = createAppManifest(manifestFile, resDir, assetDir, packageName);
                if (libraryDirs != null) {
                    appManifest.setLibraryDirectories(libraryDirs);
                }
                appManifestsByFile.put(identifier, appManifest);
            }
            return appManifest;
        }

    }
protected AndroidManifest getAppManifest ( Config config ) { if ( config . manifest ( ) . equals ( Config . NONE ) ) { return null ; } String manifestProperty = System . getProperty ( "android.manifest" ) ; String resourcesProperty = System . getProperty ( "android.resources" ) ; String assetsProperty = System . getProperty ( "android.assets" ) ; String packageName = System . getProperty ( "android.package" ) ; FsFile baseDir ; FsFile manifestFile ; FsFile resDir ; FsFile assetDir ; boolean defaultManifest = config . manifest ( ) . equals ( Config . DEFAULT ) ; if ( defaultManifest && manifestProperty != null ) { manifestFile = Fs . fileFromPath ( manifestProperty ) ; baseDir = manifestFile . getParent ( ) ; } else { manifestFile = getBaseDir ( ) . join ( defaultManifest ? AndroidManifest . DEFAULT_MANIFEST_NAME : config . manifest ( ) ) ; baseDir = manifestFile . getParent ( ) ; } boolean defaultRes = Config . DEFAULT_RES_FOLDER . equals ( config . resourceDir ( ) ) ; if ( defaultRes && resourcesProperty != null ) { resDir = Fs . fileFromPath ( resourcesProperty ) ; } else { resDir = baseDir . join ( config . resourceDir ( ) ) ; } boolean defaultAssets = Config . DEFAULT_ASSET_FOLDER . equals ( config . assetDir ( ) ) ; if ( defaultAssets && assetsProperty != null ) { assetDir = Fs . fileFromPath ( assetsProperty ) ; } else { assetDir = baseDir . join ( config . assetDir ( ) ) ; } String configPackageName = config . packageName ( ) ; if ( configPackageName != null && ! configPackageName . isEmpty ( ) ) { packageName = configPackageName ; } List < FsFile > libraryDirs = null ; if ( config . libraries ( ) . length > 0 ) { libraryDirs = new ArrayList < > ( ) ; for ( String libraryDirName : config . libraries ( ) ) { libraryDirs . add ( baseDir . join ( libraryDirName ) ) ; } } ManifestIdentifier identifier = new ManifestIdentifier ( manifestFile , resDir , assetDir , packageName , libraryDirs ) ; synchronized ( appManifestsByFile ) { AndroidManifest appManifest ; appManifest = appManifestsByFile . get ( identifier ) ; if ( appManifest == null ) { appManifest = createAppManifest ( manifestFile , resDir , assetDir , packageName ) ; if ( libraryDirs != null ) { appManifest . setLibraryDirectories ( libraryDirs ) ; } appManifestsByFile . put ( identifier , appManifest ) ; } return appManifest ; } }
protected HelperTestRunner getHelperTestRunner(Class bootstrappedTestClass) {