2021-12-17 21:59:34 +00:00
|
|
|
package b.g.a.b;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/* compiled from: Base64Variant */
|
|
|
|
public final class a implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1;
|
|
|
|
private final int _maxLineLength;
|
|
|
|
public final String _name;
|
|
|
|
private final char _paddingChar;
|
2022-02-01 08:01:17 +00:00
|
|
|
private final EnumC0072a _paddingReadBehaviour;
|
2021-07-24 02:37:17 +00:00
|
|
|
private final boolean _writePadding;
|
2021-12-02 18:53:44 +00:00
|
|
|
public final transient int[] j;
|
|
|
|
public final transient char[] k;
|
|
|
|
public final transient byte[] l;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
/* compiled from: Base64Variant */
|
2021-12-17 21:59:34 +00:00
|
|
|
/* renamed from: b.g.a.b.a$a reason: collision with other inner class name */
|
2022-02-01 08:01:17 +00:00
|
|
|
public enum EnumC0072a {
|
2021-07-24 02:37:17 +00:00
|
|
|
PADDING_FORBIDDEN,
|
|
|
|
PADDING_REQUIRED,
|
|
|
|
PADDING_ALLOWED
|
|
|
|
}
|
|
|
|
|
|
|
|
public a(a aVar, String str, int i) {
|
|
|
|
this(aVar, str, aVar._writePadding, aVar._paddingChar, aVar._paddingReadBehaviour, i);
|
|
|
|
}
|
|
|
|
|
2021-12-17 21:59:34 +00:00
|
|
|
public a(a aVar, String str, boolean z2, char c, int i) {
|
|
|
|
this(aVar, str, z2, c, aVar._paddingReadBehaviour, i);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2022-02-01 08:01:17 +00:00
|
|
|
public a(a aVar, String str, boolean z2, char c, EnumC0072a aVar2, int i) {
|
2021-07-24 02:37:17 +00:00
|
|
|
int[] iArr = new int[128];
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = iArr;
|
2021-07-24 02:37:17 +00:00
|
|
|
char[] cArr = new char[64];
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = cArr;
|
2021-07-24 02:37:17 +00:00
|
|
|
byte[] bArr = new byte[64];
|
2021-12-02 18:53:44 +00:00
|
|
|
this.l = bArr;
|
2021-07-24 02:37:17 +00:00
|
|
|
this._name = str;
|
2021-12-02 18:53:44 +00:00
|
|
|
byte[] bArr2 = aVar.l;
|
2021-07-24 02:37:17 +00:00
|
|
|
System.arraycopy(bArr2, 0, bArr, 0, bArr2.length);
|
2021-12-02 18:53:44 +00:00
|
|
|
char[] cArr2 = aVar.k;
|
2021-07-24 02:37:17 +00:00
|
|
|
System.arraycopy(cArr2, 0, cArr, 0, cArr2.length);
|
2021-12-02 18:53:44 +00:00
|
|
|
int[] iArr2 = aVar.j;
|
2021-07-24 02:37:17 +00:00
|
|
|
System.arraycopy(iArr2, 0, iArr, 0, iArr2.length);
|
|
|
|
this._writePadding = z2;
|
2021-12-17 21:59:34 +00:00
|
|
|
this._paddingChar = c;
|
2021-07-24 02:37:17 +00:00
|
|
|
this._maxLineLength = i;
|
|
|
|
this._paddingReadBehaviour = aVar2;
|
|
|
|
}
|
|
|
|
|
2021-12-17 21:59:34 +00:00
|
|
|
public a(String str, String str2, boolean z2, char c, int i) {
|
2021-07-24 02:37:17 +00:00
|
|
|
int[] iArr = new int[128];
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = iArr;
|
2021-07-24 02:37:17 +00:00
|
|
|
char[] cArr = new char[64];
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = cArr;
|
|
|
|
this.l = new byte[64];
|
2021-07-24 02:37:17 +00:00
|
|
|
this._name = str;
|
|
|
|
this._writePadding = z2;
|
2021-12-17 21:59:34 +00:00
|
|
|
this._paddingChar = c;
|
2021-07-24 02:37:17 +00:00
|
|
|
this._maxLineLength = i;
|
|
|
|
int length = str2.length();
|
|
|
|
if (length == 64) {
|
|
|
|
str2.getChars(0, length, cArr, 0);
|
|
|
|
Arrays.fill(iArr, -1);
|
|
|
|
for (int i2 = 0; i2 < length; i2++) {
|
2021-12-17 21:59:34 +00:00
|
|
|
char c2 = this.k[i2];
|
|
|
|
this.l[i2] = (byte) c2;
|
|
|
|
this.j[c2] = i2;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
if (z2) {
|
2021-12-17 21:59:34 +00:00
|
|
|
this.j[c] = -2;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
2022-02-01 08:01:17 +00:00
|
|
|
this._paddingReadBehaviour = z2 ? EnumC0072a.PADDING_REQUIRED : EnumC0072a.PADDING_FORBIDDEN;
|
2021-07-24 02:37:17 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
throw new IllegalArgumentException(b.d.b.a.a.q("Base64Alphabet length must be exactly 64 (was ", length, ")"));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String a(byte[] bArr) {
|
|
|
|
int length = bArr.length;
|
|
|
|
StringBuilder sb = new StringBuilder((length >> 2) + length + (length >> 3));
|
|
|
|
int i = this._maxLineLength >> 2;
|
|
|
|
int i2 = 0;
|
|
|
|
int i3 = length - 3;
|
|
|
|
while (i2 <= i3) {
|
|
|
|
int i4 = i2 + 1;
|
|
|
|
int i5 = i4 + 1;
|
|
|
|
int i6 = i5 + 1;
|
|
|
|
int i7 = (((bArr[i2] << 8) | (bArr[i4] & 255)) << 8) | (bArr[i5] & 255);
|
2021-12-02 18:53:44 +00:00
|
|
|
sb.append(this.k[(i7 >> 18) & 63]);
|
|
|
|
sb.append(this.k[(i7 >> 12) & 63]);
|
|
|
|
sb.append(this.k[(i7 >> 6) & 63]);
|
|
|
|
sb.append(this.k[i7 & 63]);
|
2021-07-24 02:37:17 +00:00
|
|
|
i--;
|
|
|
|
if (i <= 0) {
|
|
|
|
sb.append('\\');
|
|
|
|
sb.append('n');
|
|
|
|
i = this._maxLineLength >> 2;
|
|
|
|
}
|
|
|
|
i2 = i6;
|
|
|
|
}
|
|
|
|
int i8 = length - i2;
|
|
|
|
if (i8 > 0) {
|
|
|
|
int i9 = i2 + 1;
|
|
|
|
int i10 = bArr[i2] << 16;
|
|
|
|
if (i8 == 2) {
|
|
|
|
i10 |= (bArr[i9] & 255) << 8;
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
sb.append(this.k[(i10 >> 18) & 63]);
|
|
|
|
sb.append(this.k[(i10 >> 12) & 63]);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (this._writePadding) {
|
2021-12-02 18:53:44 +00:00
|
|
|
sb.append(i8 == 2 ? this.k[(i10 >> 6) & 63] : this._paddingChar);
|
2021-07-24 02:37:17 +00:00
|
|
|
sb.append(this._paddingChar);
|
|
|
|
} else if (i8 == 2) {
|
2021-12-02 18:53:44 +00:00
|
|
|
sb.append(this.k[(i10 >> 6) & 63]);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return sb.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int b(int i, char[] cArr, int i2) {
|
|
|
|
int i3 = i2 + 1;
|
2021-12-02 18:53:44 +00:00
|
|
|
char[] cArr2 = this.k;
|
2021-07-24 02:37:17 +00:00
|
|
|
cArr[i2] = cArr2[(i >> 18) & 63];
|
|
|
|
int i4 = i3 + 1;
|
|
|
|
cArr[i3] = cArr2[(i >> 12) & 63];
|
|
|
|
int i5 = i4 + 1;
|
|
|
|
cArr[i4] = cArr2[(i >> 6) & 63];
|
|
|
|
int i6 = i5 + 1;
|
|
|
|
cArr[i5] = cArr2[i & 63];
|
|
|
|
return i6;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int c(int i, int i2, char[] cArr, int i3) {
|
|
|
|
int i4 = i3 + 1;
|
2021-12-02 18:53:44 +00:00
|
|
|
char[] cArr2 = this.k;
|
2021-07-24 02:37:17 +00:00
|
|
|
cArr[i3] = cArr2[(i >> 18) & 63];
|
|
|
|
int i5 = i4 + 1;
|
|
|
|
cArr[i4] = cArr2[(i >> 12) & 63];
|
|
|
|
if (this._writePadding) {
|
|
|
|
int i6 = i5 + 1;
|
|
|
|
cArr[i5] = i2 == 2 ? cArr2[(i >> 6) & 63] : this._paddingChar;
|
|
|
|
int i7 = i6 + 1;
|
|
|
|
cArr[i6] = this._paddingChar;
|
|
|
|
return i7;
|
|
|
|
} else if (i2 != 2) {
|
|
|
|
return i5;
|
|
|
|
} else {
|
|
|
|
int i8 = i5 + 1;
|
|
|
|
cArr[i5] = cArr2[(i >> 6) & 63];
|
|
|
|
return i8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int d() {
|
|
|
|
return this._maxLineLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (obj == this) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (obj == null || obj.getClass() != a.class) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
a aVar = (a) obj;
|
|
|
|
return aVar._paddingChar == this._paddingChar && aVar._maxLineLength == this._maxLineLength && aVar._writePadding == this._writePadding && aVar._paddingReadBehaviour == this._paddingReadBehaviour && this._name.equals(aVar._name);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public int hashCode() {
|
|
|
|
return this._name.hashCode();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Object readResolve() {
|
|
|
|
String str = this._name;
|
|
|
|
a aVar = b.a;
|
|
|
|
if (!aVar._name.equals(str)) {
|
2022-01-27 07:52:47 +00:00
|
|
|
aVar = b.f653b;
|
2021-07-24 02:37:17 +00:00
|
|
|
if (!aVar._name.equals(str)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
aVar = b.c;
|
2021-07-24 02:37:17 +00:00
|
|
|
if (!aVar._name.equals(str)) {
|
|
|
|
aVar = b.d;
|
|
|
|
if (!aVar._name.equals(str)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
throw new IllegalArgumentException(b.d.b.a.a.v("No Base64Variant with name ", str == null ? "<null>" : b.d.b.a.a.w("'", str, "'")));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
boolean z2 = this._writePadding;
|
|
|
|
boolean z3 = aVar._writePadding;
|
|
|
|
return (z2 == z3 && this._paddingChar == aVar._paddingChar && this._paddingReadBehaviour == aVar._paddingReadBehaviour && this._maxLineLength == aVar._maxLineLength && z2 == z3) ? aVar : new a(aVar, this._name, z2, this._paddingChar, this._paddingReadBehaviour, this._maxLineLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
return this._name;
|
|
|
|
}
|
|
|
|
}
|