WechatSDKUtil.smali
.class public Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
.super Ljava/lang/Object;
.source "WechatSDKUtil.java"
# static fields
.field public static final APP_ID:Ljava/lang/String; = "wxc54439c65ae32ec9"
.field public static final REQUEST_AUTH_SCOPE:Ljava/lang/String; = "snsapi_userinfo"
.field public static final REQUEST_AUTH_STATE_ANUM:Ljava/lang/String; = "cm_anum_login_auth"
.field public static final SEND_SCENE_SESSION:I = 0x1
.field public static final SEND_SCENE_TIMELINE:I = 0x2
.field private static final SHARE_VIDEO_WHEN_TITLE_NULL:Ljava/lang/String; = "\u8fd9\u4e2a\u89c6\u9891\u4e5f\u5c31\u770b\u4e868\u904d\u800c\u5df2\uff0c\u5fcd\u4e0d\u4f4f\u5206\u4eab\u7ed9\u4f60\u3002"
.field private static final TAG:Ljava/lang/String; = "CMWX"
.field private static final THUMB_SIZE:I = 0x50
.field private static mInstance:Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
# instance fields
.field private mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
.field private mContext:Landroid/content/Context;
.field private mToupaiLogoCallback:Lcom/cm/plugincluster/news/interfaces/ILogoCallBack;
# direct methods
.method private constructor <init>(Landroid/content/Context;)V
.registers 2
.prologue
.line 64
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 65
iput-object p1, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mContext:Landroid/content/Context;
.line 66
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->registerToWechat()V
.line 67
return-void
.end method
.method static synthetic access$000(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
.registers 2
.prologue
.line 47
invoke-direct {p0, p1}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendWechatRequest(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
return-void
.end method
.method private bmpToByteArray(Landroid/graphics/Bitmap;Z)[B
.registers 6
.prologue
.line 372
new-instance v0, Ljava/io/ByteArrayOutputStream;
invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 373
sget-object v1, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;
const/16 v2, 0x64
invoke-virtual {p1, v1, v2, v0}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
.line 374
if-eqz p2, :cond_11
.line 375
invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V
.line 378
:cond_11
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v1
.line 380
:try_start_15
invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_18
.catch Ljava/lang/Exception; {:try_start_15 .. :try_end_18} :catch_19
.line 385
:goto_18
return-object v1
.line 381
:catch_19
move-exception v0
.line 382
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_18
.end method
.method public static bmpToByteArray(Landroid/graphics/Bitmap;ZLandroid/graphics/Bitmap$CompressFormat;)[B
.registers 7
.prologue
.line 558
new-instance v1, Ljava/io/ByteArrayOutputStream;
invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V
.line 559
const/16 v0, 0x64
invoke-virtual {p0, p2, v0, v1}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
.line 560
const/16 v0, 0x5a
.line 561
:goto_c
invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->size()I
move-result v2
const/16 v3, 0x7d00
if-le v2, v3, :cond_1f
if-lez v0, :cond_1f
.line 562
invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->reset()V
.line 563
invoke-virtual {p0, p2, v0, v1}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z
.line 564
add-int/lit8 v0, v0, -0xa
goto :goto_c
.line 567
:cond_1f
invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B
move-result-object v0
.line 569
if-eqz p1, :cond_28
.line 570
invoke-virtual {p0}, Landroid/graphics/Bitmap;->recycle()V
.line 574
:cond_28
:try_start_28
invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->close()V
:try_end_2b
.catch Ljava/lang/Exception; {:try_start_28 .. :try_end_2b} :catch_2c
.line 579
:goto_2b
return-object v0
.line 575
:catch_2c
move-exception v1
.line 576
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_2b
.end method
.method private buildReq(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;ILjava/lang/String;)Z
.registers 12
.prologue
const/high16 v2, 0x3f800000 # 1.0f
const/4 v3, 0x0
.line 327
if-nez p3, :cond_e
.line 328
const-string v0, "CMWX"
const-string v1, "bitmap create failed."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v3
.line 351
:goto_d
return v0
.line 332
:cond_e
invoke-direct {p0, p3, v2}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->compressBitmap(Landroid/graphics/Bitmap;F)[B
move-result-object v0
.line 333
if-nez v0, :cond_20
.line 334
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 335
const-string v0, "CMWX"
const-string v1, "bitmap compress failed."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v3
.line 336
goto :goto_d
:cond_20
move v1, v2
.line 338
:cond_21
array-length v4, v0
const v5, 0x8000
if-le v4, v5, :cond_3a
.line 339
add-float/2addr v1, v2
invoke-direct {p0, p3, v1}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->compressBitmap(Landroid/graphics/Bitmap;F)[B
move-result-object v0
.line 340
if-nez v0, :cond_21
.line 341
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 342
const-string v0, "CMWX"
const-string v1, "bitmap compress failed."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v3
.line 343
goto :goto_d
.line 346
:cond_3a
iput-object v0, p2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->thumbData:[B
.line 348
invoke-direct {p0, p5}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->buildTransaction(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
iput-object v0, p1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->transaction:Ljava/lang/String;
.line 349
iput-object p2, p1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->message:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
.line 350
invoke-direct {p0, p4}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->transformScene(I)I
move-result v0
iput v0, p1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->scene:I
.line 351
const/4 v0, 0x1
goto :goto_d
.end method
.method private buildTransaction(Ljava/lang/String;)Ljava/lang/String;
.registers 6
.prologue
.line 367
if-nez p1, :cond_b
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v0
invoke-static {v0, v1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v0
:goto_a
return-object v0
:cond_b
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
.line 368
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
goto :goto_a
.end method
.method private compressBitmap(Landroid/graphics/Bitmap;F)[B
.registers 8
.prologue
const/4 v4, 0x1
.line 356
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v0
int-to-float v0, v0
invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v1
int-to-float v1, v1
div-float/2addr v0, v1
.line 357
const/high16 v1, 0x46f00000 # 30720.0f
const/high16 v2, 0x40800000 # 4.0f
mul-float/2addr v2, p2
mul-float/2addr v2, v0
div-float/2addr v1, v2
float-to-double v2, v1
invoke-static {v2, v3}, Ljava/lang/Math;->sqrt(D)D
move-result-wide v2
double-to-int v1, v2
.line 358
int-to-float v2, v1
mul-float/2addr v0, v2
float-to-int v0, v0
.line 359
invoke-static {p1, v0, v1, v4}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
move-result-object v0
.line 360
if-nez v0, :cond_24
.line 361
const/4 v0, 0x0
.line 363
:goto_23
return-object v0
.line 362
:cond_24
invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V
.line 363
invoke-direct {p0, v0, v4}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->bmpToByteArray(Landroid/graphics/Bitmap;Z)[B
move-result-object v0
goto :goto_23
.end method
.method public static getInstance(Landroid/content/Context;)Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
.registers 2
.prologue
.line 70
sget-object v0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mInstance:Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
if-nez v0, :cond_b
.line 71
new-instance v0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
invoke-direct {v0, p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;-><init>(Landroid/content/Context;)V
sput-object v0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mInstance:Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
.line 73
:cond_b
sget-object v0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mInstance:Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;
return-object v0
.end method
.method private getVideoThumbnail(Ljava/lang/String;II)Landroid/graphics/Bitmap;
.registers 7
.prologue
const/4 v1, 0x0
.line 208
sget-object v0, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;
invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
const/4 v2, 0x7
if-le v0, v2, :cond_16
.line 209
const/4 v0, 0x3
invoke-static {p1, v0}, Landroid/media/ThumbnailUtils;->createVideoThumbnail(Ljava/lang/String;I)Landroid/graphics/Bitmap;
move-result-object v0
.line 210
if-eqz v0, :cond_18
.line 211
if-lez p3, :cond_18
if-lez p2, :cond_18
.line 218
:goto_15
return-object v0
:cond_16
move-object v0, v1
.line 216
goto :goto_15
:cond_18
move-object v0, v1
.line 218
goto :goto_15
.end method
.method private registerToWechat()V
.registers 4
.prologue
.line 78
:try_start_0
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mContext:Landroid/content/Context;
const-string/jumbo v1, "wxc54439c65ae32ec9"
const/4 v2, 0x1
invoke-static {v0, v1, v2}, Lcom/tencent/mm/opensdk/openapi/WXAPIFactory;->createWXAPI(Landroid/content/Context;Ljava/lang/String;Z)Lcom/tencent/mm/opensdk/openapi/IWXAPI;
move-result-object v0
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
.line 80
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v1, "wxc54439c65ae32ec9"
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
:try_end_14
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_14} :catch_15
.catch Ljava/lang/Error; {:try_start_0 .. :try_end_14} :catch_1a
.line 87
:goto_14
return-void
.line 81
:catch_15
move-exception v0
.line 83
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_14
.line 84
:catch_1a
move-exception v0
.line 85
invoke-virtual {v0}, Ljava/lang/Error;->printStackTrace()V
goto :goto_14
.end method
.method private sendVideo(Ljava/lang/String;I)Z
.registers 10
.prologue
const/4 v6, 0x0
.line 163
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_b
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
if-nez v0, :cond_18
.line 164
:cond_b
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareVideoErrorToast()V
.line 165
const-string v0, "CMWX"
const-string/jumbo v1, "video path is empty."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 204
:goto_17
return v0
.line 168
:cond_18
new-instance v0, Ljava/io/File;
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 169
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_29
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
move-result v0
if-nez v0, :cond_36
.line 170
:cond_29
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareVideoErrorToast()V
.line 171
const-string v0, "CMWX"
const-string/jumbo v1, "video not exist."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 172
goto :goto_17
.line 174
:cond_36
new-instance v0, Lcom/tencent/mm/opensdk/modelmsg/WXFileObject;
invoke-direct {v0}, Lcom/tencent/mm/opensdk/modelmsg/WXFileObject;-><init>()V
.line 175
iput-object p1, v0, Lcom/tencent/mm/opensdk/modelmsg/WXFileObject;->filePath:Ljava/lang/String;
.line 176
const/4 v1, 0x0
iput-object v1, v0, Lcom/tencent/mm/opensdk/modelmsg/WXFileObject;->fileData:[B
.line 177
new-instance v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v2}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 178
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 179
const-string v0, ""
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->title:Ljava/lang/String;
.line 180
const-string v0, ""
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
.line 181
const/16 v0, 0x50
const/16 v1, 0x64
invoke-direct {p0, p1, v0, v1}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->getVideoThumbnail(Ljava/lang/String;II)Landroid/graphics/Bitmap;
move-result-object v3
.line 182
new-instance v1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v1}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
.line 184
:try_start_5c
const-string v5, "file"
move-object v0, p0
move v4, p2
invoke-direct/range {v0 .. v5}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->buildReq(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;ILjava/lang/String;)Z
:try_end_63
.catch Ljava/lang/Exception; {:try_start_5c .. :try_end_63} :catch_68
move-result v0
if-nez v0, :cond_8e
move v0, v6
.line 185
goto :goto_17
.line 187
:catch_68
move-exception v0
.line 188
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 189
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 190
const-string v1, "CMWX"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v3, "share video exception:"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 191
goto :goto_17
.line 194
:cond_8e
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 195
if-nez v0, :cond_a4
.line 196
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v2, "wxc54439c65ae32ec9"
invoke-interface {v0, v2}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
.line 197
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 199
:cond_a4
if-eqz v0, :cond_b0
.line 200
const-string v1, "CMWX"
const-string/jumbo v2, "share video success."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_17
.line 202
:cond_b0
const-string v1, "CMWX"
const-string/jumbo v2, "share video failed."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_17
.end method
.method private sendWechatRequest(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
.registers 4
.prologue
.line 533
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, p1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 535
if-nez v0, :cond_15
.line 536
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v1, "wxc54439c65ae32ec9"
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
.line 537
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, p1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
.line 539
:cond_15
return-void
.end method
.method private shareImageErrorToast()V
.registers 4
.prologue
.line 226
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mContext:Landroid/content/Context;
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mContext:Landroid/content/Context;
sget v2, Lcom/cleanmaster/hpsharelib/R$string;->share_image_to_wechat_failed_tips:I
invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v0
invoke-virtual {v0}, Landroid/widget/Toast;->show()V
.line 227
return-void
.end method
.method private shareVideoErrorToast()V
.registers 4
.prologue
.line 222
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mContext:Landroid/content/Context;
const-string/jumbo v1, "\u89c6\u9891\u5206\u4eab\u5931\u8d25"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v0
invoke-virtual {v0}, Landroid/widget/Toast;->show()V
.line 223
return-void
.end method
.method private transformScene(I)I
.registers 3
.prologue
.line 389
packed-switch p1, :pswitch_data_8
.line 394
const/4 v0, 0x0
:goto_4
return v0
.line 391
:pswitch_5
const/4 v0, 0x1
goto :goto_4
.line 389
nop
:pswitch_data_8
.packed-switch 0x2
:pswitch_5
.end packed-switch
.end method
# virtual methods
.method public downLoadImg(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
.registers 18
.prologue
.line 582
new-instance v10, Lcom/android/volley/toolbox/ImageRequest;
new-instance v0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$5;
move-object v1, p0
move-object v2, p1
move v3, p2
move-object v4, p3
move-object/from16 v5, p4
invoke-direct/range {v0 .. v5}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$5;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
const/4 v9, 0x0
const/4 v11, 0x0
sget-object v7, Landroid/widget/ImageView$ScaleType;->CENTER:Landroid/widget/ImageView$ScaleType;
sget-object v8, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
new-instance v1, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$6;
move-object v2, p0
move-object v3, p1
move v4, p2
move-object v5, p3
move-object/from16 v6, p4
invoke-direct/range {v1 .. v6}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$6;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
move-object v2, v10
move-object/from16 v3, p5
move-object v4, v0
move v5, v9
move v6, v11
move-object v9, v1
invoke-direct/range {v2 .. v9}, Lcom/android/volley/toolbox/ImageRequest;-><init>(Ljava/lang/String;Lcom/android/volley/Response$Listener;IILandroid/widget/ImageView$ScaleType;Landroid/graphics/Bitmap$Config;Lcom/android/volley/Response$ErrorListener;)V
.line 599
invoke-static {}, Lcom/cleanmaster/hpsharelib/base/util/HostHelper;->getAppContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/android/volley/toolbox/Volley;->newRequestQueue(Landroid/content/Context;)Lcom/android/volley/RequestQueue;
move-result-object v0
.line 600
invoke-virtual {v0, v10}, Lcom/android/volley/RequestQueue;->add(Lcom/android/volley/Request;)Lcom/android/volley/Request;
.line 601
return-void
.end method
.method public getApi()Lcom/tencent/mm/opensdk/openapi/IWXAPI;
.registers 2
.prologue
.line 90
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
return-object v0
.end method
.method public requestAuth(Ljava/lang/String;)Z
.registers 4
.prologue
.line 94
new-instance v0, Lcom/tencent/mm/opensdk/modelmsg/SendAuth$Req;
invoke-direct {v0}, Lcom/tencent/mm/opensdk/modelmsg/SendAuth$Req;-><init>()V
.line 95
const-string/jumbo v1, "snsapi_userinfo"
iput-object v1, v0, Lcom/tencent/mm/opensdk/modelmsg/SendAuth$Req;->scope:Ljava/lang/String;
.line 96
iput-object p1, v0, Lcom/tencent/mm/opensdk/modelmsg/SendAuth$Req;->state:Ljava/lang/String;
.line 97
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v1, v0}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
if-eqz v0, :cond_16
.line 98
const/4 v0, 0x1
.line 100
:goto_15
return v0
:cond_16
const/4 v0, 0x0
goto :goto_15
.end method
.method public declared-synchronized sendImage(Ljava/lang/String;I)Z
.registers 10
.prologue
const/4 v6, 0x0
.line 280
monitor-enter p0
:try_start_2
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_c
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
if-nez v0, :cond_19
.line 281
:cond_c
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 282
const-string v0, "CMWX"
const-string v1, "image path is empty."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_16
.catchall {:try_start_2 .. :try_end_16} :catchall_a2
move v0, v6
.line 322
:goto_17
monitor-exit p0
return v0
.line 285
:cond_19
:try_start_19
new-instance v0, Ljava/io/File;
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 286
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_2a
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
move-result v0
if-nez v0, :cond_36
.line 287
:cond_2a
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 288
const-string v0, "CMWX"
const-string v1, "image not exist."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 289
goto :goto_17
.line 292
:cond_36
new-instance v0, Lcom/tencent/mm/opensdk/modelmsg/WXImageObject;
invoke-direct {v0}, Lcom/tencent/mm/opensdk/modelmsg/WXImageObject;-><init>()V
.line 293
invoke-virtual {v0, p1}, Lcom/tencent/mm/opensdk/modelmsg/WXImageObject;->setImagePath(Ljava/lang/String;)V
.line 295
new-instance v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v2}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 296
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 298
new-instance v1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v1}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
:try_end_4a
.catchall {:try_start_19 .. :try_end_4a} :catchall_a2
.line 300
:try_start_4a
invoke-static {p1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
move-result-object v3
.line 301
const-string v5, "img"
move-object v0, p0
move v4, p2
invoke-direct/range {v0 .. v5}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->buildReq(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;ILjava/lang/String;)Z
:try_end_55
.catch Ljava/lang/Exception; {:try_start_4a .. :try_end_55} :catch_5a
.catchall {:try_start_4a .. :try_end_55} :catchall_a2
move-result v0
if-nez v0, :cond_80
move v0, v6
.line 302
goto :goto_17
.line 304
:catch_5a
move-exception v0
.line 305
:try_start_5b
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 306
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 307
const-string v1, "CMWX"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v3, "share image exception:"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 308
goto :goto_17
.line 311
:cond_80
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 313
if-nez v0, :cond_96
.line 314
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v2, "wxc54439c65ae32ec9"
invoke-interface {v0, v2}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
.line 315
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 317
:cond_96
if-eqz v0, :cond_a5
.line 318
const-string v1, "CMWX"
const-string/jumbo v2, "share image success."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_a0
.catchall {:try_start_5b .. :try_end_a0} :catchall_a2
goto/16 :goto_17
.line 280
:catchall_a2
move-exception v0
monitor-exit p0
throw v0
.line 320
:cond_a5
:try_start_a5
const-string v1, "CMWX"
const-string/jumbo v2, "share image failed."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_ad
.catchall {:try_start_a5 .. :try_end_ad} :catchall_a2
goto/16 :goto_17
.end method
.method public sendImageToSession(Ljava/lang/String;)Z
.registers 3
.prologue
.line 147
const/4 v0, 0x1
invoke-virtual {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendImage(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public sendImageToTimeline(Ljava/lang/String;)Z
.registers 3
.prologue
.line 151
const/4 v0, 0x2
invoke-virtual {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendImage(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public declared-synchronized sendText(Ljava/lang/String;I)Z
.registers 6
.prologue
.line 112
monitor-enter p0
:try_start_1
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_b
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
if-nez v0, :cond_16
.line 113
:cond_b
const-string v0, "CMWX"
const-string/jumbo v1, "text is empty."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_13
.catchall {:try_start_1 .. :try_end_13} :catchall_5d
.line 114
const/4 v0, 0x0
.line 143
:goto_14
monitor-exit p0
return v0
.line 117
:cond_16
:try_start_16
new-instance v0, Lcom/tencent/mm/opensdk/modelmsg/WXTextObject;
invoke-direct {v0}, Lcom/tencent/mm/opensdk/modelmsg/WXTextObject;-><init>()V
.line 118
iput-object p1, v0, Lcom/tencent/mm/opensdk/modelmsg/WXTextObject;->text:Ljava/lang/String;
.line 120
new-instance v1, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v1}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 121
iput-object v0, v1, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 124
iput-object p1, v1, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
.line 127
new-instance v2, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v2}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
.line 128
const-string/jumbo v0, "text"
invoke-direct {p0, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->buildTransaction(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->transaction:Ljava/lang/String;
.line 129
iput-object v1, v2, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->message:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
.line 130
invoke-direct {p0, p2}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->transformScene(I)I
move-result v0
iput v0, v2, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->scene:I
.line 132
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v2}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 134
if-nez v0, :cond_52
.line 135
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v1, "wxc54439c65ae32ec9"
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
.line 136
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v2}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 138
:cond_52
if-eqz v0, :cond_60
.line 139
const-string v1, "CMWX"
const-string/jumbo v2, "share text success."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_5c
.catchall {:try_start_16 .. :try_end_5c} :catchall_5d
goto :goto_14
.line 112
:catchall_5d
move-exception v0
monitor-exit p0
throw v0
.line 141
:cond_60
:try_start_60
const-string v1, "CMWX"
const-string/jumbo v2, "share text failed."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_68
.catchall {:try_start_60 .. :try_end_68} :catchall_5d
goto :goto_14
.end method
.method public sendTextToSession(Ljava/lang/String;)Z
.registers 3
.prologue
.line 104
const/4 v0, 0x1
invoke-virtual {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendText(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public sendTextToTimeline(Ljava/lang/String;)Z
.registers 3
.prologue
.line 108
const/4 v0, 0x2
invoke-virtual {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendText(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public declared-synchronized sendUrlWebpage(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)Z
.registers 13
.prologue
const/4 v6, 0x0
.line 230
monitor-enter p0
:try_start_2
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
if-nez v0, :cond_e
if-eqz p5, :cond_e
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
if-nez v0, :cond_1b
.line 231
:cond_e
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 232
const-string v0, "CMWX"
const-string v1, "image path is empty."
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_18
.catchall {:try_start_2 .. :try_end_18} :catchall_87
move v0, v6
.line 266
:goto_19
monitor-exit p0
return v0
.line 235
:cond_1b
:try_start_1b
new-instance v0, Lcom/tencent/mm/opensdk/modelmsg/WXWebpageObject;
invoke-direct {v0}, Lcom/tencent/mm/opensdk/modelmsg/WXWebpageObject;-><init>()V
.line 236
iput-object p1, v0, Lcom/tencent/mm/opensdk/modelmsg/WXWebpageObject;->webpageUrl:Ljava/lang/String;
.line 238
new-instance v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v2}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 239
iput-object v0, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 240
iput-object p3, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->title:Ljava/lang/String;
.line 241
iput-object p4, v2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
.line 243
new-instance v1, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v1}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
:try_end_32
.catchall {:try_start_1b .. :try_end_32} :catchall_87
.line 245
:try_start_32
const-string/jumbo v5, "webpage"
move-object v0, p0
move-object v3, p5
move v4, p2
invoke-direct/range {v0 .. v5}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->buildReq(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;ILjava/lang/String;)Z
:try_end_3b
.catch Ljava/lang/Exception; {:try_start_32 .. :try_end_3b} :catch_40
.catchall {:try_start_32 .. :try_end_3b} :catchall_87
move-result v0
if-nez v0, :cond_66
move v0, v6
.line 246
goto :goto_19
.line 248
:catch_40
move-exception v0
.line 249
:try_start_41
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 250
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->shareImageErrorToast()V
.line 251
const-string v1, "CMWX"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v3, "share webpage exception:"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
move v0, v6
.line 252
goto :goto_19
.line 255
:cond_66
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 257
if-nez v0, :cond_7c
.line 258
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
const-string/jumbo v2, "wxc54439c65ae32ec9"
invoke-interface {v0, v2}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->registerApp(Ljava/lang/String;)Z
.line 259
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mApi:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
invoke-interface {v0, v1}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->sendReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)Z
move-result v0
.line 261
:cond_7c
if-eqz v0, :cond_8a
.line 262
const-string v1, "CMWX"
const-string/jumbo v2, "share image success."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_86
.catchall {:try_start_41 .. :try_end_86} :catchall_87
goto :goto_19
.line 230
:catchall_87
move-exception v0
monitor-exit p0
throw v0
.line 264
:cond_8a
:try_start_8a
const-string v1, "CMWX"
const-string/jumbo v2, "share image failed."
invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_92
.catchall {:try_start_8a .. :try_end_92} :catchall_87
goto :goto_19
.end method
.method public sendVideoToSession(Ljava/lang/String;)Z
.registers 3
.prologue
.line 155
const/4 v0, 0x1
invoke-direct {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendVideo(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public sendVideoToTimeline(Ljava/lang/String;)Z
.registers 3
.prologue
.line 159
const/4 v0, 0x2
invoke-direct {p0, p1, v0}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendVideo(Ljava/lang/String;I)Z
move-result v0
return v0
.end method
.method public setMsgThumbData(Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;Ljava/lang/Object;)V
.registers 7
.prologue
.line 543
if-nez p3, :cond_8
.line 544
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mToupaiLogoCallback:Lcom/cm/plugincluster/news/interfaces/ILogoCallBack;
invoke-interface {v0}, Lcom/cm/plugincluster/news/interfaces/ILogoCallBack;->callback()Landroid/graphics/Bitmap;
move-result-object p3
.line 546
:cond_8
if-nez p3, :cond_b
.line 554
:goto_a
return-void
.line 551
:cond_b
const/4 v0, 0x0
sget-object v1, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;
invoke-static {p3, v0, v1}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->bmpToByteArray(Landroid/graphics/Bitmap;ZLandroid/graphics/Bitmap$CompressFormat;)[B
move-result-object v0
.line 553
iput-object v0, p2, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->thumbData:[B
goto :goto_a
.end method
.method public setToupaiLogo(Lcom/cm/plugincluster/news/interfaces/ILogoCallBack;)V
.registers 2
.prologue
.line 604
iput-object p1, p0, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->mToupaiLogoCallback:Lcom/cm/plugincluster/news/interfaces/ILogoCallBack;
.line 605
return-void
.end method
.method public shareByWeChat(Landroid/content/Context;Lorg/json/JSONObject;)V
.registers 24
.prologue
.line 467
new-instance v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v7}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 470
const-string v5, ""
.line 471
const-string v8, ""
.line 472
const-string v6, ""
.line 474
:try_start_b
const-string/jumbo v4, "title"
move-object/from16 v0, p2
invoke-virtual {v0, v4}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v4
check-cast v4, Ljava/lang/String;
:try_end_16
.catch Lorg/json/JSONException; {:try_start_b .. :try_end_16} :catch_7b
.line 475
:try_start_16
const-string v5, "imageUrl"
move-object/from16 v0, p2
invoke-virtual {v0, v5}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/String;
:try_end_20
.catch Lorg/json/JSONException; {:try_start_16 .. :try_end_20} :catch_c6
.line 476
:try_start_20
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v9, "shareUrl"
move-object/from16 v0, p2
invoke-virtual {v0, v9}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v9
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v8
const-string v9, "&share=cmnews"
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v8
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
:try_end_3b
.catch Lorg/json/JSONException; {:try_start_20 .. :try_end_3b} :catch_cd
move-result-object v6
move-object/from16 v18, v5
move-object v5, v4
move-object v4, v6
.line 481
:goto_40
invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v6
if-nez v6, :cond_8a
.line 482
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->title:Ljava/lang/String;
.line 487
:goto_48
new-instance v5, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;
invoke-direct {v5}, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;-><init>()V
.line 488
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 489
iput-object v4, v5, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;->videoUrl:Ljava/lang/String;
.line 491
new-instance v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v9}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
.line 492
invoke-static/range {v18 .. v18}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
if-eqz v4, :cond_90
.line 493
const/4 v4, 0x0
move-object/from16 v0, p0
move-object/from16 v1, p1
move-object/from16 v2, p2
invoke-virtual {v0, v1, v7, v4, v2}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->setMsgThumbData(Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;Ljava/lang/Object;)V
.line 495
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v4
invoke-static {v4, v5}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v4
iput-object v4, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->transaction:Ljava/lang/String;
.line 496
iput-object v7, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->message:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
.line 497
const/4 v4, 0x0
iput v4, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->scene:I
.line 499
move-object/from16 v0, p0
invoke-direct {v0, v9}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendWechatRequest(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
.line 529
:goto_7a
return-void
.line 477
:catch_7b
move-exception v4
move-object/from16 v20, v4
move-object v4, v5
move-object v5, v8
move-object/from16 v8, v20
.line 478
:goto_82
invoke-virtual {v8}, Lorg/json/JSONException;->printStackTrace()V
move-object/from16 v18, v5
move-object v5, v4
move-object v4, v6
goto :goto_40
.line 484
:cond_8a
const-string/jumbo v5, "\u8fd9\u4e2a\u89c6\u9891\u4e5f\u5c31\u770b\u4e868\u904d\u800c\u5df2\uff0c\u5fcd\u4e0d\u4f4f\u5206\u4eab\u7ed9\u4f60\u3002"
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
goto :goto_48
.line 501
:cond_90
new-instance v19, Lcom/android/volley/toolbox/ImageRequest;
new-instance v4, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$3;
move-object/from16 v5, p0
move-object/from16 v6, p1
move-object/from16 v8, p2
invoke-direct/range {v4 .. v9}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$3;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Lorg/json/JSONObject;Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
const/4 v5, 0x0
const/4 v6, 0x0
sget-object v16, Landroid/widget/ImageView$ScaleType;->CENTER:Landroid/widget/ImageView$ScaleType;
sget-object v17, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
new-instance v10, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$4;
move-object/from16 v11, p0
move-object/from16 v12, p1
move-object v13, v7
move-object/from16 v14, p2
move-object v15, v9
invoke-direct/range {v10 .. v15}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$4;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Lorg/json/JSONObject;Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
move-object/from16 v11, v19
move-object/from16 v12, v18
move-object v13, v4
move v14, v5
move v15, v6
move-object/from16 v18, v10
invoke-direct/range {v11 .. v18}, Lcom/android/volley/toolbox/ImageRequest;-><init>(Ljava/lang/String;Lcom/android/volley/Response$Listener;IILandroid/widget/ImageView$ScaleType;Landroid/graphics/Bitmap$Config;Lcom/android/volley/Response$ErrorListener;)V
.line 526
invoke-static/range {p1 .. p1}, Lcom/android/volley/toolbox/Volley;->newRequestQueue(Landroid/content/Context;)Lcom/android/volley/RequestQueue;
move-result-object v4
.line 527
move-object/from16 v0, v19
invoke-virtual {v4, v0}, Lcom/android/volley/RequestQueue;->add(Lcom/android/volley/Request;)Lcom/android/volley/Request;
goto :goto_7a
.line 477
:catch_c6
move-exception v5
move-object/from16 v20, v5
move-object v5, v8
move-object/from16 v8, v20
goto :goto_82
:catch_cd
move-exception v8
goto :goto_82
.end method
.method public shareByWechatFriends(Landroid/content/Context;Lorg/json/JSONObject;)V
.registers 24
.prologue
.line 400
new-instance v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
invoke-direct {v7}, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;-><init>()V
.line 402
const-string v5, ""
.line 403
const-string v8, ""
.line 404
const-string v6, ""
.line 406
:try_start_b
const-string/jumbo v4, "title"
move-object/from16 v0, p2
invoke-virtual {v0, v4}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v4
check-cast v4, Ljava/lang/String;
:try_end_16
.catch Lorg/json/JSONException; {:try_start_b .. :try_end_16} :catch_7d
.line 407
:try_start_16
const-string v5, "imageUrl"
move-object/from16 v0, p2
invoke-virtual {v0, v5}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/String;
:try_end_20
.catch Lorg/json/JSONException; {:try_start_16 .. :try_end_20} :catch_cd
.line 408
:try_start_20
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v9, "shareUrl"
move-object/from16 v0, p2
invoke-virtual {v0, v9}, Lorg/json/JSONObject;->get(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v9
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v8
const-string v9, "&share=cmnews"
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v8
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
:try_end_3b
.catch Lorg/json/JSONException; {:try_start_20 .. :try_end_3b} :catch_d4
move-result-object v6
move-object/from16 v18, v5
move-object v5, v4
move-object v4, v6
.line 412
:goto_40
invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v6
if-nez v6, :cond_8c
.line 413
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
.line 414
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->title:Ljava/lang/String;
.line 419
:goto_4a
new-instance v5, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;
invoke-direct {v5}, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;-><init>()V
.line 420
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->mediaObject:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage$IMediaObject;
.line 421
iput-object v4, v5, Lcom/tencent/mm/opensdk/modelmsg/WXVideoObject;->videoUrl:Ljava/lang/String;
.line 424
new-instance v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;
invoke-direct {v9}, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;-><init>()V
.line 425
invoke-static/range {v18 .. v18}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v4
if-eqz v4, :cond_97
.line 426
const/4 v4, 0x0
move-object/from16 v0, p0
move-object/from16 v1, p1
move-object/from16 v2, p2
invoke-virtual {v0, v1, v7, v4, v2}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->setMsgThumbData(Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Landroid/graphics/Bitmap;Ljava/lang/Object;)V
.line 427
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v4
invoke-static {v4, v5}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v4
iput-object v4, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->transaction:Ljava/lang/String;
.line 428
iput-object v7, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->message:Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;
.line 429
const/4 v4, 0x1
iput v4, v9, Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;->scene:I
.line 431
move-object/from16 v0, p0
invoke-direct {v0, v9}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;->sendWechatRequest(Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
.line 463
:goto_7c
return-void
.line 409
:catch_7d
move-exception v4
move-object/from16 v20, v4
move-object v4, v5
move-object v5, v8
move-object/from16 v8, v20
.line 410
:goto_84
invoke-virtual {v8}, Lorg/json/JSONException;->printStackTrace()V
move-object/from16 v18, v5
move-object v5, v4
move-object v4, v6
goto :goto_40
.line 416
:cond_8c
const-string/jumbo v5, "\u8fd9\u4e2a\u89c6\u9891\u4e5f\u5c31\u770b\u4e868\u904d\u800c\u5df2\uff0c\u5fcd\u4e0d\u4f4f\u5206\u4eab\u7ed9\u4f60\u3002"
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->description:Ljava/lang/String;
.line 417
const-string/jumbo v5, "\u8fd9\u4e2a\u89c6\u9891\u4e5f\u5c31\u770b\u4e868\u904d\u800c\u5df2\uff0c\u5fcd\u4e0d\u4f4f\u5206\u4eab\u7ed9\u4f60\u3002"
iput-object v5, v7, Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;->title:Ljava/lang/String;
goto :goto_4a
.line 433
:cond_97
new-instance v19, Lcom/android/volley/toolbox/ImageRequest;
new-instance v4, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$1;
move-object/from16 v5, p0
move-object/from16 v6, p1
move-object/from16 v8, p2
invoke-direct/range {v4 .. v9}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$1;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Lorg/json/JSONObject;Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
const/4 v5, 0x0
const/4 v6, 0x0
sget-object v16, Landroid/widget/ImageView$ScaleType;->CENTER:Landroid/widget/ImageView$ScaleType;
sget-object v17, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
new-instance v10, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$2;
move-object/from16 v11, p0
move-object/from16 v12, p1
move-object v13, v7
move-object/from16 v14, p2
move-object v15, v9
invoke-direct/range {v10 .. v15}, Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil$2;-><init>(Lcom/cleanmaster/hpsharelib/share/WechatSDKUtil;Landroid/content/Context;Lcom/tencent/mm/opensdk/modelmsg/WXMediaMessage;Lorg/json/JSONObject;Lcom/tencent/mm/opensdk/modelmsg/SendMessageToWX$Req;)V
move-object/from16 v11, v19
move-object/from16 v12, v18
move-object v13, v4
move v14, v5
move v15, v6
move-object/from16 v18, v10
invoke-direct/range {v11 .. v18}, Lcom/android/volley/toolbox/ImageRequest;-><init>(Ljava/lang/String;Lcom/android/volley/Response$Listener;IILandroid/widget/ImageView$ScaleType;Landroid/graphics/Bitmap$Config;Lcom/android/volley/Response$ErrorListener;)V
.line 460
invoke-static/range {p1 .. p1}, Lcom/android/volley/toolbox/Volley;->newRequestQueue(Landroid/content/Context;)Lcom/android/volley/RequestQueue;
move-result-object v4
.line 461
move-object/from16 v0, v19
invoke-virtual {v4, v0}, Lcom/android/volley/RequestQueue;->add(Lcom/android/volley/Request;)Lcom/android/volley/Request;
goto :goto_7c
.line 409
:catch_cd
move-exception v5
move-object/from16 v20, v5
move-object v5, v8
move-object/from16 v8, v20
goto :goto_84
:catch_d4
move-exception v8
goto :goto_84
.end method