• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PatchResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.tencent.tinker.lib.service.PatchResult的典型用法代码示例。如果您正苦于以下问题:Java PatchResult类的具体用法?Java PatchResult怎么用?Java PatchResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PatchResult类属于com.tencent.tinker.lib.service包,在下文中一共展示了PatchResult类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: reportTinkerPatchFail

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
/**
 * 上报补丁合成情况
 * @param patchResult
 */
public static void reportTinkerPatchFail(PatchResult patchResult) {
    if (sTinkerServerClient == null) {
        TinkerLog.e(TAG, "reportTinkerPatchFail, sTinkerServerClient == null");
        return;
    }
    if (patchResult == null) {
        TinkerLog.e(TAG, "reportTinkerPatchFail, patchResult == null");
        return;
    }

    if (patchResult.isSuccess) {
        TinkerLog.i(TAG, "reportTinkerPatchFail, patch success, just return");
        return;
    }
    String patchMd5 = (patchResult.patchVersion != null)
        ? patchResult.patchVersion : SharePatchFileUtil.getMD5(new File(patchResult.rawPatchFilePath));

    if (!patchMd5.equals(sTinkerServerClient.getCurrentPatchMd5())) {
        TinkerLog.e(TAG, "reportTinkerPatchFail, md5 not equal, patchMd5:%s, currentPatchMd5:%s",
            patchMd5, sTinkerServerClient.getCurrentPatchMd5()
        );
        return;
    }
    sTinkerServerClient.reportPatchFail(
        sTinkerServerClient.getCurrentPatchVersion(),
        DefaultPatchRequestCallback.ERROR_PATCH_FAIL
    );
}
 
开发者ID:TinkerPatch,项目名称:tinkerpatch-sdk,代码行数:33,代码来源:TinkerServerManager.java


