From b0440ad6af0e190e516974ce896dcc54c8d2e122 Mon Sep 17 00:00:00 2001 From: ByteEVM <155392541+ByteEVM@users.noreply.github.com> Date: Fri, 30 May 2025 22:51:12 +0200 Subject: [PATCH] feat(Proton Mail): Add `Remove free accounts limit` patch (#4970) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Co-authored-by: oSumAtrIX --- patches/api/patches.api | 4 ++++ .../account/RemoveFreeAccountsLimitPatch.kt | 21 +++++++++++++++++++ .../signature/RemoveSentFromSignaturePatch.kt | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 patches/src/main/kotlin/app/revanced/patches/protonmail/account/RemoveFreeAccountsLimitPatch.kt diff --git a/patches/api/patches.api b/patches/api/patches.api index 668e1072e..a96d4a6c9 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -448,6 +448,10 @@ public final class app/revanced/patches/primevideo/misc/permissions/RenamePermis public static final fun getRenamePermissionsPatch ()Lapp/revanced/patcher/patch/ResourcePatch; } +public final class app/revanced/patches/protonmail/account/RemoveFreeAccountsLimitPatchKt { + public static final fun getRemoveFreeAccountsLimitPatch ()Lapp/revanced/patcher/patch/ResourcePatch; +} + public final class app/revanced/patches/protonmail/signature/RemoveSentFromSignaturePatchKt { public static final fun getRemoveSentFromSignaturePatch ()Lapp/revanced/patcher/patch/ResourcePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/protonmail/account/RemoveFreeAccountsLimitPatch.kt b/patches/src/main/kotlin/app/revanced/patches/protonmail/account/RemoveFreeAccountsLimitPatch.kt new file mode 100644 index 000000000..473d8d400 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/protonmail/account/RemoveFreeAccountsLimitPatch.kt @@ -0,0 +1,21 @@ +package app.revanced.patches.protonmail.account + +import app.revanced.patcher.patch.resourcePatch +import app.revanced.util.findElementByAttributeValueOrThrow + +@Suppress("unused") +val removeFreeAccountsLimitPatch = resourcePatch( + name = "Remove free accounts limit", + description = "Removes the limit for maximum free accounts logged in.", +) { + compatibleWith("ch.protonmail.android") + + execute { + document("res/values/integers.xml").use { document -> + document.documentElement.childNodes.findElementByAttributeValueOrThrow( + "name", + "core_feature_auth_user_check_max_free_user_count", + ).textContent = Int.MAX_VALUE.toString() + } + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/protonmail/signature/RemoveSentFromSignaturePatch.kt b/patches/src/main/kotlin/app/revanced/patches/protonmail/signature/RemoveSentFromSignaturePatch.kt index f3d2b2dd2..a59b8e7dd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/protonmail/signature/RemoveSentFromSignaturePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/protonmail/signature/RemoveSentFromSignaturePatch.kt @@ -39,4 +39,4 @@ val removeSentFromSignaturePatch = resourcePatch( if (!foundString) throw PatchException("Could not find 'sent from' string in resources") } -} \ No newline at end of file +}