link

Logo for g-c.dev

Contradiction - Spot The Liar on Mac M2/arm64

Prologue: My wife and I are true crime nerds.

Recently, I started playing this game available on Steam. It's really cool how it's built, basically an investigative game with live-action video. Well done, I would say.

contradiction screenshot from Steam a picture of contradiction spot the liar from a screenshot on Steam

#The Challenge #1

This game is old and no longer supported. It's based on Steam and was built before arm64 processors were common.

Steam can be installed on my Mac M2, but when I bought the game and started playing, I noticed it was extremely unstable, with continuous crashes.

I was pissed, not for the money per se (by the way, it's very cheap compared to the enjoyment you get), but because it was impossible to continue playing without saving after every move.

#The Problem

The game is based on an extremely old version of the nwjs framework, which requires Rosetta on Mac and is still extremely unstable, with continuous crashes, even with Rosetta.

#The Solution

Here's a tidy and clear step-by-step guide to fix Contradiction crashes on Apple M2 processors, along with an automated shell script.

#Guide: Fix Contradiction Crashes on Apple M2 Macs

This guide will replace the game's original NW.js framework with a newer, Apple Silicon compatible version to resolve crashing issues.

Before you start:

#Step-by-Step Manual Guide

  1. Locate Contradiction.app:
    • Open a Finder window.
    • Navigate to the Steam common applications folder: ~/Library/Application Support/Steam/steamapps/common/Contradiction
    • Right-click on Contradiction.app and select "Show Package Contents".
  2. Copy Contradiction's Resources:
    • Inside Contradiction.app, open the folder named "Contents".
    • Right-click on the "Resources" folder and select "Copy".
  3. Unzip NW.js:
    • Go to your Downloads folder.
    • Unzip the nwjs-v0.67.0-osx-arm64.zip file you downloaded. This will create a folder named nwjs-v0.67.0-osx-arm64 containing nwjs.app.
  4. Prepare the New NW.js App:
    • Open the nwjs-v0.67.0-osx-arm64 folder.
    • Right-click on nwjs.app and select "Show Package Contents".
    • Open the "Contents" folder within nwjs.app.
  5. Replace Resources Folder:
    • In the "Contents" folder of nwjs.app, highlight the "Resources" folder.
    • Press CMD + DELETE to delete this folder.
    • Now, press CMD + V to paste the "Resources" folder you copied from Contradiction.app.
  6. Fix Apple's App Quarantine:
    • Open the "Terminal" application (you can find it in Applications/Utilities).
    • Type the following command and press Enter:
      cd ~/Downloads/nwjs-v0.67.0-osx-arm64
    • Then, type this command and press Enter (you might be asked for your administrator password):
      sudo xattr -r -d com.apple.quarantine nwjs.app
  7. Finalize the Game App:
    • Rename nwjs.app (located in ~/Downloads/nwjs-v0.67.0-osx-arm64) to Contradiction.app.
    • Move this newly renamed Contradiction.app from your Downloads folder to your Applications folder. You can optionally replace the original Contradiction.app in the Steam common folder if you prefer, but moving it to Applications is typically sufficient for launching.

You are now done! You should be able to launch and play Contradiction without crashing on your Apple M2 Mac.


#Automated Shell Script

Here the shell script which does all the above for you. (Thanks to Gemini)

#!/bin/zsh

# --- Configuration ---
GAME_NAME="Contradiction"
STEAM_COMMON_PATH="$HOME/Library/Application Support/Steam/steamapps/common"
CONTRADICTION_APP_PATH="${STEAM_COMMON_PATH}/${GAME_NAME}/${GAME_NAME}.app"
NWJS_DOWNLOAD_URL="https://github.com/corwin-of-amber/nw.js/releases/download/nw-v0.67.0/nwjs-v0.67.0-osx-arm64.zip"
DOWNLOAD_DIR="${HOME}/Downloads"
NWJS_ZIP_FILENAME="nwjs-v0.67.0-osx-arm64.zip"
NWJS_EXTRACTED_FOLDER="nwjs-v0.67.0-osx-arm64"
NWJS_APP_PATH="${DOWNLOAD_DIR}/${NWJS_EXTRACTED_FOLDER}/nwjs.app"
FINAL_APP_NAME="${GAME_NAME}.app"
APPLICATIONS_DIR="/Applications"

echo "Starting the Contradiction (Apple M2) fix script..."

# 1. Download NW.js binary
echo "1. Downloading NW.js binary..."
curl -L "${NWJS_DOWNLOAD_URL}" -o "${DOWNLOAD_DIR}/${NWJS_ZIP_FILENAME}"
if [ $? -ne 0 ]; then
    echo "Error: Failed to download NW.js. Exiting."
    exit 1
fi
echo "Download complete."

# 2. Unzip NW.js
echo "2. Unzipping NW.js..."
unzip -o "${DOWNLOAD_DIR}/${NWJS_ZIP_FILENAME}" -d "${DOWNLOAD_DIR}"
if [ $? -ne 0 ]; then
    echo "Error: Failed to unzip NW.js. Exiting."
    exit 1
fi
echo "Unzip complete."

# 3. Check if Contradiction.app exists
if [ ! -d "${CONTRADICTION_APP_PATH}" ]; then
    echo "Error: Contradiction.app not found at ${CONTRADICTION_APP_PATH}. Please ensure the game is installed via Steam and the path is correct."
    exit 1
fi

# 4. Copy Resources from Contradiction.app
echo "3. Copying Resources from Contradiction.app..."
cp -R "${CONTRADICTION_APP_PATH}/Contents/Resources" "${DOWNLOAD_DIR}/Contradiction_Resources_Backup"
if [ $? -ne 0 ]; then
    echo "Error: Failed to copy Resources folder. Exiting."
    exit 1
fi
echo "Resources copied."

# 5. Delete existing Resources in nwjs.app and paste Contradiction's Resources
echo "4. Replacing Resources in nwjs.app..."
if [ -d "${NWJS_APP_PATH}/Contents/Resources" ]; then
    rm -rf "${NWJS_APP_PATH}/Contents/Resources"
    if [ $? -ne 0 ]; then
        echo "Error: Failed to delete existing Resources folder in nwjs.app. Exiting."
        exit 1
    fi
fi
mv "${DOWNLOAD_DIR}/Contradiction_Resources_Backup" "${NWJS_APP_PATH}/Contents/Resources"
if [ $? -ne 0 ]; then
    echo "Error: Failed to move Contradiction's Resources into nwjs.app. Exiting."
    exit 1
fi
echo "Resources replaced."

# 6. Fix Apple's App Quarantine
echo "5. Fixing Apple's App Quarantine for nwjs.app..."
sudo xattr -r -d com.apple.quarantine "${NWJS_APP_PATH}"
if [ $? -ne 0 ]; then
    echo "Warning: Failed to remove quarantine attribute. This might require manual intervention or running the script with elevated permissions."
fi
echo "Quarantine attribute removed (if applicable)."

# 7. Rename nwjs.app to Contradiction.app
echo "6. Renaming nwjs.app to ${FINAL_APP_NAME}..."
mv "${NWJS_APP_PATH}" "${DOWNLOAD_DIR}/${FINAL_APP_NAME}"
if [ $? -ne 0 ]; then
    echo "Error: Failed to rename nwjs.app. Exiting."
    exit 1
fi
echo "App renamed."

# 8. Move the new Contradiction.app to Applications folder
echo "7. Moving the new ${FINAL_APP_NAME} to ${APPLICATIONS_DIR}..."
mv "${DOWNLOAD_DIR}/${FINAL_APP_NAME}" "${APPLICATIONS_DIR}/"
if [ $? -ne 0 ]; then
    echo "Error: Failed to move the app to Applications folder. You may need to do this manually."
    exit 1
fi
echo "App moved to Applications folder."

echo "Fix process complete for Contradiction!"
echo "You can now launch ${FINAL_APP_NAME} from your Applications folder."

#The Challenge #2

Now the game is stable, but the action videos are completely muted. You can enable subtitles, yes, but you lose a lot of the fun because the actors are really good and quirky in some way.

#The Problem

The nwjs framework binaries we just replaced are redistributable without a license issued. In some countries, quite a few codecs can't be distributed in standard binaries due to licensing constraints.

My guess was that the audio in those videos was indeed encoded with a – now unsupported – codec.

#The Solution

Let's find the video(s) and re-encode the audio with a freely distributable codec.

For this part, you need to install brew (https://brew.sh/).

Interestingly, all the video content is in the form of a single movie file, which the game plays from/to specific points depending on the in-game situation.

#Re-encode the video file

  1. Install Homebrew and FFmpeg:
    • Open Terminal (Applications/Utilities).
    • Install Homebrew by running the command found on https://brew.sh/.
    • Once Homebrew is installed, install FFmpeg by typing:
      brew install ffmpeg
  2. Locate the video file:
    • Open Terminal.
    • Navigate to the game's video resources directory:
      cd "$HOME/Library/Application Support/Steam/steamapps/common/Contradiction/Contradiction.app/Contents/Resources/app.nw/gfx/"
  3. Rename the original movie file:
    • In the Terminal, rename the original file:
      mv MCMV.mp4 MCMV-original.mp4
  4. Convert the audio of the original file:
    • Use FFmpeg to re-encode the audio with the libopus codec:
      ffmpeg -i MCMV-original.mp4 -c:v copy -c:a libopus -b:a 128k MCMV.mp4
  5. Delete the now obsolete original copy:
    • Once the new MCMV.mp4 file is created and verified, you can delete the original:
      rm MCMV-original.mp4

I hope this guide was useful and let me know if

"have you seen this before?"