From 3e736e16485e7a7cd49ea2558860f60068df5a19 Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Sun, 3 Sep 2017 10:59:41 +0800 Subject: [PATCH] Fixed crash on devices using Android 4.x --- .../org/itxtech/daedalus/service/DaedalusVpnService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java index 03eca23..6729678 100644 --- a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java +++ b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java @@ -229,7 +229,7 @@ public class DaedalusVpnService extends VpnService implements Runnable { Log.d(TAG, "configure: Adding IPv6 address" + addr); builder.addAddress(addr, 120); } catch (Exception e) { - e.printStackTrace(); + Logger.logException(e); ipv6Template = null; } @@ -256,11 +256,10 @@ public class DaedalusVpnService extends VpnService implements Runnable { if (advanced) { builder.setBlocking(true); + builder.allowFamily(OsConstants.AF_INET); + builder.allowFamily(OsConstants.AF_INET6); } - builder.allowFamily(OsConstants.AF_INET); - builder.allowFamily(OsConstants.AF_INET6); - descriptor = builder.establish(); Logger.info("Daedalus VPN service is started");