webpack-obfuscator icon indicating copy to clipboard operation
webpack-obfuscator copied to clipboard

Not working with Framework7-Vue

Open anilwarbhe opened this issue 5 years ago • 3 comments

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

anilwarbhe avatar Aug 20 '20 13:08 anilwarbhe

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

sanex3339 avatar Aug 21 '20 18:08 sanex3339

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: 4. 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.

anilwarbhe avatar Aug 29 '20 08:08 anilwarbhe

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

sanex3339 avatar Aug 29 '20 08:08 sanex3339