Skip to content

Commit bf3c86f

Browse files
committed
feat: android note for vite
1 parent 1e5f4a6 commit bf3c86f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

content/configuration/vite.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,38 @@ export default () => {
239239
};
240240
};
241241
```
242+
243+
## Android Notes
244+
245+
Be sure to have a proper security policy in place using something as follows:
246+
247+
248+
1. `App_Resources/Android/src/main/res/xml/network_security.xml`
249+
250+
```xml
251+
<?xml version="1.0" encoding="utf-8"?>
252+
<network-security-config>
253+
<base-config cleartextTrafficPermitted="true">
254+
<trust-anchors>
255+
<certificates src="system" />
256+
<certificates src="user" />
257+
</trust-anchors>
258+
</base-config>
259+
<domain-config cleartextTrafficPermitted="true">
260+
<domain includeSubdomains="true">localhost</domain>
261+
<domain includeSubdomains="true">127.0.0.1</domain>
262+
<domain includeSubdomains="true">10.0.2.2</domain>
263+
</domain-config>
264+
</network-security-config>
265+
```
266+
267+
2. Then make sure to reference it in your `AndroidManifest.xml`:
268+
269+
```xml
270+
<application
271+
...
272+
android:networkSecurityConfig="@xml/network_security"
273+
... >
274+
...
275+
</application>
276+
```

0 commit comments

Comments
 (0)