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

build: override unnecessary permissions #970

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

setchy
Copy link
Member

@setchy setchy commented Apr 6, 2024

Currently, a bunch of unnecessary permissions end up in the macOS Info.plist file, in particular these

    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>This app needs access to Bluetooth</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>This app needs access to Bluetooth</string>
    <key>NSCameraUsageDescription</key>
    <string>This app needs access to the camera</string>
    <key>NSMainNibFile</key>
    <string>MainMenu</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>This app needs access to the microphone</string>

After some googling, there is a (not very well documented) way to override these.

Below is the before and after of this change. From my local testing, Play Sound events still happen

Before ``` CFBundleDisplayName Gitify CFBundleExecutable Gitify CFBundleIconFile icon.icns CFBundleIdentifier com.electron.gitify CFBundleInfoDictionaryVersion 6.0 CFBundleName Gitify CFBundlePackageType APPL CFBundleShortVersionString 5.2.0 CFBundleVersion 5.2.0 DTCompiler com.apple.compilers.llvm.clang.1_0 DTSDKBuild 23A334 DTSDKName macosx14.0 DTXcode 1501 DTXcodeBuild 15A507 LSApplicationCategoryType public.app-category.developer-tools LSEnvironment MallocNanoZone 0 LSMinimumSystemVersion 10.15 NSAppTransportSecurity NSAllowsArbitraryLoads NSAllowsLocalNetworking NSExceptionDomains 127.0.0.1 NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionAllowsInsecureHTTPSLoads NSTemporaryExceptionMinimumTLSVersion 1.0 NSTemporaryExceptionRequiresForwardSecrecy localhost NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionAllowsInsecureHTTPSLoads NSTemporaryExceptionMinimumTLSVersion 1.0 NSTemporaryExceptionRequiresForwardSecrecy NSBluetoothAlwaysUsageDescription This app needs access to Bluetooth NSBluetoothPeripheralUsageDescription This app needs access to Bluetooth NSCameraUsageDescription This app needs access to the camera NSHighResolutionCapable NSHumanReadableCopyright Copyright © 2024 Emmanouil Konstantinidis NSMainNibFile MainMenu NSMicrophoneUsageDescription This app needs access to the microphone NSPrincipalClass AtomApplication NSQuitAlwaysKeepsWindows NSRequiresAquaSystemAppearance NSSupportsAutomaticGraphicsSwitching ElectronAsarIntegrity Resources/app.asar algorithm SHA256 hash 2456016e24de91be53df536330a32198bfa17aefb0528cd708a08e854ee56948 ```
After ``` CFBundleDisplayName Gitify CFBundleExecutable Gitify CFBundleIconFile icon.icns CFBundleIdentifier com.electron.gitify CFBundleInfoDictionaryVersion 6.0 CFBundleName Gitify CFBundlePackageType APPL CFBundleShortVersionString 5.2.0 CFBundleVersion 5.2.0 DTCompiler com.apple.compilers.llvm.clang.1_0 DTSDKBuild 23A334 DTSDKName macosx14.0 DTXcode 1501 DTXcodeBuild 15A507 LSApplicationCategoryType public.app-category.developer-tools LSEnvironment MallocNanoZone 0 LSMinimumSystemVersion 10.15 NSAppTransportSecurity NSAllowsArbitraryLoads NSAllowsLocalNetworking NSExceptionDomains 127.0.0.1 NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionAllowsInsecureHTTPSLoads NSTemporaryExceptionMinimumTLSVersion 1.0 NSTemporaryExceptionRequiresForwardSecrecy localhost NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionAllowsInsecureHTTPSLoads NSTemporaryExceptionMinimumTLSVersion 1.0 NSTemporaryExceptionRequiresForwardSecrecy NSHighResolutionCapable NSHumanReadableCopyright Copyright © 2024 Emmanouil Konstantinidis NSMainNibFile MainMenu NSPrincipalClass AtomApplication NSQuitAlwaysKeepsWindows NSRequiresAquaSystemAppearance NSSupportsAutomaticGraphicsSwitching ElectronAsarIntegrity Resources/app.asar algorithm SHA256 hash 1c45b1214edc4ab7c477bda7406d3f55b5d22dd9c602c0726c428f6572a06401 ```

@setchy setchy added the build Build, action or package manager changes label Apr 6, 2024
@setchy setchy marked this pull request as ready for review April 6, 2024 12:48
@setchy setchy added this to the Release 5.3.0 milestone Apr 6, 2024
@afonsojramos
Copy link
Member

Nice cleanup and nice finds!

@afonsojramos afonsojramos merged commit 5064f48 into main Apr 6, 2024
12 checks passed
@afonsojramos afonsojramos deleted the build/attempt-to-disable-mac-perms branch April 6, 2024 14:17
@bmulholland
Copy link
Collaborator

Wow yeah, nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build, action or package manager changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants