Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot
4d1de6bc50 chore: Release v5.0.0-dev.3 [skip ci]
# [5.0.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.0-dev.2...v5.0.0-dev.3) (2024-11-09)

### Bug Fixes

* Add missing dependency to patch ([327ebd3](327ebd3649))
2024-11-09 04:20:45 +00:00
oSumAtrIX
327ebd3649 fix: Add missing dependency to patch 2024-11-09 05:17:06 +01:00
LisoUseInAIKyrios
34e98a54e0 chore(YouTube - Announcements): Remove language parameter of API call (#3874) 2024-11-08 22:11:31 -04:00
5 changed files with 17 additions and 10 deletions

View File

@@ -1,3 +1,10 @@
# [5.0.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.0-dev.2...v5.0.0-dev.3) (2024-11-09)
### Bug Fixes
* Add missing dependency to patch ([97f5240](https://github.com/ReVanced/revanced-patches/commit/97f5240d53b9978fb3745170fe03619c7c90274a))
# [5.0.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.0-dev.1...v5.0.0-dev.2) (2024-11-09)

View File

@@ -15,13 +15,10 @@ import android.widget.TextView;
import androidx.annotation.RequiresApi;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.time.LocalDateTime;
import java.util.Locale;
import java.util.logging.Level;
import app.revanced.extension.shared.Logger;
import app.revanced.extension.shared.Utils;
@@ -84,8 +81,8 @@ public final class AnnouncementsPatch {
try {
if (isLatestAlready()) return;
HttpURLConnection connection = AnnouncementsRoutes.getAnnouncementsConnectionFromRoute(
GET_LATEST_ANNOUNCEMENTS, Locale.getDefault().toLanguageTag());
HttpURLConnection connection = AnnouncementsRoutes
.getAnnouncementsConnectionFromRoute(GET_LATEST_ANNOUNCEMENTS);
Logger.printDebug(() -> "Get latest announcements route connection url: " + connection.getURL());
@@ -98,11 +95,11 @@ public final class AnnouncementsPatch {
LocalDateTime archivedAt = LocalDateTime.MAX;
Level level = Level.INFO;
try {
final var announcement = new JSONObject(jsonString);
final var announcement = new JSONArray(jsonString).getJSONObject(0);
id = announcement.getInt("id");
title = announcement.getString("title");
message = announcement.getJSONObject("content").getString("message");
message = announcement.getString("content");
if (!announcement.isNull("archived_at")) {
archivedAt = LocalDateTime.parse(announcement.getString("archived_at"));
}

View File

@@ -9,9 +9,9 @@ import java.net.HttpURLConnection;
import static app.revanced.extension.youtube.requests.Route.Method.GET;
public class AnnouncementsRoutes {
public static final Route GET_LATEST_ANNOUNCEMENTS = new Route(GET, "/announcements/latest?tag=youtube");
public static final Route GET_LATEST_ANNOUNCEMENT_IDS = new Route(GET, "/announcements/latest/id?tag=youtube");
private static final String ANNOUNCEMENTS_PROVIDER = "https://api.revanced.app/v4";
public static final Route GET_LATEST_ANNOUNCEMENT_IDS = new Route(GET, "/announcements/latest/id?tag=youtube");
public static final Route GET_LATEST_ANNOUNCEMENTS = new Route(GET, "/announcements/latest?tag=youtube");
private AnnouncementsRoutes() {
}

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.0.0-dev.2
version = 5.0.0-dev.3

View File

@@ -3,6 +3,7 @@ package app.revanced.patches.youtube.misc.dns
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.all.misc.resources.addResources
import app.revanced.patches.all.misc.resources.addResourcesPatch
import app.revanced.patches.youtube.shared.mainActivityOnCreateFingerprint
private const val EXTENSION_CLASS_DESCRIPTOR =
@@ -13,6 +14,8 @@ val checkWatchHistoryDomainNameResolutionPatch = bytecodePatch(
name = "Check watch history domain name resolution",
description = "Checks if the device DNS server is preventing user watch history from being saved.",
) {
dependsOn(addResourcesPatch)
compatibleWith(
"com.google.android.youtube"(
"18.38.44",