Sometimes you can view the logs and often find the error logs printed by the bottom layer of the framework. If you are not familiar with the framework when you want to modify this error, you need to follow the process that may generate this error log step by step. It may not be found at half past one. For example, when I recently conducted a stress test on the server set up by smartfoxserver, I found that the maximum number of waiting threads exceeds 20 and the error log will be printed, then, it took a long time to find the error output in the decompilation code that smartfoxserver received the request. Then I was wondering if I could use inputstream to query strings. The test code is as follows:
Import Java. io. bufferedreader; import Java. io. file; import Java. io. filefilter; import Java. io. ioexception; import Java. io. inputstreamreader; import Java. util. enumeration; import Java. util. regEx. pattern; import java.util.zip. zipentry; import java.util.zip. zipexception; import java.util.zip. zipfile; public class find {public static final string Path = "D:/workspace/test/"; // jar package parent directory public static final string KEYWORDS = "AAA"; // keyword public static void main (string [] ARGs) {file = new file (PATH); final pattern P = pattern. compile (". + \\. jar $ "); file [] files = file. listfiles (New filefilter () {@ override public Boolean accept (File pathname) {If (P. matcher (pathname. getpath ()). matches () {return true;} else {return false ;}}); search (files);} Private Static void search (file [] files) {try {for (file F: Files) {If (F. isdirectory () {search (F. listfiles ();} else {zipfile jar = new zipfile (f); enumeration enumration = jar. entries (); While (enumration. hasmoreelements () {zipentry = (zipentry) enumration. nextelement (); inputstreamreader ISR = new inputstreamreader (jar. getinputstream (zipentry); bufferedreader BR = new bufferedreader (ISR); string line = BR. readline (); int line_num = 1; while (Null! = Line) {// system. out. println (line); If (line. contains (keywords) {system. out. println (F. getpath () + "," + zipentry. getname () + "," + "line number =" + line_num);} line = BR. readline (); line_num ++ ;}}} catch (zipexception z_e) {z_e.printstacktrace () ;}catch (ioexception io_e) {io_e.printstacktrace ();}}}
The jar package for testing: D: \ workspace \ test. Jar code is as follows:
Test. Java:
public class Test { public static void main(String[] args){ System.out.print("aaa"); }}
The test results are as follows:
D: \ workspace \ test. jar, COM/test. Class, line number = 3
The above code is not related to the decompilation, so currently it is only valid for the query string or variable name, and the other method name may not be able to find out the time to study the decompilation Parsing