chore: Lint code

This commit is contained in:
inotia00 2024-12-08 15:46:41 +09:00
parent ac72748834
commit da10e62286
4 changed files with 10 additions and 5 deletions

View File

@ -20,6 +20,8 @@ import app.revanced.extension.youtube.utils.VideoUtils;
@SuppressWarnings("unused")
public class CustomPlaybackSpeedPatch {
private static final float PLAYBACK_SPEED_AUTO = Settings.DEFAULT_PLAYBACK_SPEED.defaultValue;
/**
* Maximum playback speed, exclusive value. Custom speeds must be less than this value.
* <p>
@ -27,7 +29,7 @@ public class CustomPlaybackSpeedPatch {
* and the UI selector starts flickering and acting weird.
* Over 10x and the speeds show up out of order in the UI selector.
*/
public static final float MAXIMUM_PLAYBACK_SPEED = 8;
public static final float PLAYBACK_SPEED_MAXIMUM = 8;
private static final String[] defaultSpeedEntries;
private static final String[] defaultSpeedEntryValues;
/**
@ -128,8 +130,8 @@ public class CustomPlaybackSpeedPatch {
throw new IllegalArgumentException();
}
if (speedFloat > MAXIMUM_PLAYBACK_SPEED) {
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", MAXIMUM_PLAYBACK_SPEED));
if (speedFloat > PLAYBACK_SPEED_MAXIMUM) {
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", PLAYBACK_SPEED_MAXIMUM));
loadCustomSpeeds();
return;
}

View File

@ -84,7 +84,7 @@ public class PlaybackSpeedPatch {
// With the 0.05x menu, if the speed is set by integrations to higher than 2.0x
// then the menu will allow increasing without bounds but the max speed is
// still capped to under 8.0x.
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.MAXIMUM_PLAYBACK_SPEED - 0.05f);
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.PLAYBACK_SPEED_MAXIMUM - 0.05f);
// Prevent toast spamming if using the 0.05x adjustments.
// Show exactly one toast after the user stops interacting with the speed menu.

View File

@ -21,7 +21,9 @@ import app.revanced.util.findMethodOrThrow
private var defaultValue = "false"
private val spoofAppVersionBytecodePatch = bytecodePatch {
private val spoofAppVersionBytecodePatch = bytecodePatch(
description = "spoofAppVersionBytecodePatch"
) {
dependsOn(
baseSpoofAppVersionPatch("$GENERAL_CLASS_DESCRIPTOR->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;"),
versionCheckPatch,

View File

@ -405,6 +405,7 @@ val videoInformationPatch = bytecodePatch(
null,
ImmutableMethodImplementation(
4, """
# Check if the playback speed is not auto (-2.0f)
const/4 v0, 0x0
cmpg-float v0, v3, v0
if-lez v0, :ignore