Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into fix/yt-shorts-pip
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Oct 7, 2024
2 parents 4c46e19 + af45ab5 commit d0219aa
Show file tree
Hide file tree
Showing 14 changed files with 1,076 additions and 1,530 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/open_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pr_body: |
This pull request will ${{ env.MESSAGE }}.
## Dependencies before merge
## Before merging this PR
- [ ] https://github.com/revanced/revanced-patches
- [ ] Remember about https://github.com/revanced/revanced-patches
pr_draft: true
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
release:
name: Release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -49,5 +51,5 @@ jobs:

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec semantic-release
3 changes: 2 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"assets": [
"CHANGELOG.md",
"gradle.properties"
]
],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
Expand Down
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
# [1.16.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.16.0-dev.3...v1.16.0-dev.4) (2024-10-06)


### Bug Fixes

* **YouTube - Hide layout components:** Adjust settings text ([#713](https://github.com/ReVanced/revanced-integrations/issues/713)) ([119c416](https://github.com/ReVanced/revanced-integrations/commit/119c416bc5c24f2455bfe70adccd51234b165d25))

# [1.16.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.16.0-dev.2...v1.16.0-dev.3) (2024-10-06)


### Features

* **YouTube - Hide layout components:** Add option to hide Yoodles (YouTube Doodles) ([#712](https://github.com/ReVanced/revanced-integrations/issues/712)) ([4b5f3de](https://github.com/ReVanced/revanced-integrations/commit/4b5f3deef9c3a8c700e23a0f4d9ce999013ec9d4))

# [1.16.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.16.0-dev.1...v1.16.0-dev.2) (2024-10-03)


### Bug Fixes

* **YouTube - Spoof video streams:** Handle app left open for a long time ([#709](https://github.com/ReVanced/revanced-integrations/issues/709)) ([ea4b073](https://github.com/ReVanced/revanced-integrations/commit/ea4b073f5c21b0fea4e3922488e8bbf69cfcb421))

# [1.16.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.15.1-dev.1...v1.16.0-dev.1) (2024-10-02)


### Features

* **YouTube - Hide Shorts components:** Add option to hide like fountain ([#708](https://github.com/ReVanced/revanced-integrations/issues/708)) ([16c3ef7](https://github.com/ReVanced/revanced-integrations/commit/16c3ef7ee5a32ec22db6da876dcf19fc02bc9aac))

## [1.15.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.15.0...v1.15.1-dev.1) (2024-10-01)

# [1.15.0](https://github.com/ReVanced/revanced-integrations/compare/v1.14.2...v1.15.0) (2024-09-30)


### Bug Fixes

* **YouTube - Check watch history domain name resolution:** Do not show warning if network connection is flaky ([#702](https://github.com/ReVanced/revanced-integrations/issues/702)) ([80482df](https://github.com/ReVanced/revanced-integrations/commit/80482df3fae05cd5bd9e3b430022f07cf118565c))
* **YouTube:** Show video chapter titles without clipping when overlay buttons are enabled ([#699](https://github.com/ReVanced/revanced-integrations/issues/699)) ([325cc17](https://github.com/ReVanced/revanced-integrations/commit/325cc179001bb79366f4ed6a5f84f717fbff66b6))


### Features

* **YouTube - Disable precise seeking gesture:** Hide "pull up" label that shows up when swiping ([#696](https://github.com/ReVanced/revanced-integrations/issues/696)) ([0b9afd0](https://github.com/ReVanced/revanced-integrations/commit/0b9afd022dbf622478bb931124ac41a969610c64))
* **YouTube - Hide Shorts components:** Add `Hide save music`, `Hide stickers` ([#703](https://github.com/ReVanced/revanced-integrations/issues/703)) ([a87456e](https://github.com/ReVanced/revanced-integrations/commit/a87456e49995e2ed5f4788e71db8f2387bc241f9))

# [1.15.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.15.0-dev.1...v1.15.0-dev.2) (2024-09-29)


### Features

* **YouTube - Hide Shorts components:** Add `Hide save music`, `Hide stickers` ([#703](https://github.com/ReVanced/revanced-integrations/issues/703)) ([a87456e](https://github.com/ReVanced/revanced-integrations/commit/a87456e49995e2ed5f4788e71db8f2387bc241f9))

# [1.15.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.14.3-dev.2...v1.15.0-dev.1) (2024-09-29)


### Features

* **YouTube - Disable precise seeking gesture:** Hide "pull up" label that shows up when swiping ([#696](https://github.com/ReVanced/revanced-integrations/issues/696)) ([0b9afd0](https://github.com/ReVanced/revanced-integrations/commit/0b9afd022dbf622478bb931124ac41a969610c64))

## [1.14.3-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.14.3-dev.1...v1.14.3-dev.2) (2024-09-26)


### Bug Fixes

* **YouTube - Check watch history domain name resolution:** Do not show warning if network connection is flaky ([#702](https://github.com/ReVanced/revanced-integrations/issues/702)) ([80482df](https://github.com/ReVanced/revanced-integrations/commit/80482df3fae05cd5bd9e3b430022f07cf118565c))

## [1.14.3-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.14.2...v1.14.3-dev.1) (2024-09-23)


Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/app/revanced/integrations/shared/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,10 @@ public static boolean containsNumber(@NonNull CharSequence text) {
}

/**
* Ignore this class. It must be public to satisfy Android requirement.
* Ignore this class. It must be public to satisfy Android requirements.
*/
@SuppressWarnings("deprecation")
public static class DialogFragmentWrapper extends DialogFragment {
public static final class DialogFragmentWrapper extends DialogFragment {

private Dialog dialog;
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class CheckWatchHistoryDomainNameResolutionPatch {
private static final String SINKHOLE_IPV4 = "0.0.0.0";
private static final String SINKHOLE_IPV6 = "::";

/** @noinspection SameParameterValue */
private static boolean domainResolvesToValidIP(String host) {
try {
InetAddress address = InetAddress.getByName(host);
Expand Down Expand Up @@ -50,7 +49,16 @@ public static void checkDnsResolver(Activity context) {

Utils.runOnBackgroundThread(() -> {
try {
if (domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)) {
// If the user has a flaky DNS server, or they just lost internet connectivity
// and the isNetworkConnected() check has not detected it yet (it can take a few
// seconds after losing connection), then the history tracking endpoint will
// show a resolving error but it's actually an internet connection problem.
//
// Prevent this false positive by verify youtube.com resolves.
// If youtube.com does not resolve, then it's not a watch history domain resolving error
// because the entire app will not work since no domains are resolving.
if (domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)
|| !domainResolvesToValidIP("youtube.com")) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
package app.revanced.integrations.youtube.patches;

import android.view.MotionEvent;
import android.view.VelocityTracker;

import app.revanced.integrations.youtube.settings.Settings;

@SuppressWarnings("unused")
public final class DisablePreciseSeekingGesturePatch {
/**
* Disables the gesture that is used to seek precisely.
* @param tracker The velocity tracker that is used to determine the gesture.
* @param event The motion event that is used to determine the gesture.
*/
public static void disableGesture(VelocityTracker tracker, MotionEvent event) {
if (Settings.DISABLE_PRECISE_SEEKING_GESTURE.get()) return;

tracker.addMovement(event);
public static boolean isGestureDisabled() {
return Settings.DISABLE_PRECISE_SEEKING_GESTURE.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static app.revanced.integrations.youtube.shared.NavigationBar.NavigationButton;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;

Expand Down Expand Up @@ -380,6 +381,21 @@ public static boolean showWatermark() {
return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get();
}


private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get();

/**
* Injection point.
*/
@Nullable
public static Drawable hideYoodles(Drawable animatedYoodle) {
if (HIDE_DOODLES_ENABLED) {
return null;
}

return animatedYoodle;
}

private static final boolean HIDE_SHOW_MORE_BUTTON_ENABLED = Settings.HIDE_SHOW_MORE_BUTTON.get();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public final class ShortsFilter extends Filter {
private final StringFilterGroup shelfHeader;

private final StringFilterGroup suggestedAction;
private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList();
private final ByteArrayFilterGroupList suggestedActionsGroupList = new ByteArrayFilterGroupList();

private final StringFilterGroup actionBar;
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList();
Expand Down Expand Up @@ -112,6 +112,16 @@ public ShortsFilter() {
"shorts_info_panel_overview"
);

StringFilterGroup stickers = new StringFilterGroup(
Settings.HIDE_SHORTS_STICKERS,
"stickers_layer.eml"
);

StringFilterGroup likeFountain = new StringFilterGroup(
Settings.HIDE_SHORTS_LIKE_FOUNTAIN,
"like_fountain.eml"
);

joinButton = new StringFilterGroup(
Settings.HIDE_SHORTS_JOIN_BUTTON,
"sponsor_button"
Expand Down Expand Up @@ -140,7 +150,7 @@ public ShortsFilter() {
addPathCallbacks(
shortsCompactFeedVideoPath, suggestedAction, actionBar, joinButton, subscribeButton,
paidPromotionButton, pausedOverlayButtons, channelBar, fullVideoLinkLabel, videoTitle,
reelSoundMetadata, soundButton, infoPanel
reelSoundMetadata, soundButton, infoPanel, stickers, likeFountain
);

//
Expand Down Expand Up @@ -193,7 +203,13 @@ public ShortsFilter() {
),
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SAVE_SOUND_BUTTON,
"yt_outline_list_add_"
"yt_outline_bookmark_",
// 'Save sound' button. It seems this has been removed and only 'Save music' is used.
// Still hide this in case it's still present.
"yt_outline_list_add_",
// 'Use this sound' button. It seems this has been removed and only 'Save music' is used.
// Still hide this in case it's still present.
"yt_outline_camera_"
),
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SEARCH_SUGGESTIONS,
Expand All @@ -202,10 +218,6 @@ public ShortsFilter() {
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SUPER_THANKS_BUTTON,
"yt_outline_dollar_sign_heart_"
),
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_USE_THIS_SOUND_BUTTON,
"yt_outline_camera_"
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public class StreamingDataRequest {
}
}

private static final String[] REQUEST_HEADER_KEYS = {
"Authorization", // Available only to logged in users.
"X-GOOG-API-FORMAT-VERSION",
"X-Goog-Visitor-Id"
};

/**
* TCP connection and HTTP read timeout.
*/
Expand Down Expand Up @@ -112,10 +118,12 @@ private static HttpURLConnection send(ClientType clientType, String videoId,
connection.setConnectTimeout(HTTP_TIMEOUT_MILLISECONDS);
connection.setReadTimeout(HTTP_TIMEOUT_MILLISECONDS);

String authHeader = playerHeaders.get("Authorization");
String visitorId = playerHeaders.get("X-Goog-Visitor-Id");
connection.setRequestProperty("Authorization", authHeader);
connection.setRequestProperty("X-Goog-Visitor-Id", visitorId);
for (String key : REQUEST_HEADER_KEYS) {
String value = playerHeaders.get(key);
if (value != null) {
connection.setRequestProperty(key, value);
}
}

String innerTubeBody = String.format(PlayerRoutes.createInnertubeBody(clientType), videoId);
byte[] requestBody = innerTubeBody.getBytes(StandardCharsets.UTF_8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_ALBUM_CARDS = new BooleanSetting("revanced_hide_album_cards", FALSE, true);
public static final BooleanSetting HIDE_ARTIST_CARDS = new BooleanSetting("revanced_hide_artist_cards", FALSE);
public static final BooleanSetting HIDE_EXPANDABLE_CHIP = new BooleanSetting("revanced_hide_expandable_chip", TRUE);
public static final BooleanSetting HIDE_DOODLES = new BooleanSetting("revanced_hide_doodles", FALSE, true, "revanced_hide_doodles_user_dialog_message");

// Alternative thumbnails
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);
Expand Down Expand Up @@ -220,11 +221,11 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_SHORTS_SHOP_BUTTON = new BooleanSetting("revanced_hide_shorts_shop_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_shorts_tagged_products", TRUE);
public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);
// Save sound to playlist and Search suggestions may have been A/B tests that were abandoned by YT, and it's not clear if these are still used.
public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_USE_THIS_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_use_this_sound_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", FALSE);
public static final BooleanSetting HIDE_SHORTS_STICKERS = new BooleanSetting("revanced_hide_shorts_stickers", TRUE);
public static final BooleanSetting HIDE_SHORTS_SUPER_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_super_thanks_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
android.useAndroidX = true
version = 1.14.3-dev.1
version = 1.16.0-dev.4
Loading

0 comments on commit d0219aa

Please sign in to comment.