Search in sources :

Example 1 with BundleArchive

use of android.taobao.atlas.framework.bundlestorage.BundleArchive in project atlas by alibaba.

the class Framework method getInstalledBundle.

/**
     * 存在隐患 storelocation后期被更改
     */
public static File getInstalledBundle(String location, String bundleVersion) {
    try {
        if (new File(STORAGE_LOCATION + location).exists()) {
            BundleArchive archive = new BundleArchive(location, new File(STORAGE_LOCATION + location), 0, 0);
            String version = archive.getCurrentRevision().getVersion();
            if (TextUtils.isEmpty(bundleVersion) || version.equals(bundleVersion)) {
                return archive.getArchiveFile();
            } else {
                return null;
            }
        }
        return null;
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}
Also used : BundleArchive(android.taobao.atlas.framework.bundlestorage.BundleArchive) IOException(java.io.IOException) File(java.io.File)

Aggregations

BundleArchive (android.taobao.atlas.framework.bundlestorage.BundleArchive)1 File (java.io.File)1 IOException (java.io.IOException)1