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


Java SharePatchFileUtil.deleteDir方法代码示例

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


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

示例1: onLoadPatchVersionChanged

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
public void onLoadPatchVersionChanged(String oldVersion, String newVersion, File
        patchDirectoryFile, String currentPatchName) {
    int i = 0;
    TinkerLog.i(TAG, "patch version change from " + oldVersion + " to " + newVersion, new
            Object[0]);
    if (oldVersion != null && newVersion != null && !oldVersion.equals(newVersion) && Tinker
            .with(this.context).isMainProcess()) {
        TinkerLog.i(TAG, "try kill all other process", new Object[0]);
        ShareTinkerInternals.killAllOtherProcess(this.context);
        File[] files = patchDirectoryFile.listFiles();
        if (files != null) {
            int length = files.length;
            while (i < length) {
                File file = files[i];
                String name = file.getName();
                if (file.isDirectory() && !name.equals(currentPatchName)) {
                    SharePatchFileUtil.deleteDir(file);
                }
                i++;
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:DefaultLoadReporter.java

示例2: deleteOutOfDateOATFile

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
private static void deleteOutOfDateOATFile(String directory) {
    String optimizeDexDirectory = directory + "/" + DEFAULT_DEX_OPTIMIZE_PATH + "/";
    SharePatchFileUtil.deleteDir(optimizeDexDirectory);
    // delete android o
    if (ShareTinkerInternals.isAfterAndroidO()) {
        String androidODexDirectory = directory + "/" + ShareConstants.ANDROID_O_DEX_OPTIMIZE_PATH + "/";
        SharePatchFileUtil.deleteDir(androidODexDirectory);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:TinkerDexLoader.java

示例3: cleanPatch

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
/**
 * clean all patch files
 */
public void cleanPatch() {
    if (patchDirectory == null) {
        return;
    }
    if (isTinkerLoaded()) {
        TinkerLog.e(TAG, "it is not safety to clean patch when tinker is loaded, you should kill all your process after clean!");
    }
    SharePatchFileUtil.deleteDir(patchDirectory);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:Tinker.java

示例4: cleanPatchByVersion

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
/**
 * clean the patch version files, such as tinker/patch-641e634c
 *
 * @param versionName
 */
public void cleanPatchByVersion(String versionName) {
    if (patchDirectory == null || versionName == null) {
        return;
    }
    String path = patchDirectory.getAbsolutePath() + "/" + versionName;
    SharePatchFileUtil.deleteDir(path);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:Tinker.java

示例5: cleanPatch

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
/**
 * clean all patch files without install tinker
 * same as {@code Tinker.cleanPatch}
 *
 * @param applicationLike
 */
public static void cleanPatch(ApplicationLike applicationLike) {
    if (applicationLike == null || applicationLike.getApplication() == null) {
        throw new TinkerRuntimeException("tinkerApplication is null");
    }
    if (TinkerApplicationHelper.isTinkerLoadSuccess(applicationLike)) {
        TinkerLog.e(TAG, "it is not safety to clean patch when tinker is loaded, you should kill all your process after clean!");
    }
    SharePatchFileUtil.deleteDir(SharePatchFileUtil.getPatchDirectory(applicationLike.getApplication()));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:TinkerApplicationHelper.java

示例6: onLoadPatchVersionChanged

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
/**
 * we can only handle patch version change in the main process,
 * we will need to kill all other process to ensure that all process's code is the same.
 * you can delete the old patch version file as {@link DefaultLoadReporter#onLoadPatchVersionChanged(String, String, File, String)}
 * or you can restart your other process here
 *
 * @param oldVersion
 * @param newVersion
 * @param patchDirectoryFile
 * @param currentPatchName
 */
@Override
public void onLoadPatchVersionChanged(String oldVersion, String newVersion, File patchDirectoryFile, String currentPatchName) {
    TinkerLog.i(TAG, "patch loadReporter onLoadPatchVersionChanged: patch version change from " + oldVersion + " to " + newVersion);

    if (oldVersion == null || newVersion == null) {
        return;
    }
    if (oldVersion.equals(newVersion)) {
        return;
    }

    //check main process
    if (!Tinker.with(context).isMainProcess()) {
        return;
    }
    TinkerLog.i(TAG, "onLoadPatchVersionChanged, try kill all other process");
    //kill all other process to ensure that all process's code is the same.
    ShareTinkerInternals.killAllOtherProcess(context);
    // reset retry count to 1, for interpret retry
    UpgradePatchRetry.getInstance(context).onPatchResetMaxCheck(newVersion);

    //delete old patch files
    File[] files = patchDirectoryFile.listFiles();
    if (files != null) {
        for (File file : files) {
            String name = file.getName();
            if (file.isDirectory() && !name.equals(currentPatchName)) {
                SharePatchFileUtil.deleteDir(file);
            }
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:DefaultLoadReporter.java

示例7: cleanPatch

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
public void cleanPatch() {
    if (this.patchDirectory != null) {
        if (isTinkerLoaded()) {
            TinkerLog.e(TAG, "it is not safety to clean patch when tinker is loaded, you " +
                    "should kill all your process after clean!", new Object[0]);
        }
        SharePatchFileUtil.deleteDir(this.patchDirectory);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:Tinker.java

示例8: cleanPatch

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
public static void cleanPatch(ApplicationLike applicationLike) {
    if (applicationLike == null || applicationLike.getApplication() == null) {
        throw new TinkerRuntimeException("tinkerApplication is null");
    }
    if (isTinkerLoadSuccess(applicationLike)) {
        TinkerLog.e(TAG, "it is not safety to clean patch when tinker is loaded, you should " +
                "kill all your process after clean!", new Object[0]);
    }
    SharePatchFileUtil.deleteDir(SharePatchFileUtil.getPatchDirectory(applicationLike
            .getApplication()));
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:TinkerApplicationHelper.java

示例9: cleanPatchByVersion

import com.tencent.tinker.loader.shareutil.SharePatchFileUtil; //导入方法依赖的package包/类
public void cleanPatchByVersion(String versionName) {
    if (this.patchDirectory != null && versionName != null) {
        SharePatchFileUtil.deleteDir(this.patchDirectory.getAbsolutePath() + "/" + versionName);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:6,代码来源:Tinker.java


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