📜 ⬆️ ⬇️

Cheat Miguel?


Once, Miguel ...
(Although no, the story is not quite about him, I will try to start differently)
Once in the world of open source ...
(Also by, OSS is only partially affected in history)
When the thirst for profit is called common sense, deception begins.
(Almost aphorism)

Prehistory

It hit me in the head to write a program for Mac on C #. I thanked Miguel de Ikas for the excellent MonoMac Open Source project, gave praise to his MonoMac library, slightly cursed MonyDevelop on the damp and went to work. After some time, an account was paid in the AppStore, the program was on the verge of completion, when a large project on the main work started and it had to be postponed. And a year later a message arrived that an empty account in the AppStore would be closed after 30 days - this was a sign that something had to be done. MonoDevelop, which was updated to Xamarin Studio itself, immediately proposed to convert the MonoMac project to Xamarin.Mac and took me to the site where it was suggested to buy this very Xamarin.Mac for only $ 999, otherwise the deployment in the AppStore will be impossible.

To tell you the truth, I was somewhat taken aback - starting a hobby development in a free product, I could not even think about paying thousands of dollars for the possibility of publishing, even if I expected to make money on beer. Even more - I vaguely remembered posts and success stories on StackOverflow about publishing in the market, some kind of pekedger, etc. But all the necessary ticks in Xamarin Studio were tightly disabled and required to buy the full version of the product. Then I realized that somewhere I was deceived, or, being expressed in modern language, they changed the product distribution strategy so that the premium publishing service to the market became paid.

All in its own right

If you look at the relationship between my and Xamarin in the face of Miguel, then no one deceived anyone - the developer has the right to do anything with his product, much less change licenses or provide premium services for some money. In the case of Xamarin.Mac, this is a static linking service with Mono libraries, during which the program is no longer dependent on Mono Runtime and can run on any computer. The project is also signed with the necessary certificates, supplied with Entitlements, Sandboxing settings, etc., for publishing to the AppStore:
As of December 12th 2012, Xamarin now offers a superset of MonoMac called Xamarin.Mac. It is a license for software licensing.

Mono Runtime itself is also distributed under the GNU Library GPL 2.0 license , in which the issue of static linking remains rather controversial. If we omit the intricacies of terms, then releasing a proprietary product linked to the LGPL library, the developer should also give the opportunity to replace this LGPL library with another version. This usually implies that the source code must be supplied along with the program, or another license must be used. The Xamarin site is of the same opinion:
You can get a commercial license from Xamarin.

')
Cheating

The last thing in life I wanted to deceive anyone, especially such a respected person as Miguel de Icaz, author of Gnome, Mono, founder of Xamarin and Ximian. But by and large, I’m sure that its marketers, having made the product a paid product (and, as for me, unreasonably paid), have already deceived me by hiding behind the letter of the law and violating its spirit. Therefore, I reserved this right without formally breaking anything, but as a result I published my program in the AppStore with a free version of the toolkit. The program contains, among other things, an .exe file with .NET Bytecode and the necessary libraries, which can be executed using the current .NET Framework and Mono Runtime, and is also absolutely sufficient for static linking with Mono libraries, AOT compilations or other actions. But the LGPL license does not oblige me to write instructions for the end user how to do this (not to mention the fact that I do not know it myself), only to provide everything necessary for this.


Technical nuances

My MonoDevelop itself was updated to Xamarin Studio and the creation of .pkg packages there is now blocked. Also on the MonoMacPackager page, the instructions for creating packages are missing and links to Xamarin.Mac appear. This is unpleasant, but not fatal, because in nature there are archives and older versions of the product. I downloaded MonoDevelop 3.0.6, adapted the project for it (I had to remove one incompatible API call), chose the “Link All” parameter and ... could not properly compile the program. To tell you the truth, I did not understand the reason, the packer simply refuses to work with different versions of Mono Runtime, gives a link error and does not go further. But nevertheless, by choosing “Don't link” you can create a project, it will be ~ 8 megabytes more, but it will work without any special problems. At the same time, the full versions of the System. *. Dll assemblies are included in the project, and not just the meta-data, as it would have been with the “Link All” mode. In my case, this is even a plus, because the same rule applies to the main .exe project - the entire bytecode remains in it.

The installer obtained in this way starts up perfectly, installs the product, but then the program refuses to start. A study of Google and the system log showed that Mono Develop includes incorrect Entitlements - keychain-access-groups that are not compatible with OS version 10.8, and may not be valid at all. This problem is solved in Xamarin.Mac, but I after all went by a thorny path, because I also had to solve it myself. As a result, I stopped at the post-build script implementation, which applies the correct data to the build and re-signs it.
The version was sent to the AppStore, but immediately returned with reports of other problems with Entitlements, the lack of a signature on the file libMonoPosixHelper.dylib, and at the same time not allowed to use Shared Memory. The first one was solved by additional edits of the plist file, the second one - by updating the post-build script, but the third problem confused me. Information about the problem was on Stackoverflow , but it said that it was already fixed, but in general it was solved by setting the environment variable MONO_DISABLE_SHARED_AREA. The idea of ​​a variable is quite good, but you need to install it not at the compilation stage, but at the execution stage already on the client’s computer. I do not know how this is solved in Xamarin.Mac, but I myself decided to add a key to the info.plist file, which sets this variable when the program starts:
<key>LSEnvironment</key> <dict> <key>MONO_DISABLE_SHARED_AREA</key> <string>1</string> </dict> 

That was enough, although the program was wrapped one more time because of the wrong title in the window title.
Over-critical error


Epilogue

The program is now in the market and honestly brings your 1 dollar and 40 cents a day. If nothing changes, then in 713 days I can buy the full version of Xamarin.Mac, excluding the fee for the AppStore itself. I wrote to Miguel on Twitter about this situation, but received no answer. He answered another questioner on the same question in the key “use”, but it is better to buy Xamarin.Mac.
Hidden text

In the meantime, the guys from Xamarin support answered me that, as a regular customer of Xamarin.iOS and an active student, I can buy a product for only $ 99. This is a good offer and I will certainly agree with him, even if I do not quite agree with the position of the company.

PS Anyone commenting on the “ugly pirate takes money from a respected person” I advise you not to waste your nerves and not to increase the entropy of the global network.

Source: https://habr.com/ru/post/217529/


All Articles