Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alex/url-macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx committed Mar 7, 2024
2 parents e19a062 + 456e694 commit 60a32b9
Show file tree
Hide file tree
Showing 53 changed files with 1,046 additions and 283 deletions.
6 changes: 6 additions & 0 deletions Configuration/AppStore.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ NETP_APP_GROUP[config=Review][sdk=macos*] = $(NETP_BASE_APP_GROUP).review
NETP_APP_GROUP[config=Debug][sdk=macos*] = $(NETP_BASE_APP_GROUP).debug
NETP_APP_GROUP[config=Release][sdk=macos*] = $(NETP_BASE_APP_GROUP)

SUBSCRIPTION_BASE_APP_GROUP = $(DEVELOPMENT_TEAM).com.duckduckgo.macos.browser.subscription
SUBSCRIPTION_APP_GROUP[config=CI][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).debug
SUBSCRIPTION_APP_GROUP[config=Review][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).review
SUBSCRIPTION_APP_GROUP[config=Debug][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).debug
SUBSCRIPTION_APP_GROUP[config=Release][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP)

AGENT_BUNDLE_ID_BASE[sdk=*] = com.duckduckgo.mobile.ios.vpn.agent
AGENT_BUNDLE_ID[sdk=*] = $(AGENT_BUNDLE_ID_BASE)
AGENT_BUNDLE_ID[config=Debug][sdk=*] = $(AGENT_BUNDLE_ID_BASE).debug
Expand Down
6 changes: 6 additions & 0 deletions Configuration/DeveloperID.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ NETP_APP_GROUP[config=Review][sdk=*] = $(NETP_BASE_APP_GROUP).review
NETP_APP_GROUP[config=Debug][sdk=*] = $(NETP_BASE_APP_GROUP).debug
NETP_APP_GROUP[config=Release][sdk=*] = $(NETP_BASE_APP_GROUP)

SUBSCRIPTION_BASE_APP_GROUP = $(DEVELOPMENT_TEAM).com.duckduckgo.macos.browser.subscription
SUBSCRIPTION_APP_GROUP[config=CI][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).debug
SUBSCRIPTION_APP_GROUP[config=Review][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).review
SUBSCRIPTION_APP_GROUP[config=Debug][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP).debug
SUBSCRIPTION_APP_GROUP[config=Release][sdk=*] = $(SUBSCRIPTION_BASE_APP_GROUP)

