Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.14k stars 3.33k forks source link

Tinker v1.9.11版本使用JobScheduler合成patch不成功 #1023

Open tuzhao opened 5 years ago

tuzhao commented 5 years ago
异常类型:app运行时异常
手机型号:小米Mix 2S
手机系统版本:Android 9.0
tinker版本:v1.9.11
gradle版本:3.2.1
是否使用热更新SDK:是用的是TinkerPatch SDK
系统:如:Mac
当前apk采用乐固进行加固

日志:
patch合成失败:
2019-02-13 21:13:10.125 32740-32740/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/com.hhm.easybuy/tinker
2019-02-13 21:13:10.128 32740-32740/? D/Tinker.DefaultAppLike: onBaseContextAttached:
2019-02-13 21:13:10.152 32740-32740/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations.
2019-02-13 21:13:10.152 32740-32740/? D/Tinker.DefaultAppLike: onCreate
2019-02-13 21:13:10.161 32740-32740/? I/Tinker.ServerUtils: with app key from manifest appKey:b72db1d336756b00
2019-02-13 21:13:10.162 32740-32740/? I/Tinker.ServerUtils: with app version from manifest appVersion:1.0.0_company
2019-02-13 21:13:10.164 32740-32740/? I/Tinker.VersionInfo: readVersionInfo file path:/data/user/0/com.hhm.easybuy/tinker_server/b72db1d336756b00_version.info, appVersion: 1.0.0_company, uuid:0cbef8cf-0490-45ec-b72b-c9f1676d9048, abi:armeabi-v7a, patchVersion:8, patchMd5:4e156edd8f3446fe542179a550381bb6, grayValue:2, crashTimes:0, retryTimes:1, applySuccess:0, patchSuccess:0
2019-02-13 21:13:10.166 32740-32740/? E/ActivityThread: Failed to find provider info for com.tinker.debug.debugprovider
2019-02-13 21:13:10.166 32740-32740/? D/Tinker.Debugger: debugger not attached cu == null
2019-02-13 21:13:10.166 32740-32740/? I/Tinker.ServerClient: installTinkerServer, debug value: false, appVersion: 1.0.0_company, appKey: b72db1d336756b00
2019-02-13 21:13:10.171 32740-32740/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.hhm.easybuy/tinker
2019-02-13 21:13:10.174 32740-32740/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.11
2019-02-13 21:13:10.174 32740-32740/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:com.hhm.easybuy, main process:true, systemOTA:false, fingerPrint:Xiaomi/polaris/polaris:9/PKQ1.180729.001/V10.2.1.0.PDGCNXM:user/release-keys, oatDir:null, useInterpretMode:false
2019-02-13 21:13:10.174 32740-32740/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return
2019-02-13 21:13:10.174 32740-32740/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.hhm.easybuy/tinker, code: -2, cost: 3ms
2019-02-13 21:13:10.175 32740-32740/? W/Tinker.Tinker: tinker load fail!
2019-02-13 21:13:10.175 32740-32740/? I/Tinker.TinkerPatch: Init TinkerPatch sdk success, version:1.2.11
2019-02-13 21:13:10.325 32740-32740/? D/Tinker.DefaultAppLike: onTrimMemory level:5
2019-02-13 21:13:10.478 32740-32740/? I/Tinker.FetchPatchHandler: try to fetch patch update with FetchPatchHandler with interval 10800000
2019-02-13 21:13:10.544 32740-32740/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry info not exist, just return
2019-02-13 21:13:10.546 32740-32740/? W/Tinker.ClientImpl: [retryAllReportFails], there is no fail report, just return
2019-02-13 21:13:10.566 32740-32740/? I/Tinker.UrlConnectionFetcher: loadData from url: http://q.tinkerpatch.com/b72db1d336756b00/1.0.0_company?d=0cbef8cf-0490-45ec-b72b-c9f1676d9048&v=1550063590564, method:GET, body:null
2019-02-13 21:13:10.572 32740-32740/? I/Tinker.UrlConnectionFetcher: loadData from url: http://q.tinkerpatch.com/c/b72db1d336756b00?d=0cbef8cf-0490-45ec-b72b-c9f1676d9048&v=1550063590572, method:GET, body:null
2019-02-13 21:13:10.572 32740-32740/? W/Tinker.ClientImpl: [retryAllReportFails], there is no fail report, just return
2019-02-13 21:13:10.572 32740-32740/? I/Tinker.ServerClient: tinker sync should wait interval 10799s
2019-02-13 21:13:10.703 32740-630/? I/Tinker.UrlConnectionFetcher: response code 200 msg: OK
2019-02-13 21:13:10.704 32740-630/? I/Tinker.ClientImpl: tinker server sync respond:{"v":8}
2019-02-13 21:13:10.704 32740-630/? I/Tinker.VersionInfo: VersionCheck: target version 8 is not latest. current version is 8
2019-02-13 21:13:10.707 32740-630/? D/Tinker.PatchRequestCallback: [beforePatchRequest] have pending patch to install, version: 8, patch:/data/user/0/com.hhm.easybuy/tinker_server/1.0.0_company_8.apk
2019-02-13 21:13:10.707 32740-630/? I/Tinker.VersionInfo: updateVersionInfo file path:/data/user/0/com.hhm.easybuy/tinker_server/b72db1d336756b00_version.info, appVersion: 1.0.0_company, uuid:0cbef8cf-0490-45ec-b72b-c9f1676d9048, abi:armeabi-v7a, patchVersion:8, patchMd5:4e156edd8f3446fe542179a550381bb6, grayValue:2, crashTimes:0, retryTimes:2, applySuccess:0, patchSuccess:0
2019-02-13 21:13:10.708 32740-630/? I/Tinker.TinkerServerPatchListener: receive a patch file: /data/user/0/com.hhm.easybuy/tinker_server/1.0.0_company_8.apk, file size:8724
2019-02-13 21:13:10.709 32740-630/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return
2019-02-13 21:13:10.709 32740-630/? I/Tinker.TinkerPatchService: run patch service...
2019-02-13 21:13:10.710 1390-2932/? I/AutoStartManagerService: MIUILOG- Reject service :Intent { cmp=com.hhm.easybuy/com.tencent.tinker.lib.service.TinkerPatchService } userId : 0 uid : 10384
2019-02-13 21:13:10.711 1390-2932/? D/JobScheduler: Error executing JobStatus{1fb24c2 #u0a384/-252579085 com.hhm.easybuy/com.tencent.tinker.lib.service.TinkerPatchService u=0 s=10384 TIME=none:0 READY}
2019-02-13 21:13:10.711 32740-630/? I/Tinker.ClientImpl: Fetch result: needn't update, gray: 2
2019-02-13 21:13:10.936 32740-630/? I/Tinker.UrlConnectionFetcher: response code 200 msg: OK
2019-02-13 21:13:20.983 1001-1001/? W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/com.hhm.easybuy/tinker
2019-02-13 21:13:20.986 1001-1001/? D/Tinker.DefaultAppLike: onBaseContextAttached:
2019-02-13 21:13:21.001 1001-1001/? I/Tinker.ComponentHotplug: method install() is not invoked, ignore ensuring operations.
2019-02-13 21:13:21.001 1001-1001/? D/Tinker.DefaultAppLike: onCreate
2019-02-13 21:13:21.012 1001-1001/? I/Tinker.ServerUtils: with app key from manifest appKey:b72db1d336756b00
2019-02-13 21:13:21.012 1001-1001/? I/Tinker.ServerUtils: with app version from manifest appVersion:1.0.0_company
2019-02-13 21:13:21.014 1001-1001/? I/Tinker.VersionInfo: readVersionInfo file path:/data/user/0/com.hhm.easybuy/tinker_server/b72db1d336756b00_version.info, appVersion: 1.0.0_company, uuid:0cbef8cf-0490-45ec-b72b-c9f1676d9048, abi:armeabi-v7a, patchVersion:8, patchMd5:4e156edd8f3446fe542179a550381bb6, grayValue:2, crashTimes:0, retryTimes:2, applySuccess:0, patchSuccess:0
2019-02-13 21:13:21.017 1001-1001/? E/ActivityThread: Failed to find provider info for com.tinker.debug.debugprovider
2019-02-13 21:13:21.017 1001-1001/? D/Tinker.Debugger: debugger not attached cu == null
2019-02-13 21:13:21.017 1001-1001/? I/Tinker.ServerClient: installTinkerServer, debug value: false, appVersion: 1.0.0_company, appKey: b72db1d336756b00
2019-02-13 21:13:21.022 1001-1001/? W/Tinker.Tinker: tinker patch directory: /data/user/0/com.hhm.easybuy/tinker
2019-02-13 21:13:21.025 1001-1001/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.11
2019-02-13 21:13:21.025 1001-1001/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:com.hhm.easybuy:channel, main process:false, systemOTA:false, fingerPrint:Xiaomi/polaris/polaris:9/PKQ1.180729.001/V10.2.1.0.PDGCNXM:user/release-keys, oatDir:null, useInterpretMode:false
2019-02-13 21:13:21.026 1001-1001/? W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return
2019-02-13 21:13:21.026 1001-1001/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/user/0/com.hhm.easybuy/tinker, code: -2, cost: 3ms
2019-02-13 21:13:21.026 1001-1001/? W/Tinker.Tinker: tinker load fail!
2019-02-13 21:13:21.026 1001-1001/? I/Tinker.TinkerPatch: Init TinkerPatch sdk success, version:1.2.11
2019-02-13 21:13:21.161 1001-1001/? D/Tinker.DefaultAppLike: onTrimMemory level:5
2019-02-13 21:13:21.178 1001-1001/? I/Tinker.FetchPatchHandler: try to fetch patch update with FetchPatchHandler with interval 10800000
2019-02-13 21:13:21.193 1001-1001/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry is not main process, just return

在相同的情况下我用tinker v1.9.9版本patch能正常合并成功。 将tinker升级到v1.9.11版本patch就不能正常应用了。 我怀疑是JobScheduler权限的问题,但是查看manifest发现是正常的。

image

Terrorist-1 commented 5 years ago

我也遇到了、按道理 来说新版本应该没问题呀、

Terrorist-1 commented 5 years ago

是的,1.9.11 有问题,1.9.9 正常、

whysohandsome commented 5 years ago

我也是~小米6A手机,安卓8.1.0,各种尝试都不成功,最后看到这里说1.9.11有问题,退回到1.9.9就正常了!!! 求官方重视一下啊!不知道又会有多少人被坑惨了。

PhantomQi commented 5 years ago

mix2(8.0系统)有类似问题,1.9.11需要在手机上进入设置开启自启动权限才能成功升级补丁,然而1.9.8~1.9.9可正常升级,对比代码有如下推测,供参考 @tomystang

  1. 没有自启动权限的时候,jobscheduler必然失败
  2. 1.9.8~1.9.9会在job失败后,尝试通过intent启动service,然后会启动成功
  3. 1.9.11去掉了通过intent启动service的逻辑,少了针对此机型的补救措施
YouCountThatCookie commented 5 years ago

小米6(8.0系统)最新的 1.9.13 也有问题 ,怎么搞都不成功

feicien commented 5 years ago

最新的 1.9.13 版本,使用官方 demo 在 xiaomi mi 6 (Android 8.0.0) 测试加载补丁时,打印日志如下

2019-05-22 14:39:58.224 28728-28728/? I/Tinker.SamplePatchListener: receive a patch file: /storage/emulated/0/patch_signed_7zip.apk, file size:11959
2019-05-22 14:39:58.237 28728-28728/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info (No such file or directory)
2019-05-22 14:39:58.238 28728-28728/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info (No such file or directory)
2019-05-22 14:39:58.238 28728-28728/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return
2019-05-22 14:39:58.244 28728-28728/? I/Tinker.SamplePatchListener: get platform:all
2019-05-22 14:39:58.244 28728-28728/? I/Tinker.TinkerPatchService: run patch service...
2019-05-22 14:39:58.245 28728-28728/? I/Tinker.TinkerPatchService: jobId of tinker patch service is: 1453143321

然后没有其它日志了

coutliuxing commented 5 years ago

系统:小米4 版本:1.9.13

06-03 14:28:38.214 16636-16636/tinker.sample.android W/Tinker.UpgradePatchRetry: onPatchRetryLoad retry info not exist, just return 06-03 14:28:46.775 16636-16636/tinker.sample.android E/Tinker.MainActivity: i am on onResume 06-03 14:28:49.978 16636-16636/tinker.sample.android D/Tinker.DefaultAppLike: onTrimMemory level:20 06-03 14:29:11.236 16636-16636/tinker.sample.android E/Tinker.MainActivity: i am on onResume 06-03 14:29:17.319 16636-16636/tinker.sample.android I/Tinker.SamplePatchListener: receive a patch file: /storage/emulated/0/patch_signed_7zip.apk, file size:660468 06-03 14:29:17.327 16636-16636/tinker.sample.android W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info: open failed: ENOENT (No such file or directory) 06-03 14:29:17.327 16636-16636/tinker.sample.android W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info: open failed: ENOENT (No such file or directory) 06-03 14:29:17.328 16636-16636/tinker.sample.android W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return 06-03 14:29:17.336 16636-16636/tinker.sample.android I/Tinker.SamplePatchListener: get platform:all 06-03 14:29:17.336 16636-16636/tinker.sample.android I/Tinker.TinkerPatchService: run patch service... 06-03 14:29:17.337 16636-16636/tinker.sample.android I/Tinker.TinkerPatchService: jobId of tinker patch service is: 1453143321 06-03 14:29:17.338 16636-16636/tinker.sample.android W/TinkerJobIntentService: it would be better to grant WAKE_LOCK permission to your app so that tinker can use WakeLock to keep system awake. 06-03 14:29:17.732 16636-16636/tinker.sample.android W/TinkerJobIntentService: it would be better to grant WAKE_LOCK permission to your app so that tinker can use WakeLock to keep system awake. 06-03 14:29:17.740 16636-17182/tinker.sample.android I/Tinker.SampleResultService: SampleResultService receive result: PatchResult: isSuccess:false rawPatchFilePath:/storage/emulated/0/patch_signed_7zip.apk costTime:169 patchVersion:274c6c177a95c2733c118f4d7fa635ce 06-03 14:29:17.741 16636-17182/tinker.sample.android I/Process: Sending signal. PID: 17158 SIG: 9 06-03 14:29:17.759 16636-16636/tinker.sample.android I/Toast: Show toast from OpPackageName:tinker.sample.android, PackageName:tinker.sample.android 06-03 14:29:17.838 16636-16670/tinker.sample.android V/RenderScript: 0x9fdd2000 Launching thread(s), CPUs 4

yanweimin7 commented 5 years ago

1.9.13版本 红米 note 7p

2019-06-05 21:34:21.252 19848-19848/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.wacai.android.aappcoin/tinker/patch.info (No such file or directory)
2019-06-05 21:34:21.252 19848-19848/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.wacai.android.aappcoin/tinker/patch.info (No such file or directory)
2019-06-05 21:34:21.252 19848-19848/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return
2019-06-05 21:34:21.252 19848-19848/? I/Tinker.TinkerPatchService: run patch service...
2019-06-05 21:34:21.253 19848-19848/? I/Tinker.TinkerPatchService: jobId of tinker patch service is: 525494697
2019-06-05 21:34:21.255 1620-3986/? I/AutoStartManagerService: MIUILOG- Reject service :Intent { cmp=com.wacai.android.aappcoin/com.tencent.tinker.lib.service.TinkerPatchService } userId : 0 uid : 10353
2019-06-05 21:34:21.255 1620-3986/? D/JobScheduler: Error executing JobStatus{e3f20b2 #u0a353/525494697 com.wacai.android.aappcoin/com.tencent.tinker.lib.service.TinkerPatchService u=0 s=10353 TIME=none:-1ms READY}

也是jobservice 启动不了

yaodiwei commented 5 years ago

试了小米9 和 小米6x,都是Android版本9。 1.9.13版本都是运行不了。

日志 2019-06-10 13:45:46.801 11965-11965/? I/Tinker.SamplePatchListener: receive a patch file: /storage/emulated/0/patch_signed_7zip.apk, file size:122690 2019-06-10 13:45:46.819 11965-11965/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info (No such file or directory) 2019-06-10 13:45:46.819 11965-11965/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/tinker.sample.android/tinker/patch.info (No such file or directory) 2019-06-10 13:45:46.821 11965-11965/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return 2019-06-10 13:45:46.831 11965-11965/? I/Tinker.SamplePatchListener: get platform:all 2019-06-10 13:45:46.836 11965-11965/? I/Tinker.TinkerPatchService: run patch service... 2019-06-10 13:45:46.837 11965-11965/? I/Tinker.TinkerPatchService: jobId of tinker patch service is: 1453143321

使用1.9.9可以运行

skylarklxlong commented 5 years ago

小米note3 Android 8.1.0 1.9.13版本必须要开启自启动也行 2019-07-18 16:02:05.811 23653-24252/? D/Tinker.TinkerManager: onDownloadSuccess. 2019-07-18 16:02:05.812 23653-24252/? D/Tinker.TinkerManager: check if has new patch. 2019-07-18 16:02:05.822 23653-24252/? D/Tinker.TinkerManager: has new patch. 2019-07-18 16:02:05.826 23653-24252/? D/Tinker.TinkerManager: starting patch. 2019-07-18 16:02:05.829 23653-24252/? I/Tinker.TinkerPatchListener: receive a patch file: /data/user/0/com.mcc.ekantone/app_tmpPatch/tmpPatch.apk, file size:81782 2019-07-18 16:02:05.835 23653-24252/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.mcc.ekantone/tinker/patch.info (No such file or directory) 2019-07-18 16:02:05.835 23653-24252/? W/Tinker.PatchInfo: read property failed, e:java.io.FileNotFoundException: /data/user/0/com.mcc.ekantone/tinker/patch.info (No such file or directory) 2019-07-18 16:02:05.835 23653-24252/? W/Tinker.UpgradePatchRetry: onPatchListenerCheck retry file is not exist, just return 2019-07-18 16:02:05.836 23653-24252/? I/Tinker.TinkerPatchListener: get platform:null 2019-07-18 16:02:05.836 23653-24252/? I/Tinker.TinkerPatchService: run patch service... 2019-07-18 16:02:05.837 23653-24252/? I/Tinker.TinkerPatchService: jobId of tinker patch service is: 1069171792

--------- beginning of system

2019-07-18 16:02:05.839 1855-1879/? I/AutoStartManagerService: MIUILOG- Reject service :Intent { cmp=com.mcc.ekantone/com.tencent.tinker.lib.service.TinkerPatchService } userId : 0 uid : 10837 2019-07-18 16:02:05.840 1855-1879/? D/JobSchedulerService: Error executing JobStatus{1e34554 #u0a837/1069171792 com.mcc.ekantone/com.tencent.tinker.lib.service.TinkerPatchService u=0 s=10837 TIME=none:-1ms READY}