1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 00:59:39 +02:00

[gitlab-ci] Also check with Java 15

This commit is contained in:
Florian Schmaus 2021-02-14 20:34:48 +01:00
parent 8b0248c346
commit 4e90db3191
9 changed files with 63 additions and 28 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2018 Florian Schmaus
* Copyright © 2014-2021 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -39,8 +39,8 @@ public class AndroidSmackInitializer implements SmackInitializer {
@Override
public List<Exception> initialize() {
SmackConfiguration.setDefaultHostnameVerifier(new StrictHostnameVerifier());
Base64.setEncoder(AndroidBase64Encoder.getInstance());
Base64UrlSafeEncoder.setEncoder(AndroidBase64UrlSafeEncoder.getInstance());
Base64.setEncoder(AndroidBase64Encoder.INSTANCE);
Base64UrlSafeEncoder.setEncoder(AndroidBase64UrlSafeEncoder.INSTANCE);
return null;
}

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2019 Florian Schmaus
* Copyright © 2014-2021 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,7 +24,10 @@ import android.util.Base64;
*/
public final class AndroidBase64Encoder implements org.jivesoftware.smack.util.stringencoder.Base64.Encoder {
private static AndroidBase64Encoder instance = new AndroidBase64Encoder();
/**
* An instance of this encoder.
*/
public static AndroidBase64Encoder INSTANCE = new AndroidBase64Encoder();
private static final int BASE64_ENCODER_FLAGS = Base64.NO_WRAP;
@ -32,10 +35,6 @@ public final class AndroidBase64Encoder implements org.jivesoftware.smack.util.s
// Use getInstance()
}
public static AndroidBase64Encoder getInstance() {
return instance;
}
@Override
public byte[] decode(String string) {
return Base64.decode(string, Base64.DEFAULT);

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2019 Florian Schmaus
* Copyright © 2014-2021 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,9 +22,16 @@ import org.jivesoftware.smack.util.stringencoder.StringEncoder;
import android.util.Base64;
/**
* An URL-safe Base64 encoder.
* @author Florian Schmaus
*/
public final class AndroidBase64UrlSafeEncoder implements StringEncoder<String> {
private static AndroidBase64UrlSafeEncoder instance = new AndroidBase64UrlSafeEncoder();
/**
* An instance of this encoder.
*/
public static AndroidBase64UrlSafeEncoder INSTANCE = new AndroidBase64UrlSafeEncoder();
private static final int BASE64_ENCODER_FLAGS = Base64.URL_SAFE | Base64.NO_WRAP;
@ -32,10 +39,6 @@ public final class AndroidBase64UrlSafeEncoder implements StringEncoder<String>
// Use getInstance()
}
public static AndroidBase64UrlSafeEncoder getInstance() {
return instance;
}
@Override
public String encode(String string) {
return Base64.encodeToString(string.getBytes(StandardCharsets.UTF_8), BASE64_ENCODER_FLAGS);

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2017 Florian Schmaus
* Copyright © 2014-2021 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -34,6 +34,11 @@ import android.util.Log;
*/
public class AndroidDebugger extends AbstractDebugger {
/**
* Constructs a new Smack debugger for Android.
*
* @param connection the connection to debug.
*/
public AndroidDebugger(XMPPConnection connection) {
super(connection);
}