[Mono-osx] MonoMac / Build process and obfuscation

Jon Lipsky jon.lipsky at elevenworks.com
Tue Nov 20 21:00:49 UTC 2012


Hi,

It's not pretty; however I found a solution that works for my projects.  

First, I build all of my dependent projects like normal.

Second, In my target MonoMac project I have a script the runs "before build" which obfuscates all of the dependent libraries.  It does this by starting a virtual machine (or making sure that it's running) on the same mac that is doing the build, and then SSHing into that virtual machine and calling a batch file that obfuscates the assemblies.  The virtual machine is configured with a "shared directory" that points to my actual project in the Mac file system, so the obfuscations are done in place.

Since the obfuscation is done before the MonoMac project is built itself, the app is built and signed with the obfuscated assemblies.

The only limitation to my approach is that the MonoMac project itself can't be obfuscated since the script runs "before build"; however I worked around that by moving everything I want obfuscated into a dependent project.  My target MonoMac project pretty much only consists of resources, property lists and enough code to bootstrap the app.

Jon...

On Nov 20, 2012, at 1:32 PM, thenextman wrote:

> I'm experimenting with obfuscation in MonoMac. We have a lot of existing
> business logic that we are reusing and would like it to be obfuscated (with
> the acknowledgement that a keen developer will still be able to deobfuscate
> and read the code)
> 
> It seems like once I've compiled my project (into a .app), I can crack the
> package open and apply some obfuscation to the assemblies / exe inside
> without any problems.
> 
> But presumably this is an issue, if my .app is signed?
> 
> Is anyone obfuscating their MonoMac application? Does anyone have
> suggestions for how I can integrate this into our build?
> 
> 1) I could obfuscate my assemblies in advance, then link the binaries to my
> MonoMac project and build that. Of course this is a pain, and it means any
> logic in my MonoMac .exe will not be obfuscated
> 2) Perhaps there is a way to 'delay' sign and package the Mac .app? So I
> could build as normal, obfuscate, then do that packaging and signing step?
> Does anyone have an insight into this?
> 3) Perhaps there is a way to integrate obfuscation into the build process
> directly? In Visual Studio, I could presumably create an MSBuild task and
> obfuscate my .NET code before the MonoMac signing / packaging step.
> 
> If anyone had some insight that could help, I would be very grateful! Thank
> you in advance.
> 
> 
> 
> --
> View this message in context: http://mono.1490590.n4.nabble.com/MonoMac-Build-process-and-obfuscation-tp4657475.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx



More information about the Mono-osx mailing list