Add network security config (#623)

This commit is contained in:
David Perez 2024-01-15 14:24:57 -06:00 committed by Álison Fernandes
parent b343761db3
commit 99d7af4c16
2 changed files with 29 additions and 2 deletions

View file

@ -5,6 +5,7 @@
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
@ -17,6 +18,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/LaunchTheme"
@ -46,9 +48,9 @@
<service
android:name=".data.autofill.BitwardenAutofillService"
android:exported="true"
android:label="Bitwarden"
android:permission="android.permission.BIND_AUTOFILL_SERVICE"
android:exported="true">
android:permission="android.permission.BIND_AUTOFILL_SERVICE">
<intent-filter>
<action android:name="android.service.autofill.AutofillService" />
</intent-filter>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:tools="http://schemas.android.com/tools">
<base-config
cleartextTrafficPermitted="true"
tools:ignore="InsecureBaseConfiguration">
<trust-anchors>
<!-- Trust pre-installed CAs -->
<certificates src="system" />
<!-- Additionally trust user added CAs -->
<certificates
src="user"
tools:ignore="AcceptsUserCertificates" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">bitwarden.com</domain>
<trust-anchors>
<!-- Only trust pre-installed CAs for bitwarden.com and all subdomains -->
<certificates src="system" />
</trust-anchors>
</domain-config>
</network-security-config>