示例2: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
@Override
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "SampleResultService received null result!!!!");
        return;
    }
    TinkerLog.i(TAG, "SampleResultService receive result: %s", result.toString());

    //first, we want to kill the recover process
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());

    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (result.isSuccess) {
                Toast.makeText(getApplicationContext(), "patch success, please restart process", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(getApplicationContext(), "patch fail, please check reason", Toast.LENGTH_LONG).show();
            }
        }
    });
    // is success and newPatch, it is nice to delete the raw file, and restart at once
    // for old patch, you can't delete the patch file
    if (result.isSuccess) {
        deleteRawPatchFile(new File(result.rawPatchFilePath));

        //not like TinkerResultService, I want to restart just when I am at background!
        //if you have not install tinker this moment, you can use TinkerApplicationHelper api
        if (checkIfNeedKill(result)) {
            if (Utils.isBackground()) {
                TinkerLog.i(TAG, "it is in background, just restart process");
                restartProcess();
            } else {
                //we can wait process at background, such as onAppBackground
                //or we can restart when the screen off
                TinkerLog.i(TAG, "tinker wait screen to restart process");
                new ScreenState(getApplicationContext(), new ScreenState.IOnScreenOff() {
                    @Override
                    public void onScreenOff() {
                        restartProcess();
                    }
                });
            }
        } else {
            TinkerLog.i(TAG, "I have already install the newly patch version!");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:50,代码来源:SampleResultService.java


示例3: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
@Override
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "SampleResultService received null result!!!!");
        return;
    }
    TinkerLog.i(TAG, "SampleResultService receive result: %s", result.toString());

    //first, we want to kill the recover process
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());

    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (result.isSuccess) {
                Toast.makeText(getApplicationContext(), "patch success, please restart process", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(getApplicationContext(), "patch fail, please check reason", Toast.LENGTH_LONG).show();
            }
        }
    });
    // is success and newPatch, it is nice to delete the raw file, and restart at once
    // for old patch, you can't delete the patch file
    if (result.isSuccess) {
        deleteRawPatchFile(new File(result.rawPatchFilePath));

        //not like TinkerResultService, I want to restart just when I am at background!
        //if you have not install tinker this moment, you can use TinkerApplicationHelper api
        if (checkIfNeedKill(result)) {
            if (Utils.isBackground()) {
                TinkerLog.i(TAG, "it is in background, just restart process");
                restartProcess();
            } else {
                //we can wait process at background, such as onAppBackground
                //or we can restart when the screen off
                TinkerLog.i(TAG, "tinker wait screen to restart process");
                new Utils.ScreenState(getApplicationContext(), new Utils.ScreenState.IOnScreenOff() {
                    @Override
                    public void onScreenOff() {
                        restartProcess();
                    }
                });
            }
        } else {
            TinkerLog.i(TAG, "I have already install the newly patch version!");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:50,代码来源:SampleResultService.java


示例4: useSample

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
/**
 * 在这里给出TinkerPatch的所有接口解释
 * 更详细的解释请参考:http://tinkerpatch.com/Docs/api
 */
private void useSample() {
    TinkerPatch.init(tinkerApplicationLike)
        //是否自动反射Library路径,无须手动加载补丁中的So文件
        //注意,调用在反射接口之后才能生效,你也可以使用Tinker的方式加载Library
        .reflectPatchLibrary()
        //向后台获取是否有补丁包更新,默认的访问间隔为3个小时
        //若参数为true,即每次调用都会真正的访问后台配置
        .fetchPatchUpdate(false)
        //设置访问后台补丁包更新配置的时间间隔,默认为3个小时
        .setFetchPatchIntervalByHours(3)
        //向后台获得动态配置,默认的访问间隔为3个小时
        //若参数为true,即每次调用都会真正的访问后台配置
        .fetchDynamicConfig(new ConfigRequestCallback() {
            @Override
            public void onSuccess(HashMap<String, String> hashMap) {

            }

            @Override
            public void onFail(Exception e) {

            }
        }, false)
        //设置访问后台动态配置的时间间隔,默认为3个小时
        .setFetchDynamicConfigIntervalByHours(3)
        //设置当前渠道号,对于某些渠道我们可能会想屏蔽补丁功能
        //设置渠道后,我们就可以使用后台的条件控制渠道更新
        .setAppChannel("default")
        //屏蔽部分渠道的补丁功能
        .addIgnoreAppChannel("googleplay")
        //设置tinkerpatch平台的条件下发参数
        .setPatchCondition("test", "1")
        //设置补丁合成成功后,锁屏重启程序
        //默认是等应用自然重启
        .setPatchRestartOnSrceenOff(true)
        //我们可以通过ResultCallBack设置对合成后的回调
        //例如弹框什么
        .setPatchResultCallback(new ResultCallBack() {
            @Override
            public void onPatchResult(PatchResult patchResult) {
                Log.i(TAG, "onPatchResult callback here");
            }
        })
        //设置收到后台回退要求时,锁屏清除补丁
        //默认是等主进程重启时自动清除
        .setPatchRollbackOnScreenOff(true)
        //我们可以通过RollbackCallBack设置对回退时的回调
        .setPatchRollBackCallback(new RollbackCallBack() {
            @Override
            public void onPatchRollback() {
                Log.i(TAG, "onPatchRollback callback here");
            }
        });
}
 
开发者ID:TinkerPatch,项目名称:tinkerpatch-andresguard-sample,代码行数:59,代码来源:SampleApplication.java


示例5: tryPatch

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
public boolean tryPatch(Context context, String tempPatchPath, PatchResult patchResult) {
    Tinker manager = Tinker.with(context);
    File patchFile = new File(tempPatchPath);
    if (!manager.isTinkerEnabled() || !ShareTinkerInternals
            .isTinkerEnableWithSharedPreferences(context)) {
        TinkerLog.e(TAG, "RepairPatch tryPatch:patch is disabled, just return", new Object[0]);
        return false;
    } else if (patchFile.isFile() && patchFile.exists()) {
        ShareSecurityCheck signatureCheck = new ShareSecurityCheck(context);
        int returnCode = ShareTinkerInternals.checkSignatureAndTinkerID(context, patchFile,
                signatureCheck);
        if (returnCode != 0) {
            TinkerLog.e(TAG, "RepairPatch tryPatch:onPatchPackageCheckFail", new Object[0]);
            manager.getPatchReporter().onPatchPackageCheckFail(patchFile, false, returnCode);
            return false;
        }
        patchResult.patchTinkerID = signatureCheck.getNewTinkerID();
        patchResult.baseTinkerID = signatureCheck.getTinkerID();
        SharePatchInfo oldInfo = manager.getTinkerLoadResultIfPresent().patchInfo;
        String patchMd5 = SharePatchFileUtil.getMD5(patchFile);
        patchResult.patchVersion = patchMd5;
        if (oldInfo == null) {
            TinkerLog.e(TAG, "OldPatchProcessor tryPatch:onPatchVersionCheckFail, oldInfo is " +
                    "null", new Object[0]);
            manager.getPatchReporter().onPatchVersionCheckFail(patchFile, oldInfo, patchMd5,
                    false);
            return false;
        } else if (oldInfo.oldVersion == null || oldInfo.newVersion == null) {
            TinkerLog.e(TAG, "RepairPatch tryPatch:onPatchInfoCorrupted", new Object[0]);
            manager.getPatchReporter().onPatchInfoCorrupted(patchFile, oldInfo.oldVersion,
                    oldInfo.newVersion, false);
            return false;
        } else if (oldInfo.oldVersion.equals(patchMd5) && oldInfo.newVersion.equals(patchMd5)) {
            String patchDirectory = manager.getPatchDirectory().getAbsolutePath();
            String patchVersionDirectory = patchDirectory + "/" + SharePatchFileUtil
                    .getPatchVersionDirectory(patchMd5);
            if (!DexDiffPatchInternal.tryRecoverDexFiles(manager, signatureCheck, context,
                    patchVersionDirectory, patchFile, false)) {
                TinkerLog.e(TAG, "RepairPatch tryPatch:try patch dex failed", new Object[0]);
                return false;
            } else if (!BsDiffPatchInternal.tryRecoverLibraryFiles(manager, signatureCheck,
                    context, patchVersionDirectory, patchFile, false)) {
                TinkerLog.e(TAG, "RepairPatch tryPatch:try patch library failed", new
                        Object[0]);
                return false;
            } else if (ResDiffPatchInternal.tryRecoverResourceFiles(manager, signatureCheck,
                    context, patchVersionDirectory, patchFile, false)) {
                return true;
            } else {
                TinkerLog.e(TAG, "RepairPatch tryPatch:try patch resource failed", new
                        Object[0]);
                return false;
            }
        } else {
            TinkerLog.e(TAG, "RepairPatch tryPatch:onPatchVersionCheckFail", new Object[0]);
            manager.getPatchReporter().onPatchVersionCheckFail(patchFile, oldInfo, patchMd5,
                    false);
            return false;
        }
    } else {
        TinkerLog.e(TAG, "RepairPatch tryPatch:patch file is not found, just return", new
                Object[0]);
        return false;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:66,代码来源:RepairPatch.java


示例6: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "SampleResultService received null result!!!!", new Object[0]);
        return;
    }
    TinkerLog.i(TAG, "SampleResultService receive result: %s", result.toString());
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());
    new Handler(Looper.getMainLooper()).post(new Runnable() {
        public void run() {
            if (result.isSuccess) {
                MobclickAgent.onEvent(MyApplication.getContext(), Event.tinker_combine_success);
                Helper.showLog(OneTinkerResultService.TAG, "patch success, please restart " +
                        "process");
                return;
            }
            MobclickAgent.onEvent(MyApplication.getContext(), Event.tinker_combine_failed);
            Helper.showLog(OneTinkerResultService.TAG, "patch fail, please check reason");
        }
    });
    if (result.isSuccess && result.isUpgradePatch) {
        File rawFile = new File(result.rawPatchFilePath);
        if (rawFile.exists()) {
            TinkerLog.i(TAG, "save delete raw patch file", new Object[0]);
            SharePatchFileUtil.safeDeleteFile(rawFile);
        }
        if (!checkIfNeedKill(result)) {
            TinkerLog.i(TAG, "I have already install the newly patch version!", new Object[0]);
        } else if (Utils.isBackground()) {
            TinkerLog.i(TAG, "it is in background, just restart process", new Object[0]);
            restartProcess();
        } else {
            TinkerLog.i(TAG, "tinker wait screen to restart process", new Object[0]);
            ScreenState screenState = new ScreenState(getApplicationContext(), new
                    IOnScreenOff() {
                public void onScreenOff() {
                    OneTinkerResultService.this.restartProcess();
                }
            });
        }
    }
    if (!result.isSuccess && !result.isUpgradePatch) {
        Tinker.with(getApplicationContext()).cleanPatch();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:45,代码来源:OneTinkerResultService.java


示例7: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
@Override
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "SampleResultService received null result!!!!");
        return;
    }
    TinkerLog.i(TAG, "SampleResultService receive result: %s", result.toString());

    //first, we want to kill the recover process
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());

    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (result.isSuccess) {
                Toast.makeText(getApplicationContext(), "patch success, please restart process", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(getApplicationContext(), "patch fail, please check reason", Toast.LENGTH_LONG).show();
            }
        }
    });
    // is success and newPatch, it is nice to delete the raw file, and restart at once
    // for old patch, you can't delete the patch file
    if (result.isSuccess) {
        deleteRawPatchFile(new File(result.rawPatchFilePath));

        //not like TinkerResultService, I want to restart just when I am at background!
        //if you have not install tinker this moment, you can use TinkerApplicationHelper api
        if (checkIfNeedKill(result)) {
            if (TinkerUtils.isBackground()) {
                TinkerLog.i(TAG, "it is in background, just restart process");
                restartProcess();
            } else {
                //we can wait process at background, such as onAppBackground
                //or we can restart when the screen off
                TinkerLog.i(TAG, "tinker wait screen to restart process");
                new TinkerUtils.ScreenState(getApplicationContext(), new TinkerUtils.ScreenState.IOnScreenOff() {
                    @Override
                    public void onScreenOff() {
                        restartProcess();
                    }
                });
            }
        } else {
            TinkerLog.i(TAG, "I have already install the newly patch version!");
        }
    }
}
 
