Skip to content

Commit 01ea945

Browse files
committed
Update cleanup
1 parent 8fabef1 commit 01ea945

File tree

9 files changed

+17
-25
lines changed

9 files changed

+17
-25
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ build
66

77
# Ignore WhatsApp credential key storage
88
credentials.json
9-
10-
# Ignore WhatsJava fat jar
11-
/build/libs/WhatsJava-all.jar

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
// Apply the java-library plugin to add support for Java Library
33
id 'java'
4+
id 'maven'
45
id "com.github.johnrengelman.shadow" version "6.1.0"
56
}
67

0 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.
Binary file not shown.

build/libs/WhatsJava-all.jar

149 KB
Binary file not shown.

src/main/java/icu/jnet/whatsjava/WAClient.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,5 @@ public void onBinaryMessage(WebSocket websocket, byte[] message) throws DecoderE
307307
}
308308
}
309309
}
310-
311-
// Send all other types of messages directly to the active interface
312-
//listener.onTextMessage(json);
313310
}
314311
}

src/main/java/icu/jnet/whatsjava/WAMessage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ private static Object[] messageToObject(JsonArray childrenArray) {
9999

100100
for(int i = 0; i < childrenArray.size(); i++) {
101101
// WebMessageInfo objects are encoded with base64 and need to be decoded
102-
String base64Message = childrenArray.get(i).getAsJsonArray().get(2).getAsJsonArray()
103-
.get(0).getAsString();
102+
String base64Message = childrenArray.get(i).getAsJsonArray().get(2).getAsJsonArray().get(0).getAsString();
104103

105104
byte[] byteMessage = Base64.getDecoder().decode(base64Message);
106105

src/main/java/icu/jnet/whatsjava/web/WebImageMessage.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,26 @@ public class WebImageMessage extends WebMessage {
1010
* E2E media image message
1111
*
1212
*/
13-
14-
15-
private String mimetype, url, caption;
16-
private byte[] fileSha256, mediaKey, jpegThumbnail;
17-
private long fileLength;
18-
private int width, height;
19-
20-
13+
14+
private final String mimetype, url, caption;
15+
private final byte[] fileSha256, mediaKey, jpegThumbnail;
16+
private final long fileLength;
17+
private final int width, height;
18+
2119
public WebImageMessage(WebMessageInfo message) {
2220
super(message);
2321

2422
ImageMessage imageMessage = message.getMessage().getImageMessage();
2523

26-
url = imageMessage.getUrl();
27-
mimetype = imageMessage.getMimetype();
28-
fileSha256 = imageMessage.getFileSha256().toByteArray();
29-
fileLength = imageMessage.getFileLength();
30-
height = imageMessage.getHeight();
31-
width = imageMessage.getWidth();
32-
mediaKey = imageMessage.getMediaKey().toByteArray();
33-
jpegThumbnail = imageMessage.getJpegThumbnail().toByteArray();
34-
caption = imageMessage.getCaption();
24+
this.url = imageMessage.getUrl();
25+
this.mimetype = imageMessage.getMimetype();
26+
this.fileSha256 = imageMessage.getFileSha256().toByteArray();
27+
this.fileLength = imageMessage.getFileLength();
28+
this.height = imageMessage.getHeight();
29+
this.width = imageMessage.getWidth();
30+
this. mediaKey = imageMessage.getMediaKey().toByteArray();
31+
this.jpegThumbnail = imageMessage.getJpegThumbnail().toByteArray();
32+
this.caption = imageMessage.getCaption();
3533
}
3634

3735
public String getMimetype() {

0 commit comments

Comments
 (0)