Skip to content

Commit cd9daf2

Browse files
authored
Merge pull request #728 from 317787106/feature/update_depend
feat(dependency): update dependency for security
2 parents 0d4e9a0 + 71bc88e commit cd9daf2

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

build.gradle

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ buildscript {
4545
}
4646
ext {
4747
projectVersion = '1.3.0-RELEASE'
48-
grpcVersion = '1.6.1'
49-
protobufVersion = '3.3.0'
48+
grpcVersion = '1.60.0'
49+
protobufVersion = '3.21.12'
5050
protobufGradlePluginVersion = '0.8.0'
51-
springCloudConsulVersion = '1.2.1.RELEASE'
5251
}
5352

5453
dependencies {
@@ -63,44 +62,40 @@ task wrapper(type: Wrapper) {
6362
}
6463

6564
dependencies {
66-
compile group: 'junit', name: 'junit', version: '4.12'
67-
compile group: 'com.beust', name: 'jcommander', version: '1.72'
65+
compile group: 'junit', name: 'junit', version: '4.13.2'
66+
compile group: 'com.beust', name: 'jcommander', version: '1.82'
6867
//compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
6968
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
70-
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
71-
compile 'com.maxmind.geoip2:geoip2:2.10.0'
69+
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.13'
7270

7371
// google grpc
74-
compile group: 'io.grpc', name: 'grpc-netty', version: '1.9.0'
75-
compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.9.0'
76-
compile group: 'io.grpc', name: 'grpc-stub', version: '1.9.0'
72+
compile group: 'io.grpc', name: 'grpc-netty', version: "${grpcVersion}"
73+
compile group: 'io.grpc', name: 'grpc-protobuf', version: "${grpcVersion}"
74+
compile group: 'io.grpc', name: 'grpc-stub', version: "${grpcVersion}"
7775

7876
compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.4'
79-
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
77+
compile group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1'
8078
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
81-
compile "com.google.code.findbugs:jsr305:3.0.0"
82-
compile "org.springframework.cloud:spring-cloud-starter-consul-discovery:${springCloudConsulVersion}"
83-
compile "org.apache.commons:commons-collections4:4.0"
84-
compile "org.apache.commons:commons-lang3:3.4"
79+
compile "org.apache.commons:commons-lang3:3.14.0"
8580
compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3'
86-
compile 'com.alibaba:fastjson:1.2.76'
81+
compile 'com.alibaba:fastjson:1.2.83'
8782

88-
compile group: 'commons-io', name: 'commons-io', version: '2.6'
83+
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.1'
8984
compile group: 'org.projectlombok', name: 'lombok', version: '1.18.2'
9085

91-
compile group: 'org.jline', name: 'jline', version: '3.15.0'
86+
compile group: 'org.jline', name: 'jline', version: '3.25.0'
9287
compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
9388
}
9489

9590
protobuf {
9691
generatedFilesBaseDir = "$projectDir/src/"
9792
protoc {
98-
artifact = "com.google.protobuf:protoc:3.5.1-1"
93+
artifact = "com.google.protobuf:protoc:${protobufVersion}"
9994

10095
}
10196
plugins {
10297
grpc {
103-
artifact = 'io.grpc:protoc-gen-grpc-java:1.9.0'
98+
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
10499
}
105100
}
106101
generateProtoTasks {
@@ -129,4 +124,5 @@ shadowJar {
129124
baseName = 'wallet-cli'
130125
classifier = null
131126
version = null
127+
mergeServiceFiles() // https://github.com/grpc/grpc-java/issues/10853
132128
}

src/main/java/org/tron/demo/ECKeyDemo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.math.BigInteger;
66
import java.util.Arrays;
77
import org.bouncycastle.math.ec.ECPoint;
8-
import org.springframework.util.StringUtils;
98
import org.tron.common.crypto.ECKey;
109
import org.tron.common.crypto.Hash;
1110
import org.tron.common.crypto.Sha256Sm3Hash;
@@ -50,7 +49,7 @@ public static String address2Encode58CheckDemo(byte[] input) {
5049

5150
private static String private2Address(byte[] privateKey) throws CipherException {
5251
ECKey eCkey;
53-
if (StringUtils.isEmpty(privateKey)) {
52+
if (privateKey == null ) {
5453
eCkey = new ECKey(Utils.getRandom()); // Gen new Keypair
5554
} else {
5655
eCkey = ECKey.fromPrivate(privateKey);

src/main/java/org/tron/demo/SelectFileDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.tron.demo;
22

3-
import org.apache.commons.lang.ArrayUtils;
3+
import org.apache.commons.lang3.ArrayUtils;
44

55
import java.io.File;
66
import java.io.IOException;

src/main/java/org/tron/walletcli/Client.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,6 +4399,7 @@ private void run() {
43994399
LineReader lineReader = LineReaderBuilder.builder()
44004400
.terminal(terminal)
44014401
.completer(commandCompleter)
4402+
.option(LineReader.Option.CASE_INSENSITIVE, true)
44024403
.build();
44034404
String prompt = "wallet> ";
44044405

src/main/java/org/tron/walletserver/GrpcClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import io.grpc.ManagedChannel;
99
import io.grpc.ManagedChannelBuilder;
1010
import lombok.extern.slf4j.Slf4j;
11-
import org.apache.commons.lang.StringUtils;
11+
import org.apache.commons.lang3.StringUtils;
1212
import org.tron.api.GrpcAPI;
1313
import org.tron.api.GrpcAPI.*;
1414
import org.tron.api.GrpcAPI.Return.response_code;
@@ -96,13 +96,13 @@ public class GrpcClient {
9696
public GrpcClient(String fullnode, String soliditynode) {
9797
if (!StringUtils.isEmpty(fullnode)) {
9898
channelFull = ManagedChannelBuilder.forTarget(fullnode)
99-
.usePlaintext(true)
99+
.usePlaintext()
100100
.build();
101101
blockingStubFull = WalletGrpc.newBlockingStub(channelFull);
102102
}
103103
if (!StringUtils.isEmpty(soliditynode)) {
104104
channelSolidity = ManagedChannelBuilder.forTarget(soliditynode)
105-
.usePlaintext(true)
105+
.usePlaintext()
106106
.build();
107107
blockingStubSolidity = WalletSolidityGrpc.newBlockingStub(channelSolidity);
108108
blockingStubExtension = WalletExtensionGrpc.newBlockingStub(channelSolidity);

0 commit comments

Comments
 (0)