mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-05-02 15:44:39 +02:00
fix(YouTube - Spoof app version): Do not hide spoof version in general settings menu (#4861)
This commit is contained in:
parent
39769bf384
commit
f459c3c7fa
@ -642,14 +642,12 @@ public abstract class app/revanced/patches/shared/misc/settings/preference/BaseP
|
|||||||
public static final field Companion Lapp/revanced/patches/shared/misc/settings/preference/BasePreference$Companion;
|
public static final field Companion Lapp/revanced/patches/shared/misc/settings/preference/BasePreference$Companion;
|
||||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
||||||
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
public fun equals (Ljava/lang/Object;)Z
|
|
||||||
public final fun getIcon ()Ljava/lang/String;
|
public final fun getIcon ()Ljava/lang/String;
|
||||||
public final fun getKey ()Ljava/lang/String;
|
public final fun getKey ()Ljava/lang/String;
|
||||||
public final fun getLayout ()Ljava/lang/String;
|
public final fun getLayout ()Ljava/lang/String;
|
||||||
public final fun getSummaryKey ()Ljava/lang/String;
|
public final fun getSummaryKey ()Ljava/lang/String;
|
||||||
public final fun getTag ()Ljava/lang/String;
|
public final fun getTag ()Ljava/lang/String;
|
||||||
public final fun getTitleKey ()Ljava/lang/String;
|
public final fun getTitleKey ()Ljava/lang/String;
|
||||||
public fun hashCode ()I
|
|
||||||
public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element;
|
public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,26 +51,6 @@ abstract class BasePreference(
|
|||||||
layout?.let { setAttribute("android:layout", layout) }
|
layout?.let { setAttribute("android:layout", layout) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
var result = key?.hashCode() ?: 0
|
|
||||||
result = 31 * result + titleKey.hashCode()
|
|
||||||
result = 31 * result + tag.hashCode()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as BasePreference
|
|
||||||
|
|
||||||
if (key != other.key) return false
|
|
||||||
if (titleKey != other.titleKey) return false
|
|
||||||
if (tag != other.tag) return false
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun Element.addSummary(summaryKey: String, summaryType: SummaryType = SummaryType.DEFAULT) =
|
fun Element.addSummary(summaryKey: String, summaryType: SummaryType = SummaryType.DEFAULT) =
|
||||||
setAttribute("android:${summaryType.type}", "@string/$summaryKey")
|
setAttribute("android:${summaryType.type}", "@string/$summaryKey")
|
||||||
|
@ -73,7 +73,7 @@ val spoofAppVersionPatch = bytecodePatch(
|
|||||||
|
|
||||||
PreferenceScreen.GENERAL_LAYOUT.addPreferences(
|
PreferenceScreen.GENERAL_LAYOUT.addPreferences(
|
||||||
// Group the switch and list preference together, since General menu is sorted by name
|
// Group the switch and list preference together, since General menu is sorted by name
|
||||||
// and the preferences can be scattered apart with non English langauges.
|
// and the preferences can be scattered apart with non English languages.
|
||||||
PreferenceCategory(
|
PreferenceCategory(
|
||||||
titleKey = null,
|
titleKey = null,
|
||||||
sorting = Sorting.UNSORTED,
|
sorting = Sorting.UNSORTED,
|
||||||
@ -122,16 +122,17 @@ val spoofAppVersionPatch = bytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val insertIndex = spoofAppVersionFingerprint.patternMatch!!.startIndex + 1
|
spoofAppVersionFingerprint.apply {
|
||||||
val buildOverrideNameRegister =
|
val startIndex = patternMatch!!.startIndex
|
||||||
spoofAppVersionFingerprint.method.getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
|
val buildOverrideNameRegister = method.getInstruction<OneRegisterInstruction>(startIndex).registerA
|
||||||
|
|
||||||
spoofAppVersionFingerprint.method.addInstructions(
|
method.addInstructions(
|
||||||
insertIndex,
|
startIndex + 1,
|
||||||
"""
|
"""
|
||||||
invoke-static {v$buildOverrideNameRegister}, $EXTENSION_CLASS_DESCRIPTOR->getYouTubeVersionOverride(Ljava/lang/String;)Ljava/lang/String;
|
invoke-static {v$buildOverrideNameRegister}, $EXTENSION_CLASS_DESCRIPTOR->getYouTubeVersionOverride(Ljava/lang/String;)Ljava/lang/String;
|
||||||
move-result-object v$buildOverrideNameRegister
|
move-result-object v$buildOverrideNameRegister
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user