0
votes

I would like to obfuscate my code. The tutorial is under Concatenation and minification topic

These are the steps I’ve used to minify the code in hybrid app:

  1. export JAVA_HOME=$(/usr/libexec/java_home)
  2. cd /Users/keatooon/Desktop/testmfpminify2
  3. mfp create testProject
  4. cd testProject
  5. mfp add hybrid testApp
  6. mfp start
  7. mfp build
  8. mfp push
  9. mfp console
  10. mfp push —concatenate —minify

xxx:testProject xxx$ mfp push --concatenate --minify

Preparing for push...

Verifying Server Configuration...

Runtime 'testProject' will be used to push the project into.

Pushing to Server...

Deploying /Users/xxx/Desktop/wktestmfp2/testProject/bin/testApp-common.wlapp...

Deploy complete for /Users/xxx/Desktop/wktestmfp2/testProject/bin/testApp-common.wlapp.

/Users/xxx/Desktop/wktestmfp2/testProject/bin/testApp-common.wlapp has been deployed.

Push Completed Successfully.

However, it does not add any security to the code.

Code before vs after Concatenation and minification:

enter image description here enter image description here

Moreover, the code doesn’t work at all after concatenating and minifying it.

enter image description here

1

1 Answers

1
votes

Without specifying which files you want to minify, done in the build-settings.xml file located in the root folder of your application, nothing would actually get concatenated and/or minified.

The fact that it fails the app from running is interesting...

Have you edited said file? If not, try to.
Find more information about concatenation and minification, here: