mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-29 14:14:36 +02:00
chore(YouTube): Reflecting the changes in ReVanced
This commit is contained in:
parent
05195caa5a
commit
1dd7eda606
@ -69,11 +69,21 @@ public class SpoofStreamingDataPatch extends BlockRequestPatch {
|
||||
* Skip response encryption in OnesiePlayerRequest.
|
||||
*/
|
||||
public static boolean skipResponseEncryption(boolean original) {
|
||||
if (SPOOF_STREAMING_DATA_SKIP_RESPONSE_ENCRYPTION) {
|
||||
return false;
|
||||
if (!SPOOF_STREAMING_DATA_SKIP_RESPONSE_ENCRYPTION) {
|
||||
return original;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return original;
|
||||
/**
|
||||
* Injection point.
|
||||
* Turns off a feature flag that interferes with video playback.
|
||||
*/
|
||||
public static boolean usePlaybackStartFeatureFlag(boolean original) {
|
||||
if (!SPOOF_STREAMING_DATA) {
|
||||
return original;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,7 +115,7 @@ public class ReturnYouTubeDislike {
|
||||
private static final Rect middleSeparatorBounds;
|
||||
|
||||
/**
|
||||
* Left separator horizontal padding for Rolling Number layout.
|
||||
* Horizontal padding between the left and middle separator.
|
||||
*/
|
||||
public static final int leftSeparatorShapePaddingPixels;
|
||||
private static final ShapeDrawable leftSeparatorShape;
|
||||
@ -131,7 +131,7 @@ public class ReturnYouTubeDislike {
|
||||
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 3.7f, dp);
|
||||
middleSeparatorBounds = new Rect(0, 0, middleSeparatorSize, middleSeparatorSize);
|
||||
|
||||
leftSeparatorShapePaddingPixels = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10.0f, dp);
|
||||
leftSeparatorShapePaddingPixels = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8.4f, dp);
|
||||
|
||||
leftSeparatorShape = new ShapeDrawable(new RectShape());
|
||||
leftSeparatorShape.setBounds(leftSeparatorBounds);
|
||||
|
@ -31,15 +31,20 @@ import app.revanced.extension.shared.utils.PackageUtils;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
public class ExtendedUtils extends PackageUtils {
|
||||
|
||||
private static boolean isVersionOrGreater(String version) {
|
||||
return getAppVersionName().compareTo(version) >= 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static final boolean IS_19_17_OR_GREATER = getAppVersionName().compareTo("19.17.00") >= 0;
|
||||
public static final boolean IS_19_20_OR_GREATER = getAppVersionName().compareTo("19.20.00") >= 0;
|
||||
public static final boolean IS_19_21_OR_GREATER = getAppVersionName().compareTo("19.21.00") >= 0;
|
||||
public static final boolean IS_19_26_OR_GREATER = getAppVersionName().compareTo("19.26.00") >= 0;
|
||||
public static final boolean IS_19_28_OR_GREATER = getAppVersionName().compareTo("19.28.00") >= 0;
|
||||
public static final boolean IS_19_29_OR_GREATER = getAppVersionName().compareTo("19.29.00") >= 0;
|
||||
public static final boolean IS_19_34_OR_GREATER = getAppVersionName().compareTo("19.34.00") >= 0;
|
||||
public static final boolean IS_20_09_OR_GREATER = getAppVersionName().compareTo("20.09.00") >= 0;
|
||||
public static final boolean IS_19_17_OR_GREATER = isVersionOrGreater("19.17.00");
|
||||
public static final boolean IS_19_20_OR_GREATER = isVersionOrGreater("19.20.00");
|
||||
public static final boolean IS_19_21_OR_GREATER = isVersionOrGreater("19.21.00");
|
||||
public static final boolean IS_19_26_OR_GREATER = isVersionOrGreater("19.26.00");
|
||||
public static final boolean IS_19_28_OR_GREATER = isVersionOrGreater("19.28.00");
|
||||
public static final boolean IS_19_29_OR_GREATER = isVersionOrGreater("19.29.00");
|
||||
public static final boolean IS_19_34_OR_GREATER = isVersionOrGreater("19.34.00");
|
||||
public static final boolean IS_20_09_OR_GREATER = isVersionOrGreater("20.09.00");
|
||||
|
||||
public static int validateValue(IntegerSetting settings, int min, int max, String message) {
|
||||
int value = settings.get();
|
||||
|
@ -153,3 +153,18 @@ internal val onesieEncryptionAlternativeFeatureFlagFingerprint = legacyFingerpri
|
||||
name = "onesieEncryptionAlternativeFeatureFlagFingerprint",
|
||||
literals = listOf(ONESIE_ENCRYPTION_ALTERNATIVE_FEATURE_FLAG),
|
||||
)
|
||||
|
||||
// Feature flag that enables different code for parsing and starting video playback,
|
||||
// but it's exact purpose is not known. If this flag is enabled while stream spoofing
|
||||
// then videos will never start playback and load forever.
|
||||
// Flag does not seem to affect playback if spoofing is off.
|
||||
// YouTube 19.50 ~
|
||||
internal const val PLAYBACK_START_CHECK_ENDPOINT_USED_FEATURE_FLAG = 45665455L
|
||||
|
||||
internal val playbackStartDescriptorFeatureFlagFingerprint = legacyFingerprint(
|
||||
name = "playbackStartDescriptorFeatureFlagFingerprint",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = emptyList(),
|
||||
returnType = ("Z"),
|
||||
literals = listOf(PLAYBACK_START_CHECK_ENDPOINT_USED_FEATURE_FLAG)
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PAC
|
||||
import app.revanced.patches.youtube.utils.compatibility.Constants.YOUTUBE_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.utils.patch.PatchList.SPOOF_STREAMING_DATA
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_34_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_50_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_20_10_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.utils.request.buildRequestPatch
|
||||
@ -345,11 +346,18 @@ val spoofStreamingDataPatch = bytecodePatch(
|
||||
"$EXTENSION_CLASS_DESCRIPTOR->skipResponseEncryption(Z)Z"
|
||||
)
|
||||
|
||||
if (is_20_10_or_greater) {
|
||||
onesieEncryptionAlternativeFeatureFlagFingerprint.injectLiteralInstructionBooleanCall(
|
||||
ONESIE_ENCRYPTION_ALTERNATIVE_FEATURE_FLAG,
|
||||
"$EXTENSION_CLASS_DESCRIPTOR->skipResponseEncryption(Z)Z"
|
||||
if (is_19_50_or_greater) {
|
||||
playbackStartDescriptorFeatureFlagFingerprint.injectLiteralInstructionBooleanCall(
|
||||
PLAYBACK_START_CHECK_ENDPOINT_USED_FEATURE_FLAG,
|
||||
"$EXTENSION_CLASS_DESCRIPTOR->usePlaybackStartFeatureFlag(Z)Z"
|
||||
)
|
||||
|
||||
if (is_20_10_or_greater) {
|
||||
onesieEncryptionAlternativeFeatureFlagFingerprint.injectLiteralInstructionBooleanCall(
|
||||
ONESIE_ENCRYPTION_ALTERNATIVE_FEATURE_FLAG,
|
||||
"$EXTENSION_CLASS_DESCRIPTOR->skipResponseEncryption(Z)Z"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
settingArray += "SETTINGS: SKIP_RESPONSE_ENCRYPTION"
|
||||
|
@ -61,6 +61,8 @@ var is_19_46_or_greater = false
|
||||
private set
|
||||
var is_19_49_or_greater = false
|
||||
private set
|
||||
var is_19_50_or_greater = false
|
||||
private set
|
||||
var is_20_02_or_greater = false
|
||||
private set
|
||||
var is_20_03_or_greater = false
|
||||
@ -116,6 +118,7 @@ val versionCheckPatch = resourcePatch(
|
||||
is_19_44_or_greater = 244505000 <= playStoreServicesVersion
|
||||
is_19_46_or_greater = 244705000 <= playStoreServicesVersion
|
||||
is_19_49_or_greater = 245005000 <= playStoreServicesVersion
|
||||
is_19_50_or_greater = 245105000 <= playStoreServicesVersion
|
||||
is_20_02_or_greater = 250299000 <= playStoreServicesVersion
|
||||
is_20_03_or_greater = 250405000 <= playStoreServicesVersion
|
||||
is_20_05_or_greater = 250605000 <= playStoreServicesVersion
|
||||
|
Loading…
x
Reference in New Issue
Block a user