Commit da2c83c8 authored by MozLando's avatar MozLando
Browse files

Merge #6183



6183: Closes #6163: Update the tracking protection lists in SystemEngine  r=psymoon a=Amejia481



Co-authored-by: default avatarArturo Mejia <arturomejiamarmol@gmail.com>
parents 2ee0dafa 0ef4a7b1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -806,7 +806,6 @@ class SystemEngineView @JvmOverloads constructor(
                URL_MATCHER = UrlMatcher.createMatcher(
                        resources,
                        R.raw.domain_blacklist,
                        intArrayOf(R.raw.domain_overrides),
                        R.raw.domain_whitelist,
                        categories)
                }
+3 −23
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class UrlMatcher {

        for ((key) in categoryMap) {
            if (!supportedCategories.contains(key)) {
                throw IllegalArgumentException("categoryMap contains undeclared category")
                throw IllegalArgumentException("$key categoryMap contains undeclared category")
            }
        }

@@ -150,14 +150,12 @@ class UrlMatcher {
        const val ADVERTISING = "Advertising"
        const val ANALYTICS = "Analytics"
        const val CONTENT = "Content"
        const val DISCONNECT = "Disconnect"
        const val SOCIAL = "Social"
        const val DEFAULT = "default"
        const val CRYPTOMINING = "Cryptomining"
        const val FINGERPRINTING = "Fingerprinting"

        private val ignoredCategories = setOf("Legacy Disconnect", "Legacy Content")
        private val disconnectMoved = setOf("Facebook", "Twitter")
        private val webfontExtensions = arrayOf(".woff2", ".woff", ".eot", ".ttf", ".otf")
        private val supportedCategories = setOf(
                ADVERTISING,
@@ -173,48 +171,41 @@ class UrlMatcher {
         *
         * @deprecated Pass resources directly
         * @param blackListFile resource ID to a JSON file containing the black list
         * @param overrides array of resource ID to JSON files containing black list overrides
         * @param whiteListFile resource ID to a JSON file containing the white list
         */
        fun createMatcher(
            context: Context,
            @RawRes blackListFile: Int,
            overrides: IntArray?,
            @RawRes whiteListFile: Int,
            enabledCategories: Set<String> = supportedCategories
        ): UrlMatcher =
            createMatcher(context.resources, blackListFile, overrides, whiteListFile, enabledCategories)
            createMatcher(context.resources, blackListFile, whiteListFile, enabledCategories)

        /**
         * Creates a new matcher instance for the provided URL lists.
         *
         * @param blackListFile resource ID to a JSON file containing the black list
         * @param overrides array of resource ID to JSON files containing black list overrides
         * @param whiteListFile resource ID to a JSON file containing the white list
         */
        fun createMatcher(
            resources: Resources,
            @RawRes blackListFile: Int,
            overrides: IntArray?,
            @RawRes whiteListFile: Int,
            enabledCategories: Set<String> = supportedCategories
        ): UrlMatcher {
            val blackListReader = InputStreamReader(resources.openRawResource(blackListFile), UTF_8)
            val whiteListReader = InputStreamReader(resources.openRawResource(whiteListFile), UTF_8)
            val overrideReaders = overrides?.map { InputStreamReader(resources.openRawResource(it), UTF_8) }
            return createMatcher(blackListReader, overrideReaders, whiteListReader, enabledCategories)
            return createMatcher(blackListReader, whiteListReader, enabledCategories)
        }

        /**
         * Creates a new matcher instance for the provided URL lists.
         *
         * @param black reader containing the black list
         * @param overrides array of resource ID to JSON files containing black list overrides
         * @param white resource ID to a JSON file containing the white list
         */
        fun createMatcher(
            black: Reader,
            overrides: List<Reader>?,
            white: Reader,
            enabledCategories: Set<String> = supportedCategories
        ): UrlMatcher {
@@ -224,12 +215,6 @@ class UrlMatcher {
                jsonReader -> loadCategories(jsonReader, categoryMap)
            }

            overrides?.forEach {
                JsonReader(it).use {
                    jsonReader -> loadCategories(jsonReader, categoryMap, true)
                }
            }

            var whiteList: WhiteList? = null
            JsonReader(white).use { jsonReader -> whiteList = WhiteList.fromJson(jsonReader) }
            return UrlMatcher(enabledCategories, supportedCategories, categoryMap, whiteList)
@@ -275,11 +260,6 @@ class UrlMatcher {
                val categoryName = reader.nextName()
                when {
                    ignoredCategories.contains(categoryName) -> reader.skipValue()
                    categoryName == DISCONNECT -> {
                        extractCategory(reader) { url, owner ->
                            if (disconnectMoved.contains(owner)) socialOverrides.add(url)
                        }
                    }
                    else -> {
                        val categoryTrie: Trie?
                        if (!override) {
+177 −162
Original line number Diff line number Diff line
@@ -2063,7 +2063,13 @@
            {
                "ClickFrog": {
                    "https://clickfrog.ru/": [
                        "clickfrog.ru"
                        "bashirian.biz",
                        "buckridge.link",
                        "clickfrog.ru",
                        "franecki.net",
                        "quitzon.net",
                        "reichelcormier.bid",
                        "wisokykulas.bid"
                    ]
                }
            },
@@ -2352,7 +2358,8 @@
                        "criteo.com",
                        "criteo.net",
                        "hlserve.com",
                        "hooklogic.com"
                        "hooklogic.com",
                        "storetail.io"
                    ]
                }
            },
@@ -2665,8 +2672,7 @@
            {
                "eBay": {
                    "http://www.ebay.com/": [
                        "ebay.com",
                        "gopjn.com"
                        "ebay.com"
                    ]
                }
            },
@@ -2964,6 +2970,13 @@
                    ]
                }
            },
            {
                "Facebook": {
                    "http://www.facebook.com/": [
                        "atlassolutions.com"
                    ]
                }
            },
            {
                "Facilitate Digital": {
                    "http://www.facilitatedigital.com/": [
@@ -3127,7 +3140,7 @@
            {
                "Friends2Follow": {
                    "https://friends2follow.com/": [
                        "friends2follow.com"
                        "tracking.friends2follow.com"
                    ]
                }
            },
@@ -3271,6 +3284,7 @@
            {
                "Gleam": {
                    "https://gleam.io/": [
                        "fraudjs.io",
                        "gleam.io"
                    ]
                }
@@ -3304,6 +3318,29 @@
                    ]
                }
            },
            {
                "Google": {
                    "http://www.google.com/": [
                        "2mdn.net",
                        "admeld.com",
                        "admob.com",
                        "adservice.google.ca",
                        "adservice.google.com",
                        "adwords.google.com",
                        "cc-dt.com",
                        "destinationurl.com",
                        "doubleclick.net",
                        "googleadservices.com",
                        "googlesyndication.com",
                        "googletagservices.com",
                        "invitemedia.com",
                        "smtad.net",
                        "teracent.com",
                        "teracent.net",
                        "ytsa.net"
                    ]
                }
            },
            {
                "Grapeshot": {
                    "http://www.grapeshot.co.uk/": [
@@ -3333,20 +3370,6 @@
                    ]
                }
            },
            {
                "GSI Commerce": {
                    "http://www.gsicommerce.com/": [
                        "gsicommerce.com",
                        "gsimedia.net",
                        "pepperjam.com",
                        "pjatr.com",
                        "pjtra.com",
                        "pntra.com",
                        "pntrac.com",
                        "pntrs.com"
                    ]
                }
            },
            {
                "GumGum": {
                    "http://gumgum.com/": [
@@ -3418,16 +3441,7 @@
            {
                "Horyzon Media": {
                    "http://www.horyzon-media.com/": [
                        "horyzon-media.com",
                        "meetic-partners.com",
                        "smartadserver.com"
                    ]
                }
            },
            {
                "HotelChamp": {
                    "https://www.hotelchamp.com": [
                        "hotelchamp.com"
                        "horyzon-media.com"
                    ]
                }
            },
@@ -3475,6 +3489,13 @@
                    ]
                }
            },
            {
                "IAB": {
                    "https://iabtechlab.com/": [
                        "digitru.st"
                    ]
                }
            },
            {
                "IAC": {
                    "http://www.iac.com/": [
@@ -3498,6 +3519,13 @@
                    ]
                }
            },
            {
                "ID5": {
                    "http://id5.io/": [
                        "id5-sync.com"
                    ]
                }
            },
            {
                "IDG": {
                    "http://www.idg.com/": [
@@ -3530,13 +3558,6 @@
                    ]
                }
            },
            {
                "iMedia": {
                    "http://www.imedia.cz": [
                        "imedia.cz"
                    ]
                }
            },
            {
                "Improve Digital": {
                    "www.improvedigital.com/": [
@@ -3852,6 +3873,13 @@
                    ]
                }
            },
            {
                "Keywee": {
                    "https://keywee.co": [
                        "keywee.co"
                    ]
                }
            },
            {
                "KissMyAds": {
                    "http://kissmyads.com/": [
@@ -4238,7 +4266,8 @@
                "Match.com": {
                    "http://www.match.com/": [
                        "chemistry.com",
                        "match.com"
                        "match.com",
                        "meetic-partners.com"
                    ]
                }
            },
@@ -5409,6 +5438,14 @@
                    ]
                }
            },
            {
                "Radial": {
                    "https://www.radial.com": [
                        "gsicommerce.com",
                        "gsimedia.net"
                    ]
                }
            },
            {
                "Radiate Media": {
                    "http://www.radiatemedia.com/": [
@@ -5875,6 +5912,13 @@
                    ]
                }
            },
            {
                "SmartAdServer": {
                    "http://smartadserver.com/": [
                        "smartadserver.com"
                    ]
                }
            },
            {
                "SmartyAds": {
                    "https://smartyads.com/": [
@@ -6155,6 +6199,13 @@
                    ]
                }
            },
            {
                "Superfish": {
                    "http://www.superfish.com/": [
                        "superfish.com"
                    ]
                }
            },
            {
                "SupersonicAds": {
                    "http://www.supersonicads.com/": [
@@ -6526,6 +6577,13 @@
                    ]
                }
            },
            {
                "Twitter": {
                    "https://twitter.com/": [
                        "ads-twitter.com"
                    ]
                }
            },
            {
                "Twyn Group": {
                    "http://www.twyn.com/": [
@@ -6617,14 +6675,6 @@
                    ]
                }
            },
            {
                "USI Technologies": {
                    "http://www.usitechnologies.com/": [
                        "upsellit.com",
                        "usitechnologies.com"
                    ]
                }
            },
            {
                "Value Ad": {
                    "http://valuead.com/": [
@@ -6754,13 +6804,6 @@
                    ]
                }
            },
            {
                "ViralLoops": {
                    "https://viral-loops.com": [
                        "viral-loops.com"
                    ]
                }
            },
            {
                "VisibleBrands": {
                    "http://www.visbrands.com/": [
@@ -6891,14 +6934,6 @@
                    ]
                }
            },
            {
                "Wirtualna Polska": {
                    "http://www.wp.pl/": [
                        "adtotal.pl",
                        "wp.pl"
                    ]
                }
            },
            {
                "Wishabi": {
                    "http://wishabi.com": [
@@ -7975,13 +8010,6 @@
                    ]
                }
            },
            {
                "Olark": {
                    "http://www.olark.com/": [
                        "olark.com"
                    ]
                }
            },
            {
                "Ooyala": {
                    "http://www.ooyala.com/": [
@@ -8081,13 +8109,6 @@
                    ]
                }
            },
            {
                "Superfish": {
                    "http://www.superfish.com/": [
                        "superfish.com"
                    ]
                }
            },
            {
                "Synacor": {
                    "http://www.synacor.com/": [
@@ -8404,13 +8425,6 @@
                    ]
                }
            },
            {
                "Adobe": {
                    "http://www.adobe.com/": [
                        "adobedtm.com"
                    ]
                }
            },
            {
                "Adventori": {
                    "https://adventori.com": [
@@ -8472,6 +8486,7 @@
            {
                "AT Internet": {
                    "http://www.atinternet.com/": [
                        "at-o.net",
                        "atinternet.com",
                        "xiti.com"
                    ]
@@ -8866,6 +8881,13 @@
                    ]
                }
            },
            {
                "Friends2Follow": {
                    "https://friends2follow.com/": [
                        "antifraudjs.friends2follow.com"
                    ]
                }
            },
            {
                "Fullstory": {
                    "https://www.fullstory.com/": [
@@ -8905,6 +8927,14 @@
                    ]
                }
            },
            {
                "Google": {
                    "http://www.google.com/": [
                        "google-analytics.com",
                        "postrank.com"
                    ]
                }
            },
            {
                "GoSquared": {
                    "https://www.gosquared.com/": [
@@ -9580,6 +9610,13 @@
                    ]
                }
            },
            {
                "Sourcepoint": {
                    "https://www.sourcepoint.com/": [
                        "summerhamster.com"
                    ]
                }
            },
            {
                "Sputnik.ru": {
                    "http://sputnik.ru": [
@@ -9636,6 +9673,13 @@
                    ]
                }
            },
            {
                "Tealium": {
                    "https://tealium.com": [
                        "tealiumiq.com"
                    ]
                }
            },
            {
                "TechSolutions": {
                    "https://www.techsolutions.com.tw/": [
@@ -9684,6 +9728,14 @@
                    ]
                }
            },
            {
                "Twitter": {
                    "https://twitter.com/": [
                        "crashlytics.com",
                        "tweetdeck.com"
                    ]
                }
            },
            {
                "Umbel": {
                    "https://www.umbel.com/": [
@@ -10058,13 +10110,6 @@
                    ]
                }
            },
            {
                "Cbox": {
                    "http://www.cbox.ws/": [
                        "cbox.ws"
                    ]
                }
            },
            {
                "ClearLink": {
                    "https://www.clearlink.com/": [
@@ -10173,7 +10218,7 @@
            {
                "Friends2Follow": {
                    "https://friends2follow.com/": [
                        "friends2follow.com"
                        "antifraudjs.friends2follow.com"
                    ]
                }
            },
@@ -10188,7 +10233,7 @@
            {
                "Gleam": {
                    "https://gleam.io/": [
                        "gleam.io"
                        "fraudjs.io"
                    ]
                }
            },
@@ -10593,13 +10638,6 @@
                    ]
                }
            },
            {
                "ViralLoops": {
                    "https://viral-loops.com": [
                        "viral-loops.com"
                    ]
                }
            },
            {
                "Webmecanik": {
                    "https://www.webmecanik.com/": [
@@ -10666,6 +10704,38 @@
                    ]
                }
            },
            {
                "Facebook": {
                    "http://www.facebook.com/": [
                        "apps.fbsbx.com",
                        "atdmt.com",
                        "facebook.com",
                        "facebook.de",
                        "facebook.fr",
                        "facebook.net",
                        "fb.com",
                        "fbsbx.com",
                        "friendfeed.com"
                    ]
                }
            },
            {
                "Google": {
                    "http://www.google.com/": [
                        "developers.google.com",
                        "gmail.com",
                        "googlemail.com",
                        "inbox.google.com",
                        "mail.google.com",
                        "orkut.com",
                        "plus.google.com",
                        "plusone.google.com",
                        "smartlock.google.com",
                        "voice.google.com",
                        "wave.google.com"
                    ]
                }
            },
            {
                "LinkedIn": {
                    "http://www.linkedin.com/": [
@@ -10733,6 +10803,15 @@
                    ]
                }
            },
            {
                "Twitter": {
                    "https://twitter.com/": [
                        "twimg.com",
                        "twitter.com",
                        "twitter.jp"
                    ]
                }
            },
            {
                "USocial": {
                    "https://usocial.pro": [
@@ -10962,70 +11041,6 @@
                    ]
                }
            }
        ],
        "Disconnect": [
            {
                "Facebook": {
                    "http://www.facebook.com/": [
                        "atdmt.com",
                        "atlassolutions.com",
                        "facebook.com",
                        "facebook.de",
                        "facebook.fr",
                        "facebook.net",
                        "fb.com",
                        "fbsbx.com",
                        "friendfeed.com"
                    ]
                }
            },
            {
                "Google": {
                    "http://www.google.com/": [
                        "2mdn.net",
                        "admeld.com",
                        "admob.com",
                        "adservice.google.ca",
                        "adservice.google.com",
                        "adwords.google.com",
                        "cc-dt.com",
                        "destinationurl.com",
                        "developers.google.com",
                        "doubleclick.net",
                        "gmail.com",
                        "google-analytics.com",
                        "googleadservices.com",
                        "googlemail.com",
                        "googlesyndication.com",
                        "googletagservices.com",
                        "inbox.google.com",
                        "invitemedia.com",
                        "mail.google.com",
                        "orkut.com",
                        "plus.google.com",
                        "plusone.google.com",
                        "postrank.com",
                        "smtad.net",
                        "teracent.com",
                        "teracent.net",
                        "voice.google.com",
                        "wave.google.com",
                        "ytsa.net"
                    ]
                }
            },
            {
                "Twitter": {
                    "https://twitter.com/": [
                        "ads-twitter.com",
                        "crashlytics.com",
                        "tweetdeck.com",
                        "twimg.com",
                        "twitter.com",
                        "twitter.jp"
                    ]
                }
            }
        ]
    }
}
 No newline at end of file
+0 −55
Original line number Diff line number Diff line
{
    "categories": {
        "Advertising": [
            {
                "Google": {
                    "http://www.google.com/": [
                        "2mdn.net",
                        "admeld.com",
                        "admob.com",
                        "cc-dt.com",
                        "destinationurl.com",
                        "doubleclick.net",
                        "adwords.google.com",
                        "googleadservices.com",
                        "googlesyndication.com",
                        "googletagservices.com",
                        "invitemedia.com",
                        "smtad.net",
                        "teracent.com",
                        "teracent.net",
                        "ytsa.net"
                    ]
                }
            }
        ],
         "Analytics": [
            {
                "Google": {
                    "http://www.google.com/": [
                        "google-analytics.com",
                        "postrank.com"
                    ]
                }
            }
        ],
         "Social": [
            {
                "Google": {
                    "http://www.google.com/": [
                        "developers.google.com",
                        "gmail.com",
                        "mail.google.com",
                        "inbox.google.com",
                        "orkut.com",
                        "plus.google.com",
                        "plusone.google.com",
                        "voice.google.com",
                        "wave.google.com",
                        "googlemail.com"
                    ]
                }
            }
        ]
    }
}
+116 −73

File changed.

Preview size limit exceeded, changes collapsed.

Loading