chore: Merge branch dev to main (#526)

This commit is contained in:
oSumAtrIX 2023-11-27 20:07:15 +01:00 committed by GitHub
commit d6ed0c061c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 22 deletions

View File

@ -1,3 +1,24 @@
## [0.124.1-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v0.124.1-dev.2...v0.124.1-dev.3) (2023-11-27)
### Bug Fixes
* **YouTube - Hide layout components:** Prevent app from crashing on startup ([c2112e0](https://github.com/ReVanced/revanced-integrations/commit/c2112e066af31890c5d441870d24f3582e9b1dd1))
## [0.124.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v0.124.1-dev.1...v0.124.1-dev.2) (2023-11-26)
### Bug Fixes
* **YouTube - Return YouTube dislike:** Fix layout of right to left languages ([11abdf1](https://github.com/ReVanced/revanced-integrations/commit/11abdf162f1a4c82a2330b16ca42800d8599c215))
## [0.124.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v0.124.0...v0.124.1-dev.1) (2023-11-25)
### Bug Fixes
* **YouTube - Spoof signature:** fix error toast when viewing very old YouTube videos ([#525](https://github.com/ReVanced/revanced-integrations/issues/525)) ([eede028](https://github.com/ReVanced/revanced-integrations/commit/eede028c96042e6abc18377bf16a75e4806aba4a))
# [0.124.0](https://github.com/ReVanced/revanced-integrations/compare/v0.123.0...v0.124.0) (2023-11-23)

View File

@ -335,9 +335,13 @@ public class ReturnYouTubeDislikePatch {
// YouTube Rolling Numbers do not use compound drawables or drawable padding.
if (view.getCompoundDrawablePadding() == 0) {
LogHelper.printDebug(() -> "Adding rolling number TextView changes");
ShapeDrawable leftSeparator = ReturnYouTubeDislike.getLeftSeparatorDrawable();
view.setCompoundDrawables(leftSeparator, null, null, null);
view.setCompoundDrawablePadding(ReturnYouTubeDislike.leftSeparatorShapePaddingPixels);
ShapeDrawable separator = ReturnYouTubeDislike.getLeftSeparatorDrawable();
if (ReVancedUtils.isRightToLeftTextLayout()) {
view.setCompoundDrawables(null, null, separator, null);
} else {
view.setCompoundDrawables(separator, null, null, null);
}
}
}

View File

@ -12,8 +12,10 @@ import app.revanced.integrations.utils.StringTrieSearch;
public final class LayoutComponentsFilter extends Filter {
private final StringTrieSearch exceptions = new StringTrieSearch();
private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch();
private static ByteArrayAsStringFilterGroup mixPlaylistsExceptions2;
private static final ByteArrayAsStringFilterGroup mixPlaylistsExceptions2 = new ByteArrayAsStringFilterGroup(
null,
"cell_description_body"
);
private final CustomFilterGroup custom;
private static final ByteArrayAsStringFilterGroup mixPlaylists = new ByteArrayAsStringFilterGroup(
@ -25,6 +27,13 @@ public final class LayoutComponentsFilter extends Filter {
private final StringFilterGroup notifyMe;
private final StringFilterGroup expandableMetadata;
static {
mixPlaylistsExceptions.addPatterns(
"V.ED", // Playlist browse id.
"java.lang.ref.WeakReference"
);
}
@RequiresApi(api = Build.VERSION_CODES.N)
public LayoutComponentsFilter() {
exceptions.addPatterns(
@ -35,16 +44,6 @@ public final class LayoutComponentsFilter extends Filter {
"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
@ -263,14 +262,15 @@ public final class LayoutComponentsFilter extends Filter {
if (mixPlaylistsExceptions.matches(conversionContext.toString()))
return false;
if (!mixPlaylists.check(bytes).isFiltered()) 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 (mixPlaylistsExceptions2.check(bytes).isFiltered())
return false;
LogHelper.printDebug(() -> "Filtered mix playlist");
return true;
}
public static boolean showWatermark() {

View File

@ -169,7 +169,17 @@ public class SpoofSignaturePatch {
* if {@link SettingsEnum#SPOOF_STORYBOARD_RENDERER} is not enabled.
*/
public static boolean getSeekbarThumbnailOverrideValue() {
return SettingsEnum.SPOOF_SIGNATURE.getBoolean();
if (!SettingsEnum.SPOOF_SIGNATURE.getBoolean()) {
return false;
}
StoryboardRenderer renderer = videoRenderer;
if (renderer == null) {
// Spoof storyboard renderer is turned off,
// video is paid, or the storyboard fetch timed out.
// Show empty thumbnails so the seek time and chapters still show up.
return true;
}
return renderer.getSpec() != null;
}
/**

View File

@ -1,23 +1,23 @@
package app.revanced.integrations.patches.spoof;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
public final class StoryboardRenderer {
@Nullable
private final String spec;
private final boolean isLiveStream;
@Nullable
private final Integer recommendedLevel;
public StoryboardRenderer(String spec, boolean isLiveStream, @Nullable Integer recommendedLevel) {
public StoryboardRenderer(@Nullable String spec, boolean isLiveStream, @Nullable Integer recommendedLevel) {
this.spec = spec;
this.isLiveStream = isLiveStream;
this.recommendedLevel = recommendedLevel;
}
@NonNull
@Nullable
public String getSpec() {
return spec;
}

View File

@ -24,6 +24,14 @@ import app.revanced.integrations.utils.ReVancedUtils;
public class StoryboardRendererRequester {
/**
* For videos that have no storyboard.
* Usually for low resolution videos as old as YouTube itself.
* Does not include paid videos where the renderer fetch fails.
*/
private static final StoryboardRenderer emptyStoryboard
= new StoryboardRenderer(null, false, null);
private StoryboardRendererRequester() {
}
@ -105,6 +113,10 @@ public class StoryboardRendererRequester {
private static StoryboardRenderer getStoryboardRendererUsingResponse(@NonNull JSONObject playerResponse) {
try {
LogHelper.printDebug(() -> "Parsing response: " + playerResponse);
if (!playerResponse.has("storyboards")) {
LogHelper.printDebug(() -> "Using empty storyboard");
return emptyStoryboard;
}
final JSONObject storyboards = playerResponse.getJSONObject("storyboards");
final boolean isLiveStream = storyboards.has("playerLiveStoryboardSpecRenderer");
final String storyboardsRendererTag = isLiveStream

View File

@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
android.useAndroidX = true
version = 0.124.0
version = 0.124.1-dev.3