Update libsignal-service-java

This commit is contained in:
AsamK 2021-10-24 19:16:01 +02:00
parent fc0a9b4102
commit 004293362e
7 changed files with 1081 additions and 973 deletions

View file

@ -1,29 +1,33 @@
[ [
{
"name":"java.lang.Boolean",
"methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }]}
,
{ {
"name":"java.lang.ClassLoader", "name":"java.lang.ClassLoader",
"methods":[ "methods":[
{"name":"getPlatformClassLoader","parameterTypes":[] }, {"name":"getPlatformClassLoader","parameterTypes":[] },
{"name":"loadClass","parameterTypes":["java.lang.String"] } {"name":"loadClass","parameterTypes":["java.lang.String"] }
] ]}
}, ,
{ {
"name":"java.lang.IllegalStateException", "name":"java.lang.IllegalStateException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]}
}, ,
{ {
"name":"java.lang.NoSuchMethodError" "name":"java.lang.NoSuchMethodError"}
}, ,
{ {
"name":"java.lang.UnsatisfiedLinkError", "name":"java.lang.UnsatisfiedLinkError",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]}
}, ,
{ {
"name":"java.util.UUID", "name":"java.util.UUID",
"methods":[{"name":"<init>","parameterTypes":["long","long"] }] "methods":[{"name":"<init>","parameterTypes":["long","long"] }]}
}, ,
{ {
"name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader" "name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader"}
}, ,
{ {
"name":"org.asamk.signal.manager.storage.protocol.SignalProtocolStore", "name":"org.asamk.signal.manager.storage.protocol.SignalProtocolStore",
"methods":[ "methods":[
@ -39,106 +43,111 @@
{"name":"saveIdentity","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","org.whispersystems.libsignal.IdentityKey"] }, {"name":"saveIdentity","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","org.whispersystems.libsignal.IdentityKey"] },
{"name":"storeSenderKey","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","java.util.UUID","org.whispersystems.libsignal.groups.state.SenderKeyRecord"] }, {"name":"storeSenderKey","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","java.util.UUID","org.whispersystems.libsignal.groups.state.SenderKeyRecord"] },
{"name":"storeSession","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","org.whispersystems.libsignal.state.SessionRecord"] } {"name":"storeSession","parameterTypes":["org.whispersystems.libsignal.SignalProtocolAddress","org.whispersystems.libsignal.state.SessionRecord"] }
] ]}
}, ,
{ {
"name":"org.graalvm.nativebridge.jni.JNIExceptionWrapperEntryPoints", "name":"org.graalvm.nativebridge.jni.JNIExceptionWrapperEntryPoints",
"methods":[{"name":"getClassName","parameterTypes":["java.lang.Class"] }] "methods":[{"name":"getClassName","parameterTypes":["java.lang.Class"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.DuplicateMessageException", "name":"org.whispersystems.libsignal.DuplicateMessageException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.IdentityKey", "name":"org.whispersystems.libsignal.IdentityKey",
"methods":[ "methods":[
{"name":"<init>","parameterTypes":["byte[]"] }, {"name":"<init>","parameterTypes":["byte[]"] },
{"name":"serialize","parameterTypes":[] } {"name":"serialize","parameterTypes":[] }
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.IdentityKeyPair", "name":"org.whispersystems.libsignal.IdentityKeyPair",
"methods":[{"name":"serialize","parameterTypes":[] }] "methods":[{"name":"serialize","parameterTypes":[] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.InvalidMessageException", "name":"org.whispersystems.libsignal.InvalidMessageException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.SignalProtocolAddress", "name":"org.whispersystems.libsignal.SignalProtocolAddress",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","int"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String","int"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.UntrustedIdentityException", "name":"org.whispersystems.libsignal.UntrustedIdentityException",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }] "methods":[{"name":"<init>","parameterTypes":["java.lang.String"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.groups.state.SenderKeyRecord", "name":"org.whispersystems.libsignal.groups.state.SenderKeyRecord",
"methods":[ "methods":[
{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["long"] },
{"name":"nativeHandle","parameterTypes":[] } {"name":"nativeHandle","parameterTypes":[] }
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.groups.state.SenderKeyStore" "name":"org.whispersystems.libsignal.groups.state.SenderKeyStore"}
}, ,
{ {
"name":"org.whispersystems.libsignal.logging.Log", "name":"org.whispersystems.libsignal.logging.Log",
"methods":[{"name":"log","parameterTypes":["int","java.lang.String","java.lang.String"] }] "methods":[{"name":"log","parameterTypes":["int","java.lang.String","java.lang.String"] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.protocol.PlaintextContent", "name":"org.whispersystems.libsignal.protocol.PlaintextContent",
"methods":[{"name":"nativeHandle","parameterTypes":[] }] "methods":[{"name":"nativeHandle","parameterTypes":[] }]}
}, ,
{ {
"name":"org.whispersystems.libsignal.protocol.PreKeySignalMessage", "name":"org.whispersystems.libsignal.protocol.PreKeySignalMessage",
"fields":[{"name":"unsafeHandle"}],
"methods":[ "methods":[
{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["long"] },
{"name":"nativeHandle","parameterTypes":[] } {"name":"nativeHandle","parameterTypes":[] }
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.protocol.SenderKeyMessage" "name":"org.whispersystems.libsignal.protocol.SenderKeyMessage"}
}, ,
{ {
"name":"org.whispersystems.libsignal.protocol.SignalMessage", "name":"org.whispersystems.libsignal.protocol.SignalMessage",
"fields":[{"name":"unsafeHandle"}],
"methods":[ "methods":[
{"name":"<init>","parameterTypes":["long"] }, {"name":"<init>","parameterTypes":["long"] },
{"name":"nativeHandle","parameterTypes":[] } {"name":"nativeHandle","parameterTypes":[] }
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.IdentityKeyStore" "name":"org.whispersystems.libsignal.state.IdentityKeyStore"}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.IdentityKeyStore$Direction", "name":"org.whispersystems.libsignal.state.IdentityKeyStore$Direction",
"fields":[ "fields":[
{"name":"RECEIVING"}, {"name":"RECEIVING"},
{"name":"SENDING"} {"name":"SENDING"}
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.PreKeyRecord", "name":"org.whispersystems.libsignal.state.PreKeyRecord",
"methods":[{"name":"nativeHandle","parameterTypes":[] }] "fields":[{"name":"unsafeHandle"}],
}, "methods":[{"name":"nativeHandle","parameterTypes":[] }]}
,
{ {
"name":"org.whispersystems.libsignal.state.PreKeyStore" "name":"org.whispersystems.libsignal.state.PreKeyStore"}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.SessionRecord", "name":"org.whispersystems.libsignal.state.SessionRecord",
"fields":[{"name":"unsafeHandle"}],
"methods":[ "methods":[
{"name":"<init>","parameterTypes":["byte[]"] }, {"name":"<init>","parameterTypes":["byte[]"] },
{"name":"nativeHandle","parameterTypes":[] } {"name":"nativeHandle","parameterTypes":[] }
] ]}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.SessionStore" "name":"org.whispersystems.libsignal.state.SessionStore"}
}, ,
{ {
"name":"org.whispersystems.libsignal.state.SignedPreKeyRecord", "name":"org.whispersystems.libsignal.state.SignedPreKeyRecord",
"methods":[{"name":"nativeHandle","parameterTypes":[] }] "fields":[{"name":"unsafeHandle"}],
}, "methods":[{"name":"nativeHandle","parameterTypes":[] }]}
,
{ {
"name":"org.whispersystems.libsignal.state.SignedPreKeyStore" "name":"org.whispersystems.libsignal.state.SignedPreKeyStore"}
}
] ]

View file

@ -1,4 +1,8 @@
[ [
["org.asamk.Signal"], {
["org.freedesktop.dbus.interfaces.DBus"] "interfaces":["org.asamk.Signal"]}
,
{
"interfaces":["org.freedesktop.dbus.interfaces.DBus"]}
] ]

File diff suppressed because it is too large Load diff

View file

@ -1,34 +1,92 @@
{ {
"resources":{ "resources":{
"includes":[ "includes":[
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AT\\E"}, {
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BD\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_AT\\E"
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ\\E"}, },
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE\\E"}, {
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BD\\E"
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES\\E"}, },
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI\\E"}, {
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FR\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ\\E"
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB\\E"}, },
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GR\\E"}, {
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IN\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_DE\\E"
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL\\E"}, },
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RU\\E"}, {
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UA\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_EE\\E"
{"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US\\E"}, },
{"pattern":"\\Qjni/x86_64-Linux/libjffi-1.2.so\\E"}, {
{"pattern":"\\Qjnr/constants/ConstantSet.class\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES\\E"
{"pattern":"\\Qjnr/constants/platform/linux/ProtocolFamily.class\\E"}, },
{"pattern":"\\Qjnr/constants/platform/linux/Shutdown.class\\E"}, {
{"pattern":"\\Qjnr/constants/platform/linux/Sock.class\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FI\\E"
{"pattern":"\\Qjnr/constants/platform/linux/SocketLevel.class\\E"}, },
{"pattern":"\\Qjnr/constants/platform/linux/SocketOption.class\\E"}, {
{"pattern":"\\Qlibsignal_jni.so\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_FR\\E"
{"pattern":"\\Qlibzkgroup.so\\E"}, },
{"pattern":"\\Qorg/asamk/signal/manager/config/ias.store\\E"}, {
{"pattern":"\\Qorg/asamk/signal/manager/config/whisper.store\\E"}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB\\E"
{"pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"}, },
{"pattern":"com/google/i18n/phonenumbers/data/.*"} {
]}, "pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GR\\E"
"bundles":[{"name":"net.sourceforge.argparse4j.internal.ArgumentParserImpl"}] },
{
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IN\\E"
},
{
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PL\\E"
},
{
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_RU\\E"
},
{
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UA\\E"
},
{
"pattern":"\\Qcom/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_US\\E"
},
{
"pattern":"\\Qjni/x86_64-Linux/libjffi-1.2.so\\E"
},
{
"pattern":"\\Qjnr/constants/ConstantSet.class\\E"
},
{
"pattern":"\\Qjnr/constants/platform/linux/ProtocolFamily.class\\E"
},
{
"pattern":"\\Qjnr/constants/platform/linux/Shutdown.class\\E"
},
{
"pattern":"\\Qjnr/constants/platform/linux/Sock.class\\E"
},
{
"pattern":"\\Qjnr/constants/platform/linux/SocketLevel.class\\E"
},
{
"pattern":"\\Qjnr/constants/platform/linux/SocketOption.class\\E"
},
{
"pattern":"\\Qlibsignal_jni.so\\E"
},
{
"pattern":"\\Qlibzkgroup.so\\E"
},
{
"pattern":"\\Qorg/asamk/signal/manager/config/ias.store\\E"
},
{
"pattern":"\\Qorg/asamk/signal/manager/config/whisper.store\\E"
},
{
"pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"
},
{
"pattern":"com/google/i18n/phonenumbers/data/.*"
}
]},
"bundles":[{
"name":"net.sourceforge.argparse4j.internal.ArgumentParserImpl"
}]
} }

View file

@ -14,7 +14,7 @@ repositories {
} }
dependencies { dependencies {
api("com.github.turasa:signal-service-java:2.15.3_unofficial_30") api("com.github.turasa:signal-service-java:2.15.3_unofficial_31")
implementation("com.google.protobuf:protobuf-javalite:3.10.0") implementation("com.google.protobuf:protobuf-javalite:3.10.0")
implementation("org.bouncycastle:bcprov-jdk15on:1.69") implementation("org.bouncycastle:bcprov-jdk15on:1.69")
implementation("org.slf4j:slf4j-api:1.7.30") implementation("org.slf4j:slf4j-api:1.7.30")

View file

@ -33,6 +33,7 @@ import java.util.Base64;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
@ -228,7 +229,8 @@ public final class ProfileHelper {
} }
private SignalServiceProfile retrieveProfileSync(String username) throws IOException { private SignalServiceProfile retrieveProfileSync(String username) throws IOException {
return dependencies.getMessageReceiver().retrieveProfileByUsername(username, Optional.absent()); final var locale = Locale.getDefault();
return dependencies.getMessageReceiver().retrieveProfileByUsername(username, Optional.absent(), locale);
} }
private ProfileAndCredential retrieveProfileAndCredential( private ProfileAndCredential retrieveProfileAndCredential(
@ -308,11 +310,16 @@ public final class ProfileHelper {
var profileService = dependencies.getProfileService(); var profileService = dependencies.getProfileService();
Single<ServiceResponse<ProfileAndCredential>> responseSingle; Single<ServiceResponse<ProfileAndCredential>> responseSingle;
final var locale = Locale.getDefault();
try { try {
responseSingle = profileService.getProfile(address, profileKey, unidentifiedAccess, requestType); responseSingle = profileService.getProfile(address, profileKey, unidentifiedAccess, requestType, locale);
} catch (NoClassDefFoundError e) { } catch (NoClassDefFoundError e) {
// Native zkgroup lib not available for ProfileKey // Native zkgroup lib not available for ProfileKey
responseSingle = profileService.getProfile(address, Optional.absent(), unidentifiedAccess, requestType); responseSingle = profileService.getProfile(address,
Optional.absent(),
unidentifiedAccess,
requestType,
locale);
} }
return responseSingle.map(pair -> { return responseSingle.map(pair -> {

View file

@ -45,7 +45,7 @@ run_linked() {
register() { register() {
NUMBER=$1 NUMBER=$1
PIN=$2 PIN=$2
echo -n "Enter a captcha token (https://signalcaptchas.org/registration/generate.html): " echo -n "Enter a captcha token (https://signalcaptchas.org/staging/challenge/generate.html): "
read CAPTCHA read CAPTCHA
run_main -u "$NUMBER" register --captcha "$CAPTCHA" run_main -u "$NUMBER" register --captcha "$CAPTCHA"
echo -n "Enter validation code for ${NUMBER}: " echo -n "Enter validation code for ${NUMBER}: "
@ -81,6 +81,20 @@ register "$NUMBER_2"
sleep 5 sleep 5
## DBus
run_main -u "$NUMBER_1" --dbus send "$NUMBER_2" -m daemon_not_running || true
run_main daemon &
DAEMON_PID=$!
sleep 10
echo send
run_main -u "$NUMBER_1" --dbus send "$NUMBER_2" -m hii
run_main -u "$NUMBER_2" --dbus receive
echo kill
kill "$DAEMON_PID"
echo killed
# JSON-RPC # JSON-RPC
FIFO_FILE="${PATH_MAIN}/dbus-fifo" FIFO_FILE="${PATH_MAIN}/dbus-fifo"
@ -184,15 +198,6 @@ done
run_main -u "$NUMBER_1" removeDevice -d 2 run_main -u "$NUMBER_1" removeDevice -d 2
## DBus
#run_main -u "$NUMBER_1" --dbus send "$NUMBER_2" -m daemon_not_running
#run_main daemon &
#DAEMON_PID=$!
#sleep 5
#run_main -u "$NUMBER_1" --dbus send "$NUMBER_2" -m hii
#run_main -u "$NUMBER_2" --dbus receive
#kill "$DAEMON_PID"
## Unregister ## Unregister
run_main -u "$NUMBER_1" unregister run_main -u "$NUMBER_1" unregister
run_main -u "$NUMBER_2" unregister --delete-account run_main -u "$NUMBER_2" unregister --delete-account