Skip to content

Commit

Permalink
fix(YouTube - Spoof streaming data): On iOS clients, livestreams al…
Browse files Browse the repository at this point in the history
…ways start from the beginning
  • Loading branch information
inotia00 authored and anddea committed Dec 17, 2024
1 parent a58ed6b commit 4e60bf5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ public static boolean isSpoofingEnabled() {
return SPOOF_STREAMING_DATA;
}

/**
* Injection point.
*/
public static boolean fixHLSCurrentTime(boolean original) {
if (!SPOOF_STREAMING_DATA) {
return original;
}
return false;
}

/**
* Injection point.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ protected void onPrepareForRemoval() {

private void updateUI() {
final ClientType clientType = Settings.SPOOF_STREAMING_DATA_TYPE.get();

final String summaryTextKey;
if (clientType == ClientType.IOS && Settings.SPOOF_STREAMING_DATA_IOS_SKIP_LIVESTREAM_PLAYBACK.get()) {
summaryTextKey = "revanced_spoof_streaming_data_side_effects_ios_skip_livestream_playback";
} else {
summaryTextKey = "revanced_spoof_streaming_data_side_effects_" + clientType.name().toLowerCase();
}
final String summaryTextKey = "revanced_spoof_streaming_data_side_effects_" + clientType.name().toLowerCase();

setSummary(str(summaryTextKey));
setEnabled(Settings.SPOOF_STREAMING_DATA.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.extension.Constants.SPOOF_PATH
import app.revanced.util.findInstructionIndicesReversedOrThrow
import app.revanced.util.fingerprint.definingClassOrThrow
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
import app.revanced.util.fingerprint.matchOrThrow
import app.revanced.util.fingerprint.methodOrThrow
import app.revanced.util.getReference
Expand Down Expand Up @@ -209,6 +210,15 @@ fun baseSpoofStreamingDataPatch(

// endregion

// region Fix iOS livestream current time.

hlsCurrentTimeFingerprint.injectLiteralInstructionBooleanCall(
HLS_CURRENT_TIME_FEATURE_FLAG,
"$EXTENSION_CLASS_DESCRIPTOR->fixHLSCurrentTime(Z)Z"
)

// endregion

executeBlock()

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,12 @@ internal val protobufClassParseByteBufferFingerprint = legacyFingerprint(
),
customFingerprint = { method, _ -> method.name == "parseFrom" },
)

internal const val HLS_CURRENT_TIME_FEATURE_FLAG = 45355374L

internal val hlsCurrentTimeFingerprint = legacyFingerprint(
name = "hlsCurrentTimeFingerprint",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Z", "L"),
literals = listOf(HLS_CURRENT_TIME_FEATURE_FLAG),
)

0 comments on commit 4e60bf5

Please sign in to comment.