@@ -675,6 +675,11 @@ end;
675
675
begin
676
676
Thread.new{
677
677
if '$custom_fakeip_filter ' == '1' then
678
+ if '${35} ' == 'whitelist' then
679
+ Value['dns']['fake-ip-filter-mode']='whitelist';
680
+ else
681
+ Value['dns']['fake-ip-filter-mode']='blacklist';
682
+ end;
678
683
if '$1 ' == 'fake-ip' then
679
684
if File::exist?('/etc/openclash/custom/openclash_custom_fake_filter.list') then
680
685
Value_4 = IO.readlines('/etc/openclash/custom/openclash_custom_fake_filter.list');
@@ -702,12 +707,24 @@ Thread.new{
702
707
end;
703
708
if '$1 ' == 'fake-ip' then
704
709
if '$china_ip_route ' != '0' then
705
- if Value['dns'].has_key?('fake-ip-filter') and not Value['dns']['fake-ip-filter'].to_a.empty? then
706
- Value['dns']['fake-ip-filter'].insert(-1,'geosite:category-games@cn');
707
- Value['dns']['fake-ip-filter'].insert(-1,'geosite:cn');
708
- Value['dns']['fake-ip-filter']=Value['dns']['fake-ip-filter'].uniq;
710
+ if Value['dns']['fake-ip-filter-mode'] == 'blacklist' or not Value['dns'].has_key?('fake-ip-filter-mode') then
711
+ if Value['dns'].has_key?('fake-ip-filter') and not Value['dns']['fake-ip-filter'].to_a.empty? then
712
+ Value['dns']['fake-ip-filter'].insert(-1,'geosite:category-games@cn');
713
+ Value['dns']['fake-ip-filter'].insert(-1,'geosite:cn');
714
+ Value['dns']['fake-ip-filter']=Value['dns']['fake-ip-filter'].uniq;
715
+ else
716
+ Value['dns'].merge!({'fake-ip-filter'=>['geosite:category-games@cn,geosite:cn']});
717
+ end;
718
+ puts '${LOGTIME} Tip: Because Need Ensure Bypassing IP Option Work, Added The Fake-IP-Filter Rule【 geosite:category-games@cn,geosite:cn 】';
709
719
else
710
- Value['dns'].merge!({'fake-ip-filter'=>['geosite:category-games@cn,geosite:cn']});
720
+ if Value['dns'].has_key?('fake-ip-filter') and not Value['dns']['fake-ip-filter'].to_a.empty? then
721
+ Value['dns']['fake-ip-filter'].each{|x|
722
+ if x =~ /(geosite:?).*(@cn|:cn)/ then
723
+ Value['dns']['fake-ip-filter'].delete(x);
724
+ puts '${LOGTIME} Tip: Because Need Ensure Bypassing IP Option Work, Deleted The Fake-IP-Filter Rule【' + x + '】';
725
+ end;
726
+ };
727
+ end;
711
728
end;
712
729
end;
713
730
end;
0 commit comments