Why does the host specified in network_security_config.xml get merged into the AppLinks section of the Android manifest by the build process?

余生颓废 提交于 2021-01-05 08:58:19

问题


Following on from this question where I had a real issue with AppLinks. The problem was eventually narrowed down to the fact that the build process was dragging the host from the network_security_config.xml into the merged manfest file section specifying the AppLinks. This unexpected host that I used for testing wasn't hosting an assetlinks.json specifying the correct signatures.

Details of the answer can be found here.

So, why does the build process turn this

        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:host="letsdraw.fun" android:pathPrefix="/ec" android:scheme="https" />
            <data android:host="letsdraw.fun" android:pathPrefix="/restore" android:scheme="https" />
        </intent-filter>

Into this?

        <intent-filter
            android:autoVerify="true">

            <action
                android:name="android.intent.action.VIEW" />

            <category
                android:name="android.intent.category.DEFAULT" />

            <category
                android:name="android.intent.category.BROWSABLE" />

            <data
                android:scheme="http"
                android:host="scribble-cloud-v24-test-dot-scribble-cloud.appspot.com"
                android:pathPrefix="/ec" />

            <data
                android:scheme="https"
                android:host="scribble-cloud.appspot.com"
                android:pathPrefix="/ec" />

            <data
                android:scheme="https"
                android:host="letsdraw.fun"
                android:pathPrefix="/ec" />

            <data
                android:scheme="https"
                android:host="letsdraw.fun"
                android:pathPrefix="/restore" />
        </intent-filter>

来源:https://stackoverflow.com/questions/65215382/why-does-the-host-specified-in-network-security-config-xml-get-merged-into-the-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!