Files
rr3-apk/decompiled-community/sources/okhttp3/internal/http/StatusLine.java
Daniel Elliott c080f0d97f Add Discord community version (64-bit only)
- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
2026-02-18 15:48:36 -08:00

73 lines
2.3 KiB
Java

package okhttp3.internal.http;
import java.net.ProtocolException;
import okhttp3.Protocol;
/* loaded from: classes5.dex */
public final class StatusLine {
public final int code;
public final String message;
public final Protocol protocol;
public StatusLine(Protocol protocol, int i, String str) {
this.protocol = protocol;
this.code = i;
this.message = str;
}
public static StatusLine parse(String str) {
Protocol protocol;
int i;
String str2;
if (str.startsWith("HTTP/1.")) {
i = 9;
if (str.length() < 9 || str.charAt(8) != ' ') {
throw new ProtocolException("Unexpected status line: " + str);
}
int charAt = str.charAt(7) - '0';
if (charAt == 0) {
protocol = Protocol.HTTP_1_0;
} else if (charAt == 1) {
protocol = Protocol.HTTP_1_1;
} else {
throw new ProtocolException("Unexpected status line: " + str);
}
} else if (str.startsWith("ICY ")) {
protocol = Protocol.HTTP_1_0;
i = 4;
} else {
throw new ProtocolException("Unexpected status line: " + str);
}
int i2 = i + 3;
if (str.length() < i2) {
throw new ProtocolException("Unexpected status line: " + str);
}
try {
int parseInt = Integer.parseInt(str.substring(i, i2));
if (str.length() <= i2) {
str2 = "";
} else {
if (str.charAt(i2) != ' ') {
throw new ProtocolException("Unexpected status line: " + str);
}
str2 = str.substring(i + 4);
}
return new StatusLine(protocol, parseInt, str2);
} catch (NumberFormatException unused) {
throw new ProtocolException("Unexpected status line: " + str);
}
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.protocol == Protocol.HTTP_1_0 ? "HTTP/1.0" : "HTTP/1.1");
sb.append(' ');
sb.append(this.code);
if (this.message != null) {
sb.append(' ');
sb.append(this.message);
}
return sb.toString();
}
}