SYSEX_MACH_SERVICE_NAME[sdk=*] = $(NETP_APP_GROUP).ipc
SYSEX_MACH_SERVICE_NAME[config=CI][sdk=*] = $(NETP_APP_GROUP).ipc
SYSEX_MACH_SERVICE_NAME[config=Review][sdk=*] = $(NETP_APP_GROUP).ipc
Expand Down
56 changes: 42 additions & 14 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,12 @@
EAC80DE0271F6C0100BBF02D /* fb-sdk.js in Resources */ = {isa = PBXBuildFile; fileRef = EAC80DDF271F6C0100BBF02D /* fb-sdk.js */; };
EAE42800275D47FA00DAC26B /* ClickToLoadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE427FF275D47FA00DAC26B /* ClickToLoadModel.swift */; };
EAFAD6CA2728BD1200F9DF00 /* clickToLoad.js in Resources */ = {isa = PBXBuildFile; fileRef = EAFAD6C92728BD1200F9DF00 /* clickToLoad.js */; };
EE0629722B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */; };
EE0629732B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */; };
EE0629742B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */; };
EE0629752B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */; };
EE0629762B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */; };
EE2F9C5B2B90F2FF00D45FC9 /* Subscription in Frameworks */ = {isa = PBXBuildFile; productRef = EE2F9C5A2B90F2FF00D45FC9 /* Subscription */; };
EE339228291BDEFD009F62C1 /* JSAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE339227291BDEFD009F62C1 /* JSAlertController.swift */; };
EE66666F2B56EDE4001D898D /* VPNLocationsHostingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE66666E2B56EDE4001D898D /* VPNLocationsHostingViewController.swift */; };
EE6666702B56EDE4001D898D /* VPNLocationsHostingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE66666E2B56EDE4001D898D /* VPNLocationsHostingViewController.swift */; };
Expand Down Expand Up @@ -4469,6 +4475,7 @@
EAC80DDF271F6C0100BBF02D /* fb-sdk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "fb-sdk.js"; sourceTree = "<group>"; };
EAE427FF275D47FA00DAC26B /* ClickToLoadModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClickToLoadModel.swift; sourceTree = "<group>"; };
EAFAD6C92728BD1200F9DF00 /* clickToLoad.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = clickToLoad.js; sourceTree = "<group>"; };
EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountManagerExtension.swift; sourceTree = "<group>"; };
EE339227291BDEFD009F62C1 /* JSAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSAlertController.swift; sourceTree = "<group>"; };
EE66666E2B56EDE4001D898D /* VPNLocationsHostingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLocationsHostingViewController.swift; sourceTree = "<group>"; };
EEA3EEB02B24EBD000E8333A /* NetworkProtectionVPNCountryLabelsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionVPNCountryLabelsModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4590,6 +4597,7 @@
7BFCB74E2ADE7E1A00DA3EA7 /* PixelKit in Frameworks */,
B64E42A12B9086A1006C1346 /* Macros in Frameworks */,
EE7295ED2A545C0A008C0991 /* NetworkProtection in Frameworks */,
EE2F9C5B2B90F2FF00D45FC9 /* Subscription in Frameworks */,
7BEC182F2AD5D8DC00D30536 /* SystemExtensionManager in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -4958,6 +4966,7 @@
1EA7B8D62B7E124E000330A4 /* Subscription */ = {
isa = PBXGroup;
children = (
EE0629712B90EE8C00D868B4 /* AccountManagerExtension.swift */,
1EA7B8D72B7E1283000330A4 /* SubscriptionFeatureAvailability.swift */,
);
path = Subscription;
Expand Down Expand Up @@ -6775,6 +6784,7 @@
565E46DE2B2725DD0013AC2A /* SyncE2EUITests */,
AA585D7F248FD31100E9A3E2 /* Products */,
85AE2FF024A33A2D002D507F /* Frameworks */,
EE0629702B90EE3500D868B4 /* Recovered References */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -6807,12 +6817,13 @@
AA585D80248FD31100E9A3E2 /* DuckDuckGo */ = {
isa = PBXGroup;
children = (
B658BAB52B0F845D00D1F2C7 /* Localizable.xcstrings */,
AA4D700525545EDE00C3411E /* Application */,
AA585D85248FD31400E9A3E2 /* Assets.xcassets */,
B31055BB27A1BA0E001AC618 /* Autoconsent */,
7B1E819A27C8874900FF0E60 /* Autofill */,
AAC5E4C025D6A6A9007F5990 /* Bookmarks */,
4BFD356E283ADE8B00CE9234 /* BookmarksBar */,
4B677454255DC18000025BD8 /* Bridging.h */,
AA86491324D831B9001BABEE /* Common */,
85D33F1025C82E93002B91A6 /* Configuration */,
4B6160D125B14E5E007DE5B2 /* ContentBlocker */,
Expand All @@ -6821,6 +6832,11 @@
4B723DEA26B0002B00E14D75 /* DataImport */,
3192EC862A4DCF0E001E97A5 /* DBP */,
4B379C1C27BDB7EA008A968E /* DeviceAuthentication */,
AA585D8B248FD31400E9A3E2 /* DuckDuckGo.entitlements */,
37D9BBA329376EE8000B99F9 /* DuckDuckGoAppStore.entitlements */,
377E54382937B7C400780A0A /* DuckDuckGoAppStoreCI.entitlements */,
AAD86E502678D104005C11BE /* DuckDuckGoCI.entitlements */,
4B5F15032A1570F10060320F /* DuckDuckGoDebug.entitlements */,
4B65143C26392483005B46EB /* Email */,
B68412192B6A16030092F66A /* ErrorPage */,
AA5FA695275F823900DCE9C9 /* Favicons */,
Expand All @@ -6833,13 +6849,18 @@
B65536902684409300085A79 /* Geolocation */,
AAE75275263B036300B973F8 /* History */,
AAE71DB225F66A0900D74437 /* HomePage */,
56CEE9092B7A66C500CF10AA /* Info.plist */,
56CEE90D2B7A6DE100CF10AA /* InfoPlist.xcstrings */,
EEAEA3F4294D05CF00D04DF3 /* JSAlert */,
B658BAB52B0F845D00D1F2C7 /* Localizable.xcstrings */,
9D03F5A22AA74829001A50E8 /* LoginItems */,
AA585DB02490E6FA00E9A3E2 /* MainWindow */,
AA97BF4425135CB60014931A /* Menus */,
85378D9A274E618C007C5CBF /* MessageViews */,
AA86491524D83384001BABEE /* NavigationBar */,
4B4D60542A0B29FA00BCD287 /* NetworkProtection */,
4B2D06642A132F3A00DE1F49 /* NetworkProtectionAppExtension.entitlements */,
4B5F14C42A145D6A0060320F /* NetworkProtectionVPNController.entitlements */,
85B7184727677A7D00B4277F /* Onboarding */,
1D074B252909A371006E4AC3 /* PasswordManager */,
B64C84DB2692D6E80048FEBE /* Permissions */,
Expand All @@ -6864,17 +6885,6 @@
4B9DB0062A983B23000927DB /* Waitlist */,
AA6EF9AE25066F99004754E6 /* Windows */,
31F28C4B28C8EE9000119F70 /* YoutubePlayer */,
AA585D85248FD31400E9A3E2 /* Assets.xcassets */,
4B677454255DC18000025BD8 /* Bridging.h */,
AAD86E502678D104005C11BE /* DuckDuckGoCI.entitlements */,
AA585D8B248FD31400E9A3E2 /* DuckDuckGo.entitlements */,
4B5F15032A1570F10060320F /* DuckDuckGoDebug.entitlements */,
37D9BBA329376EE8000B99F9 /* DuckDuckGoAppStore.entitlements */,
377E54382937B7C400780A0A /* DuckDuckGoAppStoreCI.entitlements */,
4B2D06642A132F3A00DE1F49 /* NetworkProtectionAppExtension.entitlements */,
4B5F14C42A145D6A0060320F /* NetworkProtectionVPNController.entitlements */,
56CEE9092B7A66C500CF10AA /* Info.plist */,
56CEE90D2B7A6DE100CF10AA /* InfoPlist.xcstrings */,
);
path = DuckDuckGo;
sourceTree = "<group>";
Expand Down Expand Up @@ -8306,6 +8316,13 @@
path = fonts;
sourceTree = "<group>";
};
EE0629702B90EE3500D868B4 /* Recovered References */ = {
isa = PBXGroup;
children = (
);
name = "Recovered References";
sourceTree = "<group>";
};
EEA3EEAF2B24EB5100E8333A /* VPNLocation */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -8556,6 +8573,7 @@
4B41EDAA2B1544B2001EEDF4 /* LoginItems */,
7B00997C2B6508B700FE7C31 /* NetworkProtectionProxy */,
B64E42A02B9086A1006C1346 /* Macros */,
EE2F9C5A2B90F2FF00D45FC9 /* Subscription */,
);
productName = DuckDuckGoAgent;
productReference = 4B2D06392A11CFBB00DE1F49 /* DuckDuckGo VPN.app */;
Expand Down Expand Up @@ -10145,6 +10163,7 @@
B684121D2B6A1D880092F66A /* ErrorPageHTMLTemplate.swift in Sources */,
3706FBD2293F65D500E42796 /* RunningApplicationCheck.swift in Sources */,
3706FBD3293F65D500E42796 /* StatePersistenceService.swift in Sources */,
EE0629732B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */,
3706FBD4293F65D500E42796 /* WindowManager+StateRestoration.swift in Sources */,
7B430EA22A71411A00BAC4A1 /* NetworkProtectionSimulateFailureMenu.swift in Sources */,
3706FBD5293F65D500E42796 /* TabCollection+NSSecureCoding.swift in Sources */,
Expand Down Expand Up @@ -10782,6 +10801,7 @@
7B8DB31A2B504D7500EC16DA /* VPNAppEventsHandler.swift in Sources */,
7BA7CC532AD11FCE0042E5CE /* Bundle+VPN.swift in Sources */,
7BFE95562A9DF29B0081ABE9 /* UserDefaults+NetworkProtectionWaitlist.swift in Sources */,
EE0629742B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */,
7BA7CC5D2AD120C30042E5CE /* EventMapping+NetworkProtectionError.swift in Sources */,
7BA7CC4A2AD11EA00042E5CE /* NetworkProtectionTunnelController.swift in Sources */,
7BD1688E2AD4A4C400D24876 /* NetworkExtensionController.swift in Sources */,
Expand Down Expand Up @@ -10815,6 +10835,7 @@
4B0EF7292B5780EB009D6481 /* VPNAppEventsHandler.swift in Sources */,
7BA7CC412AD11E420042E5CE /* NetworkProtectionBouncer.swift in Sources */,
4BF0E5082AD2551A00FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */,
EE0629752B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */,
7BA7CC582AD1203A0042E5CE /* UserText+NetworkProtection.swift in Sources */,
7BA7CC4B2AD11EC60042E5CE /* NetworkProtectionControllerErrorStore.swift in Sources */,
4BF0E5152AD25A2600FFEC9E /* DuckDuckGoUserAgent.swift in Sources */,
Expand Down Expand Up @@ -11282,6 +11303,7 @@
4B957AB92AC7AE700062CA31 /* SerpHeadersNavigationResponder.swift in Sources */,
4B957ABA2AC7AE700062CA31 /* HomePageContinueSetUpModel.swift in Sources */,
4B957ABB2AC7AE700062CA31 /* WebKitDownloadTask.swift in Sources */,
EE0629762B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */,
4B957ABC2AC7AE700062CA31 /* ChromiumLoginReader.swift in Sources */,
B6BCC5522AFE4F7D002C5499 /* DataImportTypePicker.swift in Sources */,
4B957ABD2AC7AE700062CA31 /* NSAlert+PasswordManager.swift in Sources */,
Expand Down Expand Up @@ -12064,6 +12086,7 @@
7BE146072A6A83C700C313B8 /* NetworkProtectionDebugMenu.swift in Sources */,
B6085D092743AAB600A9C456 /* FireproofDomains.xcdatamodeld in Sources */,
85589E8227BBB8630038AD11 /* HomePageView.swift in Sources */,
EE0629722B90EE8C00D868B4 /* AccountManagerExtension.swift in Sources */,
B6BF5D932947199A006742B1 /* SerpHeadersNavigationResponder.swift in Sources */,
569277C129DDCBB500B633EF /* HomePageContinueSetUpModel.swift in Sources */,
B68D21CF2ACBC9FC002DA3C2 /* ContentBlockerRulesManagerMock.swift in Sources */,
Expand Down Expand Up @@ -13669,8 +13692,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = revision;
revision = fb21f8ab492717e3ed68694a66fb15290de2f0eb;
kind = exactVersion;
version = 117.0.0;
};
};
AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down Expand Up @@ -14419,6 +14442,11 @@
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Configuration;
};
EE2F9C5A2B90F2FF00D45FC9 /* Subscription */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Subscription;
};
EE7295E22A545B9A008C0991 /* NetworkProtection */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/apple-toolbox.git",
"state" : {
"revision" : "2c598d005facc8799178853c6b5d63c231b897d1"
"revision" : "d51beaf1736013b530576ace13a16d6d1a63742c",
"version" : "2.0.0"
}
},
{
Expand All @@ -22,7 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "fb21f8ab492717e3ed68694a66fb15290de2f0eb"
"revision" : "dbe75fa0ee9e3b740d520d5be7967e2c5239dfb5",
"version" : "117.0.0"
}
},
{
Expand Down
15 changes: 14 additions & 1 deletion DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,20 @@ final class AppDelegate: NSObject, NSApplicationDelegate, FileDownloadManagerDel
#else
SubscriptionPurchaseEnvironment.current = .appStore
#endif
await AccountManager().checkSubscriptionState()
let accountManager = AccountManager()
do {
try accountManager.migrateAccessTokenToNewStore()
} catch {
if let error = error as? AccountManager.MigrationError {
switch error {
case AccountManager.MigrationError.migrationFailed:
os_log(.default, log: .subscription, "Access token migration failed")
case AccountManager.MigrationError.noMigrationNeeded:
os_log(.default, log: .subscription, "No access token migration needed")
}
}
}
await accountManager.checkSubscriptionState()
}
#endif
}
Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/Common/Extensions/BundleExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ extension Bundle {
appGroupName = "DBP_APP_GROUP"
case .netP:
appGroupName = "NETP_APP_GROUP"
case .subs:
appGroupName = "SUBSCRIPTION_APP_GROUP"
}

guard let appGroup = object(forInfoDictionaryKey: appGroupName) as? String else {
Expand All @@ -128,4 +130,5 @@ extension Bundle {
enum BundleGroup {
case netP
case dbp
case subs
}
Loading

0 comments on commit 60a32b9

Please sign in to comment.