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.
245 lines
5.6 KiB
245 lines
5.6 KiB
.class public Lcom/facebook/internal/GraphUtil; |
|
.super Ljava/lang/Object; |
|
.source "GraphUtil.java" |
|
|
|
|
|
# static fields |
|
.field private static final dateFormats:[Ljava/lang/String; |
|
|
|
|
|
# direct methods |
|
.method static constructor <clinit>()V |
|
.locals 3 |
|
|
|
.prologue |
|
.line 38 |
|
const/4 v0, 0x3 |
|
|
|
new-array v0, v0, [Ljava/lang/String; |
|
|
|
const/4 v1, 0x0 |
|
|
|
const-string v2, "yyyy-MM-dd\'T\'HH:mm:ssZ" |
|
|
|
aput-object v2, v0, v1 |
|
|
|
const/4 v1, 0x1 |
|
|
|
const-string v2, "yyyy-MM-dd\'T\'HH:mm:ss" |
|
|
|
aput-object v2, v0, v1 |
|
|
|
const/4 v1, 0x2 |
|
|
|
const-string v2, "yyyy-MM-dd" |
|
|
|
aput-object v2, v0, v1 |
|
|
|
sput-object v0, Lcom/facebook/internal/GraphUtil;->dateFormats:[Ljava/lang/String; |
|
|
|
return-void |
|
.end method |
|
|
|
.method public constructor <init>()V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 37 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
return-void |
|
.end method |
|
|
|
.method public static createOpenGraphActionForPost(Ljava/lang/String;)Lorg/json/JSONObject; |
|
.locals 3 |
|
|
|
.prologue |
|
.line 50 |
|
new-instance v0, Lorg/json/JSONObject; |
|
|
|
invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V |
|
|
|
.line 51 |
|
if-eqz p0, :cond_0 |
|
|
|
.line 53 |
|
:try_start_0 |
|
const-string v1, "type" |
|
|
|
invoke-virtual {v0, v1, p0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
:try_end_0 |
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
.line 60 |
|
:cond_0 |
|
return-object v0 |
|
|
|
.line 54 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 55 |
|
new-instance v1, Lcom/facebook/FacebookException; |
|
|
|
const-string v2, "An error occurred while setting up the open graph action" |
|
|
|
invoke-direct {v1, v2, v0}, Lcom/facebook/FacebookException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V |
|
|
|
throw v1 |
|
.end method |
|
|
|
.method public static createOpenGraphObjectForPost(Ljava/lang/String;)Lorg/json/JSONObject; |
|
.locals 7 |
|
|
|
.prologue |
|
const/4 v1, 0x0 |
|
|
|
.line 70 |
|
move-object v0, p0 |
|
|
|
move-object v2, v1 |
|
|
|
move-object v3, v1 |
|
|
|
move-object v4, v1 |
|
|
|
move-object v5, v1 |
|
|
|
move-object v6, v1 |
|
|
|
invoke-static/range {v0 .. v6}, Lcom/facebook/internal/GraphUtil;->createOpenGraphObjectForPost(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/json/JSONObject;Ljava/lang/String;)Lorg/json/JSONObject; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public static createOpenGraphObjectForPost(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/json/JSONObject;Ljava/lang/String;)Lorg/json/JSONObject; |
|
.locals 3 |
|
|
|
.prologue |
|
.line 92 |
|
new-instance v0, Lorg/json/JSONObject; |
|
|
|
invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V |
|
|
|
.line 94 |
|
if-eqz p0, :cond_0 |
|
|
|
.line 95 |
|
:try_start_0 |
|
const-string v1, "type" |
|
|
|
invoke-virtual {v0, v1, p0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 97 |
|
:cond_0 |
|
const-string v1, "title" |
|
|
|
invoke-virtual {v0, v1, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 99 |
|
if-eqz p2, :cond_1 |
|
|
|
.line 100 |
|
new-instance v1, Lorg/json/JSONObject; |
|
|
|
invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V |
|
|
|
.line 101 |
|
const-string v2, "url" |
|
|
|
invoke-virtual {v1, v2, p2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 102 |
|
new-instance v2, Lorg/json/JSONArray; |
|
|
|
invoke-direct {v2}, Lorg/json/JSONArray;-><init>()V |
|
|
|
.line 103 |
|
invoke-virtual {v2, v1}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray; |
|
|
|
.line 104 |
|
const-string v1, "image" |
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 107 |
|
:cond_1 |
|
const-string v1, "url" |
|
|
|
invoke-virtual {v0, v1, p3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 108 |
|
const-string v1, "description" |
|
|
|
invoke-virtual {v0, v1, p4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 109 |
|
const-string v1, "fbsdk:create_object" |
|
|
|
const/4 v2, 0x1 |
|
|
|
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject; |
|
|
|
.line 111 |
|
if-eqz p5, :cond_2 |
|
|
|
.line 112 |
|
const-string v1, "data" |
|
|
|
invoke-virtual {v0, v1, p5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
|
|
.line 115 |
|
:cond_2 |
|
if-eqz p6, :cond_3 |
|
|
|
.line 116 |
|
const-string v1, "id" |
|
|
|
invoke-virtual {v0, v1, p6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; |
|
:try_end_0 |
|
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
.line 121 |
|
:cond_3 |
|
return-object v0 |
|
|
|
.line 118 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 119 |
|
new-instance v1, Lcom/facebook/FacebookException; |
|
|
|
const-string v2, "An error occurred while setting up the graph object" |
|
|
|
invoke-direct {v1, v2, v0}, Lcom/facebook/FacebookException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V |
|
|
|
throw v1 |
|
.end method |
|
|
|
.method public static isOpenGraphObjectForPost(Lorg/json/JSONObject;)Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 130 |
|
if-eqz p0, :cond_0 |
|
|
|
const-string v0, "fbsdk:create_object" |
|
|
|
.line 131 |
|
invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optBoolean(Ljava/lang/String;)Z |
|
|
|
move-result v0 |
|
|
|
.line 130 |
|
:goto_0 |
|
return v0 |
|
|
|
.line 131 |
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method
|
|
|