Why does construct minify method names from a extern script?

Just started using Construct 2? Post your questions here

Post » Wed May 27, 2015 12:19 am

Hello

Why does construct rename(minify) method names in c2runtime.js, which owned by a external script?
How can I stop this?

Image

Image

Thanks for your help.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Wed May 27, 2015 6:27 am

I believe you can turn off minifying during export... turned on by default.
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Wed May 27, 2015 6:54 am

Using minify is a way to obfuscate the output in order to prevent unscrupulous individuals from reverse engineering your code.

I would have thought that was a good thing(!?).
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,414
Reputation: 59,512

Post » Wed May 27, 2015 7:04 am

Good point, @zenox98. Very good point indeed.
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Wed May 27, 2015 10:13 am

Construct 2 only minifies c2runtime.js, not any other script files, so the sfs2x_api_js.js file in your picture will not have been touched by Construct 2.

If code in c2runtime.js refers to the external script, those terms will also be minified unless you write code which is compatible with Closure Compiler's advanced mode. This is all documented.
Scirra Founder
B
397
S
236
G
88
Posts: 24,419
Reputation: 194,542

Post » Wed May 27, 2015 8:43 pm

Ashley wrote:Construct 2 only minifies c2runtime.js, not any other script files, so the sfs2x_api_js.js file in your picture will not have been touched by Construct 2.

If code in c2runtime.js refers to the external script, those terms will also be minified unless you write code which is compatible with Closure Compiler's advanced mode. This is all documented.


That means I'll never can use Smartfox API, when I minify my construct project? :cry:
Is there no way to say in script, dont minify this part?
Last edited by deathangel1479 on Wed May 27, 2015 11:05 pm, edited 2 times in total.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Wed May 27, 2015 9:51 pm

No, it just means you need to access properties with foo["bar"] instead of foo.bar.
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Wed May 27, 2015 10:01 pm

R0J0hound wrote:No, it just means you need to access properties with foo["bar"] instead of foo.bar.


Thanks, i will try it.
I should have stayed with C. :lol:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

So much for rewrite.... But...
Everything is working fine now.
Thank you so much!
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests