fix(security): declare explicit network security config to forbid cleartext #20
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/manifest-cleartext-traffic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Resolves the SonarQube S5332 hotspot: "usesCleartextTraffic is implicitly enabled for older Android versions" on
app/src/main/AndroidManifest.xml.The app is purely an HTTPS API client of a shard's website backend, so cleartext should be denied by default. The manifest previously left
usesCleartextTrafficimplicit. This adds an explicit network security config:app/src/main/res/xml/network_security_config.xml(release/base posture):cleartextTrafficPermitted="false"— no cleartext at all.app/src/debug/res/xml/network_security_config.xml(debug override): re-permits cleartext to loopback only (127.0.0.1/localhost) for local dev againsthttp://127.0.0.1:3000.<application android:networkSecurityConfig="@xml/network_security_config">.Why this shape
This mirrors, at the platform socket layer, the rule
ServerUrlalready enforces at the app layer (allowInsecureHttp = BuildConfig.DEBUG— HTTPS required in release, HTTP allowed only in debug for127.0.0.1). Being explicit:targetSdk28+ the platform default already blocks cleartext, so the debug loopback path only actually works with the explicitdomain-configadded here.Verification
:app:processDebugResourcesand:app:processReleaseResources— BUILD SUCCESSFUL.@xml/network_security_config; release packaged config has 0cleartextTrafficPermitted="true".domain-config.Docs
Matching doc update in
RunicGateway/docs→android/PLAN.md(M1): branchfix/android-cleartext-doc.AI-assisted: authored with Claude Code (
Co-Authored-By: Claude).🤖 Generated with Claude Code