309 lines
9.9 KiB
Java
309 lines
9.9 KiB
Java
package o;
|
|
|
|
import com.google.common.base.Ascii;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.IOException;
|
|
import java.math.BigInteger;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/* renamed from: o.gnC, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public final class C15314gnC extends AbstractC15315gnE {
|
|
private static final Map a = new HashMap();
|
|
private byte[] b;
|
|
public final String d;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // o.AbstractC15315gnE
|
|
public final boolean d() {
|
|
return false;
|
|
}
|
|
|
|
public static C15314gnC d(Object obj) {
|
|
if (obj == null || (obj instanceof C15314gnC)) {
|
|
return (C15314gnC) obj;
|
|
}
|
|
if (obj instanceof InterfaceC15342gnr) {
|
|
InterfaceC15342gnr interfaceC15342gnr = (InterfaceC15342gnr) obj;
|
|
if (interfaceC15342gnr.i() instanceof C15314gnC) {
|
|
return (C15314gnC) interfaceC15342gnr.i();
|
|
}
|
|
}
|
|
StringBuilder sb = new StringBuilder("illegal object in getInstance: ");
|
|
sb.append(obj.getClass().getName());
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
public static C15314gnC d(AbstractC15321gnP abstractC15321gnP) {
|
|
InterfaceC15342gnr interfaceC15342gnr = abstractC15321gnP.d;
|
|
AbstractC15315gnE i = interfaceC15342gnr != null ? interfaceC15342gnr.i() : null;
|
|
if (i instanceof C15314gnC) {
|
|
return d(i);
|
|
}
|
|
InterfaceC15342gnr interfaceC15342gnr2 = abstractC15321gnP.d;
|
|
return a(gnD.b(interfaceC15342gnr2 != null ? interfaceC15342gnr2.i() : null).b());
|
|
}
|
|
|
|
private C15314gnC(byte[] bArr) {
|
|
byte[] bArr2;
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
boolean z = true;
|
|
long j = 0;
|
|
BigInteger bigInteger = null;
|
|
for (int i = 0; i != bArr.length; i++) {
|
|
byte b = bArr[i];
|
|
if (j <= 72057594037927808L) {
|
|
long j2 = j + (b & Ascii.DEL);
|
|
if ((b & 128) == 0) {
|
|
if (z) {
|
|
if (j2 < 40) {
|
|
stringBuffer.append('0');
|
|
} else if (j2 < 80) {
|
|
stringBuffer.append('1');
|
|
j2 -= 40;
|
|
} else {
|
|
stringBuffer.append('2');
|
|
j2 -= 80;
|
|
}
|
|
z = false;
|
|
}
|
|
stringBuffer.append('.');
|
|
stringBuffer.append(j2);
|
|
j = 0;
|
|
} else {
|
|
j = j2 << 7;
|
|
}
|
|
} else {
|
|
BigInteger or = (bigInteger == null ? BigInteger.valueOf(j) : bigInteger).or(BigInteger.valueOf(b & Ascii.DEL));
|
|
if ((b & 128) == 0) {
|
|
if (z) {
|
|
stringBuffer.append('2');
|
|
or = or.subtract(BigInteger.valueOf(80L));
|
|
z = false;
|
|
}
|
|
stringBuffer.append('.');
|
|
stringBuffer.append(or);
|
|
bigInteger = null;
|
|
j = 0;
|
|
} else {
|
|
bigInteger = or.shiftLeft(7);
|
|
}
|
|
}
|
|
}
|
|
this.d = stringBuffer.toString();
|
|
if (bArr == null) {
|
|
bArr2 = null;
|
|
} else {
|
|
bArr2 = new byte[bArr.length];
|
|
System.arraycopy(bArr, 0, bArr2, 0, bArr.length);
|
|
}
|
|
this.b = bArr2;
|
|
}
|
|
|
|
public C15314gnC(String str) {
|
|
char charAt;
|
|
if (str == null) {
|
|
throw new IllegalArgumentException("'identifier' cannot be null");
|
|
}
|
|
if (str.length() >= 3 && str.charAt(1) == '.' && (charAt = str.charAt(0)) >= '0' && charAt <= '2' && c(str, 2)) {
|
|
this.d = str;
|
|
return;
|
|
}
|
|
StringBuilder sb = new StringBuilder("string ");
|
|
sb.append(str);
|
|
sb.append(" not an OID");
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
public C15314gnC(C15314gnC c15314gnC, String str) {
|
|
if (!c(str, 0)) {
|
|
StringBuilder sb = new StringBuilder("string ");
|
|
sb.append(str);
|
|
sb.append(" not a valid OID branch");
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(c15314gnC.d);
|
|
sb2.append(".");
|
|
sb2.append(str);
|
|
this.d = sb2.toString();
|
|
}
|
|
|
|
private static void c(ByteArrayOutputStream byteArrayOutputStream, long j) {
|
|
byte[] bArr = new byte[9];
|
|
int i = 8;
|
|
bArr[8] = (byte) (((int) j) & 127);
|
|
while (j >= 128) {
|
|
j >>= 7;
|
|
i--;
|
|
bArr[i] = (byte) ((((int) j) & 127) | 128);
|
|
}
|
|
byteArrayOutputStream.write(bArr, i, 9 - i);
|
|
}
|
|
|
|
private static void c(ByteArrayOutputStream byteArrayOutputStream, BigInteger bigInteger) {
|
|
int bitLength = (bigInteger.bitLength() + 6) / 7;
|
|
if (bitLength == 0) {
|
|
byteArrayOutputStream.write(0);
|
|
return;
|
|
}
|
|
byte[] bArr = new byte[bitLength];
|
|
int i = bitLength - 1;
|
|
for (int i2 = i; i2 >= 0; i2--) {
|
|
bArr[i2] = (byte) ((bigInteger.intValue() & 127) | 128);
|
|
bigInteger = bigInteger.shiftRight(7);
|
|
}
|
|
bArr[i] = (byte) (bArr[i] & Ascii.DEL);
|
|
byteArrayOutputStream.write(bArr, 0, bitLength);
|
|
}
|
|
|
|
private byte[] e() {
|
|
byte[] bArr;
|
|
synchronized (this) {
|
|
if (this.b == null) {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
goW gow = new goW(this.d);
|
|
int parseInt = Integer.parseInt(gow.a()) * 40;
|
|
String a2 = gow.a();
|
|
if (a2.length() <= 18) {
|
|
c(byteArrayOutputStream, parseInt + Long.parseLong(a2));
|
|
} else {
|
|
c(byteArrayOutputStream, new BigInteger(a2).add(BigInteger.valueOf(parseInt)));
|
|
}
|
|
while (gow.e != -1) {
|
|
String a3 = gow.a();
|
|
if (a3.length() <= 18) {
|
|
c(byteArrayOutputStream, Long.parseLong(a3));
|
|
} else {
|
|
c(byteArrayOutputStream, new BigInteger(a3));
|
|
}
|
|
}
|
|
this.b = byteArrayOutputStream.toByteArray();
|
|
}
|
|
bArr = this.b;
|
|
}
|
|
return bArr;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // o.AbstractC15315gnE
|
|
public final int c() throws IOException {
|
|
int length = e().length;
|
|
return goV.d(length) + 1 + length;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // o.AbstractC15315gnE
|
|
public final void c(gnG gng) throws IOException {
|
|
byte[] e = e();
|
|
gng.a(6);
|
|
gng.d(e.length);
|
|
gng.a.write(e);
|
|
}
|
|
|
|
@Override // o.AbstractC15346gnv
|
|
public final int hashCode() {
|
|
return this.d.hashCode();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // o.AbstractC15315gnE
|
|
protected final boolean e(AbstractC15315gnE abstractC15315gnE) {
|
|
if (abstractC15315gnE == this) {
|
|
return true;
|
|
}
|
|
if (abstractC15315gnE instanceof C15314gnC) {
|
|
return this.d.equals(((C15314gnC) abstractC15315gnE).d);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x001a, code lost:
|
|
|
|
if (r3 != '.') goto L17;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static boolean c(java.lang.String r5, int r6) {
|
|
/*
|
|
int r0 = r5.length()
|
|
L4:
|
|
r1 = 0
|
|
r2 = r1
|
|
L6:
|
|
int r0 = r0 + (-1)
|
|
if (r0 < r6) goto L1f
|
|
char r3 = r5.charAt(r0)
|
|
r4 = 48
|
|
if (r4 > r3) goto L18
|
|
r4 = 57
|
|
if (r3 > r4) goto L18
|
|
r2 = 1
|
|
goto L6
|
|
L18:
|
|
r4 = 46
|
|
if (r3 != r4) goto L1e
|
|
if (r2 != 0) goto L4
|
|
L1e:
|
|
return r1
|
|
L1f:
|
|
return r2
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.C15314gnC.c(java.lang.String, int):boolean");
|
|
}
|
|
|
|
public final C15314gnC a() {
|
|
Map map = a;
|
|
synchronized (map) {
|
|
LWm lWm = new LWm(e());
|
|
C15314gnC c15314gnC = (C15314gnC) map.get(lWm);
|
|
if (c15314gnC != null) {
|
|
return c15314gnC;
|
|
}
|
|
map.put(lWm, this);
|
|
return this;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.gnC$LWm */
|
|
/* loaded from: classes6.dex */
|
|
public static class LWm {
|
|
private final byte[] b;
|
|
private int d;
|
|
|
|
LWm(byte[] bArr) {
|
|
this.d = grK.c(bArr);
|
|
this.b = bArr;
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (obj instanceof LWm) {
|
|
return grK.b(this.b, ((LWm) obj).b);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.d;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static C15314gnC a(byte[] bArr) {
|
|
LWm lWm = new LWm(bArr);
|
|
Map map = a;
|
|
synchronized (map) {
|
|
C15314gnC c15314gnC = (C15314gnC) map.get(lWm);
|
|
return c15314gnC != null ? c15314gnC : new C15314gnC(bArr);
|
|
}
|
|
}
|
|
|
|
public final String toString() {
|
|
return this.d;
|
|
}
|
|
}
|