本文整理汇总了Java中com.tencent.tinker.lib.util.TinkerLog.w方法的典型用法代码示例。如果您正苦于以下问题:Java TinkerLog.w方法的具体用法?Java TinkerLog.w怎么用?Java TinkerLog.w使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.tinker.lib.util.TinkerLog
的用法示例。
在下文中一共展示了TinkerLog.w方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPatchRetryLoad
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onPatchRetryLoad() {
if (!this.isRetryEnable) {
TinkerLog.w(TAG, "onPatchRetryLoad retry disabled, just return", new Object[0]);
} else if (!Tinker.with(this.context).isMainProcess()) {
TinkerLog.w(TAG, "onPatchRetryLoad retry is not main process, just return", new
Object[0]);
} else if (!this.retryInfoFile.exists()) {
TinkerLog.w(TAG, "onPatchRetryLoad retry info not exist, just return", new Object[0]);
} else if (TinkerServiceInternals.isTinkerPatchServiceRunning(this.context)) {
TinkerLog.w(TAG, "onPatchRetryLoad tinker service is running, just return", new
Object[0]);
} else {
String path = this.tempPatchFile.getAbsolutePath();
if (path == null || !new File(path).exists()) {
TinkerLog.w(TAG, "onPatchRetryLoad patch file: %s is not exist, just return", path);
return;
}
TinkerLog.w(TAG, "onPatchRetryLoad patch file: %s is exist, retry to patch", path);
TinkerInstaller.onReceiveUpgradePatch(this.context, path);
SampleTinkerReport.onReportRetryPatch();
}
}
示例2: tryRecoverResourceFiles
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
protected static boolean tryRecoverResourceFiles(Tinker manager, ShareSecurityCheck checker,
Context context, String
patchVersionDirectory, File
patchFile, boolean isUpgradePatch) {
if (manager.isEnabledForResource()) {
String resourceMeta = (String) checker.getMetaContentMap().get(ShareConstants
.RES_META_FILE);
if (resourceMeta == null || resourceMeta.length() == 0) {
TinkerLog.w(TAG, "patch recover, resource is not contained", new Object[0]);
return true;
}
long begin = SystemClock.elapsedRealtime();
long cost = SystemClock.elapsedRealtime() - begin;
TinkerLog.i(TAG, "recover resource result:%b, cost:%d, isNewPatch:%b", Boolean
.valueOf(patchResourceExtractViaResourceDiff(context, patchVersionDirectory,
resourceMeta, patchFile, isUpgradePatch)), Long.valueOf(cost),
Boolean.valueOf(isUpgradePatch));
return patchResourceExtractViaResourceDiff(context, patchVersionDirectory,
resourceMeta, patchFile, isUpgradePatch);
}
TinkerLog.w(TAG, "patch recover, resource is not enabled", new Object[0]);
return true;
}
示例3: installTinker
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* you can specify all class you want.
* sometimes, you can only install tinker in some process you want!
*
* @param appLike
*/
public static void installTinker(ApplicationLike appLike) {
if (isInstalled) {
TinkerLog.w(TAG, "install tinker, but has installed, ignore");
return;
}
//or you can just use DefaultLoadReporter
LoadReporter loadReporter = new SampleLoadReporter(appLike.getApplication());
//or you can just use DefaultPatchReporter
PatchReporter patchReporter = new SamplePatchReporter(appLike.getApplication());
//or you can just use DefaultPatchListener
PatchListener patchListener = new SamplePatchListener(appLike.getApplication());
//you can set your own upgrade patch if you need
AbstractPatch upgradePatchProcessor = new UpgradePatch();
TinkerInstaller.install(appLike,
loadReporter, patchReporter, patchListener,
SampleResultService.class, upgradePatchProcessor);
isInstalled = true;
}
示例4: tryRecoverDexFiles
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
protected static boolean tryRecoverDexFiles(Tinker manager, ShareSecurityCheck checker, Context context,
String patchVersionDirectory, File patchFile) {
if (!manager.isEnabledForDex()) {
TinkerLog.w(TAG, "patch recover, dex is not enabled");
return true;
}
String dexMeta = checker.getMetaContentMap().get(DEX_META_FILE);
if (dexMeta == null) {
TinkerLog.w(TAG, "patch recover, dex is not contained");
return true;
}
long begin = SystemClock.elapsedRealtime();
boolean result = patchDexExtractViaDexDiff(context, patchVersionDirectory, dexMeta, patchFile);
long cost = SystemClock.elapsedRealtime() - begin;
TinkerLog.i(TAG, "recover dex result:%b, cost:%d", result, cost);
return result;
}
示例5: patchDexExtractViaDexDiff
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
private static boolean patchDexExtractViaDexDiff(Context context, String patchVersionDirectory, String meta, final File patchFile) {
String dir = patchVersionDirectory + "/" + DEX_PATH + "/";
if (!extractDexDiffInternals(context, dir, meta, patchFile, TYPE_DEX)) {
TinkerLog.w(TAG, "patch recover, extractDiffInternals fail");
return false;
}
File dexFiles = new File(dir);
File[] files = dexFiles.listFiles();
List<File> dexList = files != null ? Arrays.asList(files) : null;
final String optimizeDexDirectory = patchVersionDirectory + "/" + DEX_OPTIMIZE_PATH + "/";
return dexOptimizeDexFiles(context, dexList, optimizeDexDirectory, patchFile);
}
示例6: tryRecoverLibraryFiles
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
protected static boolean tryRecoverLibraryFiles(Tinker manager, ShareSecurityCheck checker,
Context context, String
patchVersionDirectory, File
patchFile, boolean isUpgradePatch) {
if (manager.isEnabledForNativeLib()) {
String libMeta = (String) checker.getMetaContentMap().get(ShareConstants.SO_META_FILE);
if (libMeta == null) {
TinkerLog.w(TAG, "patch recover, library is not contained", new Object[0]);
return true;
}
long begin = SystemClock.elapsedRealtime();
long cost = SystemClock.elapsedRealtime() - begin;
TinkerLog.i(TAG, "recover lib result:%b, cost:%d, isUpgradePatch:%b", Boolean.valueOf
(patchLibraryExtractViaBsDiff(context, patchVersionDirectory, libMeta,
patchFile, isUpgradePatch)), Long.valueOf(cost), Boolean.valueOf
(isUpgradePatch));
return patchLibraryExtractViaBsDiff(context, patchVersionDirectory, libMeta,
patchFile, isUpgradePatch);
}
TinkerLog.w(TAG, "patch recover, library is not enabled", new Object[0]);
return true;
}
示例7: sampleInstallTinker
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* all use default class, simply Tinker install method
*/
public static void sampleInstallTinker(ApplicationLike appLike) {
if (isInstalled) {
TinkerLog.w(TAG, "install tinker, but has installed, ignore");
return;
}
TinkerInstaller.install(appLike);
isInstalled = true;
}
示例8: onPatchServiceResult
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* if we receive any result, we can delete the temp retry info file
*/
public void onPatchServiceResult() {
if (!isRetryEnable) {
TinkerLog.w(TAG, "onPatchServiceResult retry disabled, just return");
return;
}
//delete temp patch file
if (tempPatchFile.exists()) {
SharePatchFileUtil.safeDeleteFile(tempPatchFile);
}
}
示例9: copyToTempFile
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
private void copyToTempFile(File patchFile) {
if (patchFile.getAbsolutePath().equals(tempPatchFile.getAbsolutePath())) {
return;
}
TinkerLog.w(TAG, "try copy file: %s to %s", patchFile.getAbsolutePath(), tempPatchFile.getAbsolutePath());
try {
SharePatchFileUtil.copyFileUsingStream(patchFile, tempPatchFile);
} catch (IOException e) {
TinkerLog.e(TAG, "fail to copy file: %s to %s", patchFile.getAbsolutePath(), tempPatchFile.getAbsolutePath());
}
}
示例10: patchDexExtractViaDexDiff
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
private static boolean patchDexExtractViaDexDiff(Context context, String
patchVersionDirectory, String meta, File patchFile, boolean isUpgradePatch) {
String dir = patchVersionDirectory + "/" + ShareConstants.DEX_PATH + "/";
if (extractDexDiffInternals(context, dir, meta, patchFile, ShareTinkerInternals.isVmArt()
? 4 : 3, isUpgradePatch)) {
Tinker manager = Tinker.with(context);
File[] files = new File(dir).listFiles();
if (files != null) {
String optimizeDexDirectory = patchVersionDirectory + "/" + ShareConstants
.DEX_OPTIMIZE_PATH + "/";
File file = new File(optimizeDexDirectory);
if (!file.exists()) {
file.mkdirs();
}
int length = files.length;
int i = 0;
while (i < length) {
File file2 = files[i];
try {
String outputPathName = SharePatchFileUtil.optimizedPathFor(file2, file);
long start = System.currentTimeMillis();
DexFile.loadDex(file2.getAbsolutePath(), outputPathName, 0);
TinkerLog.i(TAG, "success dex optimize file, path: %s, use time: %d",
file2.getPath(), Long.valueOf(System.currentTimeMillis() - start));
i++;
} catch (Throwable e) {
TinkerLog.e(TAG, "dex optimize or load failed, path:" + file2.getPath(),
new Object[0]);
SharePatchFileUtil.safeDeleteFile(file2);
manager.getPatchReporter().onPatchDexOptFail(patchFile, file2,
optimizeDexDirectory, file2.getName(), e, isUpgradePatch);
return false;
}
}
}
return true;
}
TinkerLog.w(TAG, "patch recover, extractDiffInternals fail", new Object[0]);
return false;
}
示例11: sampleInstallTinker
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static void sampleInstallTinker(ApplicationLike appLike) {
if (isInstalled) {
TinkerLog.w(TAG, "install tinker, but has installed, ignore", new Object[0]);
return;
}
TinkerInstaller.install(appLike);
isInstalled = true;
}
示例12: patchResourceExtractViaResourceDiff
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
private static boolean patchResourceExtractViaResourceDiff(Context context, String
patchVersionDirectory, String meta, File patchFile, boolean isUpgradePatch) {
if (extractResourceDiffInternals(context, patchVersionDirectory + "/" + ShareConstants
.RES_PATH + "/", meta, patchFile, 7, isUpgradePatch)) {
return true;
}
TinkerLog.w(TAG, "patch recover, extractDiffInternals fail", new Object[0]);
return false;
}
示例13: rollbackPatch
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* rollback patch should restart all process
*/
public void rollbackPatch() {
if (!isTinkerLoaded()) {
TinkerLog.w(TAG, "rollbackPatch: tinker is not loaded, just return");
return;
}
// kill all other process
ShareTinkerInternals.killAllOtherProcess(context);
// clean patch
cleanPatch();
// kill itself
android.os.Process.killProcess(android.os.Process.myPid());
}
示例14: installTinker
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static void installTinker(ApplicationLike appLike) {
if (isInstalled) {
TinkerLog.w(TAG, "install tinker, but has installed, ignore", new Object[0]);
return;
}
ApplicationLike applicationLike = appLike;
TinkerInstaller.install(applicationLike, new SampleLoadReporter(appLike.getApplication())
, new SamplePatchReporter(appLike.getApplication()), new SamplePatchListener
(appLike.getApplication()), OneTinkerResultService.class, new
UpgradePatch(), new RepairPatch());
isInstalled = true;
}
示例15: onPatchServiceResult
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onPatchServiceResult(boolean isUpgradePatch) {
if (!this.isRetryEnable) {
TinkerLog.w(TAG, "onPatchServiceResult retry disabled, just return", new Object[0]);
} else if (isUpgradePatch) {
if (this.retryInfoFile.exists()) {
SharePatchFileUtil.safeDeleteFile(this.retryInfoFile);
}
if (this.tempPatchFile.exists()) {
SharePatchFileUtil.safeDeleteFile(this.tempPatchFile);
}
} else {
TinkerLog.w(TAG, "onPatchServiceResult is not upgrade patch, just return", new
Object[0]);
}
}