tinker icon indicating copy to clipboard operation
tinker copied to clipboard

使用360加固后无法成生补丁

Open 123ufo opened this issue 3 years ago • 0 comments

生成补丁报错信息如下:Execution failed for task ':app:tinkerPatchRelease'.

java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: all loader classes don't appear in old primary dex.

异常类型:编译异常 tinker版本:1.9.14.18 gradle版本:com.android.tools.build:gradle:4.0.2 系统:如:window10

首先我用1.0包使用360加固后在设备上安装是正常可以使用的。然后我再对项目做了小改动再打出一个新的包2.0同样使用360加固。然后根据这两个包想生成补丁,但是编译报错。

下面是tinker的核心配置脚本部分,提供给您参考


if (buildWithTinker()) { apply plugin: 'com.tencent.tinker.patch'

tinkerPatch {
    oldApk = getOldApkPath()
    newApk =getNewApkPath()
    tinkerEnable = buildWithTinker()

    ignoreWarning = false

    //在运行过程中,我们需要验证基准apk包与补丁包的签名是否一致,我们是否需要为你签名。
    useSign = true

    buildConfig {
        applyMapping = getApplyMappingPath()
        applyResourceMapping = getApplyResourceMappingPath()

        tinkerId = getTinkerIdValue()

        keepDexApply = false

        isProtectedApp = true

        supportHotplugComponent = true
    }

    dex {
        dexMode = "jar"

        pattern = ["classes*.dex",
                   "assets/secondary-dex-?.jar"]

        loader = [
                //use sample, let BaseBuildInfo unchangeable with tinker
                "com.ufo.tinkerdemo2.app.MyApplication",
                "com.tencent.tinker.loader.*",
                "com.ufo.tinkerdemo2.tinker.*"
        ]
    }

    lib {
        pattern = ["lib/*/*.so"]
    }

    res {
        pattern = ["res/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]

        ignoreChange = ["assets/sample_meta.txt"]

        largeModSize = 100
    }

    packageConfig {
        configField("patchMessage", "tinker is sample to use")
        configField("platform", "all")
        configField("patchVersion", "2.0")
    }

    sevenZip {
        zipArtifact = "com.tencent.mm:SevenZip:1.1.10"

    }
}

123ufo avatar Dec 16 '21 03:12 123ufo