Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated for Apple Silicon #220

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

sweetppro
Copy link

  • Updated for macOS Ventura and Xcode 14.2
  • Apple Silicon compatible
  • updated project to macOS 11+
  • fixed most warnings and deprecations
  • replaced ShortcutRecorder Framework with MASShortcut package
  • general refactoring
  • updated Preferences window layout
  • replaced most static images with SF Symbols
  • moved remaining images to Assets catalogue
  • updated icon to user submitted icon New Icon for Big Sur + #203
  • refreshed status menu icon
  • refreshed .hst icon
  • added support for restarting mDNSResponder via NSUserAppleScriptTask
  • updated .gitignore to ignore .DS_Store files
  • updated README to indicate support for macOS Big Sur and above

rstad and others added 4 commits January 23, 2019 09:52
As mentioned in Issues 2ndalpha#160 and 2ndalpha#140, the list of hosts is not
alphabetized in newer versions of macOS. This change is a feeble
attempt by me to sort the `hostsFiles` array as it's populated.

It seems to have built successfully on my machine but I'm
extremely new to the world of Obj-C development so it would not
surprise me in the least if this does something in a bad or
easily improved way.

That is, I added a way to Sort (`NSSortDescriptor`) and call it
immediately after every time we `addObject` to `hostsFiles` during
`loadFiles` in LocalHostsController.m.

Doing this after every addition seems like it might be a poor
choice from a performance perspective.  Moreover, it may be
wholly unnecessary when used in some environments where this issue
doesn't present.  I went with it anyway because I didn't know how
else to approach this, nor how to conditionally use this logic
only when I know it to be necessary.
* Updated for macOS Ventura and Xcode 14.2
* Apple Silicon compatible
* updated project to macOS 11+
* fixed most warnings and deprecations
* replaced ShortcutRecorder Framework with MASShortcut package
* general refactoring
* updated Preferences window layout
* replaced most static images with SF Symbols
* moved remaining images to Assets catalogue
* updated icon to user submitted icon 2ndalpha#203
* refreshed status menu icon
* refreshed .hst icon
* added support for restarting mDNSResponder via NSUserAppleScriptTask
* updated .gitignore to ignore .DS_Store files
* updated README to indicate support for macOS Big Sur and above
@sweetppro
Copy link
Author

Here's all the assets I used/created:
Gas Mask Icons.zip

add framework searchpath to build settings to fix Sparkle build
@2ndalpha
Copy link
Owner

2ndalpha commented Mar 7, 2023

Wow, it is a big PR.
Has anyone tested it / is using it successfully daily?

@oliveratgithub
Copy link

oliveratgithub commented Mar 12, 2023

Has anyone tested it / is using it successfully daily?

I tested it today – but my conclusion is, that its not "production ready" yet.
Some key functionalities of the Gas Mask App are not working. I think the to-dos in #202 need to be addressed, too.

I tried it first with the configured Target platform settings (11.0) and with the most recent once (13.1) – the later giving me actually better results on an Apple Silicon platform.

  • MacBook Air M2
  • macOS 13.3 (b) Beta (22E7752300g)
  • Xcode Version 14.2 (14C18)

Functionality + GUI issues

  • Good news first: this version adds support for Adding remote file fails #90 - although buggy (see below)
  • Sometimes the "Combine Hosts"-selection is missing
    • Might relate to Xcode Warnings with HostsListView.m, listed below
  • A "Combined" file does not show any (combined) content --> yet I think an existing combined hosts works technically
  • A "Remote" hosts file is not being displayed properly
    • e.g. after adding, an infinite "spinner"-icon is displayed (stuck downloading the file?)
    • upon App restart, a remote Hosts is rendered empty… and not refetching or alike
  • Also I think the release is not properly updating Version information etc. (e.g. still "0.8.6").
  • Tested the changes of 2 PRs and those both seem to work flawlessly – and could be merged IMHO:

—> below are some screenshots

Xcode issues

Build Errors

None

Build Warnings

ApplicationController.m

  • /Applications/GasMask/gasmask/Source/ApplicationController.m:136:12 'setAllowedFileTypes:' is deprecated: first deprecated in macOS 12.0 - Use -allowedContentTypes instead

