Skip to content

How To: Protect a BeeWare Briefcase Application

BeeWare's Briefcase packages Python apps as native platform applications (.app on macOS, .msi on Windows, AppImage on Linux). PyLocket supports Briefcase output on all platforms.


Prerequisites

  • PyLocket CLI installed and authenticated
  • An app registered with PyLocket
  • Briefcase installed (pip install briefcase)

Build with Briefcase

briefcase create
briefcase build

The built application is in platform-specific directories:

Platform Output Path
macOS macOS/app/MyApp/MyApp.app
Windows windows/app/MyApp/
Linux linux/appimage/MyApp/

Package for Upload

Compress the built application into a ZIP:

# macOS
cd macOS/app/MyApp
zip -r myapp-briefcase.zip MyApp.app/

# Windows
cd windows/app
zip -r myapp-briefcase.zip MyApp/

# Linux
cd linux/appimage
zip -r myapp-briefcase.zip MyApp/

Protect

pylocket protect \
  --app <APP_ID> \
  --artifact myapp-briefcase.zip \
  --platform mac-arm64 \
  --python 3.12

Download

pylocket fetch --build <BUILD_ID> --out dist/protected/

Notes

  • Briefcase apps may include multiple Python files across packages. All are protected.
  • Native UI resources (.nib, .xib, icons) are not modified.
  • The Briefcase-generated stub executable is preserved; only the Python bytecode layer is encrypted.

See Also