Remove unused dependencies, Optional QR code feature
This commit is contained in:
parent
0b0de0cd1a
commit
5de875cdcd
@ -49,15 +49,11 @@
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.harawata</groupId>
|
||||
<artifactId>appdirs</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.tdlight</groupId>
|
||||
|
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>it.tdlight</groupId>
|
||||
<artifactId>tdlight-java-bom</artifactId>
|
||||
<version>2.8.9.4</version>
|
||||
<version>2.8.10.0</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -8,7 +8,7 @@ import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||
import java.util.Hashtable;
|
||||
|
||||
class QrCodeTerminal {
|
||||
public class QrCodeTerminal {
|
||||
|
||||
public static String getQr(String url) {
|
||||
int width = 40;
|
||||
@ -24,7 +24,7 @@ class QrCodeTerminal {
|
||||
}
|
||||
}
|
||||
|
||||
public static String toAscii(BitMatrix bitMatrix) {
|
||||
static String toAscii(BitMatrix bitMatrix) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int rows = 0; rows < bitMatrix.getHeight(); rows++) {
|
||||
for (int cols = 0; cols < bitMatrix.getWidth(); cols++) {
|
||||
|
@ -4,9 +4,13 @@ import it.tdlight.common.utils.ScannerUtils;
|
||||
import it.tdlight.jni.TdApi.TermsOfService;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.function.Consumer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
final class ScannerClientInteraction implements ClientInteraction {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ScannerClientInteraction.class);
|
||||
|
||||
private final ExecutorService blockingExecutor;
|
||||
private final Authenticable authenticable;
|
||||
|
||||
@ -83,8 +87,13 @@ final class ScannerClientInteraction implements ClientInteraction {
|
||||
String link = ((ParameterInfoNotifyLink) parameterInfo).getLink();
|
||||
System.out.println("Please confirm this login link on another device: " + link);
|
||||
System.out.println();
|
||||
try {
|
||||
System.out.println(QrCodeTerminal.getQr(link));
|
||||
System.out.println();
|
||||
} catch (NoClassDefFoundError ex) {
|
||||
LOG.warn("QR code library is missing!"
|
||||
+ " Please add the following dependency to your project: com.google.zxing:core");
|
||||
}
|
||||
resultCons.accept("");
|
||||
return;
|
||||
case TERMS_OF_SERVICE:
|
||||
|
@ -2,7 +2,7 @@ module tdlight.java {
|
||||
requires tdlight.api;
|
||||
requires org.reactivestreams;
|
||||
requires org.slf4j;
|
||||
requires com.google.zxing;
|
||||
requires static com.google.zxing;
|
||||
exports it.tdlight.tdlight;
|
||||
exports it.tdlight.tdnative;
|
||||
exports it.tdlight.tdlib;
|
||||
|
@ -60,13 +60,10 @@
|
||||
<artifactId>reactive-streams</artifactId>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.harawata</groupId>
|
||||
<artifactId>appdirs</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
@ -58,13 +58,10 @@
|
||||
<artifactId>reactive-streams</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.harawata</groupId>
|
||||
<artifactId>appdirs</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
@ -58,13 +58,10 @@
|
||||
<artifactId>reactive-streams</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.harawata</groupId>
|
||||
<artifactId>appdirs</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user