Update libsignal-service-java

This commit is contained in:
AsamK 2022-09-17 09:54:34 +02:00
parent 1d77153a2b
commit 60ed2c292f
7 changed files with 56 additions and 13 deletions

View file

@ -233,6 +233,12 @@
"name":"java.lang.Enum", "name":"java.lang.Enum",
"allDeclaredMethods":true "allDeclaredMethods":true
}, },
{
"name":"java.lang.Float",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true
},
{ {
"name":"java.lang.Integer", "name":"java.lang.Integer",
"allDeclaredFields":true, "allDeclaredFields":true,
@ -274,6 +280,14 @@
{"name":"getSuppressed","parameterTypes":[] } {"name":"getSuppressed","parameterTypes":[] }
] ]
}, },
{
"name":"java.lang.constant.Constable",
"queryAllDeclaredMethods":true
},
{
"name":"java.lang.constant.ConstantDesc",
"queryAllDeclaredMethods":true
},
{ {
"name":"java.lang.reflect.Method", "name":"java.lang.reflect.Method",
"methods":[{"name":"isDefault","parameterTypes":[] }] "methods":[{"name":"isDefault","parameterTypes":[] }]
@ -882,7 +896,9 @@
"queryAllDeclaredConstructors":true, "queryAllDeclaredConstructors":true,
"methods":[ "methods":[
{"name":"angle","parameterTypes":[] }, {"name":"angle","parameterTypes":[] },
{"name":"colors","parameterTypes":[] },
{"name":"endColor","parameterTypes":[] }, {"name":"endColor","parameterTypes":[] },
{"name":"positions","parameterTypes":[] },
{"name":"startColor","parameterTypes":[] } {"name":"startColor","parameterTypes":[] }
] ]
}, },
@ -3180,7 +3196,9 @@
"fields":[ "fields":[
{"name":"angle_"}, {"name":"angle_"},
{"name":"bitField0_"}, {"name":"bitField0_"},
{"name":"colors_"},
{"name":"endColor_"}, {"name":"endColor_"},
{"name":"positions_"},
{"name":"startColor_"} {"name":"startColor_"}
] ]
}, },

View file

@ -14,7 +14,7 @@ repositories {
} }
dependencies { dependencies {
implementation("com.github.turasa", "signal-service-java", "2.15.3_unofficial_56") implementation("com.github.turasa", "signal-service-java", "2.15.3_unofficial_57")
implementation("com.fasterxml.jackson.core", "jackson-databind", "2.13.3") implementation("com.fasterxml.jackson.core", "jackson-databind", "2.13.3")
implementation("com.google.protobuf", "protobuf-javalite", "3.11.4") implementation("com.google.protobuf", "protobuf-javalite", "3.11.4")
implementation("org.bouncycastle", "bcprov-jdk15on", "1.70") implementation("org.bouncycastle", "bcprov-jdk15on", "1.70")

View file

@ -837,11 +837,13 @@ public record MessageEnvelope(
} }
} }
public record Gradient(Optional<Color> startColor, Optional<Color> endColor, Optional<Integer> angle) { public record Gradient(
List<Color> colors, List<Float> positions, Optional<Integer> angle
) {
static Gradient from(SignalServiceTextAttachment.Gradient gradient) { static Gradient from(SignalServiceTextAttachment.Gradient gradient) {
return new Gradient(gradient.getStartColor().map(Color::new), return new Gradient(gradient.getColors().stream().map(Color::new).toList(),
gradient.getEndColor().map(Color::new), gradient.getPositions(),
gradient.getAngle()); gradient.getAngle());
} }
} }

View file

@ -31,7 +31,16 @@ public class ServiceConfig {
public static final AccountAttributes.Capabilities capabilities; public static final AccountAttributes.Capabilities capabilities;
static { static {
capabilities = new AccountAttributes.Capabilities(false, true, false, true, true, true, true, false, false); capabilities = new AccountAttributes.Capabilities(false,
true,
false,
true,
true,
true,
true,
false,
false,
false);
try { try {
TrustStore contactTrustStore = new IasTrustStore(); TrustStore contactTrustStore = new IasTrustStore();

View file

@ -262,11 +262,6 @@ public final class ProfileHelper {
return now - profile.getLastUpdateTimestamp() >= 6 * 60 * 60 * 1000; return now - profile.getLastUpdateTimestamp() >= 6 * 60 * 60 * 1000;
} }
private SignalServiceProfile retrieveProfileSync(String username) throws IOException {
final var locale = Utils.getDefaultLocale(Locale.US);
return dependencies.getMessageReceiver().retrieveProfileByUsername(username, Optional.empty(), locale);
}
private Profile decryptProfileAndDownloadAvatar( private Profile decryptProfileAndDownloadAvatar(
final RecipientId recipientId, final ProfileKey profileKey, final SignalServiceProfile encryptedProfile final RecipientId recipientId, final ProfileKey profileKey, final SignalServiceProfile encryptedProfile
) { ) {

View file

@ -135,4 +135,8 @@ public class RecipientHelper {
} }
return uuid; return uuid;
} }
private ACI getRegisteredUserByUsername(String username) throws IOException {
return dependencies.getAccountManager().getAciByUsername(username);
}
} }

View file

@ -6,6 +6,8 @@ import org.asamk.signal.manager.api.Color;
import org.asamk.signal.manager.api.MessageEnvelope; import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.groups.GroupId; import org.asamk.signal.manager.groups.GroupId;
import java.util.List;
record JsonStoryMessage( record JsonStoryMessage(
boolean allowsReplies, boolean allowsReplies,
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
@ -40,11 +42,24 @@ record JsonStoryMessage(
textAttachment.backgroundColor().map(Color::toHexColor).orElse(null)); textAttachment.backgroundColor().map(Color::toHexColor).orElse(null));
} }
public record Gradient(String startColor, String endColor, Integer angle) { public record Gradient(
String startColor,
String endColor,
List<String> colors,
List<Float> positions,
Integer angle
) {
static Gradient from(MessageEnvelope.Story.TextAttachment.Gradient gradient) { static Gradient from(MessageEnvelope.Story.TextAttachment.Gradient gradient) {
return new Gradient(gradient.startColor().map(Color::toHexColor).orElse(null), final var isLegacyGradient = gradient.colors().size() == 2
gradient.endColor().map(Color::toHexColor).orElse(null), && gradient.positions().size() == 2
&& gradient.positions().get(0) == 0f
&& gradient.positions().get(1) == 1f;
return new Gradient(isLegacyGradient ? gradient.colors().get(0).toHexColor() : null,
isLegacyGradient ? gradient.colors().get(1).toHexColor() : null,
gradient.colors().stream().map(Color::toHexColor).toList(),
gradient.positions(),
gradient.angle().orElse(null)); gradient.angle().orElse(null));
} }
} }