Git Product home page Git Product logo

motleyfox's Introduction

motleyfox

Create discrete Firefox applications to allow clean and complete online identity separation.

This project is in no way associated with Firefox. Mozilla owns the trademark for "Firefox":

Goals

What it Does

Run without arguments:

./motleyfox

the script defaults to the equivalent of:

./motleyfox Home:navy Work:gray

For each NAME or (NAME:COLOR) it is invoked with, it:

  1. Creates dedicated profiles, if it does not already exist
  2. Creates copies of the Firefox Application
    • Separate applications allow Command+Tab switching
  3. Updates the application
    1. Creates a launch script that loads the dedicated profile by default
    2. Updates their icons
      • Different Icons reduces confusion (I also recommend installing distinct Themes add-ons)

Compatibility

The cloned Firefox application bundles contain a modified Info.plist. The following keys are modifed:

  • CFBundleExecutable
  • CFBundleGetInfoString
  • CFBundleIdentifier
  • CFBundleName

Some plugins are known to rely on these values to function:

License

motleyfox's People

Contributors

timidrobot avatar

Watchers

 avatar  avatar

motleyfox's Issues

Fails on M1 systems (Killed: 9)

Description

This tool (hack) does not work on systems with M1 processors.

Attempting to launch the application results in...nothing.

Attempting to call the launch script directly results in a Killed: 9 error. Example (custom wrapped for legibility):

/Applications/Firefox-CustomRed.app/Contents/MacOS/firefox-customred: line 5: 63742 Killed: 9
    /Applications/Firefox-CustomRed.app/Contents/MacOS/firefox \
        -no-remote \
        --profile '/Users/username/Library/Application Support/Firefox/Profiles/firefox-customred'

Troubleshooting

UPX compressed binary contains an invalid Mach-O header

Many search results for "killed: 9" point to UPX being the issue:

However, the source application's (Firefox.app) firefox binary works without issue so we know this is not the cause.

Codesigning Required

The following gives a hint (Big Sur on ARM M1 processor requires all code to be validly signed):

Valid Signature Example

For Firefox 107.0.1

Command:

codesign -dvvvv /Applications/Firefox.app

Output:

Executable=/Applications/Firefox.app/Contents/MacOS/firefox
Identifier=org.mozilla.firefox
Format=app bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20500 size=863 flags=0x10000(runtime) hashes=18+5 location=embedded
VersionPlatform=1
VersionMin=720896
VersionSDK=721664
Hash type=sha256 size=32
CandidateCDHash sha256=9ab66d2a015d58dbbb0f73aec37e6bd5f1e9d338
CandidateCDHashFull sha256=9ab66d2a015d58dbbb0f73aec37e6bd5f1e9d338ed2c393ddae01bd4716fedbd
Hash choices=sha256
CMSDigest=9ab66d2a015d58dbbb0f73aec37e6bd5f1e9d338ed2c393ddae01bd4716fedbd
CMSDigestType=2
Page size=4096
Launch Constraints:
	None
CDHash=9ab66d2a015d58dbbb0f73aec37e6bd5f1e9d338
Signature size=8988
Authority=Developer ID Application: Mozilla Corporation (43AQ936H96)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Nov 28, 2022 at 08:31:23
Info.plist entries=25
TeamIdentifier=43AQ936H96
Runtime Version=11.3.0
Sealed Resources version=2 rules=13 files=80
Internal requirements count=1 size=188

Potential Solutions / Workarounds

Pseudo-Signing

Code Signing · Cydia:

Option #2: Pseudo-Signing

For me, the previous option just doesn't work. I do not use Macs to do my development and the entire codesign path requires not only a Mac but console access because codesign is, at some level, a graphical utility (the way it uses Keychain to get the signatures may prompt, with dialogs, for passwords). To get around this, I wrote a tool called ldid that, among other things, can generate the SHA1 hashes that are checked by Apple's iPhoneOS kernel. This tool is easily installed on the iPhone using Cydia or APT.

The tool can also be easily installed on macOS via brew install ldid.

  1. brew install ldid
  2. Run motleyfox.sh with desired options. Example:
    ./motleyfox.sh CustomRed:red CustomBlue:blue
  3. Update signature on firefox binary in generated application bundles. Example:
    ldid -S /Applications/Firefox-CustomRed.app/Contents/MacOS/firefox
    ldid -S /Applications/Firefox-CustomBlue.app/Contents/MacOS/firefox

Additional Information

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.