开发者ID:GitLqr,项目名称:HotFixDemo,代码行数:50,代码来源:SampleResultService.java


示例8: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
@Override
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "SampleResultService received null result!!!!");
        return;
    }
    TinkerLog.i(TAG, "SampleResultService receive result: %s", result.toString());

    //first, we want to kill the recover process
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());

    Handler handler = new Handler(Looper.getMainLooper());
    handler.post(new Runnable() {
        @Override
        public void run() {
            if (result.isSuccess) {
                TinkerLog.i(TAG, "patch success, please restart process");
            } else {
                TinkerLog.e(TAG, "patch fail, please check reason");
            }
        }
    });
    // is success and newPatch, it is nice to delete the raw file, and restart at once
    // for old patch, you can't delete the patch file
    if (!result.isSuccess) {
        //补丁合成异常
        PatchManager.getInstance().onPatchFailure(result.rawPatchFilePath, PatchManager.ERROR_CODE_PATCH_RESULT + PatchManager.ERROR_PATCH_FAIL);
        return;
    }
    //deleteRawPatchFile(new File(result.rawPatchFilePath));

    PatchManager.getInstance().onPatchSuccess(result.rawPatchFilePath);

    //not like TinkerResultService, I want to restart just when I am at background!
    //if you have not install tinker this moment, you can use TinkerApplicationHelper api
    if (checkIfNeedKill(result)) {
        if (SampleUtils.isBackground()) {
            TinkerLog.i(TAG, "it is in background, just restart process");
            restartProcess();
        } else {
            //we can wait process at background, such as onAppBackground
            //or we can restart when the screen off
            TinkerLog.i(TAG, "tinker wait screen to restart process");
            new SampleUtils.ScreenState(getApplicationContext(), new SampleUtils.ScreenState.IOnScreenOff() {
                @Override
                public void onScreenOff() {
                    restartProcess();
                }
            });
        }
    } else {
        TinkerLog.i(TAG, "I have already install the newly patch version!");
    }
}
 
