File tree Expand file tree Collapse file tree
android/app/src/main/java/com/therealaleph/mhrv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,12 +191,22 @@ class MhrvVpnService : VpnService() {
191191 builder.addDisallowedApplication(packageName)
192192 } catch (_: Throwable ) {}
193193 } else {
194+ var allowed = 0
194195 for (pkg in cfg.splitApps) {
195196 if (pkg == packageName) continue // can't tunnel ourselves
196- try { builder.addAllowedApplication(pkg) } catch (e: Throwable ) {
197+ try {
198+ builder.addAllowedApplication(pkg)
199+ allowed++
200+ } catch (e: Throwable ) {
197201 Log .w(TAG , " addAllowedApplication($pkg ) failed: ${e.message} " )
198202 }
199203 }
204+ if (allowed == 0 ) {
205+ Log .w(TAG , " ONLY mode had no usable apps — falling back to ALL" )
206+ try {
207+ builder.addDisallowedApplication(packageName)
208+ } catch (_: Throwable ) {}
209+ }
200210 }
201211 }
202212 SplitMode .EXCEPT -> {
You can’t perform that action at this time.
0 commit comments