mirror of
https://github.com/therealaleph/MasterHttpRelayVPN-RUST.git
synced 2026-05-18 06:24:35 +03:00
Merge pull request #150 from freeinternet865/fix/android-only-split-empty
fix(android): keep empty ONLY split lists self-excluded
This commit is contained in:
@@ -191,12 +191,22 @@ class MhrvVpnService : VpnService() {
|
||||
builder.addDisallowedApplication(packageName)
|
||||
} catch (_: Throwable) {}
|
||||
} else {
|
||||
var allowed = 0
|
||||
for (pkg in cfg.splitApps) {
|
||||
if (pkg == packageName) continue // can't tunnel ourselves
|
||||
try { builder.addAllowedApplication(pkg) } catch (e: Throwable) {
|
||||
try {
|
||||
builder.addAllowedApplication(pkg)
|
||||
allowed++
|
||||
} catch (e: Throwable) {
|
||||
Log.w(TAG, "addAllowedApplication($pkg) failed: ${e.message}")
|
||||
}
|
||||
}
|
||||
if (allowed == 0) {
|
||||
Log.w(TAG, "ONLY mode had no usable apps — falling back to ALL")
|
||||
try {
|
||||
builder.addDisallowedApplication(packageName)
|
||||
} catch (_: Throwable) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
SplitMode.EXCEPT -> {
|
||||
|
||||
Reference in New Issue
Block a user