开发者ID:baidao,项目名称:tinker-manager,代码行数:55,代码来源:SampleResultService.java


示例9: useSample

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
/**
 *  配置用例
 * 在这里给出TinkerPatch的所有接口解释
 * 更详细的解释请参考:http://tinkerpatch.com/Docs/api
 */
private void useSample() {
    TinkerPatch.init(tinkerApplicationLike)
            //是否自动反射Library路径,无须手动加载补丁中的So文件
            //注意,调用在反射接口之后才能生效,你也可以使用Tinker的方式加载Library
            .reflectPatchLibrary()
            //向后台获取是否有补丁包更新,默认的访问间隔为3个小时
            //若参数为true,即每次调用都会真正的访问后台配置
            .fetchPatchUpdate(false)
            //设置访问后台补丁包更新配置的时间间隔,默认为3个小时
            .setFetchPatchIntervalByHours(3)
            //向后台获得动态配置,默认的访问间隔为3个小时
            //若参数为true,即每次调用都会真正的访问后台配置
            .fetchDynamicConfig(new ConfigRequestCallback() {
                @Override
                public void onSuccess(HashMap<String, String> hashMap) {

                }

                @Override
                public void onFail(Exception e) {

                }
            }, false)
            //设置访问后台动态配置的时间间隔,默认为3个小时
            .setFetchDynamicConfigIntervalByHours(3)
            //设置当前渠道号,对于某些渠道我们可能会想屏蔽补丁功能
            //设置渠道后,我们就可以使用后台的条件控制渠道更新
            .setAppChannel("default")
            //屏蔽部分渠道的补丁功能
            .addIgnoreAppChannel("googleplay")
            //设置tinkerpatch平台的条件下发参数
            .setPatchCondition("test", "1")
            //设置补丁合成成功后,锁屏重启程序
            //默认是等应用自然重启
            .setPatchRestartOnSrceenOff(true)
            //我们可以通过ResultCallBack设置对合成后的回调
            //例如弹框什么
            .setPatchResultCallback(new ResultCallBack() {
                @Override
                public void onPatchResult(PatchResult patchResult) {
                    Log.i(TAG, "onPatchResult callback here");
                }
            })
            //设置收到后台回退要求时,锁屏清除补丁
            //默认是等主进程重启时自动清除
            .setPatchRollbackOnScreenOff(true)
            //我们可以通过RollbackCallBack设置对回退时的回调
            .setPatchRollBackCallback(new RollbackCallBack() {
                @Override
                public void onPatchRollback() {
                    Log.i(TAG, "onPatchRollback callback here");
                }
            });
}
 
