Thursday, July 20, 2017

#1 2016-11-08 03:21:17 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

How to Hide the source code in Xcode?

I am writing an app using AppleScriptObjC in Xcode 7.3.1, 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

Offline

 

#2 2016-11-08 05:10:53 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Go to Build Settings and search for OSACompile - Build Options. Change Save as Execute-Only to Yes.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2016-11-08 06:01:46 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

Actually I didn't work neutral

Offline

 

#4 2016-11-08 06:06:51 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Double-check -- it does work.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#5 2016-11-08 07:10:19 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

I did check and changed it in both levels here is screen shots of what I did
https://dl.dropboxusercontent.com/u/6735961/xcode1.png
https://dl.dropboxusercontent.com/u/6735961/xcode2.png

Thank you

Offline

 

#6 2016-11-08 07:24:08 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Have you done a Product -> Clean?

Last edited by Shane Stanley (2016-11-08 07:26:54 pm)


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#7 2016-11-08 07:43:20 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

I just did and still same result no change sad

Offline

 

#8 2016-11-08 07:58:19 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Are you sure you're looking at the latest build?

You can check what's happening. In the Navigator panel, click on the last icon, the Report Navigator. Find the latest Build report. You should then see a list of build stages with green ticks. Find the one that compiles your code. Select it, and then click in he icon that appears to its right to expand it. This will show the OSACompile command issued as part of the build process. In it, you should see -x -- that means execute-only.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#9 2016-11-08 08:15:16 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

it looks like you described but still the same result, here some screenshots
https://dl.dropboxusercontent.com/u/6735961/xcode3.png
https://dl.dropboxusercontent.com/u/6735961/xcode4.png

Offline

 

#10 2016-11-08 08:18:11 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Are all of the scripts .applescript files in your project? Are they all readable?


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#11 2016-11-08 08:23:59 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

Yes all of them inside my project and they are readable
thank you

Offline

 

#12 2016-11-08 08:26:57 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5045

Re: How to Hide the source code in Xcode?

Then I'm at a loss. Your screenshot shows the -x parameter in there. If you want to email me the project, I'd be happy to take a look. I don't know what else to suggest.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#13 2016-11-08 08:27:02 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

I did create small project for test, just a window with a button and also has the same issue

Offline

 

#14 2016-11-08 08:36:30 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

ok I will send it to you now to your email, thank you again Shane for your time

Offline

 

#15 2016-11-08 08:40:03 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

done

Offline

 

#16 2016-11-10 08:15:16 am

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

Hi Shane,
is Xcode able to hide the script files completely or the only thing it can do is keep the files visible and make them uneditable?
is it also possible to exclude some scripts from beeing compiled? I want to use some files to store data so I could edit them later without the need to recompile the app, they are basically setting files

thank you

Offline

 

#17 2016-11-10 08:31:31 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2665
Website

Re: How to Hide the source code in Xcode?

kamel3d wrote:

is Xcode able to hide the script files completely or the only thing it can do is keep the files visible and make them uneditable?


It's a requirement from the AppleScriptObjC.framework that is used. It's because of the AppleScript files not being compiled into the executable (see:<appname>.app/Contents/MacOS/<appname>). The first thing that is done after opening the process instance (before launching the application instance) is that the AppleScriptObjC.frameworks tries to load all AppleScript files in the script folder from the application bundle. Because of this workflow the files has to be stored in that particular folder and reachable for the framework.

kamel3d wrote:

is it also possible to exclude some scripts from beeing compiled? I want to use some files to store data so I could edit them later without the need to recompile the app, they are basically setting files


If they are settings you should store them outside the application in the preferences of application support folder. You could use a default file and when at launch this file is missing you copy this file to the preference of application support folder.

Last edited by DJ Bazzie Wazzie (2016-11-10 08:35:42 am)

Offline

 

#18 2016-11-10 12:16:06 pm

kamel3d
Member
From:: London
Registered: 2016-10-03
Posts: 22

Re: How to Hide the source code in Xcode?

thank you DJ Bazzie Wazzie

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)