190 lines
4.7 KiB
Smali
190 lines
4.7 KiB
Smali
.class public Lorg/apache/http/client/protocol/RequestProxyAuthentication;
|
|
.super Ljava/lang/Object;
|
|
.source "RequestProxyAuthentication.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/apache/http/HttpRequestInterceptor;
|
|
|
|
|
|
# annotations
|
|
.annotation build Lorg/apache/http/annotation/Immutable;
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final log:Lorg/apache/commons/logging/Log;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lorg/apache/commons/logging/LogFactory;->getLog(Ljava/lang/Class;)Lorg/apache/commons/logging/Log;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lorg/apache/http/client/protocol/RequestProxyAuthentication;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public process(Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/HttpException;,
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
if-eqz p2, :cond_6
|
|
|
|
const-string v0, "Proxy-Authorization"
|
|
|
|
.line 1
|
|
invoke-interface {p1, v0}, Lorg/apache/http/HttpMessage;->containsHeader(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string v0, "http.auth.proxy-scope"
|
|
|
|
.line 2
|
|
invoke-interface {p2, v0}, Lorg/apache/http/protocol/HttpContext;->getAttribute(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lorg/apache/http/auth/AuthState;
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_1
|
|
invoke-virtual {p2}, Lorg/apache/http/auth/AuthState;->getAuthScheme()Lorg/apache/http/auth/AuthScheme;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_2
|
|
invoke-virtual {p2}, Lorg/apache/http/auth/AuthState;->getCredentials()Lorg/apache/http/auth/Credentials;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
.line 5
|
|
iget-object p1, p0, Lorg/apache/http/client/protocol/RequestProxyAuthentication;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
const-string p2, "User credentials not available"
|
|
|
|
invoke-interface {p1, p2}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
.line 6
|
|
:cond_3
|
|
invoke-virtual {p2}, Lorg/apache/http/auth/AuthState;->getAuthScope()Lorg/apache/http/auth/AuthScope;
|
|
|
|
move-result-object p2
|
|
|
|
if-nez p2, :cond_4
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/auth/AuthScheme;->isConnectionBased()Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_5
|
|
|
|
.line 7
|
|
:cond_4
|
|
:try_start_0
|
|
invoke-interface {v0, v1, p1}, Lorg/apache/http/auth/AuthScheme;->authenticate(Lorg/apache/http/auth/Credentials;Lorg/apache/http/HttpRequest;)Lorg/apache/http/Header;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1, p2}, Lorg/apache/http/HttpMessage;->addHeader(Lorg/apache/http/Header;)V
|
|
:try_end_0
|
|
.catch Lorg/apache/http/auth/AuthenticationException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 8
|
|
iget-object p2, p0, Lorg/apache/http/client/protocol/RequestProxyAuthentication;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
invoke-interface {p2}, Lorg/apache/commons/logging/Log;->isErrorEnabled()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
.line 9
|
|
iget-object p2, p0, Lorg/apache/http/client/protocol/RequestProxyAuthentication;->log:Lorg/apache/commons/logging/Log;
|
|
|
|
const-string v0, "Proxy authentication error: "
|
|
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p2, p1}, Lorg/apache/commons/logging/Log;->error(Ljava/lang/Object;)V
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return-void
|
|
|
|
.line 10
|
|
:cond_6
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "HTTP context may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 11
|
|
:cond_7
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "HTTP request may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|