MCPcopy Create free account
hub / github.com/WindXaa/Android-reverse / getServerInfo

Method getServerInfo

WebCurl/WebCurl.java:113–136  ·  view source on GitHub ↗
(WebInfo wi,String domain)

Source from the content-addressed store, hash-verified

111
112 //使用curl获取服务器信息,输入url
113 public static void getServerInfo(WebInfo wi,String domain) throws IOException {
114 String charset = "utf-8";
115 charset = getCharset(domain);
116 //System.out.println("charset:"+charset);
117 if(!matcherChar(charset,"gb")){
118 charset = "utf-8";
119 }
120 //-L 跟随跳转 -i 打印详细信息
121 String[] cmds = {"curl","-A","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36","-L","-i",domain};
122 String result_html = execCurl(cmds,charset);
123 //获取的header和html信息
124 //System.out.println(result_html);
125 if(!result_html.isEmpty()){
126 wi.title = getTitle(result_html);
127 }else{
128 System.out.println("无法获取域名的html");
129 }
130 strName(wi,result_html);
131 LanguageCheck(wi);
132 NormalLanguageTest(wi);
133 ExceptionCheck(wi);
134 // CheckStatus(wi);
135
136 }
137
138
139

Callers 1

mainMethod · 0.95

Calls 8

getCharsetMethod · 0.95
matcherCharMethod · 0.95
execCurlMethod · 0.95
getTitleMethod · 0.95
strNameMethod · 0.95
LanguageCheckMethod · 0.95
NormalLanguageTestMethod · 0.95
ExceptionCheckMethod · 0.95

Tested by

no test coverage detected