The new version of JSA, a tool for script analysis, compression, and obfuscation, increases compression efficiency by about 10% SA 1.0 Alpha release and compression efficiency by about 10%
Compression Algorithm Improvement:
Implemented your own text compression algorithm
* Improves the compression ratio and decompression efficiency.
Optimized syntax Compression
* Merge consecutive var statements,
* The redundant var statement is deleted,
* Excessive Large arc brackets ({,}) are deleted ({,}),
* Excessive semicolons (;) are deleted (;).
UI improvement:
* Automatic encoding and Recognition
* Supports file drag and drop
* Supports java 1.4.2 + when the jar open mode is java, you can double-click it to run it. However, if the open mode of JAR is modified (such as winrar), use the following method:
CMD> java-jar xx. jar
* Format
Annotations can only be separated between statements. Comments inserted in the middle of the statement may be lost. When formatting, It is a bug.
* Compression parameter settings
Operation-> Settings:
Execute syntax compression: replace local variables and delete redundant syntax.
Execute text compression: compress the word segmentation and replacement of script text. You can use eval (extract function () to restore the file during execution.
Compatible with IE5 and NS3: Regular Expressions are preferred in earlier versions of browsers. Do you need to be compatible with regular expressions? (a slightly more complex decompression function is required ).
Condition settings for executing text compression: set when to use text compression. There are two requirements: ratio requirement and size requirement. Because eval requires additional overhead, text compression is used only when the ratio of Text compression is smaller than the specified value and the file size is greater than the specified value.
ANT Task
* Default encoding: the default JRE encoding may vary with random machines. Therefore, we recommend that you manually specify the encoding method (eg: charset = "UTF-8"/charset = "GBK ")
* Jsicompile task: Compile JSI (compression, preload compilation, and custom Startup File)
* Jscompress compression script
ANT Task example
Example of jsicompiler (processing JSI and its integrated third-party scripts)
Xml Code
The Code is as follows:
Example of jscompress (compressing common scripts)
Xml Code
<Target name = "test-compress"> <jscompress destDir = "ant/temp/script3"> <fileset dir = "web/scripts"> <include name = "js /* */*. js? 1.1.9 "/> <include name =" *. js? 1.1.9 "/> </fileset> </jscompress> </target>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]