MethodDispatcher$MethodDispatchHelper.smali
.class public Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;
.super Ljava/lang/Object;
.source "MethodDispatcher.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/facebook/stetho/inspector/MethodDispatcher;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "MethodDispatchHelper"
.end annotation
# instance fields
.field public final mInstance:Lcom/facebook/stetho/inspector/protocol/ChromeDevtoolsDomain;
.field public final mMethod:Ljava/lang/reflect/Method;
.field public final mObjectMapper:Lcom/facebook/stetho/json/ObjectMapper;
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>(Lcom/facebook/stetho/json/ObjectMapper;Lcom/facebook/stetho/inspector/protocol/ChromeDevtoolsDomain;Ljava/lang/reflect/Method;)V
.registers 4
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mObjectMapper:Lcom/facebook/stetho/json/ObjectMapper;
iput-object p2, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mInstance:Lcom/facebook/stetho/inspector/protocol/ChromeDevtoolsDomain;
iput-object p3, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mMethod:Ljava/lang/reflect/Method;
return-void
.end method
# virtual methods
.method public invoke(Lcom/facebook/stetho/inspector/jsonrpc/JsonRpcPeer;Lorg/json/JSONObject;)Lorg/json/JSONObject;
.registers 7
.param p1 # Lcom/facebook/stetho/inspector/jsonrpc/JsonRpcPeer;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/reflect/InvocationTargetException;,
Ljava/lang/IllegalAccessException;,
Lorg/json/JSONException;,
Lcom/facebook/stetho/inspector/jsonrpc/JsonRpcException;
}
.end annotation
iget-object v0, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mMethod:Ljava/lang/reflect/Method;
iget-object v1, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mInstance:Lcom/facebook/stetho/inspector/protocol/ChromeDevtoolsDomain;
const/4 v2, 0x2
new-array v2, v2, [Ljava/lang/Object;
const/4 v3, 0x0
aput-object p1, v2, v3
const/4 p1, 0x1
aput-object p2, v2, p1
invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
if-eqz p1, :cond_25
instance-of p2, p1, Lcom/facebook/stetho/inspector/jsonrpc/protocol/EmptyResult;
if-eqz p2, :cond_18
goto :goto_25
:cond_18
check-cast p1, Lcom/facebook/stetho/inspector/jsonrpc/JsonRpcResult;
iget-object p2, p0, Lcom/facebook/stetho/inspector/MethodDispatcher$MethodDispatchHelper;->mObjectMapper:Lcom/facebook/stetho/json/ObjectMapper;
const-class v0, Lorg/json/JSONObject;
invoke-virtual {p2, p1, v0}, Lcom/facebook/stetho/json/ObjectMapper;->convertValue(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Lorg/json/JSONObject;
return-object p1
:cond_25
:goto_25
new-instance p1, Lorg/json/JSONObject;
invoke-direct {p1}, Lorg/json/JSONObject;-><init>()V
return-object p1
.end method