Add cloud based ACL updating

This commit is contained in:
Max Lv
2016-10-09 10:51:08 +08:00
parent bbf614484d
commit 0f24d7c0bc
9 changed files with 47 additions and 33 deletions
@@ -96,6 +96,7 @@ class ShadowsocksNatService extends BaseService {
if (profile.route != Route.ALL) {
cmd += "--acl"
profile.route match {
case Route.BYPASS_LAN => cmd += (getApplicationInfo.dataDir + "/bypass_lan.acl")
case Route.BYPASS_CHN => cmd += (getApplicationInfo.dataDir + "/bypass_chn.acl")
@@ -336,8 +337,10 @@ class ShadowsocksNatService extends BaseService {
}
handleConnection()
// Set DNS
su.addCommand(Utils.FLUSH_DNS)
// lazily get ACL from cloud
getAcl(profile.route)
changeState(State.CONNECTED)
notification = new ShadowsocksNotification(this, profile.name, true)
}