mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 05:37:40 +02:00
fix(YouTube Music/Spoof app version): ListPreference sometimes selects wrong values
This commit is contained in:
@ -1,11 +1,15 @@
|
|||||||
package app.revanced.patches.music.general.spoofappversion
|
package app.revanced.patches.music.general.spoofappversion
|
||||||
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patches.music.general.oldstylelibraryshelf.OldStyleLibraryShelfPatch
|
import app.revanced.patches.music.general.oldstylelibraryshelf.OldStyleLibraryShelfPatch
|
||||||
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
||||||
|
import app.revanced.patches.music.utils.integrations.Constants.GENERAL_CLASS_DESCRIPTOR
|
||||||
import app.revanced.patches.music.utils.settings.CategoryType
|
import app.revanced.patches.music.utils.settings.CategoryType
|
||||||
|
import app.revanced.patches.music.utils.settings.SettingsBytecodePatch
|
||||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||||
import app.revanced.util.appendAppVersion
|
import app.revanced.util.appendAppVersion
|
||||||
|
import app.revanced.util.findMethodOrThrow
|
||||||
import app.revanced.util.patch.BaseResourcePatch
|
import app.revanced.util.patch.BaseResourcePatch
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@ -24,6 +28,13 @@ object SpoofAppVersionPatch : BaseResourcePatch(
|
|||||||
|
|
||||||
if (SettingsPatch.upward0718) {
|
if (SettingsPatch.upward0718) {
|
||||||
context.appendAppVersion("7.16.53")
|
context.appendAppVersion("7.16.53")
|
||||||
|
|
||||||
|
SettingsBytecodePatch.contexts.findMethodOrThrow(GENERAL_CLASS_DESCRIPTOR) {
|
||||||
|
name == "getSpoofAppVersionDefault"
|
||||||
|
}.replaceInstruction(
|
||||||
|
0,
|
||||||
|
"const-string v0, \"7.16.53\""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPatch.addSwitchPreference(
|
SettingsPatch.addSwitchPreference(
|
||||||
|
@ -44,8 +44,10 @@ object SettingsBytecodePatch : BytecodePatch(
|
|||||||
"$INTEGRATIONS_PATH/settings/preference/ReVancedPreferenceFragment;"
|
"$INTEGRATIONS_PATH/settings/preference/ReVancedPreferenceFragment;"
|
||||||
private const val INTEGRATIONS_INITIALIZATION_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_INITIALIZATION_CLASS_DESCRIPTOR =
|
||||||
"$UTILS_PATH/InitializationPatch;"
|
"$UTILS_PATH/InitializationPatch;"
|
||||||
|
lateinit var contexts: BytecodeContext
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
contexts = context
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SharedPrefCategory
|
* Set SharedPrefCategory
|
||||||
|
Reference in New Issue
Block a user