From e00eaf10e8820760d179862c736fb0b826c305d8 Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 18 Aug 2021 19:37:03 +0200 Subject: [PATCH] Adapt User-Agent string to get rate limit challenges --- src/main/java/org/asamk/signal/BaseConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/asamk/signal/BaseConfig.java b/src/main/java/org/asamk/signal/BaseConfig.java index afafc7d7..bb8db7d2 100644 --- a/src/main/java/org/asamk/signal/BaseConfig.java +++ b/src/main/java/org/asamk/signal/BaseConfig.java @@ -5,7 +5,11 @@ public class BaseConfig { public final static String PROJECT_NAME = BaseConfig.class.getPackage().getImplementationTitle(); public final static String PROJECT_VERSION = BaseConfig.class.getPackage().getImplementationVersion(); - final static String USER_AGENT = PROJECT_NAME == null ? "signal-cli" : PROJECT_NAME + " " + PROJECT_VERSION; + final static String USER_AGENT_SIGNAL_ANDROID = "Signal-Android/5.12.4"; + final static String USER_AGENT_SIGNAL_CLI = PROJECT_NAME == null + ? "signal-cli" + : PROJECT_NAME + "/" + PROJECT_VERSION; + final static String USER_AGENT = USER_AGENT_SIGNAL_ANDROID + " " + USER_AGENT_SIGNAL_CLI; private BaseConfig() { }