From 22bd830353d6de98cf808909f0e6beaf584c5fdd Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Mon, 6 Feb 2023 01:03:31 +0300 Subject: [PATCH] fix #1062 --- .../ru/vtosters/lite/hooks/AdBlockHook.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java b/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java index a8909cdac..544a0a997 100644 --- a/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java +++ b/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java @@ -277,41 +277,9 @@ public class AdBlockHook { } } - if (!json.has("items")) return json; - - var items = json.optJSONArray("items"); - if (items != null) { - for (int i = 0; i < items.length(); i++) { - var item = items.optJSONObject(i); - if (item != null) { - parseStoriesItem(item); - } - } - } - return json; } - private static void parseStoriesItem(JSONObject item) throws JSONException { - var stories = item.optJSONArray("stories"); - var newStories = new JSONArray(); - - if (stories == null) return; - - for (int j = 0; j < stories.length(); j++) { - var story = stories.optJSONObject(j); - - if (!story.optBoolean("is_ads") && !story.optBoolean("is_promo")) { - newStories.put(story); - } else { - if (dev()) - Log.d("StoriesAds", "Fetched ad, owner id " + story.optString("owner_id") + ", caption " + story.optString("caption")); - } - } - - item.put("stories", newStories); - } - public static Boolean isAds(JSONObject list, String type) throws JSONException { if (list == null || type == null || !ads()) return false;