feat(YouTube): Support version 19.45.38 (#3938)

This commit is contained in:
LisoUseInAIKyrios
2024-11-20 13:51:36 +04:00
committed by GitHub
parent 3691fe6189
commit 7c4e3fe97e
82 changed files with 96 additions and 77 deletions

View File

@ -1,7 +1,11 @@
package app.revanced.extension.shared.checks;
// Fields are set by the patch. Do not modify.
// Fields are not final, because the compiler is inlining them.
/**
* Fields are set by the patch. Do not modify.
* Fields are not final, because the compiler is inlining them.
*
* @noinspection CanBeFinal
*/
final class PatchInfo {
static long PATCH_TIME = 0L;

View File

@ -11,9 +11,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
public class ShowOnLockscreenPatch {
/**
* @noinspection deprecation
*/
public static Window getWindow(AppCompatActivity activity, float brightness) {
Window window = activity.getWindow();

View File

@ -147,6 +147,7 @@ public class ReturnYouTubeDislikeApi {
*/
private static void randomlyWaitIfLocallyDebugging() {
final boolean DEBUG_RANDOMLY_DELAY_NETWORK_CALLS = false; // set true to debug UI
//noinspection ConstantValue
if (DEBUG_RANDOMLY_DELAY_NETWORK_CALLS) {
final long amountOfTimeToWaste = (long) (Math.random()
* (API_GET_VOTES_TCP_TIMEOUT_MILLISECONDS + API_GET_VOTES_HTTP_TIMEOUT_MILLISECONDS));
@ -187,6 +188,7 @@ public class ReturnYouTubeDislikeApi {
*/
private static boolean checkIfRateLimitWasHit(int httpResponseCode) {
final boolean DEBUG_RATE_LIMIT = false; // set to true, to verify rate limit works
//noinspection ConstantValue
if (DEBUG_RATE_LIMIT) {
final double RANDOM_RATE_LIMIT_PERCENTAGE = 0.2; // 20% chance of a triggering a rate limit
if (Math.random() < RANDOM_RATE_LIMIT_PERCENTAGE) {

View File

@ -49,7 +49,7 @@ enum class PlayerType {
companion object {
private val nameToPlayerType = values().associateBy { it.name }
private val nameToPlayerType = PlayerType.entries.associateBy { it.name }
@JvmStatic
fun setFromString(enumName: String) {

View File

@ -22,7 +22,7 @@ enum class VideoState {
companion object {
private val nameToVideoState = values().associateBy { it.name }
private val nameToVideoState = VideoState.entries.associateBy { it.name }
@JvmStatic
fun setFromString(enumName: String) {

View File

@ -382,7 +382,6 @@ public class SponsorBlockUtils {
return statsNumberFormatter.format(viewCount);
}
@SuppressWarnings("ConstantConditions")
private static long parseSegmentTime(@NonNull String time) {
Matcher matcher = manualEditTimePattern.matcher(time);
if (!matcher.matches()) {

View File

@ -113,6 +113,7 @@ public class SBRequester {
// Could benefit from:
// 1) collection of YouTube videos with test segment times (verify client skip timing matches the video, verify seekbar draws correctly)
// 2) unit tests (verify everything else)
//noinspection ConstantValue
if (false) {
segments.clear();
// Test auto-hide skip button:

View File

@ -1,7 +1,5 @@
package app.revanced.extension.youtube.sponsorblock.ui;
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
import android.view.View;
import android.widget.ImageView;

View File

@ -1,7 +1,5 @@
package app.revanced.extension.youtube.sponsorblock.ui;
import static app.revanced.extension.shared.Utils.getResourceIdentifier;
import android.view.View;
import android.widget.ImageView;

View File

@ -7,8 +7,6 @@ import android.os.Handler
import android.os.Looper
import android.util.TypedValue
import android.view.HapticFeedbackConstants
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import android.widget.TextView
import app.revanced.extension.shared.StringRef.str
@ -59,8 +57,8 @@ class SwipeControlsOverlayLayout(
val compoundIconPadding = 4.applyDimension(context, TypedValue.COMPLEX_UNIT_DIP)
feedbackTextView = TextView(context).apply {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
).apply {
addRule(CENTER_IN_PARENT, TRUE)
setPadding(
@ -91,7 +89,7 @@ class SwipeControlsOverlayLayout(
private val feedbackHideHandler = Handler(Looper.getMainLooper())
private val feedbackHideCallback = Runnable {
feedbackTextView.visibility = View.GONE
feedbackTextView.visibility = GONE
}
/**