Software Archive
Read-only legacy content
17061 Discussions

Intel XDK source code not getting Minify/obfuscated

dang__sapan
Beginner
1,491 Views

Hi,

I created an app using IntelXDK. After building the application for Android I saw that the Intel XDK source code not getting Minify/obfuscated.. I am able to view my application javascripts code , it is also containing my comments.

In Services setting of intelXDK 'minify/obfuscate generate code' is checked.

Please Help

Thank you

 

 

 

 

0 Kudos
8 Replies
John_H_Intel2
Employee
1,491 Views

That checkbox is only for the code that is generated from the Web Services panel, not your html/js/css code.

0 Kudos
dang__sapan
Beginner
1,491 Views

Thanks 

I obfuscated my source code using another tool.

0 Kudos
Vijay_R_1
Beginner
1,491 Views

@SKD Do share the tool you have used to minify/obfuscate custom code.

Thanks.

0 Kudos
dang__sapan
Beginner
1,491 Views
0 Kudos
Alessandro_T_
Beginner
1,491 Views

Is it integrated in build process ? I had found a Cordova plugin that minified code after build 

0 Kudos
Stephen_T_2
Beginner
1,491 Views

 Could you please share your cordova plugin??

0 Kudos
Alessandro_T_
Beginner
1,491 Views

 

Sorry i did not explain well : when using cordova without XDK , i used that plugin ( it's not a plugin , but a hook, cfr : https://software.intel.com/en-us/xdk/docs/add-manage-project-plugins ) 

There are a few features of the Cordova CLI that are not supported by the Intel XDK. These include the “merges” folder and the “hooks” feature. Merges are platform-specific source variations. It is possible, for example, to say that you want to substitute some file in your application with an alternative version when you build on a specific platform. Hooks are scripts that are executed at various points in the project life cycle. For example, you can write a script that will be executed each time you add a new plugin. Hooks are not invoked in the Intel XDK environment nor are they used on the Intel XDK Build Server. 

this is the plugin that i used without xdk :

https://github.com/rossmartin/cordova-uglify

( does not work with XDK , just tested , and reported in xdk docs as not supported  )

 

0 Kudos
Fab_V_
New Contributor I
1,491 Views

Another alternative solution that i personally use, considering using xdk app coupled to a php website :

  1. load JS dynamically in your app for example with $.getScript
  2. JS sources folder is outside www/, e.g. : one level up.
  3. juste before loading JS, check if your running app on device or in web/browser/local by checking if "device" object exists.
  4. if no (web), load JS in folder outside www (e.g. one level up)
  5. if yes (device) load the obfuscated/minified JS in www/js/ folder
  6. to ease the process, i created a php script that minify the target JS et place it is www/js/folder of the app.
  7. load the local php script juste before compiling with XDK.
0 Kudos
Reply