Skip to content

Commit

Permalink
Alert user about abnormal app conditions (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp authored Nov 4, 2023
1 parent 9210ed9 commit ecf6b1f
Show file tree
Hide file tree
Showing 132 changed files with 12,683 additions and 499 deletions.
1 change: 1 addition & 0 deletions Core/AppURLs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public extension URL {

static let autocomplete = URL(string: "\(base)/ac/")!
static let emailProtection = URL(string: "\(base)/email")!
static let emailProtectionSignUp = URL(string: "\(base)/email/start-incontext")!
static let emailProtectionQuickLink = URL(string: AppDeepLinkSchemes.quickLink.appending("\(ddg.host!)/email"))!
static let aboutLink = URL(string: AppDeepLinkSchemes.quickLink.appending("\(ddg.host!)/about"))!

Expand Down
8 changes: 7 additions & 1 deletion Core/ContentBlocking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import BrowserServicesKit
import Combine
import Common


public final class ContentBlocking {
public static let shared = ContentBlocking()

Expand All @@ -34,6 +35,11 @@ public final class ContentBlocking {
private let exceptionsSource: DefaultContentBlockerRulesExceptionsSource
private let lastCompiledRulesStore: AppLastCompiledRulesStore

public var onCriticalError: (() -> Void)? {
didSet {
contentBlockingManager.onCriticalError = onCriticalError
}
}

private init(privacyConfigurationManager: PrivacyConfigurationManaging? = nil) {
let internalUserDecider = DefaultInternalUserDecider(store: InternalUserStore())
Expand Down Expand Up @@ -128,7 +134,7 @@ public final class ContentBlocking {
}

}

public func makeAdClickAttributionDetection(tld: TLD) -> AdClickAttributionDetection {
AdClickAttributionDetection(feature: adClickAttribution,
tld: tld,
Expand Down
64 changes: 63 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
C1F341C52A6924000032057B /* EmailAddressPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F341C42A6924000032057B /* EmailAddressPromptView.swift */; };
C1F341C72A6924100032057B /* EmailAddressPromptViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F341C62A6924100032057B /* EmailAddressPromptViewModel.swift */; };
C1F341C92A6926920032057B /* EmailAddressPromptViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F341C82A6926920032057B /* EmailAddressPromptViewController.swift */; };
CB1143DE2AF6D4B600C1CCD3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CB1143DC2AF6D4B600C1CCD3 /* InfoPlist.strings */; };
CB258D1229A4F24900DEBA24 /* ConfigurationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB258D0F29A4D0FD00DEBA24 /* ConfigurationManager.swift */; };
CB258D1329A4F24E00DEBA24 /* ConfigurationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB84C7C029A3F0280088A5B8 /* ConfigurationStore.swift */; };
CB258D1D29A52AF900DEBA24 /* EtagStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9896632322C56716007BE4FE /* EtagStorage.swift */; };
Expand All @@ -739,6 +740,7 @@
CBD4F140279EBFB300B20FD7 /* SwiftUICollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1AEFB02799AA940031AE3D /* SwiftUICollectionViewCell.swift */; };
CBDD5DDF29A6736A00832877 /* APIHeadersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDD5DDE29A6736A00832877 /* APIHeadersTests.swift */; };
CBDD5DE129A6741300832877 /* MockBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBDD5DE029A6741300832877 /* MockBundle.swift */; };
CBEFB9142AE0844700DEDE7B /* CriticalAlerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEFB9102ADFFE7900DEDE7B /* CriticalAlerts.swift */; };
D63657192A7BAE7C001AF19D /* EmailManagerRequestDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D63657182A7BAE7C001AF19D /* EmailManagerRequestDelegate.swift */; };
EA39B7E2268A1A35000C62CD /* privacy-reference-tests in Resources */ = {isa = PBXBuildFile; fileRef = EA39B7E1268A1A35000C62CD /* privacy-reference-tests */; };
EAB19EDA268963510015D3EA /* DomainMatchingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB19ED9268963510015D3EA /* DomainMatchingTests.swift */; };
Expand Down Expand Up @@ -2292,22 +2294,47 @@
C1F341C42A6924000032057B /* EmailAddressPromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailAddressPromptView.swift; sourceTree = "<group>"; };
C1F341C62A6924100032057B /* EmailAddressPromptViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailAddressPromptViewModel.swift; sourceTree = "<group>"; };
C1F341C82A6926920032057B /* EmailAddressPromptViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmailAddressPromptViewController.swift; sourceTree = "<group>"; };
CB1143DD2AF6D4B600C1CCD3 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB15F4762AF6D5100062A994 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB18F2712AF6D4E400A0F8FE /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB1AEFB02799AA940031AE3D /* SwiftUICollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUICollectionViewCell.swift; sourceTree = "<group>"; };
CB1FAE472AF6D59B003F452F /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB24F70E29A3EB15006DCC58 /* AppConfigurationURLProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppConfigurationURLProvider.swift; path = ../Core/AppConfigurationURLProvider.swift; sourceTree = "<group>"; };
CB258D0C29A4CD0500DEBA24 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
CB258D0F29A4D0FD00DEBA24 /* ConfigurationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationManager.swift; sourceTree = "<group>"; };
CB29792D2AF6D5C1006C461D /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB2A7EEE283D185100885F67 /* RulesCompilationMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RulesCompilationMonitor.swift; sourceTree = "<group>"; };
CB2A7EF028410DF700885F67 /* PixelEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PixelEvent.swift; sourceTree = "<group>"; };
CB2A7EF3285383B300885F67 /* AppLastCompiledRulesStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLastCompiledRulesStore.swift; sourceTree = "<group>"; };
CB2C47822AF6D55800AEDCD9 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB4448752AF6D51D001F93F7 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB5038622AF6D563007FD69F /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB6ABD002AF6D52B004A8224 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB6CE65B2AF6D4EE00119848 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB7407BC2AF6D56D0090A41C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB75AA132AF6D5AA00AED266 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB84C7C029A3F0280088A5B8 /* ConfigurationStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationStore.swift; sourceTree = "<group>"; };
CB8EF4A32AF6D4C200EF158D /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB8F1F7D2AF6D5370024BF0E /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CB9B8738278C8E72001F4906 /* WidgetEducationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetEducationViewController.swift; sourceTree = "<group>"; };
CB9B873B278C8FEA001F4906 /* WidgetEducationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetEducationView.swift; sourceTree = "<group>"; };
CB9B873D278C93C2001F4906 /* HomeMessage.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = HomeMessage.xcassets; sourceTree = "<group>"; };
CB9F2A4B2AF6D4FB00F924BB /* et */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = et; path = et.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBA1DE942AF6D579007C9457 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBAA195927BFE15600A4BD49 /* NSManagedObjectContextExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSManagedObjectContextExtension.swift; sourceTree = "<group>"; };
CBAA195B27C3982A00A4BD49 /* PrivacyFeatures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyFeatures.swift; sourceTree = "<group>"; };
CBB6B2542AF6D543006B777C /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = lt; path = lt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBC7AB542AF6D583008CB798 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBC8DC252AF6D4CD00BA681A /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBD4F13B279EBF4A00B20FD7 /* HomeMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeMessage.swift; sourceTree = "<group>"; };
CBD7AE812AF6D5B6009052FD /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBDD5DDE29A6736A00832877 /* APIHeadersTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APIHeadersTests.swift; sourceTree = "<group>"; };
CBDD5DE029A6741300832877 /* MockBundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockBundle.swift; sourceTree = "<group>"; };
CBE099292AF6D54D000EFC47 /* lv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = lv; path = lv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBECB27B2AF6D58D006960FA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBEF49902AF6D50600BFBD7D /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBEFB9102ADFFE7900DEDE7B /* CriticalAlerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CriticalAlerts.swift; sourceTree = "<group>"; };
CBF0FA762AF6D4D800FB1C5B /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
CBF14FC227970072001D94D0 /* HomeMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeMessageView.swift; sourceTree = "<group>"; };
CBF14FC427970AB0001D94D0 /* HomeMessageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeMessageViewModel.swift; sourceTree = "<group>"; };
CBF14FC627970C8A001D94D0 /* HomeMessageCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeMessageCollectionViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2632,6 +2659,7 @@
02025666298818B200E694E7 /* AppTrackingProtectionPacketTunnelProvider.swift */,
02025B1429884EA500E694E7 /* DDGObserverFactory.swift */,
02025668298818B200E694E7 /* Info.plist */,
CB1143DC2AF6D4B600C1CCD3 /* InfoPlist.strings */,
02025669298818B200E694E7 /* PacketTunnelProvider.entitlements */,
EEFC6A5F2AC0F2F80065027D /* UserText.swift */,
EEDFE2DC2AC6ED4F00F0E19C /* Localizable.strings */,
Expand Down Expand Up @@ -5045,6 +5073,7 @@
850ABD022AC4D46C00A733DF /* SuggestionTray.storyboard */,
85864FBB24D31EF300E756FF /* SuggestionTrayViewController.swift */,
851DFD86212C39D300D95F20 /* TabSwitcherButton.swift */,
CBEFB9102ADFFE7900DEDE7B /* CriticalAlerts.swift */,
);
name = Main;
sourceTree = "<group>";
Expand Down Expand Up @@ -5647,6 +5676,7 @@
buildActionMask = 2147483647;
files = (
0262085C2A37915D006CB755 /* ios_blocklist_075.json in Resources */,
CB1143DE2AF6D4B600C1CCD3 /* InfoPlist.strings in Resources */,
EEDFE2DA2AC6ED4F00F0E19C /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -6166,6 +6196,7 @@
4B53648A26718D0E001AA041 /* EmailWaitlist.swift in Sources */,
027F48762A4B5FBE001A1C6C /* AppTPLinkButton.swift in Sources */,
8524CC98246D66E100E59D45 /* String+Markdown.swift in Sources */,
CBEFB9142AE0844700DEDE7B /* CriticalAlerts.swift in Sources */,
020108A329A561C300644F9D /* AppTPActivityView.swift in Sources */,
02A54A9E2A097F0F000C8FED /* AppTPCollectionViewCell.swift in Sources */,
C1B7B529289420830098FD6A /* RemoteMessaging.xcdatamodeld in Sources */,
Expand Down Expand Up @@ -7482,6 +7513,37 @@
name = OmniBar.xib;
sourceTree = "<group>";
};
CB1143DC2AF6D4B600C1CCD3 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
CB1143DD2AF6D4B600C1CCD3 /* bg */,
CB8EF4A32AF6D4C200EF158D /* cs */,
CBC8DC252AF6D4CD00BA681A /* da */,
CBF0FA762AF6D4D800FB1C5B /* de */,
CB18F2712AF6D4E400A0F8FE /* el */,
CB6CE65B2AF6D4EE00119848 /* es */,
CB9F2A4B2AF6D4FB00F924BB /* et */,
CBEF49902AF6D50600BFBD7D /* fi */,
CB15F4762AF6D5100062A994 /* fr */,
CB4448752AF6D51D001F93F7 /* hr */,
CB6ABD002AF6D52B004A8224 /* hu */,
CB8F1F7D2AF6D5370024BF0E /* it */,
CBB6B2542AF6D543006B777C /* lt */,
CBE099292AF6D54D000EFC47 /* lv */,
CB2C47822AF6D55800AEDCD9 /* nb */,
CB5038622AF6D563007FD69F /* nl */,
CB7407BC2AF6D56D0090A41C /* pl */,
CBA1DE942AF6D579007C9457 /* pt */,
CBC7AB542AF6D583008CB798 /* ro */,
CBECB27B2AF6D58D006960FA /* ru */,
CB1FAE472AF6D59B003F452F /* sk */,
CB75AA132AF6D5AA00AED266 /* sl */,
CBD7AE812AF6D5B6009052FD /* sv */,
CB29792D2AF6D5C1006C461D /* tr */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
EEDFE2DC2AC6ED4F00F0E19C /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -8996,7 +9058,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 82.1.0;
version = 82.2.0;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "71e916d070cedcba9ccb3ce9431797260bf5cbea",
"version": "82.1.0"
"revision": "86e4aba326ce06585b842ab13023ce08f86ac424",
"version": "82.2.0"
}
},
{
Expand Down
Loading

0 comments on commit ecf6b1f

Please sign in to comment.