fix(X / Twitter - Change Link Sharing Domain): Change link domain of share copy action (#6091)

Co-authored-by: nyraa <112930946+nyraa@users.noreply.github.com>
This commit is contained in:
ADudeCalledLeo 2025-10-11 01:01:44 +03:00 committed by GitHub
parent a98e8f7370
commit 54846253d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 53 additions and 67 deletions

View file

@ -2,22 +2,19 @@ package app.revanced.twitter.patches.links;
@SuppressWarnings("unused")
public final class ChangeLinkSharingDomainPatch {
private static final String DOMAIN_NAME = "https://fxtwitter.com";
private static final String LINK_FORMAT = "%s/%s/status/%s";
/**
* Injection point.
* Method is modified during patching. Do not change.
*/
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);
private static String getShareDomain() {
return "";
}
/**
* Injection point.
*/
public static String formatLink(long tweetId, String username) {
return String.format(LINK_FORMAT, DOMAIN_NAME, username, tweetId);
return String.format(LINK_FORMAT, getShareDomain(), username, tweetId);
}
}