Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a375b66

Browse files
committed
Update documentation to reflect Signal change
// FREEBIE
1 parent d148ea8 commit a375b66

File tree

9 files changed

+800
-799
lines changed

9 files changed

+800
-799
lines changed

README.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
1-
# libtextsecure-java
1+
# signal-service-java
22

3-
A Java library for communicating via TextSecure.
3+
A Java library for communicating via Signal.
44

5-
## Implementing the Axolotl interfaces
5+
## Implementing the Signal Protocol interfaces
66

7-
The axolotl encryption protocol is a stateful protocol, so libtextsecure users
8-
need to implement the storage interface `AxolotlStore`, which handles load/store
7+
The Signal encryption protocol is a stateful protocol, so libsignal-service users
8+
need to implement the storage interface `SignalProtocolStore`, which handles load/store
99
of your key and session information to durable media.
1010

1111
## Creating keys
1212

1313
`````
1414
IdentityKeyPair identityKey = KeyHelper.generateIdentityKeyPair();
1515
List<PreKeyRecord> oneTimePreKeys = KeyHelper.generatePreKeys(100);
16-
PreKeyRecord lastResortKey = KeyHelper.generateLastResortKey();
1716
SignedPreKeyRecord signedPreKeyRecord = KeyHelper.generateSignedPreKey(identityKey, signedPreKeyId);
1817
`````
1918

20-
The above are then stored locally so that they're available for load via the `AxolotlStore`.
19+
The above are then stored locally so that they're available for load via the `SignalProtocolStore`.
2120

2221
## Registering
2322

24-
At install time, clients need to register with the TextSecure server.
23+
At install time, clients need to register with the Signal server.
2524

