# Installing and running a modified helper

These steps are for a local test copy of Film Buddy. They invalidate the
notarized distribution signature, so the modified copy must not overwrite the
original application and will not retain Apple's notarized trust decision.

## 1. Build your modified helper

Edit the included source and run:

```bash
./build.sh
```

## 2. Copy the application

Copy `Film Buddy.app` from the DMG or `/Applications` to a writable test
location such as `~/Desktop/Film Buddy Modified.app`.

```bash
APP="$HOME/Desktop/Film Buddy Modified.app"
cp build/libraw-decoder/filmbuddy-raw-decode-libraw \
  "$APP/Contents/MacOS/filmbuddy-raw-decode-libraw"
cp build/libraw-decoder/libomp.dylib "$APP/Contents/MacOS/libomp.dylib"
```

## 3. Apply local ad-hoc signatures

```bash
codesign --force --sign - "$APP/Contents/MacOS/libomp.dylib"
codesign --force --sign - "$APP/Contents/MacOS/filmbuddy-raw-decode-libraw"
codesign --force --sign - --options runtime \
  --entitlements macos/FilmBuddy.entitlements "$APP"
codesign --verify --deep --strict --verbose=2 "$APP"
```

The included `macos/FilmBuddy.entitlements` is the entitlements file used for
the main app. It is intentionally empty because this direct-distribution build
is not App Sandbox-enabled and does not need a Hardened Runtime exception.

## 4. Execute the replacement

```bash
"$APP/Contents/MacOS/filmbuddy-raw-decode-libraw" status
```

Then run a decode against a RAW file you are authorized to use:

```bash
"$APP/Contents/MacOS/filmbuddy-raw-decode-libraw" decode \
  --input /path/to/input.raw --output /tmp/filmbuddy-modified-output.tif
```

The helper and `libomp.dylib` must stay together in `Contents/MacOS` because
the helper resolves the runtime through `@rpath/libomp.dylib`.

For a distributor-signed release, replace the ad-hoc signing steps with the
documented Developer ID signing/notarization process. Apple signing
certificates and notarization credentials are not part of Corresponding Source.
