I am writing an app using applescriptobjc in xcode, and while making the archive I see the source code is still inside the package, is there a way to hide it or transform it completely to binary code? Thanks
-
I tried making an archive and then I looked inside. I did not find any of my source code. Can you be more specific about how you found the source code, like the relative file path in the archive? Or if you are using a tool to extract the source code out of the archive what is it?DerrickHo328– DerrickHo3282016-11-06 02:21:09 +00:00Commented Nov 6, 2016 at 2:21
-
@Calimari328 you don't seem to be familiar with xcode I guessKamel Labiad– Kamel Labiad2016-11-06 04:55:04 +00:00Commented Nov 6, 2016 at 4:55
2 Answers
I may be a year late to the discussion but I asked the same question around the same time as you did last year and hope that the answer I got will satisfy your own question. Here is an extract answer from my own question:
When you save the AppleScript file you have the option of checking "Run Only" - in that case the script is compiled into a new form that can be run exactly as the original script, but it is not meant for further editing/development.
It doesn't mean that the run-only file is complete protected or non-readable, but parts of your code, comments, etc. are not included or not easily readable.
If you want to do more you'll need a code obfuscator if you still want to use AppleScript - however I'm not sure if one exists on the market, or you need to develop your own.
As you can see, a simple way to do this is:
- Open your final AppDelegate.applescript file in Script Editor on the mac.
- Select: File > Export...
2.1. Don't change the file name but override the archive file
2.2. BEFORE SAVING: Choose Run-only checkbox from the save options but leave the File Format as Script
Now your file cannot be opened in plain text as it is set to Run-only. Please remember that it is not a 100% read-proof solution, but works great for small projects (provided you are not rushing the final export and don't forget to perform the above mentioned steps before handing it over to the customer).
I hope you can make the most of this answer and still deem it useful. Let me know how you get on or whether you have any more questions. Perhaps you have since found a far better solution (or just an alternative), if so, I am still looking for the next best thing in source code protection.