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 localization
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Nov 13, 2023
2 parents 46da1a5 + 130f629 commit d8bad80
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 20 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# [0.122.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v0.121.1-dev.4...v0.122.0-dev.1) (2023-11-12)


### Bug Fixes

* **YouTube - Disable suggested video end screen:** Properly hide it every time the screen appears ([828ff6f](https://github.com/ReVanced/revanced-integrations/commit/828ff6f31e2f15bf50899ab1e403bdc40cc09d07))
* **YouTube - Hide layout components:** Reduce false positives when hiding mix playlists ([5f30100](https://github.com/ReVanced/revanced-integrations/commit/5f30100fd59c1e61c0236bc54cfcd03212994cab))


### Features

* **YouTube:** Add `Enable slide to seek` patch ([b1ce7a7](https://github.com/ReVanced/revanced-integrations/commit/b1ce7a75eba53312d9522c87321ac83cb16d83cf))
* **YouTube:** Add `Remove tracking query parameter` patch ([e84b7b3](https://github.com/ReVanced/revanced-integrations/commit/e84b7b328ea48e86d240d38cf83aa960f87d6902))


### Performance Improvements

* **YouTube - Client spoof:** Reduce timeout to fetch storyboard renderer ([847cce4](https://github.com/ReVanced/revanced-integrations/commit/847cce43f6436c592c680820960f5270f799cb8d))

## [0.121.1-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v0.121.1-dev.3...v0.121.1-dev.4) (2023-11-11)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ public static void closeEndScreen(final ImageView imageView) {
if (lastView == parent) return;

lastView = (ViewGroup)parent;
lastView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop,
int oldRight, int oldBottom) {
// Disable sound effects to prevent the click sound.
imageView.setSoundEffectsEnabled(false);
imageView.performClick();

// Remove the listener to prevent it from being called multiple times.
lastView.removeOnLayoutChangeListener(this);
}
lastView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
// Disable sound effects to prevent the click sound.
imageView.setSoundEffectsEnabled(false);
imageView.performClick();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package app.revanced.integrations.patches;

import app.revanced.integrations.settings.SettingsEnum;

public final class RemoveTrackingQueryParameterPatch {
private static final String NEW_TRACKING_PARAMETER_REGEX = ".si=.+";
private static final String OLD_TRACKING_PARAMETER_REGEX = ".feature=.+";

public static String sanitize(String url) {
if (!SettingsEnum.REMOVE_TRACKING_QUERY_PARAMETER.getBoolean()) return url;

return url
.replaceAll(NEW_TRACKING_PARAMETER_REGEX, "")
.replaceAll(OLD_TRACKING_PARAMETER_REGEX, "");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package app.revanced.integrations.patches;

import app.revanced.integrations.settings.SettingsEnum;

public final class SlideToSeekPatch {
public static boolean isSlideToSeekDisabled() {
return !SettingsEnum.SLIDE_TO_SEEK.getBoolean();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@


import android.os.Build;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.StringTrieSearch;

@RequiresApi(api = Build.VERSION_CODES.N)
public final class LayoutComponentsFilter extends Filter {
private final StringTrieSearch exceptions = new StringTrieSearch();
private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch();
private static ByteArrayAsStringFilterGroup mixPlaylistsExceptions2;

private final CustomFilterGroup custom;

private static final ByteArrayAsStringFilterGroup mixPlaylists = new ByteArrayAsStringFilterGroup(
Expand All @@ -34,6 +35,16 @@ public LayoutComponentsFilter() {
"library_recent_shelf"
);

mixPlaylistsExceptions.addPatterns(
"V.ED", // Playlist browse id.
"java.lang.ref.WeakReference"
);

mixPlaylistsExceptions2 = new ByteArrayAsStringFilterGroup(
null,
"cell_description_body"
);

custom = new CustomFilterGroup(
SettingsEnum.CUSTOM_FILTER,
SettingsEnum.CUSTOM_FILTER_STRINGS
Expand Down Expand Up @@ -243,13 +254,19 @@ public boolean isFiltered(@Nullable String identifier, String path, byte[] proto
* Injection point.
* Called from a different place then the other filters.
*/
public static boolean filterMixPlaylists(final byte[] bytes) {
final boolean isMixPlaylistFiltered = mixPlaylists.check(bytes).isFiltered();
public static boolean filterMixPlaylists(final Object conversionContext, final byte[] bytes) {
// Prevent playlist items being hidden, if a mix playlist is present in it.
if (mixPlaylistsExceptions.matches(conversionContext.toString()))
return false;

if (!mixPlaylists.check(bytes).isFiltered()) return false;

// Prevent hiding the description of some videos accidentally.
if (mixPlaylistsExceptions2.check(bytes).isFiltered()) return false;

if (isMixPlaylistFiltered)
LogHelper.printDebug(() -> "Filtered mix playlist");
LogHelper.printDebug(() -> "Filtered mix playlist");
return true;

return isMixPlaylistFiltered;
}

public static boolean showWatermark() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class SpoofSignaturePatch {
private static StoryboardRenderer getRenderer() {
if (rendererFuture != null) {
try {
return rendererFuture.get(4000, TimeUnit.MILLISECONDS);
return rendererFuture.get(2000, TimeUnit.MILLISECONDS);
} catch (TimeoutException ex) {
LogHelper.printDebug(() -> "Could not get renderer (get timed out)");
} catch (ExecutionException | InterruptedException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public enum SettingsEnum {
EXTERNAL_BROWSER("revanced_external_browser", BOOLEAN, TRUE, true),
AUTO_REPEAT("revanced_auto_repeat", BOOLEAN, FALSE),
SEEKBAR_TAPPING("revanced_seekbar_tapping", BOOLEAN, TRUE),
SLIDE_TO_SEEK("revanced_slide_to_seek", BOOLEAN, FALSE),
@Deprecated DISABLE_FINE_SCRUBBING_GESTURE("revanced_disable_fine_scrubbing_gesture", BOOLEAN, TRUE),
DISABLE_PRECISE_SEEKING_GESTURE("revanced_disable_precise_seeking_gesture", BOOLEAN, TRUE),
SPOOF_SIGNATURE("revanced_spoof_signature_verification_enabled", BOOLEAN, TRUE, true,
Expand All @@ -190,6 +191,7 @@ public enum SettingsEnum {
ANNOUNCEMENTS("revanced_announcements", BOOLEAN, TRUE),
ANNOUNCEMENT_CONSUMER("revanced_announcement_consumer", STRING, ""),
ANNOUNCEMENT_LAST_HASH("revanced_announcement_last_hash", STRING, ""),
REMOVE_TRACKING_QUERY_PARAMETER("revanced_remove_tracking_query_parameter", BOOLEAN, TRUE),

// Swipe controls
SWIPE_BRIGHTNESS("revanced_swipe_brightness", BOOLEAN, TRUE),
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 = 0.121.1-dev.4
version = 0.122.0-dev.1

0 comments on commit d8bad80

Please sign in to comment.