296 lines
7.4 KiB
Smali
296 lines
7.4 KiB
Smali
.class public final Lcom/my/target/HttpAdRequest;
|
|
.super Lcom/my/target/HttpRequest;
|
|
.source "HttpAdRequest.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/my/target/HttpRequest<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/my/target/HttpRequest;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static d()Lcom/my/target/HttpAdRequest;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Lcom/my/target/HttpAdRequest;
|
|
|
|
invoke-direct {v0}, Lcom/my/target/HttpAdRequest;-><init>()V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected synthetic a(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/Object;
|
|
.locals 0
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1, p2}, Lcom/my/target/HttpAdRequest;->c(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method protected c(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;
|
|
.locals 5
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
const/4 p2, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "send ad request: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/my/target/Tracer;->a(Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/net/URL;
|
|
|
|
invoke-direct {v1, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/net/HttpURLConnection;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
const/16 v0, 0x2710
|
|
|
|
.line 3
|
|
:try_start_1
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V
|
|
|
|
.line 4
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 5
|
|
invoke-virtual {p1, v0}, Ljava/net/HttpURLConnection;->setInstanceFollowRedirects(Z)V
|
|
|
|
const-string v0, "connection"
|
|
|
|
const-string v1, "close"
|
|
|
|
.line 6
|
|
invoke-virtual {p1, v0, v1}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 7
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->connect()V
|
|
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getResponseCode()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/my/target/HttpRequest;->b:I
|
|
|
|
.line 9
|
|
iget v0, p0, Lcom/my/target/HttpRequest;->b:I
|
|
|
|
const/16 v1, 0xc8
|
|
|
|
if-ne v0, v1, :cond_1
|
|
|
|
.line 10
|
|
new-instance v0, Ljava/io/BufferedReader;
|
|
|
|
new-instance v1, Ljava/io/InputStreamReader;
|
|
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "UTF-8"
|
|
|
|
invoke-static {v3}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v1, v2, v3}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
|
|
|
|
invoke-direct {v0, v1}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
|
|
|
|
.line 11
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
.line 12
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 13
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
.line 14
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
|
|
|
|
.line 15
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/my/target/HttpRequest;->c:Ljava/lang/Object;
|
|
|
|
goto :goto_2
|
|
|
|
.line 16
|
|
:cond_1
|
|
iget v0, p0, Lcom/my/target/HttpRequest;->b:I
|
|
|
|
const/16 v1, 0xcc
|
|
|
|
if-eq v0, v1, :cond_2
|
|
|
|
.line 17
|
|
iput-boolean p2, p0, Lcom/my/target/HttpRequest;->a:Z
|
|
|
|
.line 18
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "ad request error: response code "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v1, p0, Lcom/my/target/HttpRequest;->b:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/my/target/HttpRequest;->d:Ljava/lang/String;
|
|
|
|
.line 19
|
|
iget-object v0, p0, Lcom/my/target/HttpRequest;->d:Ljava/lang/String;
|
|
|
|
invoke-static {v0}, Lcom/my/target/Tracer;->a(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_2
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
move-object v4, v0
|
|
|
|
move-object v0, p1
|
|
|
|
move-object p1, v4
|
|
|
|
.line 20
|
|
:goto_1
|
|
iput-boolean p2, p0, Lcom/my/target/HttpRequest;->a:Z
|
|
|
|
.line 21
|
|
invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
iput-object p2, p0, Lcom/my/target/HttpRequest;->d:Ljava/lang/String;
|
|
|
|
.line 22
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v0, "ad request error: "
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v0, p0, Lcom/my/target/HttpRequest;->d:Ljava/lang/String;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Lcom/my/target/Tracer;->a(Ljava/lang/String;)V
|
|
|
|
:cond_2
|
|
:goto_2
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 23
|
|
invoke-virtual {p1}, Ljava/net/HttpURLConnection;->disconnect()V
|
|
|
|
.line 24
|
|
:cond_3
|
|
iget-object p1, p0, Lcom/my/target/HttpRequest;->c:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
return-object p1
|
|
.end method
|