本文整理汇总了Java中com.tencent.tinker.lib.util.TinkerLog.printErrStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java TinkerLog.printErrStackTrace方法的具体用法?Java TinkerLog.printErrStackTrace怎么用?Java TinkerLog.printErrStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.tinker.lib.util.TinkerLog
的用法示例。
在下文中一共展示了TinkerLog.printErrStackTrace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPatchDexOptFail
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* dex opt failed
*
* @param patchFile the input patch file to recover
* @param dexFiles the dex files
* @param t
*/
@Override
public void onPatchDexOptFail(File patchFile, List<File> dexFiles, Throwable t) {
TinkerLog.i(TAG, "patchReporter onPatchDexOptFail: dex opt fail path: %s, dex size: %d",
patchFile.getAbsolutePath(), dexFiles.size());
TinkerLog.printErrStackTrace(TAG, t, "onPatchDexOptFail:");
// some phone such as VIVO/OPPO like to change dex2oat to interpreted may go here
// check oat file if it is elf format
if (t.getMessage().contains(ShareConstants.CHECK_DEX_OAT_EXIST_FAIL)
|| t.getMessage().contains(ShareConstants.CHECK_DEX_OAT_FORMAT_FAIL)) {
shouldRetry = true;
deleteOptFiles(dexFiles);
} else {
Tinker.with(context).cleanPatchByVersion(patchFile);
}
}
示例2: onPatchException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* recover patch occur unknown exception that we have wrap try catch for you!
* you may need to report this exception and contact me
* welcome to report a new issues for us!
*
* @param patchFile the input file to patch
* @param e
*/
@Override
public void onPatchException(File patchFile, Throwable e) {
TinkerLog.i(TAG, "patchReporter onPatchException: patch exception path: %s, throwable: %s",
patchFile.getAbsolutePath(), e.getMessage());
TinkerLog.e(TAG, "tinker patch exception, welcome to submit issue to us: https://github.com/Tencent/tinker/issues");
// if (e.getMessage().contains(ShareConstants.CHECK_VM_PROPERTY_FAIL)) {
// ShareTinkerInternals.setTinkerDisableWithSharedPreferences(context);
// TinkerLog.i(TAG, "check vm property exception disable tinker forever with sp");
// }
TinkerLog.printErrStackTrace(TAG, e, "tinker patch exception");
//don't accept request any more!
Tinker.with(context).setTinkerDisable();
////delete temp files, I think we don't have to clean all patch
Tinker.with(context).cleanPatchByVersion(patchFile);
}
示例3: onLoadException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onLoadException(Throwable e, int errorCode) {
switch (errorCode) {
case -4:
TinkerLog.i(TAG, "patch load unCatch exception: %s", e);
ShareTinkerInternals.setTinkerDisableWithSharedPreferences(this.context);
TinkerLog.i(TAG, "unCaught exception disable tinker forever with sp", new
Object[0]);
break;
case -3:
TinkerLog.i(TAG, "patch load resource exception: %s", e);
break;
case -2:
if (e.getMessage().contains(ShareConstants.CHECK_DEX_INSTALL_FAIL)) {
TinkerLog.e(TAG, "tinker dex check fail:" + e.getMessage(), new Object[0]);
} else {
TinkerLog.i(TAG, "patch load dex exception: %s", e);
}
ShareTinkerInternals.setTinkerDisableWithSharedPreferences(this.context);
TinkerLog.i(TAG, "dex exception disable tinker forever with sp", new Object[0]);
break;
case -1:
TinkerLog.i(TAG, "patch load unknown exception: %s", e);
break;
}
TinkerLog.printErrStackTrace(TAG, e, "tinker load exception", new Object[0]);
Tinker.with(this.context).setTinkerDisable();
Tinker.with(this.context).cleanPatch();
}
示例4: onPatchDexOptFail
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onPatchDexOptFail(File patchFile, File dexFile, String optDirectory, String
dexName, Throwable t, boolean isUpgradePatch) {
TinkerLog.i(TAG, "patchReporter: dex opt fail path:%s, dexPath:%s, optDir:%s, dexName:%s," +
" isUpgrade:%b", patchFile.getAbsolutePath(), dexFile.getPath(), optDirectory,
dexName, Boolean.valueOf(isUpgradePatch));
TinkerLog.printErrStackTrace(TAG, t, "onPatchDexOptFail:", new Object[0]);
Tinker.with(this.context).cleanPatchByVersion(patchFile);
}
示例5: onPatchException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onPatchException(File patchFile, Throwable e, boolean isUpgradePatch) {
TinkerLog.i(TAG, "patchReporter: patch exception path:%s, throwable:%s, isUpgrade:%b",
patchFile.getAbsolutePath(), e.getMessage(), Boolean.valueOf(isUpgradePatch));
TinkerLog.printErrStackTrace(TAG, e, "tinker patch exception", new Object[0]);
Tinker.with(this.context).setTinkerDisable();
Tinker.with(this.context).cleanPatchByVersion(patchFile);
}
示例6: onLoadException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* load patch occur unknown exception that we have wrap try catch for you!
* you may need to report this exception and contact me
* welcome to report a new issues for us!
* you can disable patch as {@link DefaultLoadReporter#onLoadException(Throwable, int)}
*
* @param e
* @param errorCode exception code
* {@code ShareConstants.ERROR_LOAD_EXCEPTION_UNKNOWN} unknown exception
* {@code ShareConstants.ERROR_LOAD_EXCEPTION_DEX} exception when load dex
* {@code ShareConstants.ERROR_LOAD_EXCEPTION_RESOURCE} exception when load resource
* {@code ShareConstants.ERROR_LOAD_EXCEPTION_UNCAUGHT} exception unCaught
*/
@Override
public void onLoadException(Throwable e, int errorCode) {
//for unCaught or dex exception, disable tinker all the time with sp
switch (errorCode) {
case ShareConstants.ERROR_LOAD_EXCEPTION_DEX:
if (e.getMessage().contains(ShareConstants.CHECK_DEX_INSTALL_FAIL)) {
TinkerLog.e(TAG, "patch loadReporter onLoadException: tinker dex check fail:" + e.getMessage());
} else {
TinkerLog.i(TAG, "patch loadReporter onLoadException: patch load dex exception: %s", e);
}
ShareTinkerInternals.setTinkerDisableWithSharedPreferences(context);
TinkerLog.i(TAG, "dex exception disable tinker forever with sp");
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_RESOURCE:
if (e.getMessage().contains(ShareConstants.CHECK_RES_INSTALL_FAIL)) {
TinkerLog.e(TAG, "patch loadReporter onLoadException: tinker res check fail:" + e.getMessage());
} else {
TinkerLog.i(TAG, "patch loadReporter onLoadException: patch load resource exception: %s", e);
}
ShareTinkerInternals.setTinkerDisableWithSharedPreferences(context);
TinkerLog.i(TAG, "res exception disable tinker forever with sp");
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNCAUGHT:
TinkerLog.i(TAG, "patch loadReporter onLoadException: patch load unCatch exception: %s", e);
ShareTinkerInternals.setTinkerDisableWithSharedPreferences(context);
TinkerLog.i(TAG, "unCaught exception disable tinker forever with sp");
String uncaughtString = SharePatchFileUtil.checkTinkerLastUncaughtCrash(context);
if (!ShareTinkerInternals.isNullOrNil(uncaughtString)) {
File laseCrashFile = SharePatchFileUtil.getPatchLastCrashFile(context);
SharePatchFileUtil.safeDeleteFile(laseCrashFile);
// found really crash reason
TinkerLog.e(TAG, "tinker uncaught real exception:" + uncaughtString);
}
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNKNOWN:
TinkerLog.i(TAG, "patch loadReporter onLoadException: patch load unknown exception: %s", e);
//exception can be caught, it is no need to disable Tinker with sharedPreference
break;
}
TinkerLog.e(TAG, "tinker load exception, welcome to submit issue to us: https://github.com/Tencent/tinker/issues");
TinkerLog.printErrStackTrace(TAG, e, "tinker load exception");
Tinker.with(context).setTinkerDisable();
checkAndCleanPatch();
}
示例7: writeRetryProperty
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
static void writeRetryProperty(File infoFile, RetryInfo info) {
Exception e;
Throwable th;
if (info != null) {
File parentFile = infoFile.getParentFile();
if (!parentFile.exists()) {
parentFile.mkdirs();
}
Properties newProperties = new Properties();
newProperties.put(UpgradePatchRetry.RETRY_FILE_MD5_PROPERTY, info.md5);
newProperties.put(UpgradePatchRetry.RETRY_COUNT_PROPERTY, info.times);
FileOutputStream outputStream = null;
try {
FileOutputStream outputStream2 = new FileOutputStream(infoFile, false);
try {
newProperties.store(outputStream2, null);
SharePatchFileUtil.closeQuietly(outputStream2);
outputStream = outputStream2;
} catch (Exception e2) {
e = e2;
outputStream = outputStream2;
try {
TinkerLog.printErrStackTrace(UpgradePatchRetry.TAG, e, "retry write " +
"property fail", new Object[0]);
SharePatchFileUtil.closeQuietly(outputStream);
} catch (Throwable th2) {
th = th2;
SharePatchFileUtil.closeQuietly(outputStream);
throw th;
}
} catch (Throwable th3) {
th = th3;
outputStream = outputStream2;
SharePatchFileUtil.closeQuietly(outputStream);
throw th;
}
} catch (Exception e3) {
e = e3;
TinkerLog.printErrStackTrace(UpgradePatchRetry.TAG, e, "retry write property " +
"fail", new Object[0]);
SharePatchFileUtil.closeQuietly(outputStream);
}
}
}