Skip to content

Commit

Permalink
Merge branch 'main' into sam/remove-tzoffset
Browse files Browse the repository at this point in the history
# By Dax the Duck (10) and others
# Via GitHub (6) and others
* main: (40 commits)
  Bump version to 1.83.0 (160)
  macOS VPN: Ask users to reboot if system extension was not uninstalled (#2603)
  macOS VPN: Ask users to reboot if system extension was not uninstalled (#2603)
  Fix popover not displayed reliably when VPN shortcut is unpinned (#2606)
  Automatically mark / close stale PRs (#2596)
  Update copy for DBP open button (#2586)
  Bump version to 1.83.0 (159)
  [Release PR] Fix lottie high Windowserver load (#2598)
  Bump version to 1.83.0 (158)
  BSK release 133.1.0 (#2597)
  Fix VPN bug: Nearest city breaks register requests (#2589)
  Fix lottie high Windowserver load (#2595)
  drop Downloads storyboard (#2556)
  Disable directory download (#2585)
  Add supported document types (#2581)
  Allow choosing downloads location in App Store builds (#2532)
  Fix Open Downloads not working (#2576)
  Update Privacy Dashboard URL on navigation commit (#2583)
  Percent-decode download filenames (#2584)
  Bump version to 1.83.0 (157)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Apr 12, 2024
2 parents 0638bdc + 0d0a85b commit 608aa5f
Show file tree
Hide file tree
Showing 139 changed files with 5,448 additions and 2,376 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/stale_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Close Stale Pull Requests

on:
schedule:
- cron: '0 0 * * *'

jobs:
close_stale_prs:
runs-on: ubuntu-latest
steps:
- name: Close stale pull requests
uses: actions/stale@v9
with:
stale-pr-message: 'This PR has been inactive for more than 7 days and will be automatically closed 7 days from now.'
days-before-stale: 7
close-pr-message: 'This PR has been closed after 14 days of inactivity. Feel free to reopen it if you plan to continue working on it or have further discussions.'
days-before-close: 7
stale-pr-label: stale
exempt-draft-pr: true
8 changes: 4 additions & 4 deletions Configuration/App/DuckDuckGo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = MacOS Browser
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = MacOS Browser Product Review

GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 DEBUG=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 REVIEW=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME)
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 DEBUG=1 CI=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 DEBUG=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION=1 REVIEW=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)

SWIFT_ACTIVE_COMPILATION_CONDITIONS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION DEBUG CI $(FEATURE_FLAGS)
Expand Down
8 changes: 4 additions & 4 deletions Configuration/AppStore.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ MAIN_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(MAIN_BUNDLE_IDENTIFIER_PREFIX).d
MAIN_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(MAIN_BUNDLE_IDENTIFIER_PREFIX).debug
MAIN_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(MAIN_BUNDLE_IDENTIFIER_PREFIX).review

GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = APPSTORE=1
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = APPSTORE=1 REVIEW=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = APPSTORE=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME)
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 CI=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = APPSTORE=1 REVIEW=1 SWIFT_OBJC_INTERFACE_HEADER_NAME=$(SWIFT_OBJC_INTERFACE_HEADER_NAME) $(inherited)

MACOSX_DEPLOYMENT_TARGET = 12.3

Expand Down
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 152
CURRENT_PROJECT_VERSION = 160
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.82.0
MARKETING_VERSION = 1.83.0
102 changes: 75 additions & 27 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"branch" : "sam/remove-tzoffset",
"revision" : "3bad81e0ba757ddc0953139b5db819520bb533f1"
"revision" : "4699a5ff3d0669736e87f6da808884f245d80ede",
"version" : "133.1.0"
}
},
{
Expand All @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/duckduckgo-autofill.git",
"state" : {
"revision" : "6493e296934bf09277c03df45f11f4619711cb24",
"version" : "10.2.0"
"revision" : "6053999d6af384a716ab0ce7205dbab5d70ed1b3",
"version" : "11.0.1"
}
},
{
Expand Down
6 changes: 6 additions & 0 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

PrivacyFeatures.httpsUpgrade.loadDataAsync()
bookmarksManager.loadBookmarks()

// Force use of .mainThread to prevent high WindowServer Usage
// Pending Fix with newer Lottie versions
// https://app.asana.com/0/1177771139624306/1207024603216659/f
LottieConfiguration.shared.renderingEngine = .mainThread

if case .normal = NSApp.runType {
FaviconManager.shared.loadFavicons()
}
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Autoconsent/autoconsent-bundle.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions DuckDuckGo/Bookmarks/Services/ContextualMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ private extension ContextualMenu {
static func addBookmarkToFavoritesMenuItem(isFavorite: Bool, bookmark: Bookmark?) -> NSMenuItem {
let title = isFavorite ? UserText.removeFromFavorites : UserText.addToFavorites
return menuItem(title, #selector(BookmarkMenuItemSelectors.toggleBookmarkAsFavorite(_:)), bookmark)
.withAccessibilityIdentifier(isFavorite == false ? "ContextualMenu.addBookmarkToFavoritesMenuItem" :
"ContextualMenu.removeBookmarkFromFavoritesMenuItem")
}

static func addBookmarksToFavoritesMenuItem(bookmarks: [Bookmark], allFavorites: Bool) -> NSMenuItem {
let title = allFavorites ? UserText.removeFromFavorites : UserText.addToFavorites
let accessibilityValue = allFavorites ? "Favorited" : "Unfavorited"
return menuItem(title, #selector(BookmarkMenuItemSelectors.toggleBookmarkAsFavorite(_:)), bookmarks)
.withAccessibilityIdentifier("ContextualMenu.addBookmarksToFavoritesMenuItem").withAccessibilityValue(accessibilityValue)
}

static func editBookmarkMenuItem(bookmark: Bookmark?) -> NSMenuItem {
Expand All @@ -180,6 +184,7 @@ private extension ContextualMenu {

static func deleteBookmarkMenuItem(bookmark: Bookmark?) -> NSMenuItem {
menuItem(UserText.bookmarksBarContextMenuDelete, #selector(BookmarkMenuItemSelectors.deleteBookmark(_:)), bookmark)
.withAccessibilityIdentifier("ContextualMenu.deleteBookmark")
}

static func moveToEndMenuItem(entity: BaseBookmarkEntity?, parent: BookmarkFolder?) -> NSMenuItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ final class BookmarkManagementSidebarViewController: NSViewController {
tabSwitcherButton.menu = NSMenu {
for content in Tab.TabContent.displayableTabTypes {
NSMenuItem(title: content.title!, representedObject: content)
.withAccessibilityIdentifier("BookmarkManagementSidebarViewController.\(content.title!)")
}
}

Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/Bookmarks/View/BookmarkOutlineCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ final class BookmarkOutlineCellView: NSTableCellView {

init(identifier: NSUserInterfaceItemIdentifier) {
super.init(frame: .zero)
self.identifier = identifier

setupUI()
}

Expand Down Expand Up @@ -82,6 +84,7 @@ final class BookmarkOutlineCellView: NSTableCellView {
faviconImageView.imageScaling = .scaleProportionallyDown
faviconImageView.wantsLayer = true
faviconImageView.layer?.cornerRadius = 2.0
faviconImageView.setAccessibilityIdentifier("BookmarkOutlineCellView.favIconImageView")

titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.isEditable = false
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Bookmarks/View/BookmarkTableCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ final class BookmarkTableCellView: NSTableCellView {
menuButton.translatesAutoresizingMaskIntoConstraints = false
menuButton.isBordered = false
menuButton.isHidden = true
menuButton.setAccessibilityIdentifier("BookmarkTableCellView.menuButton")
}

private func setupLayout() {
Expand Down Expand Up @@ -209,11 +210,14 @@ final class BookmarkTableCellView: NSTableCellView {

faviconImageView.image = bookmark.favicon(.small) ?? .bookmarkDefaultFavicon

faviconImageView.setAccessibilityIdentifier("BookmarkTableCellView.favIconImageView")
if bookmark.isFavorite {
accessoryImageView.isHidden = false
}

accessoryImageView.image = bookmark.isFavorite ? .favoriteFilledBorder : nil
accessoryImageView.setAccessibilityIdentifier("BookmarkTableCellView.accessoryImageView")
accessoryImageView.setAccessibilityValue(bookmark.isFavorite ? "Favorited" : "Unfavorited")
titleLabel.stringValue = bookmark.title
primaryTitleLabelValue = bookmark.title
tertiaryTitleLabelValue = bookmark.url
Expand Down
10 changes: 10 additions & 0 deletions DuckDuckGo/Common/Extensions/BundleExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extension Bundle {
static let buildNumber = kCFBundleVersionKey as String
static let versionNumber = "CFBundleShortVersionString"
static let displayName = "CFBundleDisplayName"
static let documentTypes = "CFBundleDocumentTypes"
static let typeExtensions = "CFBundleTypeExtensions"
static let vpnMenuAgentBundleId = "AGENT_BUNDLE_ID"
static let vpnMenuAgentProductName = "AGENT_PRODUCT_NAME"

Expand Down Expand Up @@ -115,6 +117,14 @@ extension Bundle {
return path.hasPrefix(applicationsPath)
}

var documentTypes: [[String: Any]] {
infoDictionary?[Keys.documentTypes] as? [[String: Any]] ?? []
}

var fileTypeExtensions: Set<String> {
documentTypes.reduce(into: []) { $0.formUnion($1[Keys.typeExtensions] as? [String] ?? []) }
}

}

enum BundleGroup {
Expand Down
12 changes: 12 additions & 0 deletions DuckDuckGo/Common/Extensions/FileManagerExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,16 @@ extension FileManager {
return resolvedUrl.path.hasPrefix(trashUrl.path)
}

/// Check if location pointed by the URL is writable by writing an empty data to it and removing the file if write succeeds
/// - Throws error if writing to the location fails
func checkWritability(_ url: URL) throws {
if fileExists(atPath: url.path), isWritableFile(atPath: url.path) {
return // we can write
} else {
// either we can‘t write or there‘s no file at the url – try writing throwing access error if no permission
try Data().write(to: url)
try removeItem(at: url)
}
}

}
9 changes: 0 additions & 9 deletions DuckDuckGo/Common/Extensions/NSAlertExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,6 @@ extension NSAlert {
return alert
}

static func noAccessToSelectedFolder() -> NSAlert {
let alert = NSAlert()
alert.messageText = UserText.noAccessToSelectedFolderHeader
alert.informativeText = UserText.noAccessToSelectedFolder
alert.alertStyle = .warning
alert.addButton(withTitle: UserText.cancel)
return alert
}

static func disableEmailProtection() -> NSAlert {
let alert = NSAlert()
alert.messageText = UserText.disableEmailProtectionTitle
Expand Down
5 changes: 5 additions & 0 deletions DuckDuckGo/Common/Extensions/NSMenuItemExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ extension NSMenuItem {
return self
}

func withAccessibilityValue(_ accessibilityValue: String) -> NSMenuItem {
self.setAccessibilityValue(accessibilityValue)
return self
}

@discardableResult
func withImage(_ image: NSImage?) -> NSMenuItem {
self.image = image
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/Common/Extensions/StringExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ extension String {
return result
}

func replacingInvalidFileNameCharacters(with replacement: String = "_") -> String {
replacingOccurrences(of: "[~#@*+%{}<>\\[\\]|\"\\_^\\/:\\\\]", with: replacement, options: .regularExpression)
}

init(_ staticString: StaticString) {
self = staticString.withUTF8Buffer {
String(decoding: $0, as: UTF8.self)
Expand Down
51 changes: 51 additions & 0 deletions DuckDuckGo/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,57 @@ extension URL {

}

var isFileHidden: Bool {
get throws {
try self.resourceValues(forKeys: [.isHiddenKey]).isHidden ?? false
}
}

var isDirectory: Bool {
var isDirectory: ObjCBool = false
guard isFileURL,
FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) else { return false }
return isDirectory.boolValue
}

mutating func setFileHidden(_ hidden: Bool) throws {
var resourceValues = URLResourceValues()
resourceValues.isHidden = true
try setResourceValues(resourceValues)
}

/// Check if location pointed by the URL is writable
/// - Note: if there‘s no file at the URL, it will try to create a file and then remove it
func isWritableLocation() -> Bool {
do {
try FileManager.default.checkWritability(self)
return true
} catch {
return false
}
}

#if DEBUG && APPSTORE
/// sandbox extension URL access should be stopped after SecurityScopedFileURLController is deallocated - this function validates it and breaks if the file is still writable
func ensureUrlIsNotWritable(or handler: () -> Void) {
let fm = FileManager.default
// is the URL ~/Downloads?
if self.resolvingSymlinksInPath() == fm.urls(for: .downloadsDirectory, in: .userDomainMask).first!.resolvingSymlinksInPath() {
assert(isWritableLocation())
return
}
// is parent directory writable (e.g. ~/Downloads)?
if fm.isWritableFile(atPath: self.deletingLastPathComponent().path)
// trashed files are still accessible for some reason even after stopping access
|| fm.isInTrash(self)
// other file is being saved at the same URL
|| NSURL.activeSecurityScopedUrlUsages.contains(where: { $0.url !== self as NSURL && $0.url == self as NSURL })
|| !isWritableLocation() { return }

handler()
}
#endif

// MARK: - System Settings

static var fullDiskAccess = URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles")!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension UserText {
// "network.protection.system.extension.unknown.activation.error" - Message shown to users when they try to enable NetP and there is an unexpected activation error.
static let networkProtectionUnknownActivationError = "There as an unexpected error. Please try again."
// "network.protection.system.extension.please.reboot" - Message shown to users when they try to enable NetP and they need to reboot the computer to complete the installation
static let networkProtectionPleaseReboot = "Please reboot to activate the VPN"
static let networkProtectionPleaseReboot = "VPN update available. Restart your Mac to reconnect."
}

// MARK: - VPN Waitlist
Expand Down
4 changes: 1 addition & 3 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,6 @@ struct UserText {
}
}

static let noAccessToSelectedFolderHeader = NSLocalizedString("no.access.to.selected.folder.header", value: "DuckDuckGo needs permission to access selected folder", comment: "Header of the alert dialog informing user about failed download")
static let noAccessToSelectedFolder = NSLocalizedString("no.access.to.selected.folder", value: "Grant access to the location of download.", comment: "Alert presented to user if the app doesn't have rights to access selected folder")
static let cannotOpenFileAlertHeader = NSLocalizedString("cannot.open.file.alert.header", value: "Cannot Open File", comment: "Header of the alert dialog informing user it is not possible to open the file")
static let cannotOpenFileAlertInformative = NSLocalizedString("cannot.open.file.alert.informative", value: "The App Store version of DuckDuckGo can only access local files if you drag-and-drop them into a browser window.\n\n To navigate local files using the address bar, please download DuckDuckGo directly from https://duckduckgo.com/mac.", comment: "Informative of the alert dialog informing user it is not possible to open the file")

Expand Down Expand Up @@ -1063,7 +1061,7 @@ struct UserText {
static let downloadsOpenWebsiteItem = NSLocalizedString("downloads.open-website.item", value: "Open Originating Website", comment: "Contextual menu item in downloads manager to open the downloaded file originating website")
static let downloadsRemoveFromListItem = NSLocalizedString("downloads.remove-from-list.item", value: "Remove from List", comment: "Contextual menu item in downloads manager to remove the given downloaded from the list of downloaded files")
static let downloadsStopItem = NSLocalizedString("downloads.stop.item", value: "Stop", comment: "Contextual menu item in downloads manager to stop the download")
static let downloadsRestartItem = NSLocalizedString("downloads.restart.item", value: "Stop", comment: "Contextual menu item in downloads manager to restart the download")
static let downloadsRestartItem = restartDownloadToolTip
static let downloadsClearAllItem = NSLocalizedString("downloads.clear-all.item", value: "Clear All", comment: "Contextual menu item in downloads manager to clear all downloaded items from the list")
static let downloadsNoRecentDownload = NSLocalizedString("downloads.no-recent-downloads", value: "No recent downloads", comment: "Label in the downloads manager that shows that there are no recently downloaded items")
static let downloadsOpenDownloadsFolder = NSLocalizedString("downloads.open-downloads-folder", value: "Open Downloads Folder", comment: "Button in the downloads manager that allows the user to open the downloads folder")
Expand Down
42 changes: 42 additions & 0 deletions DuckDuckGo/Common/Logging/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,45 @@ func logOrAssertionFailure(_ message: String) {
os_log("%{public}s", type: .error, message)
#endif
}

#if DEBUG

func breakByRaisingSigInt(_ description: String, file: StaticString = #file, line: Int = #line) {
let fileLine = "\(("\(file)" as NSString).lastPathComponent):\(line)"
os_log("""
------------------------------------------------------------------------------------------------------
BREAK at %s:
------------------------------------------------------------------------------------------------------
%s
Hit Continue (^⌘Y) to continue program execution
------------------------------------------------------------------------------------------------------
""", type: .debug, fileLine, description.components(separatedBy: "\n").map { " " + $0.trimmingWhitespace() }.joined(separator: "\n"))
raise(SIGINT)
}

// get symbol from stack trace for a caller of a calling method
func callingSymbol() -> String {
let stackTrace = Thread.callStackSymbols
// find `callingSymbol` itself or dispatch_once_callout
var callingSymbolIdx = stackTrace.firstIndex(where: { $0.contains("_dispatch_once_callout") })
?? stackTrace.firstIndex(where: { $0.contains("callingSymbol") })!
// procedure calling `callingSymbol`
callingSymbolIdx += 1

var symbolName: String
repeat {
// caller for the procedure
callingSymbolIdx += 1
let line = stackTrace[callingSymbolIdx].replacingOccurrences(of: Bundle.main.executableURL!.lastPathComponent, with: "DDG")
symbolName = String(line.split(separator: " ", maxSplits: 3)[3]).components(separatedBy: " + ")[0]
} while stackTrace[callingSymbolIdx - 1].contains(symbolName.dropping(suffix: "To")) // skip objc wrappers

return symbolName
}

#endif
Loading

0 comments on commit 608aa5f

Please sign in to comment.