开发者ID:longtaoge,项目名称:tinkerDemo,代码行数:60,代码来源:MyApplication.java


示例10: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
@Override
public void onPatchResult(final PatchResult result) {
    if (result == null) {
        TinkerLog.e(TAG, "received null result!!!!");
        return;
    }
    TinkerLog.i(TAG, "receive result: %s", result.toString());

    //first, we want to kill the recover process
    TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());
    TinkerServerManager.reportTinkerPatchFail(result);

    if (result.isSuccess) {
        TinkerLog.i(TAG, "patch success, please restart process");
        File rawFile = new File(result.rawPatchFilePath);
        if (rawFile.exists()) {
            TinkerLog.i(TAG, "save delete raw patch file");
            SharePatchFileUtil.safeDeleteFile(rawFile);
        }
        //not like TinkerResultService, I want to restart just when I am at background!
        //if you have not install tinker this moment, you can use TinkerApplicationHelper api
        if (checkIfNeedKill(result)) {
            if (TinkerServerUtils.isBackground()) {
                TinkerLog.i(TAG, "it is in background, just restart process");
                restartProcess();
            } else {
                //we can wait process at background, such as onAppBackground
                //or we can restart when the screen off
                TinkerLog.i(TAG, "tinker wait screen to restart process");
                new TinkerServerUtils.ScreenState(
                    getApplicationContext(), new TinkerServerUtils.IOnScreenOff() {
                    @Override
                    public void onScreenOff() {
                        restartProcess();
                    }
                });
            }
        } else {
            TinkerLog.i(TAG, "I have already install the newly patch version!");
        }
    } else {
        TinkerLog.i(TAG, "patch fail, please check reason");
    }

    //repair current patch fail, just clean!
    if (!result.isSuccess) {
        //if you have not install tinker this moment, you can use TinkerApplicationHelper api
        Tinker.with(getApplicationContext()).cleanPatch();
    }
}
 
