本文整理汇总了Java中com.tencent.tinker.lib.util.TinkerLog.e方法的典型用法代码示例。如果您正苦于以下问题:Java TinkerLog.e方法的具体用法?Java TinkerLog.e怎么用?Java TinkerLog.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.tinker.lib.util.TinkerLog
的用法示例。
在下文中一共展示了TinkerLog.e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPatchResult
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onPatchResult(PatchResult result) {
if (result == null) {
TinkerLog.e(TAG, "DefaultTinkerResultService received null result!!!!", new Object[0]);
return;
}
TinkerLog.i(TAG, "DefaultTinkerResultService received a result:%s ", result.toString());
TinkerServiceInternals.killTinkerPatchServiceProcess(getApplicationContext());
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)) {
Process.killProcess(Process.myPid());
} else {
TinkerLog.i(TAG, "I have already install the newly patch version!", new Object[0]);
}
}
if (!result.isSuccess && !result.isUpgradePatch) {
Tinker.with(getApplicationContext()).cleanPatch();
}
}
示例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: onLoadInterpret
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* After system ota, we will try to load dex with interpret mode
*
* @param type type define as following
* {@code ShareConstants.TYPE_INTERPRET_OK} it is ok, using interpret mode
* {@code ShareConstants.TYPE_INTERPRET_GET_INSTRUCTION_SET_ERROR} get instruction set from exist oat file fail
* {@code ShareConstants.TYPE_INTERPRET_COMMAND_ERROR} use command line to generate interpret oat file fail
* @param e
*/
@Override
public void onLoadInterpret(int type, Throwable e) {
TinkerLog.i(TAG, "patch loadReporter onLoadInterpret: type: %d, throwable: %s",
type, e);
switch (type) {
case ShareConstants.TYPE_INTERPRET_GET_INSTRUCTION_SET_ERROR:
TinkerLog.e(TAG, "patch loadReporter onLoadInterpret fail, can get instruction set from existed oat file");
break;
case ShareConstants.TYPE_INTERPRET_COMMAND_ERROR:
TinkerLog.e(TAG, "patch loadReporter onLoadInterpret fail, command line to interpret return error");
break;
case ShareConstants.TYPE_INTERPRET_OK:
TinkerLog.i(TAG, "patch loadReporter onLoadInterpret ok");
break;
}
retryPatch();
}
示例4: installNavitveLibraryABI
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
/**
* you can reflect your current abi to classloader library path
* as you don't need to use load*Library method above
* @param context
* @param currentABI
*/
public static void installNavitveLibraryABI(Context context, String currentABI) {
Tinker tinker = Tinker.with(context);
if (!tinker.isTinkerLoaded()) {
TinkerLog.i(TAG, "tinker is not loaded, just return");
return;
}
TinkerLoadResult loadResult = tinker.getTinkerLoadResultIfPresent();
if (loadResult.libs == null) {
TinkerLog.i(TAG, "tinker libs is null, just return");
return;
}
File soDir = new File(loadResult.libraryDirectory, "lib/" + currentABI);
if (!soDir.exists()) {
TinkerLog.e(TAG, "current libraryABI folder is not exist, path: %s", soDir.getPath());
return;
}
ClassLoader classLoader = context.getClassLoader();
if (classLoader == null) {
TinkerLog.e(TAG, "classloader is null");
return;
}
TinkerLog.i(TAG, "before hack classloader:" + classLoader.toString());
try {
installNativeLibraryPath(classLoader, soDir);
} catch (Throwable throwable) {
TinkerLog.e(TAG, "installNativeLibraryPath fail:" + throwable);
}
TinkerLog.i(TAG, "after hack classloader:" + classLoader.toString());
}
示例5: onLoadException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static void onLoadException(Throwable throwable, int errorCode) {
if (reporter == null) {
return;
}
boolean isCheckFail = false;
switch (errorCode) {
case ShareConstants.ERROR_LOAD_EXCEPTION_DEX:
if (throwable.getMessage().contains(ShareConstants.CHECK_DEX_INSTALL_FAIL)) {
reporter.onReport(KEY_LOADED_EXCEPTION_DEX_CHECK);
isCheckFail = true;
TinkerLog.e(TAG, "tinker dex check fail:" + throwable.getMessage());
} else {
reporter.onReport(KEY_LOADED_EXCEPTION_DEX);
TinkerLog.e(TAG, "tinker dex reflect fail:" + throwable.getMessage());
}
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_RESOURCE:
if (throwable.getMessage().contains(ShareConstants.CHECK_RES_INSTALL_FAIL)) {
reporter.onReport(KEY_LOADED_EXCEPTION_RESOURCE_CHECK);
isCheckFail = true;
TinkerLog.e(TAG, "tinker res check fail:" + throwable.getMessage());
} else {
reporter.onReport(KEY_LOADED_EXCEPTION_RESOURCE);
TinkerLog.e(TAG, "tinker res reflect fail:" + throwable.getMessage());
}
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNCAUGHT:
reporter.onReport(KEY_LOADED_UNCAUGHT_EXCEPTION);
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNKNOWN:
reporter.onReport(KEY_LOADED_UNKNOWN_EXCEPTION);
break;
}
//reporter exception, for dex check fail, we don't need to report stacktrace
if (!isCheckFail) {
reporter.onReport("Tinker Exception:load tinker occur exception " + Utils.getExceptionCauseString(throwable));
}
}
示例6: onCreate
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
try {
startForeground(notificationId, new Notification());
} catch (Throwable e) {
TinkerLog.e(TAG, "InnerService set service for push exception:%s.", e);
}
// kill
stopSelf();
}
示例7: onHandleIntent
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
if (intent == null) {
TinkerLog.e(TAG, "AbstractResultService received a null intent, ignoring.");
return;
}
PatchResult result = (PatchResult) ShareIntentUtil.getSerializableExtra(intent, RESULT_EXTRA);
onPatchResult(result);
}
示例8: uncaughtException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
@Override
public void uncaughtException(Thread thread, Throwable ex) {
TinkerLog.e(TAG, "uncaughtException:" + ex.getMessage());
tinkerFastCrashProtect();
tinkerPreVerifiedCrashHandler(ex);
ueh.uncaughtException(thread, ex);
}
示例9: onLoadException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static void onLoadException(Throwable throwable, int errorCode) {
if (reporter != null) {
boolean isDexCheckFail = false;
switch (errorCode) {
case -4:
reporter.onReport((int) KEY_LOADED_UNCAUGHT_EXCEPTION);
break;
case -3:
reporter.onReport(254);
break;
case -2:
if (!throwable.getMessage().contains(ShareConstants.CHECK_DEX_INSTALL_FAIL)) {
reporter.onReport((int) KEY_LOADED_EXCEPTION_DEX);
TinkerLog.e(TAG, "tinker dex reflect fail:" + throwable.getMessage(), new
Object[0]);
break;
}
reporter.onReport((int) KEY_LOADED_EXCEPTION_DEX_CHECK);
isDexCheckFail = true;
TinkerLog.e(TAG, "tinker dex check fail:" + throwable.getMessage(), new
Object[0]);
break;
case -1:
reporter.onReport(250);
break;
}
if (!isDexCheckFail) {
reporter.onReport("Tinker Exception:load tinker occur exception " + Utils
.getExceptionCauseString(throwable));
}
}
}
示例10: onLoadException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static void onLoadException(Throwable throwable, int errorCode) {
if (reporter == null) {
return;
}
boolean isCheckFail = false;
switch (errorCode) {
case ShareConstants.ERROR_LOAD_EXCEPTION_DEX:
if (throwable.getMessage().contains(ShareConstants.CHECK_DEX_INSTALL_FAIL)) {
reporter.onReport(KEY_LOADED_EXCEPTION_DEX_CHECK);
isCheckFail = true;
TinkerLog.e(TAG, "tinker dex check fail:" + throwable.getMessage());
} else {
reporter.onReport(KEY_LOADED_EXCEPTION_DEX);
TinkerLog.e(TAG, "tinker dex reflect fail:" + throwable.getMessage());
}
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_RESOURCE:
if (throwable.getMessage().contains(ShareConstants.CHECK_RES_INSTALL_FAIL)) {
reporter.onReport(KEY_LOADED_EXCEPTION_RESOURCE_CHECK);
isCheckFail = true;
TinkerLog.e(TAG, "tinker res check fail:" + throwable.getMessage());
} else {
reporter.onReport(KEY_LOADED_EXCEPTION_RESOURCE);
TinkerLog.e(TAG, "tinker res reflect fail:" + throwable.getMessage());
}
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNCAUGHT:
reporter.onReport(KEY_LOADED_UNCAUGHT_EXCEPTION);
break;
case ShareConstants.ERROR_LOAD_EXCEPTION_UNKNOWN:
reporter.onReport(KEY_LOADED_UNKNOWN_EXCEPTION);
break;
}
//reporter exception, for dex check fail, we don't need to report stacktrace
if (!isCheckFail) {
reporter.onReport("Tinker Exception:load tinker occur exception " + TinkerUtils.getExceptionCauseString(throwable));
}
}
示例11: extract
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public static boolean extract(ZipFile zipFile, ZipEntry entryFile, File extractTo, String
targetMd5, boolean isDex) throws IOException {
int numAttempts = 0;
boolean isExtractionSuccessful = false;
while (numAttempts < 2 && !isExtractionSuccessful) {
numAttempts++;
BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entryFile));
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(extractTo));
TinkerLog.i(TAG, "try Extracting " + extractTo.getPath(), new Object[0]);
try {
byte[] buffer = new byte[16384];
for (int length = bis.read(buffer); length != -1; length = bis.read(buffer)) {
out.write(buffer, 0, length);
}
if (isDex) {
isExtractionSuccessful = SharePatchFileUtil.verifyDexFileMd5(extractTo,
targetMd5);
} else {
isExtractionSuccessful = SharePatchFileUtil.verifyFileMd5(extractTo, targetMd5);
}
TinkerLog.i(TAG, "isExtractionSuccessful: %b", Boolean.valueOf
(isExtractionSuccessful));
if (!isExtractionSuccessful) {
extractTo.delete();
if (extractTo.exists()) {
TinkerLog.e(TAG, "Failed to delete corrupted dex " + extractTo.getPath(),
new Object[0]);
}
}
} finally {
SharePatchFileUtil.closeQuietly(out);
SharePatchFileUtil.closeQuietly(bis);
}
}
return isExtractionSuccessful;
}
示例12: cleanPatch
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的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);
}
示例13: onCreate
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void onCreate() {
super.onCreate();
try {
startForeground(TinkerPatchService.notificationId, new Notification());
} catch (NullPointerException e) {
TinkerLog.e(TinkerPatchService.TAG, "InnerService set service for push " +
"exception:%s.", e);
}
stopSelf();
}
示例14: tryPatch
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的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;
}
}
示例15: uncaughtException
import com.tencent.tinker.lib.util.TinkerLog; //导入方法依赖的package包/类
public void uncaughtException(Thread thread, Throwable ex) {
TinkerLog.e(TAG, "uncaughtException:" + ex.getMessage(), new Object[0]);
tinkerFastCrashProtect();
tinkerPreVerifiedCrashHandler(ex);
this.ueh.uncaughtException(thread, ex);
}