forked from ndroi/easy163
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
Easy163/app/src/main/java/org/ndroi/easy163/hooks/BaseHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package org.ndroi.easy163.hooks; | ||
|
||
import android.util.Log; | ||
|
||
import org.ndroi.easy163.vpn.hookhttp.Hook; | ||
import org.ndroi.easy163.vpn.hookhttp.Request; | ||
|
||
import java.util.Random; | ||
|
||
public abstract class BaseHook extends Hook | ||
{ | ||
private static final String ip = String.format("175.17.%d.%d", new Random().nextInt(256), new Random().nextInt(256)); | ||
|
||
@Override | ||
public void hookRequest(Request request) | ||
{ | ||
request.getHeaderFields().remove("X-NAPM-RETRY"); | ||
request.getHeaderFields().remove("Accept-Encoding"); | ||
request.getHeaderFields().put("X-Real-IP", "175.17.223.14"); | ||
request.getHeaderFields().put("X-Real-IP", ip); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters