mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Replace Base64 class from libsignal with java.util.Base64
This commit is contained in:
parent
e6ea5d55f8
commit
9a775171b5
17 changed files with 100 additions and 96 deletions
|
@ -4,9 +4,9 @@ import org.asamk.signal.manager.groups.GroupUtils;
|
|||
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceGroupV2;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.util.Base64;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
class JsonGroupInfo {
|
||||
|
@ -17,7 +17,7 @@ class JsonGroupInfo {
|
|||
String type;
|
||||
|
||||
JsonGroupInfo(SignalServiceGroup groupInfo) {
|
||||
this.groupId = Base64.encodeBytes(groupInfo.getGroupId());
|
||||
this.groupId = Base64.getEncoder().encodeToString(groupInfo.getGroupId());
|
||||
if (groupInfo.getMembers().isPresent()) {
|
||||
this.members = new ArrayList<>(groupInfo.getMembers().get().size());
|
||||
for (SignalServiceAddress address : groupInfo.getMembers().get()) {
|
||||
|
@ -36,6 +36,6 @@ class JsonGroupInfo {
|
|||
}
|
||||
|
||||
JsonGroupInfo(byte[] groupId) {
|
||||
this.groupId = Base64.encodeBytes(groupId);
|
||||
this.groupId = Base64.getEncoder().encodeToString(groupId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package org.asamk.signal.json;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
|
||||
import org.whispersystems.util.Base64;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
public class JsonSticker {
|
||||
|
||||
|
@ -10,8 +11,8 @@ public class JsonSticker {
|
|||
int stickerId;
|
||||
|
||||
public JsonSticker(SignalServiceDataMessage.Sticker sticker) {
|
||||
this.packId = Base64.encodeBytes(sticker.getPackId());
|
||||
this.packKey = Base64.encodeBytes(sticker.getPackKey());
|
||||
this.packId = Base64.getEncoder().encodeToString(sticker.getPackId());
|
||||
this.packKey = Base64.getEncoder().encodeToString(sticker.getPackKey());
|
||||
this.stickerId = sticker.getStickerId();
|
||||
// TODO also download sticker image ??
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue