From c6739517f179bf8e811e869640a24f433d729f42 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Oct 2024 19:23:56 +0400 Subject: [PATCH] feat(Twitter): Add `Change link sharing domain` patch (#715) Co-authored-by: oSumAtrIX --- .../links/ChangeLinkSharingDomainPatch.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/src/main/java/app/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch.java diff --git a/app/src/main/java/app/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch.java b/app/src/main/java/app/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch.java new file mode 100644 index 00000000..943c306d --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/twitter/patches/links/ChangeLinkSharingDomainPatch.java @@ -0,0 +1,16 @@ +package app.revanced.integrations.twitter.patches.links; + +public final class ChangeLinkSharingDomainPatch { + private static final String DOMAIN_NAME = "https://fxtwitter.com"; + private static final String LINK_FORMAT = "%s/%s/status/%s"; + + public static String formatResourceLink(Object... formatArgs) { + String username = (String) formatArgs[0]; + String tweetId = (String) formatArgs[1]; + return String.format(LINK_FORMAT, DOMAIN_NAME, username, tweetId); + } + + public static String formatLink(long tweetId, String username) { + return String.format(LINK_FORMAT, DOMAIN_NAME, username, tweetId); + } +}