tinker icon indicating copy to clipboard operation
tinker copied to clipboard

升级Tinker到1.9.13.2,360加固后,热更只有部分代码生效

Open LiviaGeneral opened this issue 6 years ago • 4 comments

异常类型:App热更部分类型手机合并异常 手机型号:HuaWei 8X MAX 或 Vivo Y55L 手机系统版本:9.1 或 6.0.1 tinker版本::1.9.13.2 gradle版本::5.4 是否使用热更新SDK: Bugly SDK

系统:win 7 堆栈/日志: 下载补丁和合并补丁日志, 10-24 18:03:27.698 15716-15716/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/com.zhongwei.buglytest/tinker 10-24 18:03:27.698 15716-15716/? D/Tinker.DefaultAppLike: onBaseContextAttached: 10-24 18:03:27.698 15716-15716/? I/Tinker.TinkerPatchListener: application maxMemory:128 10-24 18:03:27.708 15716-15716/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.zhongwei.buglytest/tinker 10-24 18:03:27.708 15716-15716/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.13.2 10-24 18:03:27.708 15716-15716/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:com.zhongwei.buglytest, main process:true, systemOTA:false, fingerPrint:vivo/PD1613/PD1613:6.0.1/MMB29M/compiler05271100:user/release-keys, oatDir:null, useInterpretMode:false 10-24 18:03:27.708 15716-15716/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return 10-24 18:03:27.708 15716-15716/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.zhongwei.buglytest/tinker, code: -2, cost: 2ms 10-24 18:03:27.708 15716-15716/? W/Tinker.Tinker: tinker load fail! 10-24 18:03:27.708 15716-15716/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 10-24 18:03:27.708 15716-15716/? D/Tinker.DefaultAppLike: onCreate 10-24 18:03:27.728 15716-15716/? I/CrashReport: backup java handler: com.tencent.bugly.beta.tinker.TinkerUncaughtExceptionHandler@27f53c 10-24 18:03:27.778 15716-15716/? W/CrashReport: [patch] tinker new id is null ,so patch version is invalid 10-24 18:03:27.778 15716-15716/? I/CrashReport: TINKER_ID:2.0.0.4_1024-16-11-23 10-24 18:03:27.778 15716-15716/? I/CrashReport: NEW_TINKER_ID: 10-24 18:03:27.778 15716-15716/? D/Tinker.DefaultAppLike: onTrimMemory level:5 10-24 18:03:27.788 15716-15716/? D/Tinker.DefaultAppLike: onTrimMemory level:5 10-24 18:03:28.118 15716-15716/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry info not exist, just return 10-24 18:03:30.838 15716-15739/? D/CrashReport: app version is: [2.0.0.4], [deviceId:null|null|47cca6669d02c91f], channel: [null], base tinkerId:[2.0.0.4_1024-16-11-23], patch tinkerId:[], patch version:[] 10-24 18:03:35.038 15716-15716/? D/Tinker.TinkerManager: onDownloadSuccess. 10-24 18:03:35.038 15716-15716/? D/Tinker.TinkerManager: check if has new patch. 10-24 18:03:35.048 15716-15716/? D/Tinker.TinkerManager: has new patch. 10-24 18:03:35.048 15716-15716/? D/Tinker.TinkerManager: starting patch. 10-24 18:03:35.048 15716-15716/? I/Tinker.TinkerPatchListener: receive a patch file: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk, file size:6008 10-24 18:03:35.058 15716-15716/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.zhongwei.buglytest/tinker/patch.info: open failed: ENOENT (No such file or directory) 10-24 18:03:35.058 15716-15716/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.zhongwei.buglytest/tinker/patch.info: open failed: ENOENT (No such file or directory) 10-24 18:03:35.058 15716-15716/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return 10-24 18:03:35.058 15716-15716/? I/Tinker.TinkerPatchListener: get platform:null 10-24 18:03:35.058 15716-15716/? I/Tinker.TinkerPatchService: run patch service... 10-24 18:03:35.058 1469-1485/? D/ActivityManager: app: com.zhongwei.buglytest:patch, app uid: 11225, user 0, intent ComponentInfo{com.zhongwei.buglytest/com.tencent.tinker.lib.service.TinkerPatchService}, calling uid 11225, mCallerApp ProcessRecord{8ccad1f 15716:com.zhongwei.buglytest/u0a1225} 10-24 18:03:35.078 1469-1485/? I/ActivityManager: Start proc 15764:com.zhongwei.buglytest:patch/u0a1225 for service com.zhongwei.buglytest/com.tencent.tinker.lib.service.TinkerPatchService 10-24 18:03:35.758 15764-15764/? W/Tinker.TinkerLoader: tryLoadPatchFiles: we don't load patch with :patch process itself, just return 10-24 18:03:35.758 15764-15764/? D/Tinker.DefaultAppLike: onBaseContextAttached: 10-24 18:03:35.768 15764-15764/? I/Tinker.TinkerPatchListener: application maxMemory:128 10-24 18:03:35.778 15764-15764/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.zhongwei.buglytest/tinker 10-24 18:03:35.778 15764-15764/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.13.2 10-24 18:03:35.778 15764-15764/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-1, process name:com.zhongwei.buglytest:patch, main process:false, systemOTA:false, fingerPrint:vivo/PD1613/PD1613:6.0.1/MMB29M/compiler05271100:user/release-keys, oatDir:null, useInterpretMode:false 10-24 18:03:35.778 15764-15764/? W/Tinker.TinkerLoadResult: tinker is disable, just return 10-24 18:03:35.778 15764-15764/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.zhongwei.buglytest/tinker, code: -1, cost: 4ms 10-24 18:03:35.778 15764-15764/? W/Tinker.Tinker: tinker load fail! 10-24 18:03:35.778 15764-15764/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations. 10-24 18:03:35.778 15764-15764/? D/Tinker.DefaultAppLike: onCreate 10-24 18:03:35.808 15764-15764/? I/CrashReport: backup java handler: com.tencent.bugly.beta.tinker.TinkerUncaughtExceptionHandler@27f53c 10-24 18:03:35.838 15764-15764/? D/Tinker.DefaultAppLike: onTrimMemory level:5 10-24 18:03:35.838 15764-15764/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry is not main process, just return 10-24 18:03:35.838 15764-15787/? I/Tinker.TinkerPatchService: try to increase patch process priority 10-24 18:03:35.838 1469-1517/? V/ActivityManager: Attempted to start a foreground service (ComponentInfo{com.zhongwei.buglytest/com.tencent.tinker.lib.service.TinkerPatchService}) with a broken notification (no icon: Notification(pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)) 10-24 18:03:35.848 15764-15787/? I/Tinker.DefaultPatchReporter: patchReporter onPatchServiceStart: patch service start 10-24 18:03:35.848 1469-1517/? V/ActivityManager: Attempted to start a foreground service (ComponentInfo{com.zhongwei.buglytest/com.tencent.tinker.lib.service.TinkerPatchService$InnerService}) with a broken notification (no icon: Notification(pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE internalType=0 internalPriority=0 internalGroupPriority=0 internalFlag=0)) 10-24 18:03:35.848 15764-15787/? W/Tinker.UpgradePatchRetry: try copy file: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk to /data/user/0/com.zhongwei.buglytest/tinker_temp/temp.apk 10-24 18:03:35.898 15764-15787/? I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchMd5:d7334a298927173ef95a7fc993369c67 10-24 18:03:35.898 15764-15787/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.zhongwei.buglytest/tinker/patch.info: open failed: ENOENT (No such file or directory) 10-24 18:03:35.898 15764-15787/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.zhongwei.buglytest/tinker/patch.info: open failed: ENOENT (No such file or directory) 10-24 18:03:35.898 15764-15787/? I/Tinker.UpgradePatch: UpgradePatch tryPatch:patchVersionDirectory:/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29 10-24 18:03:35.898 15764-15787/? W/Tinker.UpgradePatch: UpgradePatch copy patch file, src file: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk size: 6008, dest file: /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/patch-d7334a29.apk size:6008 10-24 18:03:35.908 15764-15787/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/classes.dex.jar 10-24 18:03:35.918 15764-15787/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 10-24 18:03:35.918 15764-15787/? I/Tinker.DexDiffPatchInternal: try Extracting /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/test.dex.jar 10-24 18:03:35.928 15764-15787/? I/Tinker.DexDiffPatchInternal: isExtractionSuccessful: true 10-24 18:03:35.928 15764-15787/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/test.dex.jar 10-24 18:03:35.938 15764-15787/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/classes.dex.jar 10-24 18:03:35.938 15764-15787/? I/Tinker.DexDiffPatchInternal: merge classN dex file /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/tinker_classN.apk, result: true, size: 1693, use: 8ms 10-24 18:03:35.938 15764-15787/? I/Tinker.DexDiffPatchInternal: legal files to do dexopt: [/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/tinker_classN.apk] 10-24 18:03:35.938 15764-15787/? I/Tinker.DexDiffPatchInternal: patch recover, try to optimize dex file count:1, optimizeDexDirectory:/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/odex/ 10-24 18:03:35.938 15764-15787/? I/Tinker.DexDiffPatchInternal: start to parallel optimize dex /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/tinker_classN.apk, size: 1693 10-24 18:03:36.008 15792-15792/? I/dex2oat: /system/bin/dex2oat --compiler-filter=verify-none --dex-file=/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/tinker_classN.apk --oat-file=/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/odex/tinker_classN.dex -j4 10-24 18:03:36.048 15764-15787/? I/Tinker.DexDiffPatchInternal: success to parallel optimize dex /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/dex/tinker_classN.apk, opt file:/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/odex/tinker_classN.dex, opt file size: 8624, use time 110 10-24 18:03:36.048 15764-15787/? I/Tinker.DexDiffPatchInternal: recover dex result:true, cost:148 10-24 18:03:36.048 15764-15787/? W/Tinker.BsDiffPatchInternal: patch recover, library is not contained 10-24 18:03:36.048 15764-15787/? I/Tinker.ResDiffPatchInternal: res dir: /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/res/, meta: resArscMd5:b2a526e0045a4889d72e33136eac0d59 arscBaseCrc:1324939279 pattern:resources.arsc pattern:r/.* pattern:assets/.* pattern:res/.* addedSet:assets/only_use_to_test_tinker_resource.txt modifiedSet:res/layout/activity_main.xml 10-24 18:03:36.058 15764-15787/? I/Tinker.ResDiffPatchInternal: no large modify or store resources, just return 10-24 18:03:36.328 15764-15787/? I/Tinker.ResDiffPatchInternal: final new resource file:/data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/res/resources.apk, entry count:430, size:2649448 10-24 18:03:36.328 15764-15787/? I/Tinker.ResDiffPatchInternal: recover resource result:true, cost:282 10-24 18:03:36.328 15764-15787/? I/Tinker.DexDiffPatchInternal: raw dex count: 2, dex opt dex count: 1, final wait times: 60 10-24 18:03:36.338 15764-15787/? I/Tinker.DexDiffPatchInternal: check dex optimizer file exist: /data/user/0/com.zhongwei.buglytest/tinker/patch-d7334a29/odex/tinker_classN.dex, size 8624 10-24 18:03:36.338 15764-15787/? I/Tinker.DexDiffPatchInternal: check dex optimizer file format: tinker_classN.dex, size 8624 10-24 18:03:36.338 15764-15787/? I/Tinker.PatchInfo: rewritePatchInfoFile file path:/data/user/0/com.zhongwei.buglytest/tinker/patch.info , oldVer:, newVer:d7334a298927173ef95a7fc993369c67, isProtectedApp:1, isRemoveNewVersion:0, fingerprint:vivo/PD1613/PD1613:6.0.1/MMB29M/compiler05271100:user/release-keys, oatDir:odex 10-24 18:03:36.338 15764-15787/? I/Tinker.UpgradePatchRetry: onPatchResetMaxCheck, reset max check to 1 10-24 18:03:36.338 15764-15787/? W/Tinker.UpgradePatch: UpgradePatch tryPatch: done, it is ok 10-24 18:03:36.338 15764-15787/? I/Tinker.DefaultPatchReporter: patchReporter onPatchResult: patch all result path: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk, success: true, cost: 477 10-24 18:03:36.338 15764-15787/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.zhongwei.buglytest/tinker_temp/temp.apk 10-24 18:03:36.358 15764-15764/? D/Tinker.DefaultAppLike: onTrimMemory level:80 10-24 18:03:36.358 15716-15804/? I/Tinker.TinkerResultService: TinkerResultService receive result: PatchResult: isSuccess:true rawPatchFilePath:/data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk costTime:477 patchVersion:d7334a298927173ef95a7fc993369c67 10-24 18:03:36.358 15716-15804/? W/Tinker.DefaultTinkerResultService: deleteRawPatchFile rawFile path: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk 10-24 18:03:36.358 15716-15804/? I/Tinker.PatchFileUtil: safeDeleteFile, try to delete path: /data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk 10-24 18:03:36.358 15716-15716/? I/CrashReport: Tinker patch success, result: PatchResult: isSuccess:true rawPatchFilePath:/data/user/0/com.zhongwei.buglytest/app_tmpPatch/tmpPatch.apk costTime:477 patchVersion:d7334a298927173ef95a7fc993369c67 10-24 18:03:36.358 15716-15804/? I/Tinker.TinkerResultService: tinker wait screen to restart process

