mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-23 18:37:14 +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.patches.music.general.oldstylelibraryshelf.OldStyleLibraryShelfPatch
|
||||
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.SettingsBytecodePatch
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
@ -26,21 +26,30 @@ object SpoofAppVersionPatch : BaseResourcePatch(
|
||||
) {
|
||||
override fun execute(context: ResourceContext) {
|
||||
|
||||
var defaultValue = "false"
|
||||
|
||||
if (SettingsPatch.upward0718) {
|
||||
context.appendAppVersion("7.16.53")
|
||||
|
||||
SettingsBytecodePatch.contexts.findMethodOrThrow(GENERAL_CLASS_DESCRIPTOR) {
|
||||
name == "getSpoofAppVersionDefault"
|
||||
SettingsBytecodePatch.contexts.findMethodOrThrow(PATCH_STATUS_CLASS_DESCRIPTOR) {
|
||||
name == "SpoofAppVersionDefaultString"
|
||||
}.replaceInstruction(
|
||||
0,
|
||||
"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(
|
||||
CategoryType.GENERAL,
|
||||
"revanced_spoof_app_version",
|
||||
"false"
|
||||
defaultValue
|
||||
)
|
||||
SettingsPatch.addPreferenceWithIntent(
|
||||
CategoryType.GENERAL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user