No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Obfuscate code

    Framework
    5
    10
    964
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gaguerrero last edited by

      I want to be able to obfuscate the source code of my mobile application, to make it difficult even partially to understand it.
      Is there any way to do it? Thank you

      dobbel 1 Reply Last reply Reply Quote 0
      • S
        SLIpros last edited by

        Don’t use javascript script if you need to obfuscate your work.

        1 Reply Last reply Reply Quote -1
        • W
          walfin last edited by walfin

          @gaguerrero Cross-posting my previous post in https://forum.quasar-framework.org/topic/4919/solved-how-to-achieve-obfuscation-like-https-obfuscator-io-in-cli

          Use npm install --save-dev webpack-obfuscator.

          Here’s a sample from my quasar.conf.js:

          let JavaScriptObfuscator=require('webpack-obfuscator');
          ...
          build:{
          ...
          extendWebpack(cfg,{isServer,isClient}){
          if(!ctx.dev&&!ctx.debug){
          cfg.plugins.push(new JavaScriptObfuscator({
          debugProtection: true,
          debugProtectionInterval: true,
          rotateStringArray: true,
          renameGlobals: true,
          stringArrayEncoding: 'rc4',
          stringArrayThreshold: 1
          }));
          ...
          }
          ...
          }
          
          1 Reply Last reply Reply Quote 0
          • G
            gaguerrero last edited by

            Thanks for your answer, I will try

            1 Reply Last reply Reply Quote 0
            • dobbel
              dobbel @gaguerrero last edited by

              @gaguerrero

              You could make your app heavily rely on server responses then nobody can see all of your code.

              1 Reply Last reply Reply Quote 1
              • G
                gaguerrero last edited by

                Does anyone know how to exclude the vendor.js file from the obfuscation process? Thanks

                1 Reply Last reply Reply Quote 0
                • Hawkeye64
                  Hawkeye64 last edited by

                  @gaguerrero Quasar already uses Uglify.

                        build: {
                          transpileDependencies: [],
                          transformAssetUrls: {},
                          stylusLoaderOptions: {},
                          sassLoaderOptions: {},
                          scssLoaderOptions: {},
                          lessLoaderOptions: {},
                          env: {},
                          uglifyOptions: {
                            compress: {},
                            mangle: {}
                          }
                        },
                  

                  You can change configuration with:

                        build: {
                          uglifyOptions: {
                            compress: {},
                            mangle: {}
                          }
                        },
                  

                  and looking at the docs: https://github.com/mishoo/UglifyJS

                  1 Reply Last reply Reply Quote 0
                  • G
                    gaguerrero last edited by

                    Thanks! works perfect, is it possible to exclude vendor.js file? I can’t tell by reading the uglify documentation.

                    1 Reply Last reply Reply Quote 0
                    • Hawkeye64
                      Hawkeye64 last edited by Hawkeye64

                      I don’t think that is uglified by default. Because vendors.js comes from node_modules, some may already be obfuscated or compiled, etc. I think vendors.js is only assembled…

                      1 Reply Last reply Reply Quote 0
                      • W
                        walfin last edited by walfin

                        @gaguerrero Uglify doesn’t really obfuscate when mangling names, it only minifies.

                        Also, AFAIK vendor.js is not obfuscated by default.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post