LocationMessage.smali
.class public final Lio/rong/message/LocationMessage;
.super Lio/rong/imlib/model/MessageContent;
.source "LocationMessage.java"
# annotations
.annotation runtime Lio/rong/imlib/DestructionTag;
.end annotation
.annotation runtime Lio/rong/imlib/MessageTag;
flag = 0x3
messageHandler = Lio/rong/message/LocationMessageHandler;
value = "RC:LBSMsg"
.end annotation
# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/os/Parcelable$Creator<",
"Lio/rong/message/LocationMessage;",
">;"
}
.end annotation
.end field
.field private static final TAG:Ljava/lang/String; = "LocationMessage"
# instance fields
.field protected extra:Ljava/lang/String;
.field private mBase64:Ljava/lang/String;
.field private mImgUri:Landroid/net/Uri;
.field private mLat:D
.field private mLng:D
.field private mPoi:Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.registers 1
.line 1
new-instance v0, Lio/rong/message/LocationMessage$1;
invoke-direct {v0}, Lio/rong/message/LocationMessage$1;-><init>()V
sput-object v0, Lio/rong/message/LocationMessage;->CREATOR:Landroid/os/Parcelable$Creator;
return-void
.end method
.method private constructor <init>(DDLjava/lang/String;Landroid/net/Uri;)V
.registers 7
.line 18
invoke-direct {p0}, Lio/rong/imlib/model/MessageContent;-><init>()V
.line 19
iput-wide p1, p0, Lio/rong/message/LocationMessage;->mLat:D
.line 20
iput-wide p3, p0, Lio/rong/message/LocationMessage;->mLng:D
.line 21
iput-object p5, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
.line 22
iput-object p6, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
return-void
.end method
.method public constructor <init>(Landroid/os/Parcel;)V
.registers 4
.line 23
invoke-direct {p0}, Lio/rong/imlib/model/MessageContent;-><init>()V
.line 24
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lio/rong/message/LocationMessage;->extra:Ljava/lang/String;
.line 25
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readDoubleFromParcel(Landroid/os/Parcel;)Ljava/lang/Double;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Double;->doubleValue()D
move-result-wide v0
iput-wide v0, p0, Lio/rong/message/LocationMessage;->mLat:D
.line 26
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readDoubleFromParcel(Landroid/os/Parcel;)Ljava/lang/Double;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Double;->doubleValue()D
move-result-wide v0
iput-wide v0, p0, Lio/rong/message/LocationMessage;->mLng:D
.line 27
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
.line 28
const-class v0, Landroid/net/Uri;
invoke-static {p1, v0}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;Ljava/lang/Class;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/net/Uri;
iput-object v0, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
.line 29
const-class v0, Lio/rong/imlib/model/UserInfo;
invoke-static {p1, v0}, Lio/rong/common/ParcelUtils;->readFromParcel(Landroid/os/Parcel;Ljava/lang/Class;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Lio/rong/imlib/model/UserInfo;
invoke-virtual {p0, v0}, Lio/rong/imlib/model/MessageContent;->setUserInfo(Lio/rong/imlib/model/UserInfo;)V
.line 30
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readIntFromParcel(Landroid/os/Parcel;)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
const/4 v1, 0x1
if-ne v0, v1, :cond_44
goto :goto_45
:cond_44
const/4 v1, 0x0
:goto_45
invoke-virtual {p0, v1}, Lio/rong/imlib/model/MessageContent;->setDestruct(Z)V
.line 31
invoke-static {p1}, Lio/rong/common/ParcelUtils;->readLongFromParcel(Landroid/os/Parcel;)Ljava/lang/Long;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
move-result-wide v0
invoke-virtual {p0, v0, v1}, Lio/rong/imlib/model/MessageContent;->setDestructTime(J)V
return-void
.end method
.method public constructor <init>([B)V
.registers 9
const-string v0, "burnDuration"
const-string v1, "isBurnAfterRead"
const-string v2, "user"
const-string v3, "extra"
const-string v4, "content"
.line 1
invoke-direct {p0}, Lio/rong/imlib/model/MessageContent;-><init>()V
.line 2
new-instance v5, Ljava/lang/String;
invoke-direct {v5, p1}, Ljava/lang/String;-><init>([B)V
.line 3
:try_start_12
new-instance p1, Lorg/json/JSONObject;
invoke-direct {p1, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
const-string v5, "latitude"
.line 4
invoke-virtual {p1, v5}, Lorg/json/JSONObject;->getDouble(Ljava/lang/String;)D
move-result-wide v5
invoke-virtual {p0, v5, v6}, Lio/rong/message/LocationMessage;->setLat(D)V
const-string v5, "longitude"
.line 5
invoke-virtual {p1, v5}, Lorg/json/JSONObject;->getDouble(Ljava/lang/String;)D
move-result-wide v5
invoke-virtual {p0, v5, v6}, Lio/rong/message/LocationMessage;->setLng(D)V
.line 6
invoke-virtual {p1, v4}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v5
if-eqz v5, :cond_36
.line 7
invoke-virtual {p1, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
invoke-virtual {p0, v4}, Lio/rong/message/LocationMessage;->setBase64(Ljava/lang/String;)V
.line 8
:cond_36
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_43
.line 9
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {p0, v3}, Lio/rong/message/LocationMessage;->setExtra(Ljava/lang/String;)V
:cond_43
const-string v3, "poi"
.line 10
invoke-virtual {p1, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {p0, v3}, Lio/rong/message/LocationMessage;->setPoi(Ljava/lang/String;)V
.line 11
invoke-virtual {p1, v2}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v3
if-eqz v3, :cond_5d
.line 12
invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
move-result-object v2
invoke-virtual {p0, v2}, Lio/rong/imlib/model/MessageContent;->parseJsonToUserInfo(Lorg/json/JSONObject;)Lio/rong/imlib/model/UserInfo;
move-result-object v2
invoke-virtual {p0, v2}, Lio/rong/imlib/model/MessageContent;->setUserInfo(Lio/rong/imlib/model/UserInfo;)V
.line 13
:cond_5d
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_6a
.line 14
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->getBoolean(Ljava/lang/String;)Z
move-result v1
invoke-virtual {p0, v1}, Lio/rong/imlib/model/MessageContent;->setDestruct(Z)V
.line 15
:cond_6a
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_82
.line 16
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getLong(Ljava/lang/String;)J
move-result-wide v0
invoke-virtual {p0, v0, v1}, Lio/rong/imlib/model/MessageContent;->setDestructTime(J)V
:try_end_77
.catch Lorg/json/JSONException; {:try_start_12 .. :try_end_77} :catch_78
goto :goto_82
:catch_78
move-exception p1
.line 17
invoke-virtual {p1}, Lorg/json/JSONException;->getMessage()Ljava/lang/String;
move-result-object p1
const-string v0, "JSONException"
invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:cond_82
:goto_82
return-void
.end method
.method public static obtain(DDLjava/lang/String;Landroid/net/Uri;)Lio/rong/message/LocationMessage;
.registers 14
.line 1
new-instance v7, Lio/rong/message/LocationMessage;
move-object v0, v7
move-wide v1, p0
move-wide v3, p2
move-object v5, p4
move-object v6, p5
invoke-direct/range {v0 .. v6}, Lio/rong/message/LocationMessage;-><init>(DDLjava/lang/String;Landroid/net/Uri;)V
return-object v7
.end method
# virtual methods
.method public describeContents()I
.registers 2
const/4 v0, 0x0
return v0
.end method
.method public encode()[B
.registers 5
.line 1
new-instance v0, Lorg/json/JSONObject;
invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V
.line 2
:try_start_5
iget-object v1, p0, Lio/rong/message/LocationMessage;->mBase64:Ljava/lang/String;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
:try_end_b
.catch Lorg/json/JSONException; {:try_start_5 .. :try_end_b} :catch_70
const-string v2, "content"
if-nez v1, :cond_15
.line 3
:try_start_f
iget-object v1, p0, Lio/rong/message/LocationMessage;->mBase64:Ljava/lang/String;
invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
goto :goto_1e
.line 4
:cond_15
iget-object v1, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
if-eqz v1, :cond_1e
.line 5
iget-object v1, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
invoke-virtual {v0, v2, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
:cond_1e
:goto_1e
const-string v1, "latitude"
.line 6
iget-wide v2, p0, Lio/rong/message/LocationMessage;->mLat:D
invoke-virtual {v0, v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;
const-string v1, "longitude"
.line 7
iget-wide v2, p0, Lio/rong/message/LocationMessage;->mLng:D
invoke-virtual {v0, v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;
.line 8
invoke-virtual {p0}, Lio/rong/message/LocationMessage;->getExtra()Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_3f
const-string v1, "extra"
.line 9
invoke-virtual {p0}, Lio/rong/message/LocationMessage;->getExtra()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
.line 10
:cond_3f
iget-object v1, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_4e
const-string v1, "poi"
.line 11
iget-object v2, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
.line 12
:cond_4e
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getJSONUserInfo()Lorg/json/JSONObject;
move-result-object v1
if-eqz v1, :cond_5d
const-string v1, "user"
.line 13
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getJSONUserInfo()Lorg/json/JSONObject;
move-result-object v2
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->putOpt(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
:cond_5d
const-string v1, "isBurnAfterRead"
.line 14
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->isDestruct()Z
move-result v2
invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;
const-string v1, "burnDuration"
.line 15
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getDestructTime()J
move-result-wide v2
invoke-virtual {v0, v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;
:try_end_6f
.catch Lorg/json/JSONException; {:try_start_f .. :try_end_6f} :catch_70
goto :goto_7a
:catch_70
move-exception v1
.line 16
invoke-virtual {v1}, Lorg/json/JSONException;->getMessage()Ljava/lang/String;
move-result-object v1
const-string v2, "JSONException"
invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:goto_7a
const/4 v1, 0x0
.line 17
iput-object v1, p0, Lio/rong/message/LocationMessage;->mBase64:Ljava/lang/String;
.line 18
invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B
move-result-object v0
return-object v0
.end method
.method public getBase64()Ljava/lang/String;
.registers 2
.line 1
iget-object v0, p0, Lio/rong/message/LocationMessage;->mBase64:Ljava/lang/String;
return-object v0
.end method
.method public getExtra()Ljava/lang/String;
.registers 2
.line 1
iget-object v0, p0, Lio/rong/message/LocationMessage;->extra:Ljava/lang/String;
return-object v0
.end method
.method public getImgUri()Landroid/net/Uri;
.registers 2
.line 1
iget-object v0, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
return-object v0
.end method
.method public getLat()D
.registers 3
.line 1
iget-wide v0, p0, Lio/rong/message/LocationMessage;->mLat:D
return-wide v0
.end method
.method public getLng()D
.registers 3
.line 1
iget-wide v0, p0, Lio/rong/message/LocationMessage;->mLng:D
return-wide v0
.end method
.method public getPoi()Ljava/lang/String;
.registers 2
.line 1
iget-object v0, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
return-object v0
.end method
.method public setBase64(Ljava/lang/String;)V
.registers 2
.line 1
iput-object p1, p0, Lio/rong/message/LocationMessage;->mBase64:Ljava/lang/String;
return-void
.end method
.method public setExtra(Ljava/lang/String;)V
.registers 2
.line 1
iput-object p1, p0, Lio/rong/message/LocationMessage;->extra:Ljava/lang/String;
return-void
.end method
.method public setImgUri(Landroid/net/Uri;)V
.registers 2
.line 1
iput-object p1, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
return-void
.end method
.method public setLat(D)V
.registers 3
.line 1
iput-wide p1, p0, Lio/rong/message/LocationMessage;->mLat:D
return-void
.end method
.method public setLng(D)V
.registers 3
.line 1
iput-wide p1, p0, Lio/rong/message/LocationMessage;->mLng:D
return-void
.end method
.method public setPoi(Ljava/lang/String;)V
.registers 2
.line 1
iput-object p1, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
return-void
.end method
.method public writeToParcel(Landroid/os/Parcel;I)V
.registers 5
.line 1
iget-object p2, p0, Lio/rong/message/LocationMessage;->extra:Ljava/lang/String;
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/String;)V
.line 2
iget-wide v0, p0, Lio/rong/message/LocationMessage;->mLat:D
invoke-static {v0, v1}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;
move-result-object p2
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/Double;)V
.line 3
iget-wide v0, p0, Lio/rong/message/LocationMessage;->mLng:D
invoke-static {v0, v1}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;
move-result-object p2
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/Double;)V
.line 4
iget-object p2, p0, Lio/rong/message/LocationMessage;->mPoi:Ljava/lang/String;
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/String;)V
.line 5
iget-object p2, p0, Lio/rong/message/LocationMessage;->mImgUri:Landroid/net/Uri;
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Landroid/os/Parcelable;)V
.line 6
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getUserInfo()Lio/rong/imlib/model/UserInfo;
move-result-object p2
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Landroid/os/Parcelable;)V
.line 7
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->isDestruct()Z
move-result p2
if-eqz p2, :cond_30
const/4 p2, 0x1
goto :goto_31
:cond_30
const/4 p2, 0x0
:goto_31
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/Integer;)V
.line 8
invoke-virtual {p0}, Lio/rong/imlib/model/MessageContent;->getDestructTime()J
move-result-wide v0
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object p2
invoke-static {p1, p2}, Lio/rong/common/ParcelUtils;->writeToParcel(Landroid/os/Parcel;Ljava/lang/Long;)V
return-void
.end method