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 committed Dec 16, 2024
1 parent e809024 commit 4ed7b68
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 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 @@ -1903,9 +1903,7 @@ Tap on the continue button and disable battery optimizations."</string>
<string name="revanced_spoof_streaming_data_type_entry_android_unplugged">Android TV</string>
<string name="revanced_spoof_streaming_data_type_entry_android_vr">Android VR</string>
<string name="revanced_spoof_streaming_data_side_effects_title">Spoofing side effects</string>
<string name="revanced_spoof_streaming_data_side_effects_ios">"• Livestreams start from the beginning.
• Videos may end 1 second early."</string>
<string name="revanced_spoof_streaming_data_side_effects_ios_skip_livestream_playback">• Videos may end 1 second early.</string>
<string name="revanced_spoof_streaming_data_side_effects_ios">• Videos may end 1 second early.</string>
<string name="revanced_spoof_streaming_data_side_effects_android_unplugged">"• Audio track menu is missing.
• Stable volume is not available."</string>
<string name="revanced_spoof_streaming_data_side_effects_android_vr">"• Audio track menu is missing.
Expand Down

0 comments on commit 4ed7b68

Please sign in to comment.