diff --git a/shadowsocks-csharp/Data/abp.js b/shadowsocks-csharp/Data/abp.js index cea08514..1f8c1408 100644 --- a/shadowsocks-csharp/Data/abp.js +++ b/shadowsocks-csharp/Data/abp.js @@ -6,8 +6,21 @@ // 2019-02-08: Updated to support shadowsocks-windows user rules. var proxy = __PROXY__; -var userrules = __USERRULES__; -var rules = __RULES__; +var userrules = []; +var rules = []; + +// convert to abp grammar +for (var i = 0; i < __RULES__.length; i++) { + var s = __RULES__.pop(); + if (s.substring(0, 2) == "||") s += "^"; + rules.push(s); +} + +for (var i = 0; i < __USERRULES__.length; i++) { + var s = __USERRULES__.pop(); + if (s.substring(0, 2) == "||") s += "^"; + userrules.push(s); +} /* * This file is part of Adblock Plus ,