Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Atlas DexPatch调试记录

DexPatch简介

DexPatch是以动态部署技术方案为基础,以快速解决线上故障为唯一目的的动态化方案。

简单来说,动态部署是针对Apk级别的动态升级,DexPatch是针对Bundle级别的动态修复(主dex可以认为是一个Bundle)

打包DexPatch

基于ap所属的版本(1.0.0)

..\gradlew publish

修改Bundle版本

修改Bundle代码,并修改Bundle版本(也可以修改Bundle依赖的某个aar的版本)

group = 'com.atlas.demo'
version = '1.0.1'

指定基线版本,生成dexPatch包

..\gradlew clean assembleDebug -DapVersion=1.0.0 -DversionName=1.0.0

push 1.0.0@1.0.0.tpatch & dexpatch-1.0.0.json

adb push build\outputs\tpatch-debug\dexpatch-1.0.0.json /sdcard/Android/data/com.taobao.demo/cache/
adb push build\outputs\tpatch-debug\1.0.0@1.0.0.tpatch /sdcard/Android/data/com.taobao.demo/cache/

调试日志

firstbundle: 1.0.0 -> 1.0.1

I/yezhou: dexPatchUpdate begin
D/DexMergeClient: Get binder159 ms
D/DexMergeClient: dexMerge  true487 ms
D/update: merge: true com.taobao.firstbundle 1
D/update: install: true com.taobao.firstbundle 1
D/update: update success
I/yezhou: dexPatchUpdate end

firstbundle: 1.0.1 -> 1.0.2

I/yezhou: dexPatchUpdate begin
I/yezhou: isDexPatched
I/yezhou: version: 1
E/delete: /data/user/0/com.taobao.demo/files/storage/com.taobao.firstbundle/dexpatch/1
D/DexMergeClient: Get binder315 ms
D/DexMergeClient: dexMerge  true486 ms
D/update: merge: true com.taobao.firstbundle 2
D/update: install: true com.taobao.firstbundle 2
D/update: update success
I/yezhou: dexPatchUpdate end

secondbundle: 1.0.0 -> 1.0.1

I/yezhou: dexPatchUpdate begin
I/yezhou: isDexPatched
I/yezhou: version: 13
D/DexMergeClient: Get binder177 ms
D/DexMergeClient: dexMerge  true707 ms
D/update: merge: true com.taobao.secondbundle 3
D/update: merge: true com.taobao.firstbundle 3
D/update: install: true com.taobao.secondbundle 3
D/update: install: true com.taobao.firstbundle 3
D/update: update success
I/yezhou: dexPatchUpdate end

注:若dexPatchUpdate不成功,则重启APP进程重新dexPatchUpdate

dexpatch-1.0.0.json

{
    "baseVersion":"1.0.0",
    "diffBundleDex":true,
    "patches":[
        {
            "bundles":[
                {
                    "artifactId":"secondbundle",
                    "dependency":[

                    ],
                    "dexpatchVersion":"3",
                    "inherit":false,
                    "isMainDex":false,
                    "name":"com.taobao.secondbundle",
                    "newBundle":false,
                    "patchType":1,
                    "pkgName":"com.taobao.secondbundle",
                    "reset":false,
                    "srcUnitTag":"221s8s6hnw066",
                    "unitTag":"3l3h7art62o7a",
                    "version":"1.0.1"
                },
                {
                    "artifactId":"firstbundle",
                    "dependency":[
                        "com.taobao.publicBundle"
                    ],
                    "dexpatchVersion":"3",
                    "inherit":false,
                    "isMainDex":false,
                    "name":"com.taobao.firstbundle",
                    "newBundle":false,
                    "patchType":1,
                    "pkgName":"com.taobao.firstbundle",
                    "reset":false,
                    "srcUnitTag":"2ddkv55keedea",
                    "unitTag":"wso75w9m111a",
                    "version":"1.0.2"
                }
            ],
            "dexPatch":true,
            "fileName":"1.0.0@1.0.0.tpatch",
            "patchVersion":"1.0.0",
            "targetVersion":"1.0.0"
        }
    ]
}
上一篇 laravel-admin模型表格Grid行展开ExpandRow设计
下一篇 Atlas远程bundle配置及更新