From 05fe2efc8522a6548aa66aa5e877181a15abd5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 24 Feb 2026 15:45:08 +0800 Subject: [PATCH] Ensure self package not excluded from per-app proxy --- app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt b/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt index 7f8b50f..a3f036a 100644 --- a/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt +++ b/app/src/main/java/io/nekohasekai/sfa/bg/BoxService.kt @@ -142,10 +142,10 @@ class BoxService(private val service: Service, private val platformInterface: Pl val appList = Settings.getEffectivePerAppProxyList() if (Settings.getEffectivePerAppProxyMode() == Settings.PER_APP_PROXY_INCLUDE) { includePackage = - PlatformInterfaceWrapper.StringArray(appList.iterator()) + PlatformInterfaceWrapper.StringArray((appList + Application.application.packageName).iterator()) } else { excludePackage = - PlatformInterfaceWrapper.StringArray(appList.iterator()) + PlatformInterfaceWrapper.StringArray((appList - Application.application.packageName).iterator()) } } }, @@ -224,9 +224,9 @@ class BoxService(private val service: Service, private val platformInterface: Pl if (Vendor.isPerAppProxyAvailable() && Settings.perAppProxyEnabled) { val appList = Settings.getEffectivePerAppProxyList() if (Settings.getEffectivePerAppProxyMode() == Settings.PER_APP_PROXY_INCLUDE) { - includePackage = PlatformInterfaceWrapper.StringArray(appList.iterator()) + includePackage = PlatformInterfaceWrapper.StringArray((appList + Application.application.packageName).iterator()) } else { - excludePackage = PlatformInterfaceWrapper.StringArray(appList.iterator()) + excludePackage = PlatformInterfaceWrapper.StringArray((appList - Application.application.packageName).iterator()) } } },