VirtualAPK icon indicating copy to clipboard operation
VirtualAPK copied to clipboard

MergeManifestsHooker为什么强制删除了allowBackup?

Open PhantomQi opened this issue 7 years ago • 0 comments

VirtualAPK/virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/MergeManifestsHooker.groovy中有如下代码

    void rewrite(File xml) {
        if (xml?.exists()) {
            final Node manifest = new XmlParser().parse(xml)


            manifest.application.each { application ->
                [ 'icon', 'label', 'allowBackup', 'supportsRtl' ].each {
                    application.attributes().remove(new QName(MergeManifestsHooker.ANDROID_NAMESPACE, it))
                }
            }

            xml.withPrintWriter('utf-8', { pw ->
                XmlUtil.serialize(manifest, pw)
            })
        }
    }

我的目的是指定android:allowBackup="false",因为通常认为allowBackup是有安全风险的配置项,且默认为true,需要手动关闭。但由于MergeManifestsHooker强制删除了allowBackup项,导致其无法关闭。

VA这么做是出于什么考虑?

PhantomQi avatar Jan 23 '19 01:01 PhantomQi