开发者ID:TinkerPatch,项目名称:tinkerpatch-sdk,代码行数:51,代码来源:TinkerServerResultService.java


示例11: useSample

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
/**
 * 在这里给出TinkerPatch的所有接口解释
 * 更详细的解释请参考:http://tinkerpatch.com/Docs/api
 */
private void useSample() {
    TinkerPatch.init(this)
        //是否自动反射Library路径,无须手动加载补丁中的So文件
        //注意,调用在反射接口之后才能生效,你也可以使用Tinker的方式加载Library
        .reflectPatchLibrary()
        //向后台获取是否有补丁包更新,默认的访问间隔为3个小时
        //若参数为true,即每次调用都会真正的访问后台配置
        .fetchPatchUpdate(false)
        //设置访问后台补丁包更新配置的时间间隔,默认为3个小时
        .setFetchPatchIntervalByHours(3)
        //向后台获得动态配置,默认的访问间隔为3个小时
        //若参数为true,即每次调用都会真正的访问后台配置
        .fetchDynamicConfig(new ConfigRequestCallback() {
            @Override
            public void onSuccess(HashMap<String, String> hashMap) {

            }

            @Override
            public void onFail(Exception e) {

            }
        }, false)
        //设置访问后台动态配置的时间间隔,默认为3个小时
        .setFetchDynamicConfigIntervalByHours(3)
        //设置当前渠道号,对于某些渠道我们可能会想屏蔽补丁功能
        //设置渠道后,我们就可以使用后台的条件控制渠道更新
        .setAppChannel("default")
        //屏蔽部分渠道的补丁功能
        .addIgnoreAppChannel("googleplay")
        //设置tinkerpatch平台的条件下发参数
        .setPatchCondition("test", "1")
        //设置补丁合成成功后,锁屏重启程序
        //默认是等应用自然重启
        .setPatchRestartOnSrceenOff(true)
        //我们可以通过ResultCallBack设置对合成后的回调
        //例如弹框什么
        .setPatchResultCallback(new ResultCallBack() {
            @Override
            public void onPatchResult(PatchResult patchResult) {
                Log.i(TAG, "onPatchResult callback here");
            }
        })
        //设置收到后台回退要求时,锁屏清除补丁
        //默认是等主进程重启时自动清除
        .setPatchRollbackOnScreenOff(true)
        //我们可以通过RollbackCallBack设置对回退时的回调
        .setPatchRollBackCallback(new RollbackCallBack() {
            @Override
            public void onPatchRollback() {
                Log.i(TAG, "onPatchRollback callback here");
            }
        });
}
 
开发者ID:TinkerPatch,项目名称:tinkerpatch-sample,代码行数:59,代码来源:SampleApplicationLike.java


示例12: tryPatch

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
public abstract boolean tryPatch(Context context, String tempPatchPath, PatchResult patchResult); 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:2,代码来源:AbstractPatch.java


示例13: tryPatch

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
public abstract boolean tryPatch(Context context, String str, PatchResult patchResult); 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:2,代码来源:AbstractPatch.java


示例14: onPatchResult

import com.tencent.tinker.lib.service.PatchResult; //导入依赖的package包/类
void onPatchResult(final PatchResult result); 
开发者ID:TinkerPatch,项目名称:tinkerpatch-sdk,代码行数:2,代码来源:ResultCallBack.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StreamJob类代码示例发布时间:2022-05-22
下一篇:
Java DataSetBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap