Reputation: 658
I'm creating a .framework (or a static library) for a component that I developed and that I'd like to sell to third-parties.
I was planning to add some code to protect the framework from unauthorised re-use, re-distribution or re-sale.
I think a good way to achieve this would be to ask to the purchaser to tell me what is the bundle ID of the app that will use the framework, save it in the framework as an NSString property and create a method that checks at runtime if the bundle ID of the app that is using the framework match or not.
However I'd like also to make the framework available to try for free. Therefore I want to enable the bundle ID check only then the containing app is compiled in released mode, or when the app is running on the end user device, outside the development sandbox.
Of course I can't use any methods that relies on variables or macros set in the project file, because they would be too easy to exploit. I need to do it at runtime... and without any action needed by the purchaser.
Is there a way to check at runtime if an app is running in the developer sandbox or not? Or if an app has been built with the release build profile?
Thanks!
Upvotes: 4
Views: 650
Reputation: 643
In the past, I have implemented a simple time-bomb expiration in free to eval but not free to deploy components. The library would function up to certain date X, and then stop working. The user would just have to re-download the latest bits to continue evaluating. One paid order, a download link is provided without the the time-bomb or a license file with a digitally signed license disabled the time bomb logic all together. Relying on run-time environmental characteristics is fragile at best.
Upvotes: 1