diff --git a/Cartfile.resolved b/Cartfile.resolved index 42fc5d64c6d5..30178ea39e16 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -14,7 +14,7 @@ github "jrendel/SwiftKeychainWrapper" "3.4.0" github "kif-framework/KIF" "v3.7.8" github "mozilla-mobile/MappaMundi" "1d17845e4bd6077d790aca5a2b4a468f19567934" github "mozilla-mobile/telemetry-ios" "v1.1.2" -github "mozilla-services/shavar-prod-lists" "c938da47c4880a48ac40d535caff74dac1d4d77b" +github "mozilla-services/shavar-prod-lists" "1f282be9bc7bf86cf4d695e2a63dbcdf2eecfb89" github "mozilla/application-services" "v0.59.0" github "mozilla/glean" "v29.0.0" github "swisspol/GCDWebServer" "3.5.3" diff --git a/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGen/main.swift b/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGen/main.swift index fbb6cac3c612..27c9d41f85b3 100644 --- a/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGen/main.swift +++ b/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGen/main.swift @@ -12,7 +12,6 @@ let execIsFromCorrectDir = fm.fileExists(atPath: fm.currentDirectoryPath + "/Pac let rootdir = execIsFromCorrectDir ? fm.currentDirectoryPath : fallbackPath let blacklist = "\(rootdir)/../../Carthage/Checkouts/shavar-prod-lists/disconnect-blacklist.json" let entityList = "\(rootdir)/../../Carthage/Checkouts/shavar-prod-lists/disconnect-entitylist.json" -let googleMappingList = "\(rootdir)/../../Carthage/Checkouts/shavar-prod-lists/google_mapping.json" let fingerprintingList = "\(rootdir)/../../Carthage/Checkouts/shavar-prod-lists/normalized-lists/base-fingerprinting-track.json" func jsonFrom(filename: String) -> [String: Any] { @@ -21,7 +20,7 @@ func jsonFrom(filename: String) -> [String: Any] { return try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any] } -let gen = ContentBlockerGenLib(entityListJson: jsonFrom(filename: entityList), googleMappingJson: jsonFrom(filename: googleMappingList)) +let gen = ContentBlockerGenLib(entityListJson: jsonFrom(filename: entityList)) // Remove and create the output dir let outputDir = URL(fileURLWithPath: "\(rootdir)/../Lists") diff --git a/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGenLib/ContentBlockerGenLib.swift b/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGenLib/ContentBlockerGenLib.swift index 98b08ed57112..db6a7e1d798f 100644 --- a/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGenLib/ContentBlockerGenLib.swift +++ b/content-blocker-lib-ios/ContentBlockerGen/Sources/ContentBlockerGenLib/ContentBlockerGenLib.swift @@ -21,10 +21,8 @@ public enum CategoryTitle: String, CaseIterable { public class ContentBlockerGenLib { var companyToRelatedDomains = [String: [String]]() - let googleMappingJson: [String: Any] - public init(entityListJson: [String: Any], googleMappingJson: [String: Any]) { - self.googleMappingJson = googleMappingJson["categories"]! as! [String: Any] + public init(entityListJson: [String: Any]) { parseEntityList(json: entityListJson) } @@ -83,25 +81,6 @@ public class ContentBlockerGenLib { result += handleCategoryItem($0, action: action) } - // Special handling for Social, pull in lists from Disconnect category - if categoryTitle == .Social { - let category = categories[CategoryTitle.Disconnect.rawValue] as! [Any] - category.forEach { - let item = $0 as! [String: Any] - let companyName = item.first!.key - if ["Facebook", "Twitter"].contains(companyName) { - result += handleCategoryItem($0, action: action) - } - } - } - - // Google properties exist in a special list that gets appended per-category - if let cat = googleMappingJson[categoryTitle.rawValue] as? [Any] { - cat.forEach { - result += handleCategoryItem($0, action: action) - } - } - return result } diff --git a/content-blocker-lib-ios/ContentBlockerGen/Tests/ContentBlockerGenTests/ContentBlockerGenTests.swift b/content-blocker-lib-ios/ContentBlockerGen/Tests/ContentBlockerGenTests/ContentBlockerGenTests.swift index 8cec751add33..531b5e54a7b6 100644 --- a/content-blocker-lib-ios/ContentBlockerGen/Tests/ContentBlockerGenTests/ContentBlockerGenTests.swift +++ b/content-blocker-lib-ios/ContentBlockerGen/Tests/ContentBlockerGenTests/ContentBlockerGenTests.swift @@ -24,18 +24,11 @@ let entitylist = """ } """ -let googlemapping = """ -{ "categories": { - "Analytics": [{"Google": {"http://www.google.com/": ["google-analytics.com", "postrank.com"]}}] -}} -""" - final class ContentBlockerGenTests: XCTestCase { func testParsing() throws { let entityJson = try! JSONSerialization.jsonObject(with: entitylist.data(using: .utf8)!, options: []) as! [String: Any] - let googleJson = try! JSONSerialization.jsonObject(with: googlemapping.data(using: .utf8)!, options: []) as! [String: Any] - let contentBlocker = ContentBlockerGenLib(entityListJson: entityJson, googleMappingJson: googleJson) + let contentBlocker = ContentBlockerGenLib(entityListJson: entityJson) let json = try! JSONSerialization.jsonObject(with: blacklist.data(using: .utf8)!, options: []) as! [String: Any] let categories = json["categories"]! as! [String: Any]