我有一个想要混淆的 Greasemonkey 脚本。我想知道可用的“Packer”Javascript obfuscator出了什么问题。
它可以很好地压缩脚本,但安装后,脚本不起作用。是否有任何 PHP 类可以混淆/打包 GM 脚本并保留功能?或者我该怎么做?
错误:
Timestamp: 01-05-2013 13:11:35
Error: missing ; before statement
Source File: file://file_path
Line: 1
脚本:
// ==UserScript==
// @name Test
// @namespace http://*
// @description Test
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// ==/UserScript==
var SomeVar = "Something";
GM_setValue("foo","bar");
var AnotherVar = GM_getValue("foo");
alert(AnotherVar);
打包脚本:
eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0 3="4";5("1","6");0 2=7("1");8(2);',9,9,'var|foo|AnotherVar|SomeVar|Something|GM_setValue|bar|GM_getValue|alert'.split('|'),0,{}))