问题: 虽然补丁下载成功,同时合并成功,但是只有部分代码生效了,在布局文件xml中修改TextViewandroid:text="第一个补丁包" 生效了,但是在Activity中修改TextView.setTextView("动态修改"),却没任何效果,同时在onClick 回调事件中修改逻辑处理也生效了。请问这种情况应该如何处理?

LiviaGeneral avatar Oct 24 '19 10:10 LiviaGeneral

今天使用最新版本1.9.14。3也还是有这个问题,不加固所有代码都生效了。加固后,用4.X手机测试时正常的,8.X和9.X只能热更资源文件,同时7.0合并重启后,直接crash!有谁遇到过类似的问题。

LiviaGeneral avatar Oct 25 '19 09:10 LiviaGeneral

我这边尝试了,app的第一个页面代码修改的东西不会成功,估测加载的逻辑,还是先走app的原始逻辑,之后,才会走热更新完的代码,所以在点击事件onClick 回调事件中修改逻辑生效,跳转到第二个页面的修改也生效

zhaoxl1234 avatar Nov 01 '19 09:11 zhaoxl1234

用1.19.14.16,用的乐固vmp加固,同样有这个问题,MainActivity的全没生效,其它类就生效了

kasogg avatar May 21 '21 06:05 kasogg

@LiviaGeneral 请问你的问题解决了吗。 我遇到了类似的问题: 显示升级成功,我如果马上退出app,重新打开就生效了。 但是如果升级成功后我不退出app,直接去原来有问题页面,之后再退出app重进就再也不生效了。

huangyin1109 avatar Sep 29 '21 08:09 huangyin1109