tsurlfilter icon indicating copy to clipboard operation
tsurlfilter copied to clipboard

The `$app` modifier is ignored by the DnsEngine

Open DemianParkhomenko opened this issue 2 years ago • 2 comments

$app=com.miui.systemAdSolution matches all hostnames.

  const dnsResult = dnsEngine.match(hostname);
   if (dnsResult.basicRule && !dnsResult.basicRule.isAllowlist()) {
       // blocking rule found
       ..
   }

   if (dnsResult.hostRules.length > 0) {
       // hosts rules found
       ..
   }

DemianParkhomenko avatar Mar 24 '22 18:03 DemianParkhomenko

'$app=com.fiberhome.wifiserver'
'$app=com.miui.analytics'

These rules always match as a basic rule. It is a bug, isn't it?

DemianParkhomenko avatar Mar 24 '22 20:03 DemianParkhomenko

@demian-parkhomenko generally, tsurlfilter just ignores the $app modifier in the current version. It was added to tsurlfilter just for the sake of compatibility with CoreLibs/DnsLibs (the other engines that we use in AdGuard apps).

@maximtop I think we have two options here:

  1. Make the $app modifier work.
  2. Introduce a "compatibility level" concept to tsurlfilter with the following options: Extension, DNS, CoreLibs. The supported modifiers should depend on the compatibility level.

ameshkov avatar Mar 25 '22 08:03 ameshkov