Skip to content

Commit

Permalink
v1.3.6(16) key url编码
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jan 7, 2019
1 parent ced9b00 commit 6268dc5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions app/src/main/java/com/monke/monkeybook/base/ProxyInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,23 @@ public Response intercept(Chain chain) throws IOException {
if (!StringUtil.isBlank(oldUrl)) {
oldUrl = URLEncoder.encode(oldUrl, "utf-8");
}
try{
String key = AESUtil.aesEncode(ProxyManager.packageName+UUID.randomUUID().toString()+System.currentTimeMillis(),ProxyManager.PROXY_PACKAGENAME_ENCODE);
try {
String temp = ProxyManager.packageName + UUID.randomUUID().toString() + System.currentTimeMillis();
String key = AESUtil.aesEncode(temp.trim(), ProxyManager.PROXY_PACKAGENAME_ENCODE);
try {
key = URLEncoder.encode(key,"utf-8");
} catch (Exception e) {
key = temp.trim();
}
HttpUrl newBaseUrl = HttpUrl.parse(ProxyManager.proxyHttp).newBuilder()
.setQueryParameter("proxyUrl",oldUrl)
.setQueryParameter("proxyPackagename",key)
.setQueryParameter("proxyUrl", oldUrl)
.setQueryParameter("proxyPackagename", key)
.build();
Response response = chain.proceed(builder.url(newBaseUrl).build());
if(response.isSuccessful()) {
if (response.isSuccessful()) {
return response;
}
}catch (Exception e){
} catch (Exception e) {

}
}
Expand Down

0 comments on commit 6268dc5

Please sign in to comment.