Skip to content

Commit

Permalink
Shorten bug report url
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Jul 29, 2022
1 parent 6654b91 commit b8558e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
7 changes: 3 additions & 4 deletions Pareto/AppInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ enum AppInfo {

static let bugReportURL = { () -> URL in
let baseURL = "https://paretosecurity.com/report-bug?"
let logs = try? logEntries().joined(separator: "\n").addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
let versions = getVersions().addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
if let url = URL(string: baseURL + "&logs=" + logs! + "&version=" + versions!) {
if let url = URL(string: baseURL + "&version=" + versions!) {
return url
}

Expand Down Expand Up @@ -133,7 +132,7 @@ enum AppInfo {
for log in allEntries
.compactMap({ $0 as? OSLogEntryLog })
.filter({ entry in
entry.subsystem == "niteo.co.Pareto"
entry.subsystem == Bundle.main.bundleIdentifier
}) {
logs.append("\(log.subsystem): \(log.composedMessage)")
}
Expand All @@ -145,7 +144,7 @@ enum AppInfo {
}

static let getVersions = { () -> String in
"HW: \(AppInfo.hwModelName)\nmacOS: \(AppInfo.macOSVersionString)\nApp Version: \(AppInfo.appVersion)\nBuild: \(AppInfo.buildVersion)"
"HW: \(AppInfo.hwModelName) macOS: \(AppInfo.macOSVersionString) App: Pareto Auditor App Version: \(AppInfo.appVersion) Build: \(AppInfo.buildVersion)"
}

public static func getSystemUUID() -> String? {
Expand Down
2 changes: 1 addition & 1 deletion Pareto/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4870</string>
<string>4875</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
32 changes: 6 additions & 26 deletions Pareto/Views/Settings/AboutSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,21 @@ struct AboutSettingsView: View {
case Failed = "Failed to update, download manually"
}

func copy() {
var logs = [String]()
logs.append("Version: \(AppInfo.getVersions())")
logs.append("Location: \(Bundle.main.path)")
logs.append("Build: \(AppInfo.utmSource)")

NSPasteboard.general.clearContents()
NSPasteboard.general.setString(logs.joined(separator: "\n"), forType: .string)
}

var body: some View {
HStack {
Image("Logo").resizable()
.aspectRatio(contentMode: .fit).onTapGesture {
if !showBeta {
konami += 1
if konami == 3 {
showBeta = true
konami = 0
konami += 1
if konami >= 3 {
showBeta.toggle()
konami = 0
if showBeta {
let alert = NSAlert()
alert.messageText = "You are now part of a secret society seeing somewhat mysterious things."
alert.alertStyle = NSAlert.Style.informational
alert.addButton(withTitle: "Let me in")
alert.runModal()
}

} else {
konami += 1
if konami >= 3 {
showBeta = false
konami = 0
}
}
}
VStack(alignment: .leading) {
Expand Down Expand Up @@ -81,10 +64,7 @@ struct AboutSettingsView: View {
}
}
#endif
}.contextMenu(ContextMenu(menuItems: {
Button("Copy diagnostic data", action: copy)
}))

}
HStack(spacing: 0) {
Text("We’d love to ")
Link("hear from you!",
Expand Down

0 comments on commit b8558e6

Please sign in to comment.