2625
`````
27-
private final String URL = "https://my.textsecure.server.com";
26+
private final String URL = "https://my.signal.server.com";
2827
private final TrustStore TRUST_STORE = new MyTrustStoreImpl();
2928
private final String USERNAME = "+14151231234";
3029
private final String PASSWORD = generateRandomPassword();
3130
32-
TextSecureAccountManager accountManager = new TextSecureAccountManager(URL, TRUST_STORE,
33-
USERNAME, PASSWORD);
31+
SignalServiceAccountManager accountManager = new SignalServiceAccountManager(URL, TRUST_STORE,
32+
USERNAME, PASSWORD);
3433
3534
accountManager.requestSmsVerificationCode();
3635
accountManager.verifyAccount(receivedSmsVerificationCode, generateRandomSignalingKey(),
@@ -42,52 +41,52 @@ accountManager.setPreKeys(identityKey.getPublic(), lastResortKey, signedPreKey,
4241
## Sending text messages
4342

4443
`````
45-
TextSecureMessageSender messageSender = new TextSecureMessageSender(URL, TRUST_STORE, USERNAME, PASSWORD,
46-
localRecipientId, new MyAxolotlStore(),
47-
Optional.absent());
48-
49-
messageSender.sendMessage(new TextSecureAddress("+14159998888"),
50-
TextSecureMessage.newBuilder()
51-
.withBody("Hello, world!")
52-
.build());
44+
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(URL, TRUST_STORE, USERNAME, PASSWORD,
45+
localRecipientId, new MySignalProtocolStore(),
46+
Optional.absent());
47+
48+
messageSender.sendMessage(new SignalProtocolAddress("+14159998888"),
49+
SignalProtocolMessage.newBuilder()
50+
.withBody("Hello, world!")
51+
.build());
5352
`````
5453

5554
## Sending media messages
5655

5756
`````
58-
TextSecureMessageSender messageSender = new TextSecureMessageSender(URL, TRUST_STORE, USERNAME, PASSWORD,
59-
localRecipientId, new MyAxolotlStore(),
60-
Optional.absent());
57+
SignalServiceMessageSender messageSender = new SignalServiceMessageSender(URL, TRUST_STORE, USERNAME, PASSWORD,
58+
localRecipientId, new MySignalProtocolStore(),
59+
Optional.absent());
6160
6261
File myAttachment = new File("/path/to/my.attachment");
6362
FileInputStream attachmentStream = new FileInputStream(myAttachment);
64-
TextSecureAttachment attachment = TextSecureAttachment.newStreamBuilder()
65-
.withStream(attachmentStream)
66-
.withContentType("image/png")
67-
.withLength(myAttachment.size())
68-
.build();
69-
70-
messageSender.sendMessage(new TextSecureAddress("+14159998888"),
71-
TextSecureMessage.newBuilder()
72-
.withBody("An attachment!")
73-
.withAttachment(attachment)
74-
.build());
63+
TextSecureAttachment attachment = SignalServiceAttachment.newStreamBuilder()
64+
.withStream(attachmentStream)
65+
.withContentType("image/png")
66+
.withLength(myAttachment.size())
67+
.build();
68+
69+
messageSender.sendMessage(new SignalProtocolAddress("+14159998888"),
70+
SignalProtocolMessage.newBuilder()
71+
.withBody("An attachment!")
72+
.withAttachment(attachment)
73+
.build());
7574
7675
`````
7776

7877
## Receiving messages
7978

8079
`````
81-
TextSecureMessageReceiver messageReceiver = new TextSecureMessageReceiver(URL, TRUST_STORE, USERNAME, PASSWORD, mySignalingKey);
82-
TextSecureMessagePipe messagePipe;
80+
SignalServiceMessageReceiver messageReceiver = new SignalServiceMessageReceiver(URL, TRUST_STORE, USERNAME, PASSWORD, mySignalingKey);
81+
SignalServiceMessagePipe messagePipe;
8382
8483
try {
8584
messagePipe = messageReciever.createMessagePipe();
8685
8786
while (listeningForMessages) {
88-
TextSecureEnvelope envelope = messagePipe.read(timeout, timeoutTimeUnit);
89-
TextSecureCipher cipher = new TextSecureCipher(new MyAxolotlStore());
90-
TextSecureMessage message = cipher.decrypt(envelope);
87+
SignalServiceEnvelope envelope = messagePipe.read(timeout, timeoutTimeUnit);
88+
SignalServiceCipher cipher = new SignalServiceCipher(new MySignalProtocolStore());
89+
SignalServiceMessage message = cipher.decrypt(envelope);
9190
9291
System.out.println("Received message: " + message.getBody().get());
9392
}
@@ -111,7 +110,7 @@ The form and manner of this distribution makes it eligible for export under the
111110

112111
## License
113112

114-
Copyright 2013-2015 Open Whisper Systems
113+
Copyright 2013-2016 Open Whisper Systems
115114

116115
Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html
117116

android/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apply plugin: 'com.android.library'
1212
apply plugin: 'maven'
1313
apply plugin: 'signing'
1414

15-
archivesBaseName = "textsecure-android"
15+
archivesBaseName = "signal-service-android"
1616
version = version_number
1717
group = group_info
1818

@@ -76,15 +76,15 @@ uploadArchives {
7676
}
7777

7878
pom.project {
79-
name 'textsecure-android'
79+
name 'signal-service-android'
8080
packaging 'aar'
81-
description 'TextSecure library for Android'
82-
url 'https://github.com/WhisperSystems/libtextsecure-java'
81+
description 'Signal Service communication library for Android'
82+
url 'https://github.com/WhisperSystems/libsignal-service-java'
8383

8484
scm {
85-
url 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
86-
connection 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
87-
developerConnection 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
85+
url 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
86+
connection 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
87+
developerConnection 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
8888
}
8989

9090
licenses {

java/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'maven'
33
apply plugin: 'signing'
44

55
sourceCompatibility = 1.7
6-
archivesBaseName = "textsecure-java"
6+
archivesBaseName = "signal-service-java"
77
version = version_number
88
group = group_info
99

@@ -50,15 +50,15 @@ uploadArchives {
5050
}
5151

5252
pom.project {
53-
name 'textscure-java'
53+
name 'signal-service-java'
5454
packaging 'jar'
55-
description 'TetSecure library for Java'
56-
url 'https://github.com/WhisperSystems/libtextsecure-java'
55+
description 'Signal Service communication library for Java'
56+
url 'https://github.com/WhisperSystems/libsignal-service-java'
5757

5858
scm {
59-
url 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
60-
connection 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
61-
developerConnection 'scm:[email protected]:WhisperSystems/libtextsecure-java.git'
59+
url 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
60+
connection 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
61+
developerConnection 'scm:[email protected]:WhisperSystems/libsignal-service-java.git'
6262
}
6363

6464
licenses {

0 commit comments

Comments
 (0)