vpn: fix all lint findings
- Commit
bb21c03b1b9e095852af4b7edff4cb1ee6487fce- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 04:52 UTC (19 days ago)
- Parents
79e9ec2
Fix every lint warning reported for the vpn module's own sources by :vpn:lintDev, now 0 errors / 0 warnings for vpn/** (remaining report entries are transitive library findings owned by other clusters). PluralsCandidate: bypass_selected_count is now a real <plurals> (one/other in the default locale, other plus the quantity forms each locale requires in ar/et/fr/sv/zh-rCN) and BypassListPage reads it with pluralStringResource. QueryAllPackagesPermission: tools:ignore on the manifest line — the bypass list enumerates every installed app, so a <queries> declaration cannot express the package set. ForegroundServicePermission: tools:ignore on VpnTunnelService — systemExempted is the foreground-service type for preinstalled system apps and the manifest already holds FOREGROUND_SERVICE_SYSTEM_EXEMPTED; the exact-alarm permissions lint pairs with the type gate exact-alarm features this tunnel service does not have. Those two are the justified suppressions in this module. No lint config or baseline changed. Verified: ./gradlew :vpn:lintDev (0 own-module errors/warnings) and :vpn:testDevUnitTest green.
Diff
vpn/src/main/AndroidManifest.xml
diff --git a/vpn/src/main/AndroidManifest.xml b/vpn/src/main/AndroidManifest.xmlindex 42e9403ff1..ba7e9ee3cb 100644--- a/vpn/src/main/AndroidManifest.xml+++ b/vpn/src/main/AndroidManifest.xml@@ -12,7 +12,11 @@ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />+ <!-- The bypass list enumerates every installed app (BypassHelpers.getInstalledApplications):+ the set of packages is "all of them", so a <queries> declaration cannot express it. -->+ <uses-permission+ android:name="android.permission.QUERY_ALL_PACKAGES"+ tools:ignore="QueryAllPackagesPermission" /> <application android:allowBackup="true"@@ -39,11 +43,16 @@ </intent-filter> </activity> + <!-- systemExempted is the FGS type for preinstalled system apps; this VPN ships in+ /system/priv-app and holds FOREGROUND_SERVICE_SYSTEM_EXEMPTED above. The exact-alarm+ permissions lint pairs with this type gate user-facing exact-alarm features, which+ a tunnel service does not have. --> <service android:name=".service.VpnTunnelService" android:permission="android.permission.BIND_VPN_SERVICE" android:exported="true"- android:foregroundServiceType="systemExempted">+ android:foregroundServiceType="systemExempted"+ tools:ignore="ForegroundServicePermission"> <intent-filter> <action android:name="android.net.VpnService" /> </intent-filter>
vpn/src/main/java/com/vayunmathur/vpn/ui/BypassListPage.kt
diff --git a/vpn/src/main/java/com/vayunmathur/vpn/ui/BypassListPage.kt b/vpn/src/main/java/com/vayunmathur/vpn/ui/BypassListPage.ktindex ce8e5873ca..ce5cfe23f9 100644--- a/vpn/src/main/java/com/vayunmathur/vpn/ui/BypassListPage.kt+++ b/vpn/src/main/java/com/vayunmathur/vpn/ui/BypassListPage.kt@@ -14,6 +14,7 @@ import androidx.compose.runtime.produceState import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.vayunmathur.library.ui.AppScaffold@@ -79,7 +80,7 @@ fun BypassListPage(backStack: NavBackStack<Route>) { } item { Text(- stringResource(R.string.bypass_selected_count, bypassed.size),+ pluralStringResource(R.plurals.bypass_selected_count, bypassed.size, bypassed.size), Modifier.padding(horizontal = 16.dp, vertical = 8.dp), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.onSurfaceVariant,
vpn/src/main/res/values-ar/strings.xml
diff --git a/vpn/src/main/res/values-ar/strings.xml b/vpn/src/main/res/values-ar/strings.xmlindex b4556e97d6..76eb5c2c8e 100644--- a/vpn/src/main/res/values-ar/strings.xml+++ b/vpn/src/main/res/values-ar/strings.xml@@ -12,7 +12,14 @@ <string name="bypass_list_title">التطبيقات التي تتجاوز الـ VPN</string> <string name="bypass_lockdown_warning">إذا ”حظر الاتصالات بدون VPN“ مفعلاً على إعدادات VPN في Android، فلن تحصل هذه التطبيقات على اتصال بالإنترنت على الإطلاق بدلاً من استخدام اتصالك العادي. قم بإيقاف تشغيله لكي يعمل التجاوز.</string> <string name="bypass_loading_apps">جارٍ تحميل التطبيقات…</string>- <string name="bypass_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</string>+ <plurals name="bypass_selected_count">+ <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ <item quantity="zero"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ <item quantity="one"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ <item quantity="two"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ <item quantity="few"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ <item quantity="many"><xliff:g id="count" example="3">%1$d</xliff:g> يتجاوز الـ VPN</item>+ </plurals> <string name="delete_all_logs">حذف كل السجلات؟</string> <string name="this_will_permanently_remove_all_connect">سيؤدي هذا إلى إزالة جميع سجلات الاتصال نهائيًا ولا يمكن التراجع عن ذلك.</string> <string name="address">العنوان: %1$s</string>
vpn/src/main/res/values-et/strings.xml
diff --git a/vpn/src/main/res/values-et/strings.xml b/vpn/src/main/res/values-et/strings.xmlindex b290a4d710..3896711893 100644--- a/vpn/src/main/res/values-et/strings.xml+++ b/vpn/src/main/res/values-et/strings.xml@@ -26,7 +26,10 @@ <string name="delete_all_logs">Kas kustutad kõik logid?</string> <string name="this_will_permanently_remove_all_connect">Järgnevaga kustuvad kõik ühenduste logid ja seda tegevust ei saa tagasi pöörata.</string> <string name="tunnel">Tunnel - %1$s</string>- <string name="bypass_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> rakendust võivad VPN-ist mööda minna</string>+ <plurals name="bypass_selected_count">+ <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> rakendust võivad VPN-ist mööda minna</item>+ <item quantity="one"><xliff:g id="count" example="3">%1$d</xliff:g> rakendust võivad VPN-ist mööda minna</item>+ </plurals> <string name="bypass_lockdown_warning">Kui Androidi VPN-seadistustes on sisse lülitatud valik „Blokeeri ühendused ilma VPN-ita“, ei saa need rakendused üldse internetiühendust kasutada. Kui tahad, et ümbersuunamine toimiks, lülita see välja.</string> <string name="need_activity_to_grant_vpn_permission">VPN-i õiguste lubamiseks vajad tegevust</string> <string name="imported_from_wireguard_conf_using_gotat">Imporditud WireGuardi .conf-failist gotatuni abil (mullvad/gotatun), kasutusel on Noise IK / X25519 + ChaCha20Poly1305. Uuendamiseks impordi uus .conf-fail.</string>
vpn/src/main/res/values-fr/strings.xml
diff --git a/vpn/src/main/res/values-fr/strings.xml b/vpn/src/main/res/values-fr/strings.xmlindex c2e8762c86..1faf7cd1b6 100644--- a/vpn/src/main/res/values-fr/strings.xml+++ b/vpn/src/main/res/values-fr/strings.xml@@ -25,7 +25,11 @@ <string name="bypass_list_title">Applications qui contournent le VPN</string> <string name="publickey">Clé publique : %1$s</string> <string name="need_activity_to_grant_vpn_permission">Une activité est nécessaire pour accorder l’autorisation VPN</string>- <string name="bypass_selected_count">Applications contournant le VPN : <xliff:g id="count" example="3">%1$d</xliff:g></string>+ <plurals name="bypass_selected_count">+ <item quantity="other">Applications contournant le VPN : <xliff:g id="count" example="3">%1$d</xliff:g></item>+ <item quantity="many">Applications contournant le VPN : <xliff:g id="count" example="3">%1$d</xliff:g></item>+ <item quantity="one">Applications contournant le VPN : <xliff:g id="count" example="3">%1$d</xliff:g></item>+ </plurals> <string name="vpn_wireguard_gotatun">VPN — WireGuard (gotatun)</string> <string name="no_tunnels_yet">Aucun tunnel pour le moment</string> <string name="always_on_vpn">VPN permanent</string>
vpn/src/main/res/values-sv/strings.xml
diff --git a/vpn/src/main/res/values-sv/strings.xml b/vpn/src/main/res/values-sv/strings.xmlindex bda0153fdd..0e930c7948 100644--- a/vpn/src/main/res/values-sv/strings.xml+++ b/vpn/src/main/res/values-sv/strings.xml@@ -13,7 +13,10 @@ <string name="bypass_list_title">Appar som kringgår VPN</string> <string name="bypass_lockdown_warning">Om ”Blockera anslutningar utan VPN” är aktiverat i Androids VPN-inställningar får dessa appar ingen internetåtkomst alls i stället för att använda din vanliga anslutning. Stäng av det för att undantag ska fungera.</string> <string name="bypass_loading_apps">Läser in appar …</string>- <string name="bypass_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> kringgår VPN</string>+ <plurals name="bypass_selected_count">+ <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> kringgår VPN</item>+ <item quantity="one"><xliff:g id="count" example="3">%1$d</xliff:g> kringgår VPN</item>+ </plurals> <string name="delete_all_logs">Ta bort alla loggar?</string> <string name="this_will_permanently_remove_all_connect">Detta tar permanent bort alla anslutningsloggar och kan inte ångras.</string> <string name="address">Adress: %1$s</string>
vpn/src/main/res/values-zh-rCN/strings.xml
diff --git a/vpn/src/main/res/values-zh-rCN/strings.xml b/vpn/src/main/res/values-zh-rCN/strings.xmlindex f96be68dbd..6c7b8a520b 100644--- a/vpn/src/main/res/values-zh-rCN/strings.xml+++ b/vpn/src/main/res/values-zh-rCN/strings.xml@@ -13,7 +13,9 @@ <string name="bypass_list_title">绕过 VPN 的应用</string> <string name="bypass_lockdown_warning">如果在 Android 的 VPN 设置中启用了“屏蔽未使用 VPN 的所有连接”,这些应用将完全无法访问互联网,而非使用您的常规连接。请将其关闭以使绕过功能生效。</string> <string name="bypass_loading_apps">正在加载应用…</string>- <string name="bypass_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> 个应用绕过 VPN</string>+ <plurals name="bypass_selected_count">+ <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> 个应用绕过 VPN</item>+ </plurals> <string name="delete_all_logs">删除所有日志?</string> <string name="this_will_permanently_remove_all_connect">这将永久移除所有连接日志,且无法撤销。</string> <string name="address">地址:%1$s</string>
vpn/src/main/res/values/strings.xml
diff --git a/vpn/src/main/res/values/strings.xml b/vpn/src/main/res/values/strings.xmlindex 3b810b9f45..6bc5325cd8 100644--- a/vpn/src/main/res/values/strings.xml+++ b/vpn/src/main/res/values/strings.xml@@ -19,7 +19,10 @@ <!-- BypassListPage: Shown while the installed-app list is being loaded. Sentence fragment --> <string name="bypass_loading_apps">Loading apps…</string> <!-- BypassListPage: Count of currently bypassed apps. %1$d = number of apps, e.g. 3 -->- <string name="bypass_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> bypassing the VPN</string>+ <plurals name="bypass_selected_count">+ <item quantity="one"><xliff:g id="count" example="1">%1$d</xliff:g> bypassing the VPN</item>+ <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> bypassing the VPN</item>+ </plurals> <string name="delete_all_logs">Delete all logs?</string> <string name="this_will_permanently_remove_all_connect">This will permanently remove all connection logs and cannot be undone.</string> <string name="address">Address: %1$s</string>