mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-29 22:24:31 +02:00
fix(YouTube Music - Spoof client): Some users have a playback issue even if Spoof client
is turned on (A/B testing)
This commit is contained in:
parent
1f10fdbccd
commit
2f80fc9623
@ -131,4 +131,16 @@ public class SpoofClientPatch extends BlockRequestPatch {
|
|||||||
}
|
}
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Injection point.
|
||||||
|
* <p>
|
||||||
|
* Return false to force disable playback feature flag.
|
||||||
|
*/
|
||||||
|
public static boolean forceDisablePlaybackFeatureFlag(boolean original) {
|
||||||
|
if (SPOOF_CLIENT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return original;
|
||||||
|
}
|
||||||
}
|
}
|
@ -39,4 +39,20 @@ internal val userAgentHeaderBuilderFingerprint = legacyFingerprint(
|
|||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
parameters = listOf("Landroid/content/Context;"),
|
parameters = listOf("Landroid/content/Context;"),
|
||||||
strings = listOf("(Linux; U; Android "),
|
strings = listOf("(Linux; U; Android "),
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this flag is activated, a playback issue occurs.
|
||||||
|
* (Regardless of the 'Spoof client')
|
||||||
|
*
|
||||||
|
* Added in YouTube Music 7.33+
|
||||||
|
*/
|
||||||
|
internal const val PLAYBACK_FEATURE_FLAG = 45665455L
|
||||||
|
|
||||||
|
internal val playbackFeatureFlagFingerprint = legacyFingerprint(
|
||||||
|
name = "playbackFeatureFlagFingerprint",
|
||||||
|
returnType = "Z",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = emptyList(),
|
||||||
|
literals = listOf(PLAYBACK_FEATURE_FLAG),
|
||||||
)
|
)
|
@ -13,6 +13,8 @@ import app.revanced.patches.music.utils.extension.Constants.VIDEO_PATH
|
|||||||
import app.revanced.patches.music.utils.patch.PatchList.SPOOF_CLIENT
|
import app.revanced.patches.music.utils.patch.PatchList.SPOOF_CLIENT
|
||||||
import app.revanced.patches.music.utils.playbackRateBottomSheetClassFingerprint
|
import app.revanced.patches.music.utils.playbackRateBottomSheetClassFingerprint
|
||||||
import app.revanced.patches.music.utils.playbackSpeedBottomSheetFingerprint
|
import app.revanced.patches.music.utils.playbackSpeedBottomSheetFingerprint
|
||||||
|
import app.revanced.patches.music.utils.playservice.is_7_33_or_greater
|
||||||
|
import app.revanced.patches.music.utils.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.music.utils.resourceid.sharedResourceIdPatch
|
import app.revanced.patches.music.utils.resourceid.sharedResourceIdPatch
|
||||||
import app.revanced.patches.music.utils.resourceid.varispeedUnavailableTitle
|
import app.revanced.patches.music.utils.resourceid.varispeedUnavailableTitle
|
||||||
import app.revanced.patches.music.utils.settings.CategoryType
|
import app.revanced.patches.music.utils.settings.CategoryType
|
||||||
@ -30,6 +32,7 @@ import app.revanced.patches.shared.indexOfManufacturerInstruction
|
|||||||
import app.revanced.patches.shared.indexOfModelInstruction
|
import app.revanced.patches.shared.indexOfModelInstruction
|
||||||
import app.revanced.patches.shared.indexOfReleaseInstruction
|
import app.revanced.patches.shared.indexOfReleaseInstruction
|
||||||
import app.revanced.util.findMethodOrThrow
|
import app.revanced.util.findMethodOrThrow
|
||||||
|
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
|
||||||
import app.revanced.util.fingerprint.matchOrThrow
|
import app.revanced.util.fingerprint.matchOrThrow
|
||||||
import app.revanced.util.fingerprint.methodOrThrow
|
import app.revanced.util.fingerprint.methodOrThrow
|
||||||
import app.revanced.util.fingerprint.mutableClassOrThrow
|
import app.revanced.util.fingerprint.mutableClassOrThrow
|
||||||
@ -69,6 +72,7 @@ val spoofClientPatch = bytecodePatch(
|
|||||||
settingsPatch,
|
settingsPatch,
|
||||||
sharedResourceIdPatch,
|
sharedResourceIdPatch,
|
||||||
blockRequestPatch,
|
blockRequestPatch,
|
||||||
|
versionCheckPatch,
|
||||||
customPlaybackSpeedPatch(
|
customPlaybackSpeedPatch(
|
||||||
"$VIDEO_PATH/CustomPlaybackSpeedPatch;",
|
"$VIDEO_PATH/CustomPlaybackSpeedPatch;",
|
||||||
5.0f
|
5.0f
|
||||||
@ -334,6 +338,17 @@ val spoofClientPatch = bytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region fix for feature flags
|
||||||
|
|
||||||
|
if (is_7_33_or_greater) {
|
||||||
|
playbackFeatureFlagFingerprint.injectLiteralInstructionBooleanCall(
|
||||||
|
PLAYBACK_FEATURE_FLAG,
|
||||||
|
"$EXTENSION_CLASS_DESCRIPTOR->forceDisablePlaybackFeatureFlag(Z)Z"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
findMethodOrThrow("$PATCHES_PATH/PatchStatus;") {
|
findMethodOrThrow("$PATCHES_PATH/PatchStatus;") {
|
||||||
name == "SpoofClient"
|
name == "SpoofClient"
|
||||||
}.replaceInstruction(
|
}.replaceInstruction(
|
||||||
|
@ -33,6 +33,8 @@ var is_7_27_or_greater = false
|
|||||||
private set
|
private set
|
||||||
var is_7_29_or_greater = false
|
var is_7_29_or_greater = false
|
||||||
private set
|
private set
|
||||||
|
var is_7_33_or_greater = false
|
||||||
|
private set
|
||||||
var is_8_03_or_greater = false
|
var is_8_03_or_greater = false
|
||||||
private set
|
private set
|
||||||
|
|
||||||
@ -64,6 +66,7 @@ val versionCheckPatch = resourcePatch(
|
|||||||
is_7_25_or_greater = 244399000 <= playStoreServicesVersion
|
is_7_25_or_greater = 244399000 <= playStoreServicesVersion
|
||||||
is_7_27_or_greater = 244515000 <= playStoreServicesVersion
|
is_7_27_or_greater = 244515000 <= playStoreServicesVersion
|
||||||
is_7_29_or_greater = 244799000 <= playStoreServicesVersion
|
is_7_29_or_greater = 244799000 <= playStoreServicesVersion
|
||||||
|
is_7_33_or_greater = 245199000 <= playStoreServicesVersion
|
||||||
is_8_03_or_greater = 250399000 <= playStoreServicesVersion
|
is_8_03_or_greater = 250399000 <= playStoreServicesVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user