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

Wrap --codesign-identity & --add-binary into flet pack #1776

Closed
joshvisionalgo opened this issue Aug 30, 2023 · 5 comments
Closed

Wrap --codesign-identity & --add-binary into flet pack #1776

joshvisionalgo opened this issue Aug 30, 2023 · 5 comments

Comments

@joshvisionalgo
Copy link
Contributor

Please Describe The Problem To Be Solved

In macOS if you pack a .app using "flet pack", and then codesign + notarize the app it will fail to run because the packed binaries are not signed as well. The easy workaround is to use pyinstaller which allows the argument "--codesign-identity" to complete the build with an end to end signing process.

The problem with this workaround appears to be that once the Application is opened the app icon changes to the Flet icon, and the application name changes to "Flet". Meanwhile, the app icon & name remain correct in /Applications.

(Optional): Suggest A Solution

  • Wrap --codesign-identity from pyinstaller into flet pack

Not sure how feasible or desirable this option fits into the future of the project, but it would be helpful with the current circus of code signing on MacOS.

@joshvisionalgo
Copy link
Contributor Author

Clearing any ~.flet cache does resolve the app icon issue when using pyinstaller. The App name when running appears to be the only thing I can't resolve.

@joshvisionalgo
Copy link
Contributor Author

For further testing and to confirm this solution does indeed resolve the issue I explored the source for pack.py and added in the parser argument for --codesign-identity as well as the handler. I officially have a fully signed (end to end) and working macOS app when using "flet pack".

I'm new to contributions on github so I'll review the guidelines and make a submission if it's of interest for the repo manager/owner.

@FeodorFitsner
Copy link
Contributor

You are absolutely welcome to do a PR, thank you!

@joshvisionalgo
Copy link
Contributor Author

Finally getting time to get around to the PR so I'll do that this afternoon.

I'm going to include wrapping for --add-binary as well due to further testing with dynamic linked libraries (.dylib) being packed. Unsigned you can get away with --add-data to pack the dylib in "./" however, with end to end code signing I noticed the underlying security system of macOS was unhappy about the dylib signing.

Adding in --add-binary to use for dynamic linked libraries in flet pack resolved this in code signed packages.

@joshvisionalgo joshvisionalgo changed the title Wrap --codesign-identity into flet pack Wrap --codesign-identity & --add-binary into flet pack Sep 1, 2023
@joshvisionalgo
Copy link
Contributor Author

Closing. PR #1789 accepted and merged.

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

No branches or pull requests

2 participants