HostsListView.m

  • /Applications/GasMask/gasmask/Source/HostsListView.m:43:85 'NSFilenamesPboardType' is deprecated: first deprecated in macOS 10.14 - Create multiple pasteboard items with NSPasteboardTypeFileURL or kUTTypeFileURL instead
  • /Applications/GasMask/gasmask/Source/HostsListView.m:47:35 'NSTableViewSelectionHighlightStyleSourceList' is deprecated: first deprecated in macOS 12.0 - Set the NSTableView.style property to NSTableViewStyleSourceList instead.
  • /Applications/GasMask/gasmask/Source/HostsListView.m:101:1 Implementing deprecated method

HostsMainController.m

  • /Applications/GasMask/gasmask/Source/HostsMainController.m:420:9 'FSEventStreamScheduleWithRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead.
  • /Applications/GasMask/gasmask/Source/HostsMainController.m:431:9 'FSEventStreamUnscheduleFromRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead.

LoginItem.m

  • /Applications/GasMask/gasmask/Source/LoginItem.m:56:2 'LSSharedFileListInsertItemURL' is deprecated: first deprecated in macOS 10.11 - No longer supported
  • /Applications/GasMask/gasmask/Source/LoginItem.m:57:11 'kLSSharedFileListItemLast' is deprecated: first deprecated in macOS 10.11 - No longer supported
  • /Applications/GasMask/gasmask/Source/LoginItem.m:69:3 'LSSharedFileListItemRemove' is deprecated: first deprecated in macOS 10.11 - No longer supported
  • /Applications/GasMask/gasmask/Source/LoginItem.m:75:9 'LSSharedFileListCreate' is deprecated: first deprecated in macOS 10.11 - No longer supported
  • /Applications/GasMask/gasmask/Source/LoginItem.m:75:38 'kLSSharedFileListSessionLoginItems' is deprecated: first deprecated in macOS 10.11
  • /Applications/GasMask/gasmask/Source/LoginItem.m:87:49 'LSSharedFileListCopySnapshot' is deprecated: first deprecated in macOS 10.11 - No longer supported
  • /Applications/GasMask/gasmask/Source/LoginItem.m:95:7 'LSSharedFileListItemResolve' is deprecated: first deprecated in macOS 10.10

PrivilegedActions.m

  • /Applications/GasMask/gasmask/Source/PrivilegedActions.m:121:20 'AuthorizationExecuteWithPrivileges' is deprecated: first deprecated in macOS 10.7

Util.m

  • /Applications/GasMask/gasmask/Source/Util.m:57:45 'currentAppearance' is deprecated: first deprecated in macOS 12.0 - Use -performAsCurrentDrawingAppearance: to temporarily set the drawing appearance, or +currentDrawingAppearance to access the currently drawing appearance.
  • /Applications/GasMask/gasmask/Source/Util.m:57:45 'setCurrentAppearance:' is deprecated: first deprecated in macOS 12.0 - Use -performAsCurrentDrawingAppearance: to temporarily set the drawing appearance, or +currentDrawingAppearance to access the currently drawing appearance.

Screenshots

Screenshot 2023-03-12 at 16 26 12

Screenshot 2023-03-12 at 16 00 24

App GUI

Screenshot 2023-03-12 at 16 04 59

Screenshot 2023-03-12 at 16 06 45

Screenshot 2023-03-12 at 16 11 31

Xcode

Screenshot 2023-03-12 at 16 02 40

Screenshot 2023-03-12 at 15 30 00

@2ndalpha
Copy link
Owner

Thank you @oliveratgithub for testing.
To be fair the current code in master does not work at all.

I will try to review it all.

@lockieluke
Copy link

merge this!

@tlogik
Copy link

tlogik commented Jan 23, 2024

Hi @2ndalpha
Is there something we can do to help the process of getting the Apple Silicon version out.
I see some testing is required and maybe some fixes.
Please advise as it seems you placed you self in the eye of the storm and wanted to review :-D

@2ndalpha
Copy link
Owner

@tlogik I can review and test PR-s. The changes would need to be as small as possible.
This PR is huge and if the author does not have to fix the issues then there is no real way to move forward with it.
Unfortunately I don't have time to actively develop it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants