You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
278 lines
6.8 KiB
278 lines
6.8 KiB
.class Lcom/viatech/util/HttpRequestManager$3; |
|
.super Ljava/lang/Object; |
|
.source "HttpRequestManager.java" |
|
|
|
# interfaces |
|
.implements Ljava/lang/Runnable; |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/EnclosingMethod; |
|
value = Lcom/viatech/util/HttpRequestManager;->requestHttp(Ljava/lang/String;Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;)V |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/InnerClass; |
|
accessFlags = 0x0 |
|
name = null |
|
.end annotation |
|
|
|
|
|
# instance fields |
|
.field final synthetic this$0:Lcom/viatech/util/HttpRequestManager; |
|
|
|
.field final synthetic val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
.field final synthetic val$str:Ljava/lang/String; |
|
|
|
|
|
# direct methods |
|
.method constructor <init>(Lcom/viatech/util/HttpRequestManager;Ljava/lang/String;Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 247 |
|
iput-object p1, p0, Lcom/viatech/util/HttpRequestManager$3;->this$0:Lcom/viatech/util/HttpRequestManager; |
|
|
|
iput-object p2, p0, Lcom/viatech/util/HttpRequestManager$3;->val$str:Ljava/lang/String; |
|
|
|
iput-object p3, p0, Lcom/viatech/util/HttpRequestManager$3;->val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
return-void |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public run()V |
|
.locals 7 |
|
|
|
.prologue |
|
const/4 v1, 0x0 |
|
|
|
.line 251 |
|
const-string v0, "Vpai_HttpRequestManager" |
|
|
|
const-string v2, "requestHttp()" |
|
|
|
invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
.line 254 |
|
:try_start_0 |
|
new-instance v0, Ljava/net/URL; |
|
|
|
iget-object v2, p0, Lcom/viatech/util/HttpRequestManager$3;->val$str:Ljava/lang/String; |
|
|
|
invoke-direct {v0, v2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V |
|
|
|
.line 255 |
|
invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/net/HttpURLConnection; |
|
:try_end_0 |
|
.catch Ljava/net/MalformedURLException; {:try_start_0 .. :try_end_0} :catch_3 |
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2 |
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0 |
|
|
|
.line 256 |
|
const/16 v1, 0x7d0 |
|
|
|
:try_start_1 |
|
invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V |
|
|
|
.line 257 |
|
const/16 v1, 0xc8 |
|
|
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getResponseCode()I |
|
|
|
move-result v2 |
|
|
|
if-ne v1, v2, :cond_2 |
|
|
|
.line 259 |
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream; |
|
|
|
move-result-object v1 |
|
|
|
.line 260 |
|
new-instance v2, Ljava/io/ByteArrayOutputStream; |
|
|
|
invoke-direct {v2}, Ljava/io/ByteArrayOutputStream;-><init>()V |
|
|
|
.line 261 |
|
const/16 v3, 0x400 |
|
|
|
new-array v3, v3, [B |
|
|
|
.line 263 |
|
:goto_0 |
|
const/4 v4, -0x1 |
|
|
|
invoke-virtual {v1, v3}, Ljava/io/InputStream;->read([B)I |
|
|
|
move-result v5 |
|
|
|
if-eq v4, v5, :cond_1 |
|
|
|
.line 264 |
|
const/4 v4, 0x0 |
|
|
|
invoke-virtual {v2, v3, v4, v5}, Ljava/io/ByteArrayOutputStream;->write([BII)V |
|
|
|
.line 265 |
|
invoke-virtual {v2}, Ljava/io/ByteArrayOutputStream;->flush()V |
|
:try_end_1 |
|
.catch Ljava/net/MalformedURLException; {:try_start_1 .. :try_end_1} :catch_0 |
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1 |
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1 |
|
|
|
goto :goto_0 |
|
|
|
.line 271 |
|
:catch_0 |
|
move-exception v1 |
|
|
|
move-object v6, v1 |
|
|
|
move-object v1, v0 |
|
|
|
move-object v0, v6 |
|
|
|
.line 272 |
|
:goto_1 |
|
:try_start_2 |
|
invoke-virtual {v0}, Ljava/net/MalformedURLException;->printStackTrace()V |
|
|
|
.line 273 |
|
iget-object v0, p0, Lcom/viatech/util/HttpRequestManager$3;->val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
const/4 v2, 0x0 |
|
|
|
invoke-interface {v0, v2}, Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;->onHttpResponse(Ljava/lang/String;)V |
|
:try_end_2 |
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0 |
|
|
|
.line 278 |
|
if-eqz v1, :cond_0 |
|
|
|
.line 279 |
|
invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V |
|
|
|
.line 281 |
|
:cond_0 |
|
:goto_2 |
|
return-void |
|
|
|
.line 267 |
|
:cond_1 |
|
:try_start_3 |
|
iget-object v1, p0, Lcom/viatech/util/HttpRequestManager$3;->val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
const-string v3, "utf-8" |
|
|
|
invoke-virtual {v2, v3}, Ljava/io/ByteArrayOutputStream;->toString(Ljava/lang/String;)Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
invoke-interface {v1, v2}, Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;->onHttpResponse(Ljava/lang/String;)V |
|
:try_end_3 |
|
.catch Ljava/net/MalformedURLException; {:try_start_3 .. :try_end_3} :catch_0 |
|
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1 |
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1 |
|
|
|
.line 278 |
|
:goto_3 |
|
if-eqz v0, :cond_0 |
|
|
|
.line 279 |
|
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V |
|
|
|
goto :goto_2 |
|
|
|
.line 269 |
|
:cond_2 |
|
:try_start_4 |
|
iget-object v1, p0, Lcom/viatech/util/HttpRequestManager$3;->val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
const/4 v2, 0x0 |
|
|
|
invoke-interface {v1, v2}, Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;->onHttpResponse(Ljava/lang/String;)V |
|
:try_end_4 |
|
.catch Ljava/net/MalformedURLException; {:try_start_4 .. :try_end_4} :catch_0 |
|
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1 |
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1 |
|
|
|
goto :goto_3 |
|
|
|
.line 274 |
|
:catch_1 |
|
move-exception v1 |
|
|
|
move-object v6, v1 |
|
|
|
move-object v1, v0 |
|
|
|
move-object v0, v6 |
|
|
|
.line 275 |
|
:goto_4 |
|
:try_start_5 |
|
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V |
|
|
|
.line 276 |
|
iget-object v0, p0, Lcom/viatech/util/HttpRequestManager$3;->val$listener:Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener; |
|
|
|
const/4 v2, 0x0 |
|
|
|
invoke-interface {v0, v2}, Lcom/viatech/util/HttpRequestManager$OnHttpResponseListener;->onHttpResponse(Ljava/lang/String;)V |
|
:try_end_5 |
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0 |
|
|
|
.line 278 |
|
if-eqz v1, :cond_0 |
|
|
|
.line 279 |
|
invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V |
|
|
|
goto :goto_2 |
|
|
|
.line 278 |
|
:catchall_0 |
|
move-exception v0 |
|
|
|
:goto_5 |
|
if-eqz v1, :cond_3 |
|
|
|
.line 279 |
|
invoke-virtual {v1}, Ljava/net/HttpURLConnection;->disconnect()V |
|
|
|
.line 280 |
|
:cond_3 |
|
throw v0 |
|
|
|
.line 278 |
|
:catchall_1 |
|
move-exception v1 |
|
|
|
move-object v6, v1 |
|
|
|
move-object v1, v0 |
|
|
|
move-object v0, v6 |
|
|
|
goto :goto_5 |
|
|
|
.line 274 |
|
:catch_2 |
|
move-exception v0 |
|
|
|
goto :goto_4 |
|
|
|
.line 271 |
|
:catch_3 |
|
move-exception v0 |
|
|
|
goto :goto_1 |
|
.end method
|
|
|