|
|
@ -281,7 +281,13 @@ class AnalyzeUrl( |
|
|
|
fun getResponse(tag: String): Call<String> { |
|
|
|
fun getResponse(tag: String): Call<String> { |
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
headerMap["Cookie"] += ";${cookie}" |
|
|
|
val cookieMap = CookieStore.cookieToMap(cookie) |
|
|
|
|
|
|
|
val customCookieMap = CookieStore.cookieToMap(headerMap["Cookie"] ?: "") |
|
|
|
|
|
|
|
cookieMap.putAll(customCookieMap) |
|
|
|
|
|
|
|
val newCookie = CookieStore.mapToCookie(cookieMap) |
|
|
|
|
|
|
|
newCookie?.let { |
|
|
|
|
|
|
|
headerMap.put("Cookie", it) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return when { |
|
|
|
return when { |
|
|
|
method == RequestMethod.POST -> { |
|
|
|
method == RequestMethod.POST -> { |
|
|
@ -312,6 +318,16 @@ class AnalyzeUrl( |
|
|
|
if (type != null) { |
|
|
|
if (type != null) { |
|
|
|
return Res(url, StringUtils.byteToHexString(getResponseBytes(tag))) |
|
|
|
return Res(url, StringUtils.byteToHexString(getResponseBytes(tag))) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
|
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
|
|
|
|
val cookieMap = CookieStore.cookieToMap(cookie) |
|
|
|
|
|
|
|
val customCookieMap = CookieStore.cookieToMap(headerMap["Cookie"] ?: "") |
|
|
|
|
|
|
|
cookieMap.putAll(customCookieMap) |
|
|
|
|
|
|
|
val newCookie = CookieStore.mapToCookie(cookieMap) |
|
|
|
|
|
|
|
newCookie?.let { |
|
|
|
|
|
|
|
headerMap.put("Cookie", it) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (useWebView) { |
|
|
|
if (useWebView) { |
|
|
|
val params = AjaxWebView.AjaxParams(url) |
|
|
|
val params = AjaxWebView.AjaxParams(url) |
|
|
|
params.headerMap = headerMap |
|
|
|
params.headerMap = headerMap |
|
|
@ -322,10 +338,6 @@ class AnalyzeUrl( |
|
|
|
params.tag = tag |
|
|
|
params.tag = tag |
|
|
|
return HttpHelper.ajax(params) |
|
|
|
return HttpHelper.ajax(params) |
|
|
|
} |
|
|
|
} |
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
|
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
|
|
|
|
headerMap["Cookie"] += ";${cookie}" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
val res = when { |
|
|
|
val res = when { |
|
|
|
method == RequestMethod.POST -> { |
|
|
|
method == RequestMethod.POST -> { |
|
|
|
if (fieldMap.isNotEmpty()) { |
|
|
|
if (fieldMap.isNotEmpty()) { |
|
|
@ -356,7 +368,13 @@ class AnalyzeUrl( |
|
|
|
if (tag != null) { |
|
|
|
if (tag != null) { |
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
val cookie = CookieStore.getCookie(tag) |
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
if (cookie.isNotEmpty()) { |
|
|
|
headerMap["Cookie"] += ";${cookie}" |
|
|
|
val cookieMap = CookieStore.cookieToMap(cookie) |
|
|
|
|
|
|
|
val customCookieMap = CookieStore.cookieToMap(headerMap["Cookie"] ?: "") |
|
|
|
|
|
|
|
cookieMap.putAll(customCookieMap) |
|
|
|
|
|
|
|
val newCookie = CookieStore.mapToCookie(cookieMap) |
|
|
|
|
|
|
|
newCookie?.let { |
|
|
|
|
|
|
|
headerMap.put("Cookie", it) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
val response = when { |
|
|
|
val response = when { |
|
|
|