Skip to content

Commit

Permalink
File association.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed May 16, 2015
1 parent 0dadc8b commit 7111d93
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Thumbs.db
.DS_Store
*.swp

TrueCrypt.app
Info.plist.xml
*.dmg
image-resources.xml
44 changes: 44 additions & 0 deletions Info.plist.xml.original-7.1a
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>

<key>CFBundleIdentifier</key>
<string>org.TrueCryptFoundation.TrueCrypt</string>

<key>CFBundleDevelopmentRegion</key>
<string>English</string>

<key>CFBundleExecutable</key>
<string>TrueCrypt</string>

<key>CFBundleIconFile</key>
<string>TrueCrypt.icns</string>

<key>CFBundleName</key>
<string>TrueCrypt</string>

<key>CFBundlePackageType</key>
<string>APPL</string>

<key>CFBundleSignature</key>
<string>TRUE</string>

<key>CFBundleVersion</key>
<string>0</string>

<key>CFBundleShortVersionString</key>
<string>_VERSION_</string>

<key>CFBundleLongVersionString</key>
<string>TrueCrypt _VERSION_</string>

<key>LSRequiresCarbon</key>
<true/>

<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
68 changes: 68 additions & 0 deletions Info.plist.xml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
--- Info.plist.xml.original-7.1a 2012-02-07 02:36:48.000000000 -0800
+++ Info.plist.xml 2015-05-15 22:05:26.000000000 -0700
@@ -30,15 +30,63 @@
<string>0</string>

<key>CFBundleShortVersionString</key>
- <string>_VERSION_</string>
+ <string>7.1.2</string>

<key>CFBundleLongVersionString</key>
- <string>TrueCrypt _VERSION_</string>
+ <string>TrueCrypt 7.1.2</string>

<key>LSRequiresCarbon</key>
<true/>

<key>CSResourcesFileMapped</key>
<true/>
+
+ <key>UTExportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeIdentifier</key>
+ <string>org.TrueCryptFoundation.TrueCrypt.file-container</string>
+ <key>UTTypeReferenceURL</key>
+ <string>http://truecrypt.org</string>
+ <key>UTTypeDescription</key>
+ <string>TrueCrypt File Container</string>
+ <key>UTTypeIconFile</key>
+ <string>TrueCrypt.icns</string>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ <string>public.item</string>
+ </array>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>com.apple.ostype</key>
+ <string>TRUE</string>
+ <key>public.filename-extension</key>
+ <array>
+ <string>tc</string>
+ </array>
+ <key>public.mime-type</key>
+ <string>application/x-truecrypt</string>
+ </dict>
+ </dict>
+ </array>
+
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>TrueCrypt File Container</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>org.TrueCryptFoundation.TrueCrypt.file-container</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>TrueCrypt.icns</string>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ </dict>
+ </array>
</dict>
</plist>
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,51 @@

You can either download the installer directly from [the releases](https://github.com/stefansundin/truecrypt-mac/releases/latest) or patch it yourself.

The TrueCrypt binary has not changed or recompiled.
Changes:

- The installer has been patched to be compatible with OS X 10.10.
- The file extension `.tc` is associated with TrueCrypt.

## Install patch
The TrueCrypt binary has not changed or recompiled.

The installer contains a bug that prevents installing it on Mac OS X 10.10 or higher.
## Patch it yourself

```bash
hdiutil convert 'TrueCrypt 7.1a Mac OS X.dmg' -format UDRW -o 'TrueCrypt 7.1a Mac OS X writable.dmg'
hdiutil attach 'TrueCrypt 7.1a Mac OS X writable.dmg'

# patch installer
patch '/Volumes/TrueCrypt 7.1a/TrueCrypt 7.1a.mpkg/Contents/distribution.dist' distribution.dist.patch

# add file association
patch -o Info.plist.xml Info.plist.xml.original-7.1a Info.plist.xml.patch
tar xzf '/Volumes/TrueCrypt 7.1a/TrueCrypt 7.1a.mpkg/Contents/Packages/TrueCrypt.pkg/Contents/Archive.pax.gz'
plutil -convert binary1 -o TrueCrypt.app/Contents/Info.plist Info.plist.xml
tar c ./TrueCrypt.app | gzip --best > '/Volumes/TrueCrypt 7.1a/TrueCrypt 7.1a.mpkg/Contents/Packages/TrueCrypt.pkg/Contents/Archive.pax.gz'

hdiutil detach '/Volumes/TrueCrypt 7.1a'
hdiutil convert 'TrueCrypt 7.1a Mac OS X writable.dmg' -format UDBZ -o 'TrueCrypt 7.1a Mac OS X (patched).dmg'
```

## Icon problems

If your `.tc` icons don't show up, try running these commands and then reboot:

```bash
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec sudo rm -rf {} \;
sudo rm -rf /Library/Caches/com.apple.iconservices.store
```

## Uninstall TrueCrypt

TrueCrypt installs MacFUSE, which isn't uninstalled when you remove `TrueCrypt.app`.

```bash
sudo rm -rf /Applications/TrueCrypt.app
export BOMFILE=/private/var/db/receipts/com.google.macfuse.core.bom
sudo -E /Library/Filesystems/osxfusefs.fs/Support/uninstall-macfuse-core.sh
export BOMFILE_CORE=/private/var/db/receipts/com.github.osxfuse.pkg.Core.bom
sudo -E /Library/Filesystems/osxfusefs.fs/Support/uninstall-osxfuse-core.sh
```

0 comments on commit 7111d93

Please sign in to comment.