331 lines
7 KiB
Smali
331 lines
7 KiB
Smali
|
.class public final Lokio/j;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "Okio.java"
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field static final logger:Ljava/util/logging/Logger;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method static constructor <clinit>()V
|
||
|
.locals 1
|
||
|
|
||
|
const-class v0, Lokio/j;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sput-object v0, Lokio/j;->logger:Ljava/util/logging/Logger;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private constructor <init>()V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static B(Ljava/io/File;)Lokio/r;
|
||
|
.locals 1
|
||
|
.annotation system Ldalvik/annotation/Throws;
|
||
|
value = {
|
||
|
Ljava/io/FileNotFoundException;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p0, :cond_0
|
||
|
|
||
|
new-instance v0, Ljava/io/FileInputStream;
|
||
|
|
||
|
invoke-direct {v0, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
|
||
|
|
||
|
invoke-static {v0}, Lokio/j;->v(Ljava/io/InputStream;)Lokio/r;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
return-object p0
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string v0, "file == null"
|
||
|
|
||
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
.end method
|
||
|
|
||
|
.method private static a(Ljava/io/OutputStream;Lokio/s;)Lokio/q;
|
||
|
.locals 1
|
||
|
|
||
|
if-eqz p0, :cond_1
|
||
|
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
new-instance v0, Lokio/j$1;
|
||
|
|
||
|
invoke-direct {v0, p1, p0}, Lokio/j$1;-><init>(Lokio/s;Ljava/io/OutputStream;)V
|
||
|
|
||
|
return-object v0
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string p1, "timeout == null"
|
||
|
|
||
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string p1, "out == null"
|
||
|
|
||
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
.end method
|
||
|
|
||
|
.method private static a(Ljava/io/InputStream;Lokio/s;)Lokio/r;
|
||
|
.locals 1
|
||
|
|
||
|
if-eqz p0, :cond_1
|
||
|
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
new-instance v0, Lokio/j$2;
|
||
|
|
||
|
invoke-direct {v0, p1, p0}, Lokio/j$2;-><init>(Lokio/s;Ljava/io/InputStream;)V
|
||
|
|
||
|
return-object v0
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string p1, "timeout == null"
|
||
|
|
||
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string p1, "in == null"
|
||
|
|
||
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
.end method
|
||
|
|
||
|
.method static a(Ljava/lang/AssertionError;)Z
|
||
|
.locals 1
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/lang/AssertionError;->getCause()Ljava/lang/Throwable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/lang/AssertionError;->getMessage()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/lang/AssertionError;->getMessage()Ljava/lang/String;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
const-string v0, "getsockname failed"
|
||
|
|
||
|
invoke-virtual {p0, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
||
|
|
||
|
move-result p0
|
||
|
|
||
|
if-eqz p0, :cond_0
|
||
|
|
||
|
const/4 p0, 0x1
|
||
|
|
||
|
return p0
|
||
|
|
||
|
:cond_0
|
||
|
const/4 p0, 0x0
|
||
|
|
||
|
return p0
|
||
|
.end method
|
||
|
|
||
|
.method public static b(Lokio/q;)Lokio/BufferedSink;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Lokio/l;
|
||
|
|
||
|
invoke-direct {v0, p0}, Lokio/l;-><init>(Lokio/q;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static b(Lokio/r;)Lokio/d;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Lokio/m;
|
||
|
|
||
|
invoke-direct {v0, p0}, Lokio/m;-><init>(Lokio/r;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static b(Ljava/io/OutputStream;)Lokio/q;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Lokio/s;
|
||
|
|
||
|
invoke-direct {v0}, Lokio/s;-><init>()V
|
||
|
|
||
|
invoke-static {p0, v0}, Lokio/j;->a(Ljava/io/OutputStream;Lokio/s;)Lokio/q;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
return-object p0
|
||
|
.end method
|
||
|
|
||
|
.method public static b(Ljava/net/Socket;)Lokio/q;
|
||
|
.locals 2
|
||
|
.annotation system Ldalvik/annotation/Throws;
|
||
|
value = {
|
||
|
Ljava/io/IOException;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p0, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-static {p0}, Lokio/j;->d(Ljava/net/Socket;)Lokio/a;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
invoke-static {p0, v0}, Lokio/j;->a(Ljava/io/OutputStream;Lokio/s;)Lokio/q;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
new-instance v1, Lokio/a$1;
|
||
|
|
||
|
invoke-direct {v1, v0, p0}, Lokio/a$1;-><init>(Lokio/a;Lokio/q;)V
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p0, Ljava/io/IOException;
|
||
|
|
||
|
const-string v0, "socket\'s output stream == null"
|
||
|
|
||
|
invoke-direct {p0, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string v0, "socket == null"
|
||
|
|
||
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
.end method
|
||
|
|
||
|
.method public static c(Ljava/net/Socket;)Lokio/r;
|
||
|
.locals 2
|
||
|
.annotation system Ldalvik/annotation/Throws;
|
||
|
value = {
|
||
|
Ljava/io/IOException;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p0, :cond_1
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-static {p0}, Lokio/j;->d(Ljava/net/Socket;)Lokio/a;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
invoke-static {p0, v0}, Lokio/j;->a(Ljava/io/InputStream;Lokio/s;)Lokio/r;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
new-instance v1, Lokio/a$2;
|
||
|
|
||
|
invoke-direct {v1, v0, p0}, Lokio/a$2;-><init>(Lokio/a;Lokio/r;)V
|
||
|
|
||
|
return-object v1
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p0, Ljava/io/IOException;
|
||
|
|
||
|
const-string v0, "socket\'s input stream == null"
|
||
|
|
||
|
invoke-direct {p0, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
|
||
|
:cond_1
|
||
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
||
|
|
||
|
const-string v0, "socket == null"
|
||
|
|
||
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p0
|
||
|
.end method
|
||
|
|
||
|
.method private static d(Ljava/net/Socket;)Lokio/a;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Lokio/j$3;
|
||
|
|
||
|
invoke-direct {v0, p0}, Lokio/j$3;-><init>(Ljava/net/Socket;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static v(Ljava/io/InputStream;)Lokio/r;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Lokio/s;
|
||
|
|
||
|
invoke-direct {v0}, Lokio/s;-><init>()V
|
||
|
|
||
|
invoke-static {p0, v0}, Lokio/j;->a(Ljava/io/InputStream;Lokio/s;)Lokio/r;
|
||
|
|
||
|
move-result-object p0
|
||
|
|
||
|
return-object p0
|
||
|
.end method
|