javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
856 stars 84 forks source link

Not working with Framework7-Vue #89

Open anilwarbhe opened 3 years ago

anilwarbhe commented 3 years ago

The app compiles but does not run. Throw errors. Has anybody tried using this plugin with Framework7-Vue? Please Help!

sanex3339 commented 3 years ago

Need more info. Obfuscator version, used options, error message and reproduceable example if possible.

anilwarbhe commented 3 years ago

I am using a hybrid framework to build my apk using (Framework7-Vue). For that, I am using a template by F7 - Vue - Webpack - Cordova by Caio Biodere you an please find it here: https://github.com/caiobiodere/cordova-template-framework7-vue-webpack

O Ubuntu I am using following commands:

  1. cordova create cordova-template com.template DefaultTemplate --template git://github.com/caiobiodere/cordova-template-framework7-vue-webpack.git#master

  2. npm install

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

Once Done In 'webpack.release.js' I have added WebpackObfuscator code to it, the file now looks as:

const path = require('path');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common');

const CordovaHtmlOutputPlugin = require('../webpack/plugins/CordovaHtmlOutputPlugin.js');
const TerserPlugin = require('terser-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const WebpackObfuscator = require('webpack-obfuscator');

module.exports = function() {
  return webpackMerge(commonConfig({ mode: 'production' }), {
    module: {
      rules: [
        {
          test: /\.css$/,
          loader: ['style-loader', 'css-loader']
        }
      ]
    },
    plugins: [
      new CordovaHtmlOutputPlugin(),
      new TerserPlugin({
        extractComments: false
      }),    
      new WebpackObfuscator ({
        rotateStringArray: true
      }),      
      new CleanWebpackPlugin({
        dry: false,
        verbose: false,
        cleanOnceBeforeBuildPatterns: ['!index.html'],
        cleanAfterEveryBuildPatterns: ['!index.html']
      })
    ]
  });
};

After that I buld a release version of an apk using command:

  1. cordova build --release android

The built apk I try to install in my phone as well as Emulator

But it throws error:

The APK failed to install. Error: Could not parse error string.

Please Help.

sanex3339 commented 3 years ago

May you create a simple reproducible repo with this error? Without repo i wont help