zswang / jdists

A feature rich code block preprocessing tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

混淆真个js文件后,拿不到方法

xyclouds opened this issue · comments

我有一个问题,我希望把所有的要混淆加密的内容放在一个javascript文件里面,但是我在依照demo尝试的时候,发现对于一个方法函数,在使用 /*<jdists encoding="zero">*/ 混淆以后,在html文件中无法调用.

I have a problem, I want to put all the confusion to the encrypted content in a JavaScript file inside, but when I was in accordance with the demo to try, find a method to use the /*<jdists encoding= function, after the "zero" >*/ confused, unable to call in the HTML file

(function () {
  /*<jdists encoding="zero">*/
  function log(x) {
    console.log(x);
  }
  window.log = log; // 需要导出
  /*</jdists>*/
  log(1);
})();

zero 编码后会形成一个闭包,需要做一个导出,如上解决。

已解决,非常感谢