angr-management
angr-management copied to clipboard
Application title not set correctly on macOS
When I launch angr management on macOS, the title is just the name of the python interpreter it is running with.
It seems this is set by macOS and not changeable by the application directly. macOS will set it based on a parameter in the .app directory, defaulting to the executable name when that metadata is missing.
This can be dynamically adjusted fixed by interfacing with mac via Cocoa.
pip install pyobjc-framework-Cocoa
from pathlib import Path
if sys.platform.startswith("darwin"):
from Foundation import NSBundle
bundle = NSBundle.mainBundle()
if bundle:
app_info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
if app_info:
app_info['CFBundleName'] = Path(sys.argv[0]).stem
Note this only changes the application title- not the name (which is shown in the dock and tab-switcher)
It has to be execute before qt stuff sets up the app though; i.e. before this line: https://github.com/angr/angr-management/blob/d1701ae13273bc46960b917b240b68b7a196436f/angrmanagement/main.py#L142