Skip to content

Commit

Permalink
Disable crash analytics client side
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Jan 1, 2025
1 parent 5f1e21e commit 743076a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# OpenCore Legacy Patcher changelog

## 2.3.0
- Disable crash analytics
- Disabled server side for years, removing client side

## 2.2.0
- Resolved non-metal accessibility zoom on macOS Sonoma/Sequoia
- Resolved non-metal photos app on macOS Sequoia
Expand Down
2 changes: 1 addition & 1 deletion opencore_legacy_patcher/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class Constants:
def __init__(self) -> None:
# Patcher Versioning
self.patcher_version: str = "2.2.0" # OpenCore-Legacy-Patcher
self.patcher_version: str = "2.3.0" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.9.1" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2024 Dortania"
self.patcher_name: str = "OpenCore Legacy Patcher"
Expand Down
19 changes: 2 additions & 17 deletions opencore_legacy_patcher/support/logging_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,14 @@ def custom_excepthook(type, value, tb) -> None:
return

if self.constants.cli_mode is True:
threading.Thread(target=analytics_handler.Analytics(self.constants).send_crash_report, args=(self.log_filepath,)).start()
return

error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n"
error_msg += f"{type.__name__}: {value}"
if tb:
error_msg += f"\n\n{traceback.extract_tb(tb)[-1]}"

cant_log: bool = global_settings.GlobalEnviromentSettings().read_property("DisableCrashAndAnalyticsReporting")
if not isinstance(cant_log, bool):
cant_log = False

if self.constants.commit_info[0].startswith("refs/tags"):
cant_log = True

if cant_log is True:
error_msg += "\n\nReveal log file?"
else:
error_msg += "\n\nSend crash report to Dortania?"
error_msg += "\n\nReveal log file?"

# Ask user if they want to send crash report
try:
Expand All @@ -230,11 +219,7 @@ def custom_excepthook(type, value, tb) -> None:
if result[applescript.AEType(b'bhit')] != "Yes":
return

if cant_log is True:
subprocess.run(["/usr/bin/open", "--reveal", self.log_filepath])
return

threading.Thread(target=analytics_handler.Analytics(self.constants).send_crash_report, args=(self.log_filepath,)).start()
subprocess.run(["/usr/bin/open", "--reveal", self.log_filepath])


def custom_thread_excepthook(args) -> None:
Expand Down

0 comments on commit 743076a

Please sign in to comment.