mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-24 02:42:11 +02:00
feat(YouTube Music/Spoof app version): app crashes when first installed
This commit is contained in:
parent
f29fbaeebe
commit
4387c55479
@ -4,7 +4,7 @@ import app.revanced.patcher.data.ResourceContext
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
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.integrations.Constants.PATCH_STATUS_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.SettingsBytecodePatch
|
||||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||||
@ -26,21 +26,30 @@ object SpoofAppVersionPatch : BaseResourcePatch(
|
|||||||
) {
|
) {
|
||||||
override fun execute(context: ResourceContext) {
|
override fun execute(context: ResourceContext) {
|
||||||
|
|
||||||
|
var defaultValue = "false"
|
||||||
|
|
||||||
if (SettingsPatch.upward0718) {
|
if (SettingsPatch.upward0718) {
|
||||||
context.appendAppVersion("7.16.53")
|
context.appendAppVersion("7.16.53")
|
||||||
|
|
||||||
SettingsBytecodePatch.contexts.findMethodOrThrow(GENERAL_CLASS_DESCRIPTOR) {
|
SettingsBytecodePatch.contexts.findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) {
|
||||||
name == "getSpoofAppVersionDefault"
|
name == "SpoofAppVersionDefaultString"
|
||||||
}.replaceInstruction(
|
}.replaceInstruction(
|
||||||
0,
|
0,
|
||||||
"const-string v0, \"7.16.53\""
|
"const-string v0, \"7.16.53\""
|
||||||
)
|
)
|
||||||
|
SettingsBytecodePatch.contexts.findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) {
|
||||||
|
name == "SpoofAppVersionDefaultBoolean"
|
||||||
|
}.replaceInstruction(
|
||||||
|
0,
|
||||||
|
"const/4 v0, 0x1"
|
||||||
|
)
|
||||||
|
defaultValue = "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPatch.addSwitchPreference(
|
SettingsPatch.addSwitchPreference(
|
||||||
CategoryType.GENERAL,
|
CategoryType.GENERAL,
|
||||||
"revanced_spoof_app_version",
|
"revanced_spoof_app_version",
|
||||||
"false"
|
defaultValue
|
||||||
)
|
)
|
||||||
SettingsPatch.addPreferenceWithIntent(
|
SettingsPatch.addPreferenceWithIntent(
|
||||||
CategoryType.GENERAL,
|
CategoryType.GENERAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user