Reducing the size of news traffic by disabling the ad request
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
package ru.vtosters.lite.hooks;
|
||||
import static ru.vtosters.lite.utils.Preferences.ads;
|
||||
import static ru.vtosters.lite.utils.Preferences.adsslider;
|
||||
import static ru.vtosters.lite.utils.Preferences.dev;
|
||||
|
||||
import android.util.Log;
|
||||
@@ -9,10 +11,16 @@ import java.util.LinkedHashMap;
|
||||
|
||||
public class RequestDumper{
|
||||
public static void addParams(MethodCall.a paramslist, String method, LinkedHashMap params, String apiver) {
|
||||
if (method.contains("execute.getGiftByStickerId")) {
|
||||
if (method.contains("execute.getGiftByStickerId") || method.contains("execute.getNewsfeedCustom")) {
|
||||
apiver = "5.187";
|
||||
}
|
||||
|
||||
if (params.get("filters") != null) {
|
||||
if (params.get("filters").toString().contains("ads_app") && ads() && adsslider()) {
|
||||
params.put("filters", "ads_disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (dev()) {
|
||||
Log.d("RequestDumper", "Method: " + method);
|
||||
Log.d("RequestDumper", "API version: " + apiver);
|
||||
|
||||
Reference in New Issue
Block a user