Skip to content

Commit

Permalink
Fix AnswerAd: searchwords
Browse files Browse the repository at this point in the history
  • Loading branch information
shatyuka committed Jun 19, 2023
1 parent 250730f commit 28f6440
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/com/shatyuka/zhiliao/hooks/AnswerAd.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ protected void afterHookedMethod(MethodHookParam param) {
if (Helper.prefs.getBoolean("switch_searchwords", false) && segments.get(0).equals("appview") && segments.get(segments.size() - 2).equals("answer")) {
WebResourceResponse response = (WebResourceResponse) param.getResult();
try {
byte[] data = new byte[response.getData().available()];
int available = response.getData().available();
if (available == 0) {
available = 0x100000;
}
byte[] data = new byte[available];
response.getData().read(data);
String content = new String(data);
content = content.replace("\"searchWords\"", "\"searchWords_bak\"");
Expand Down

0 comments on commit 28f6440

Please sign in to comment.