今奥全景相机
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.

2895 lines
77 KiB

.class public Lcom/viatech/util/SocialShareUtil;
.super Ljava/lang/Object;
.source "SocialShareUtil.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;,
Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;
}
.end annotation
# static fields
.field public static final SHARE_2_FACEBOOK:I = 0x1
.field public static final SHARE_2_OTHERS:I = 0x4
.field public static final SHARE_2_UNKNOWN:I = 0x0
.field public static final SHARE_2_VPAICLOUD:I = 0x3
.field public static final SHARE_2_WEIXIN:I = 0x5
.field public static final SHARE_2_YOUTUBE:I = 0x2
.field public static final SHARE_ERROR_CONTENT:I = -0x5
.field public static final SHARE_ERROR_NETWORK:I = -0x4
.field public static final SHARE_ERROR_NOAPP:I = -0x1
.field public static final SHARE_ERROR_NOLOGIN:I = -0x2
.field public static final SHARE_ERROR_NOPERMISSION:I = -0x3
.field public static final SHARE_TYPE:Ljava/lang/String; = "share_type"
.field private static final TAG:Ljava/lang/String; = "VPAI_SocialShareUtil"
.field private static mInstance:Lcom/viatech/util/SocialShareUtil;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 53
const/4 v0, 0x0
sput-object v0, Lcom/viatech/util/SocialShareUtil;->mInstance:Lcom/viatech/util/SocialShareUtil;
return-void
.end method
.method private constructor <init>()V
.locals 0
.prologue
.line 70
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 72
return-void
.end method
.method public static getMediaListType(Ljava/util/List;)I
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)I"
}
.end annotation
.prologue
const/4 v4, 0x2
const/4 v5, 0x1
const/4 v2, 0x0
.line 245
if-eqz p0, :cond_0
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_1
.line 265
:cond_0
:goto_0
return v2
.line 252
:cond_1
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v6
move v1, v2
move v3, v2
:goto_1
invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_3
invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 253
iget v7, v0, Lcom/viatech/gallery/FileInfo;->fileType:I
if-ne v7, v5, :cond_2
.line 254
add-int/lit8 v3, v3, 0x1
move v0, v1
move v1, v3
:goto_2
move v3, v1
move v1, v0
.line 258
goto :goto_1
.line 255
:cond_2
iget v0, v0, Lcom/viatech/gallery/FileInfo;->fileType:I
if-ne v0, v4, :cond_5
.line 256
add-int/lit8 v1, v1, 0x1
move v0, v1
move v1, v3
goto :goto_2
.line 260
:cond_3
if-nez v3, :cond_4
if-lt v1, v5, :cond_4
move v2, v4
.line 261
goto :goto_0
.line 262
:cond_4
if-nez v1, :cond_0
if-lt v3, v5, :cond_0
move v2, v5
.line 263
goto :goto_0
:cond_5
move v0, v1
move v1, v3
goto :goto_2
.end method
.method public static instance()Lcom/viatech/util/SocialShareUtil;
.locals 1
.prologue
.line 75
sget-object v0, Lcom/viatech/util/SocialShareUtil;->mInstance:Lcom/viatech/util/SocialShareUtil;
if-nez v0, :cond_0
.line 76
new-instance v0, Lcom/viatech/util/SocialShareUtil;
invoke-direct {v0}, Lcom/viatech/util/SocialShareUtil;-><init>()V
sput-object v0, Lcom/viatech/util/SocialShareUtil;->mInstance:Lcom/viatech/util/SocialShareUtil;
.line 78
:cond_0
sget-object v0, Lcom/viatech/util/SocialShareUtil;->mInstance:Lcom/viatech/util/SocialShareUtil;
return-object v0
.end method
.method private static isFacebookInstalled(Landroid/app/Activity;)Z
.locals 4
.prologue
const/4 v0, 0x1
.line 86
invoke-virtual {p0}, Landroid/app/Activity;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v1
.line 89
:try_start_0
const-string v2, "com.facebook.katana"
const/4 v3, 0x1
invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 94
:goto_0
return v0
.line 91
:catch_0
move-exception v0
.line 92
const/4 v0, 0x0
goto :goto_0
.end method
.method public static requestFacebookPublishPermission(Landroid/app/Activity;)V
.locals 4
.prologue
.line 98
invoke-static {}, Lcom/facebook/login/LoginManager;->getInstance()Lcom/facebook/login/LoginManager;
move-result-object v0
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/String;
const/4 v2, 0x0
const-string v3, "publish_video"
aput-object v3, v1, v2
.line 99
invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v1
.line 98
invoke-virtual {v0, p0, v1}, Lcom/facebook/login/LoginManager;->logInWithPublishPermissions(Landroid/app/Activity;Ljava/util/Collection;)V
.line 100
return-void
.end method
.method public static uploadPhoto2Facebook(Landroid/net/Uri;Ljava/lang/String;Landroid/app/Activity;Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;)V
.locals 7
.prologue
const v3, 0x7f07012a
const/4 v1, -0x1
const/4 v6, -0x5
const/4 v0, 0x0
.line 613
.line 614
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->isFacebookInstalled(Landroid/app/Activity;)Z
move-result v2
if-nez v2, :cond_0
.line 616
invoke-static {v3}, Lcom/viatech/VPaiApplication;->b(I)V
move v0, v1
.line 619
:cond_0
if-gt v0, v1, :cond_2
.line 621
new-instance v1, Lcom/viatech/util/SocialShareUtil$3;
invoke-direct {v1, p3, v0}, Lcom/viatech/util/SocialShareUtil$3;-><init>(Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;I)V
invoke-virtual {p2, v1}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V
.line 775
:cond_1
:goto_0
return-void
.line 634
:cond_2
:try_start_0
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->isFacebookInstalled(Landroid/app/Activity;)Z
move-result v0
if-nez v0, :cond_3
.line 635
const v0, 0x7f07012a
invoke-static {v0}, Lcom/viatech/VPaiApplication;->b(I)V
:try_end_0
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_1
goto :goto_0
.line 764
:catch_0
move-exception v0
.line 765
invoke-virtual {v0}, Ljava/io/FileNotFoundException;->printStackTrace()V
.line 766
if-eqz p3, :cond_1
.line 767
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "FileNotFoundException: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v0}, Ljava/io/FileNotFoundException;->getMessage()Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, 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-interface {p3, v6, v0}, Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;->onFailure(ILjava/lang/String;)V
goto :goto_0
.line 639
:cond_3
:try_start_1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 640
new-instance v1, Lcom/facebook/share/model/SharePhoto$Builder;
invoke-direct {v1}, Lcom/facebook/share/model/SharePhoto$Builder;-><init>()V
invoke-virtual {v1, p0}, Lcom/facebook/share/model/SharePhoto$Builder;->setImageUrl(Landroid/net/Uri;)Lcom/facebook/share/model/SharePhoto$Builder;
move-result-object v1
invoke-virtual {v1}, Lcom/facebook/share/model/SharePhoto$Builder;->build()Lcom/facebook/share/model/SharePhoto;
move-result-object v1
.line 641
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 643
new-instance v1, Lcom/facebook/share/model/SharePhotoContent$Builder;
invoke-direct {v1}, Lcom/facebook/share/model/SharePhotoContent$Builder;-><init>()V
invoke-virtual {v1, v0}, Lcom/facebook/share/model/SharePhotoContent$Builder;->addPhotos(Ljava/util/List;)Lcom/facebook/share/model/SharePhotoContent$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/facebook/share/model/SharePhotoContent$Builder;->build()Lcom/facebook/share/model/SharePhotoContent;
move-result-object v0
.line 645
new-instance v1, Lcom/facebook/share/widget/ShareDialog;
invoke-direct {v1, p2}, Lcom/facebook/share/widget/ShareDialog;-><init>(Landroid/app/Activity;)V
.line 646
invoke-static {}, Lcom/facebook/CallbackManager$Factory;->create()Lcom/facebook/CallbackManager;
move-result-object v2
new-instance v3, Lcom/viatech/util/SocialShareUtil$4;
invoke-direct {v3, p3}, Lcom/viatech/util/SocialShareUtil$4;-><init>(Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;)V
invoke-virtual {v1, v2, v3}, Lcom/facebook/share/widget/ShareDialog;->registerCallback(Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;)V
.line 664
const-string v2, "VPAI_SocialShareUtil"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "shareDialog.canShow(SharePhotoContent)="
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v1, v0}, Lcom/facebook/share/widget/ShareDialog;->canShow(Ljava/lang/Object;)Z
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 667
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->canShow(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)Z
move-result v2
if-eqz v2, :cond_4
.line 668
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->show(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)V
.line 680
:goto_1
new-instance v0, Landroid/graphics/BitmapFactory$Options;
invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V
.line 681
const/4 v1, 0x1
iput-boolean v1, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
.line 682
invoke-virtual {p2}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "r"
invoke-virtual {v1, p0, v2}, Landroid/content/ContentResolver;->openFileDescriptor(Landroid/net/Uri;Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
move-result-object v1
.line 683
invoke-virtual {v1}, Landroid/os/ParcelFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;
move-result-object v1
const/4 v2, 0x0
invoke-static {v1, v2, v0}, Landroid/graphics/BitmapFactory;->decodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
.line 684
iget v1, v0, Landroid/graphics/BitmapFactory$Options;->outWidth:I
.line 685
iget v0, v0, Landroid/graphics/BitmapFactory$Options;->outHeight:I
.line 687
new-instance v2, Landroid/os/Bundle;
invoke-direct {v2}, Landroid/os/Bundle;-><init>()V
.line 688
new-instance v3, Lorg/json/JSONObject;
invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V
.line 689
const-string v4, "ProjectionType"
const-string v5, "equirectangular"
invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
.line 690
const-string v4, "CroppedAreaImageWidthPixels"
invoke-virtual {v3, v4, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 691
const-string v4, "CroppedAreaImageHeightPixels"
invoke-virtual {v3, v4, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 693
const-string v4, "FullPanoWidthPixels"
invoke-virtual {v3, v4, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 694
const-string v1, "FullPanoHeightPixels"
invoke-virtual {v3, v1, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 696
const-string v0, "CroppedAreaLeftPixels"
const/4 v1, 0x0
invoke-virtual {v3, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 697
const-string v0, "CroppedAreaTopPixels"
const/4 v1, 0x0
invoke-virtual {v3, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
.line 699
const-string v0, "VPAI_SocialShareUtil"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "spherical_metadata: "
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v3}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 701
const-string v0, "spherical_metadata"
invoke-virtual {v3}, Lorg/json/JSONObject;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V
.line 702
const-string v0, "allow_spherical_photo"
const/4 v1, 0x1
invoke-virtual {v2, v0, v1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V
:try_end_1
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
.catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1
goto/16 :goto_0
.line 769
:catch_1
move-exception v0
.line 770
invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V
.line 771
if-eqz p3, :cond_1
.line 772
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "JSONException: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v0}, Lorg/json/JSONException;->getMessage()Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, 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-interface {p3, v6, v0}, Lcom/viatech/util/SocialShareUtil$OnFacebookUploadCallback;->onFailure(ILjava/lang/String;)V
goto/16 :goto_0
.line 670
:cond_4
:try_start_2
new-instance v0, Lcom/viatech/util/SocialShareUtil$5;
invoke-direct {v0}, Lcom/viatech/util/SocialShareUtil$5;-><init>()V
invoke-virtual {p2, v0}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V
:try_end_2
.catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_0
.catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_1
goto/16 :goto_1
.end method
# virtual methods
.method public canFacebookShowDialog()Z
.locals 1
.prologue
.line 82
const-class v0, Lcom/facebook/share/model/ShareVideoContent;
invoke-static {v0}, Lcom/facebook/share/widget/ShareDialog;->canShow(Ljava/lang/Class;)Z
move-result v0
if-eqz v0, :cond_0
const-class v0, Lcom/facebook/share/model/SharePhotoContent;
invoke-static {v0}, Lcom/facebook/share/widget/ShareDialog;->canShow(Ljava/lang/Class;)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public share2Facebook(Landroid/app/Activity;Ljava/util/List;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;",
"Lcom/facebook/CallbackManager;",
"Lcom/facebook/FacebookCallback",
"<",
"Lcom/facebook/share/Sharer$Result;",
">;",
"Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;",
")V"
}
.end annotation
.prologue
.line 271
if-eqz p2, :cond_0
invoke-interface {p2}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_1
.line 289
:cond_0
:goto_0
return-void
.line 275
:cond_1
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->getMediaListType(Ljava/util/List;)I
move-result v1
.line 277
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 278
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_1
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_2
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 279
new-instance v4, Ljava/io/File;
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v0
invoke-direct {v4, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 280
invoke-static {v4}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v0
.line 281
invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_1
.line 284
:cond_2
const/4 v0, 0x2
if-eq v1, v0, :cond_0
.line 286
const/4 v0, 0x1
if-ne v1, v0, :cond_0
move-object v0, p0
move-object v1, p1
move-object v3, p3
move-object v4, p4
move-object v5, p5
.line 287
invoke-virtual/range {v0 .. v5}, Lcom/viatech/util/SocialShareUtil;->shareMultiplyPhoto2Facebook(Landroid/app/Activity;Ljava/util/List;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
goto :goto_0
.end method
.method public share2Others(Landroid/app/Activity;Ljava/util/List;)V
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
const/4 v7, 0x2
const/4 v6, 0x0
const/4 v5, 0x1
.line 443
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->getMediaListType(Ljava/util/List;)I
move-result v1
.line 444
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 445
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_0
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_0
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 446
new-instance v4, Ljava/io/File;
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v0
invoke-direct {v4, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 447
invoke-static {v4}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v0
.line 448
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 451
:cond_0
new-instance v3, Landroid/content/Intent;
invoke-direct {v3}, Landroid/content/Intent;-><init>()V
.line 452
if-ne v1, v7, :cond_2
.line 453
invoke-static {v7}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 454
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 455
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v6}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 467
:cond_1
:goto_1
const v0, 0x7f070133
:try_start_0
invoke-virtual {p1, v0}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v0
invoke-static {v3, v0}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 472
:goto_2
return-void
.line 456
:cond_2
if-ne v1, v5, :cond_1
.line 457
invoke-static {v5}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 458
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v0
if-ne v0, v5, :cond_3
.line 459
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 460
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v6}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
goto :goto_1
.line 462
:cond_3
const-string v0, "android.intent.action.SEND_MULTIPLE"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 463
const-string v0, "android.intent.extra.STREAM"
invoke-virtual {v3, v0, v2}, Landroid/content/Intent;->putParcelableArrayListExtra(Ljava/lang/String;Ljava/util/ArrayList;)Landroid/content/Intent;
goto :goto_1
.line 468
:catch_0
move-exception v0
.line 469
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_2
.end method
.method public share2Others(Landroid/app/Activity;Ljava/util/List;Z)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;Z)V"
}
.end annotation
.prologue
.line 566
if-eqz p3, :cond_0
.line 567
invoke-virtual {p0, p1, p2}, Lcom/viatech/util/SocialShareUtil;->shareLink2Others(Landroid/app/Activity;Ljava/util/List;)V
.line 571
:goto_0
return-void
.line 569
:cond_0
invoke-virtual {p0, p1, p2}, Lcom/viatech/util/SocialShareUtil;->share2Others(Landroid/app/Activity;Ljava/util/List;)V
goto :goto_0
.end method
.method public share2VPaiActivity(Landroid/app/Activity;Ljava/util/ArrayList;Z)V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/ArrayList",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;Z)V"
}
.end annotation
.prologue
const/4 v9, 0x2
const/4 v8, 0x1
const/4 v7, 0x0
.line 355
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->getMediaListType(Ljava/util/List;)I
move-result v1
.line 356
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 357
invoke-virtual {p2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_0
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_1
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 358
const-string v4, "VPAI_SocialShareUtil"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "share2VPaiActivity "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
iget-object v6, v0, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
const-string v6, ", url "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
iget-object v6, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 361
iget-object v4, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
if-eqz v4, :cond_0
.line 362
iget-object v0, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v0
.line 368
:goto_1
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 364
:cond_0
new-instance v4, Ljava/io/File;
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v0
invoke-direct {v4, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 365
invoke-static {v4}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v0
goto :goto_1
.line 371
:cond_1
new-instance v3, Landroid/content/Intent;
invoke-direct {v3}, Landroid/content/Intent;-><init>()V
.line 372
if-ne v1, v9, :cond_4
.line 373
invoke-static {v9}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 374
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 375
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 376
const-string v1, "FileInfo"
invoke-virtual {p2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Serializable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 377
if-eqz p3, :cond_3
.line 378
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/Uri;
invoke-virtual {v3, v0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
.line 379
const-string v1, "share_file_name_key"
invoke-virtual {p2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
iget-object v0, v0, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 380
const-string v0, "share_only_key"
invoke-virtual {v3, v0, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 381
const-class v0, Lcom/viatech/gallery/SendActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
.line 383
const-string v0, "Type"
invoke-virtual {v3, v0, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 384
const-string v0, "ShareMsg"
const-string v1, ""
invoke-virtual {v3, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 385
const-string v0, "ShareOnly"
invoke-virtual {v3, v0, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 386
const-string v0, "ShareFromOss"
invoke-virtual {v3, v0, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 387
const-string v0, "FileList"
invoke-virtual {v3, v0, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 409
:cond_2
:goto_2
:try_start_0
invoke-virtual {p1, v3}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 413
:goto_3
return-void
.line 389
:cond_3
const-class v0, Lcom/viatech/gallery/EditVideoActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
goto :goto_2
.line 391
:cond_4
if-ne v1, v8, :cond_2
.line 392
const-class v0, Lcom/viatech/gallery/SendActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
.line 393
invoke-static {v8}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 394
const-string v1, "FileInfo"
invoke-virtual {p2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Serializable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 395
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v0
if-ne v0, v8, :cond_5
.line 396
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 397
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 402
:goto_4
const-string v0, "Type"
invoke-virtual {v3, v0, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 403
const-string v0, "ShareMsg"
const-string v1, ""
invoke-virtual {v3, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 404
const-string v0, "ShareOnly"
invoke-virtual {v3, v0, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 405
const-string v0, "ShareFromOss"
invoke-virtual {v3, v0, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 406
const-string v0, "FileList"
invoke-virtual {v3, v0, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
goto :goto_2
.line 399
:cond_5
const-string v0, "android.intent.action.SEND_MULTIPLE"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 400
const-string v0, "android.intent.extra.STREAM"
invoke-virtual {v3, v0, v2}, Landroid/content/Intent;->putParcelableArrayListExtra(Ljava/lang/String;Ljava/util/ArrayList;)Landroid/content/Intent;
goto :goto_4
.line 410
:catch_0
move-exception v0
.line 411
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_3
.end method
.method public share2VPaiCloud(Landroid/app/Activity;Ljava/util/List;ZZ)V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;ZZ)V"
}
.end annotation
.prologue
const/4 v9, 0x2
const/4 v8, 0x1
const/4 v7, 0x0
.line 292
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->getMediaListType(Ljava/util/List;)I
move-result v1
.line 293
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 294
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_0
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_1
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 295
const-string v4, "VPAI_SocialShareUtil"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "share2VPaiCloud "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
iget-object v6, v0, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
const-string v6, ", url "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
iget-object v6, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 298
iget-object v4, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
if-eqz v4, :cond_0
.line 299
iget-object v0, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v0
.line 304
:goto_1
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 301
:cond_0
new-instance v4, Ljava/io/File;
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v0
invoke-direct {v4, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 302
invoke-static {v4}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v0
goto :goto_1
.line 307
:cond_1
new-instance v3, Landroid/content/Intent;
invoke-direct {v3}, Landroid/content/Intent;-><init>()V
.line 308
if-ne v1, v9, :cond_5
.line 309
invoke-static {v9}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 310
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 311
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 312
const-string v1, "FileInfo"
invoke-interface {p2, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Serializable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 313
if-eqz p4, :cond_3
.line 314
const-string v0, "share_type"
const/4 v1, 0x5
invoke-virtual {v3, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
.line 318
:goto_2
if-eqz p3, :cond_4
.line 319
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/Uri;
invoke-virtual {v3, v0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
.line 320
const-string v1, "share_file_name_key"
invoke-interface {p2, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
iget-object v0, v0, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 321
const-string v0, "share_only_key"
invoke-virtual {v3, v0, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 322
const-class v0, Lcom/viatech/gallery/SendVideoActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
.line 341
:cond_2
:goto_3
:try_start_0
invoke-virtual {p1, v3}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 345
:goto_4
return-void
.line 316
:cond_3
const-string v0, "share_type"
const/4 v1, 0x3
invoke-virtual {v3, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
goto :goto_2
.line 324
:cond_4
const-class v0, Lcom/viatech/gallery/EditVideoActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
goto :goto_3
.line 326
:cond_5
if-ne v1, v8, :cond_2
.line 327
const-class v0, Lcom/viatech/gallery/SendPhotoActivity;
invoke-virtual {v3, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
.line 328
invoke-static {v8}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v3, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 329
const-string v0, "share_only_key"
invoke-virtual {v3, v0, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 330
const-string v0, "share_weixin_key"
invoke-virtual {v3, v0, p4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 331
const-string v1, "FileInfo"
invoke-interface {p2, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Serializable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 332
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v0
if-ne v0, v8, :cond_6
.line 333
const-string v0, "android.intent.action.SEND"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 334
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v2, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v3, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
goto :goto_3
.line 336
:cond_6
const-string v0, "android.intent.action.SEND_MULTIPLE"
invoke-virtual {v3, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 337
const-string v0, "android.intent.extra.STREAM"
invoke-virtual {v3, v0, v2}, Landroid/content/Intent;->putParcelableArrayListExtra(Ljava/lang/String;Ljava/util/ArrayList;)Landroid/content/Intent;
goto :goto_3
.line 342
:catch_0
move-exception v0
.line 343
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_4
.end method
.method public share2Youtube(Landroid/app/Activity;Ljava/util/List;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)Z"
}
.end annotation
.prologue
.line 436
invoke-static {p1}, Lcom/via/vpailib/vpaiinterface/YouTubeApi;->loginYouTube(Landroid/app/Activity;)Z
.line 439
const/4 v0, 0x1
return v0
.end method
.method public shareFile2Others(Landroid/app/Activity;Landroid/net/Uri;)V
.locals 2
.prologue
.line 508
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 509
const-string v1, "android.intent.action.SEND"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 510
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v0, v1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 512
const v1, 0x7f07017f
:try_start_0
invoke-virtual {p1, v1}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 516
:goto_0
return-void
.line 513
:catch_0
move-exception v0
.line 514
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_0
.end method
.method public shareLink2Facebook(Landroid/app/Activity;Lcom/viatech/gallery/FileInfo;Z)V
.locals 6
.prologue
.line 574
invoke-static {p1}, Lcom/viatech/util/SocialShareUtil;->isFacebookInstalled(Landroid/app/Activity;)Z
move-result v0
if-nez v0, :cond_0
.line 575
const v0, 0x7f07012a
invoke-static {v0}, Lcom/viatech/VPaiApplication;->b(I)V
.line 588
:goto_0
return-void
.line 580
:cond_0
iget-object v2, p2, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
.line 581
if-eqz p3, :cond_1
invoke-static {}, Lcom/viatech/cloud/CloudConfig;->curUser()Lcom/viatech/cloud/CloudConfig$LoginUser;
move-result-object v0
invoke-virtual {v0}, Lcom/viatech/cloud/CloudConfig$LoginUser;->isCloudLogin()Z
move-result v0
if-eqz v0, :cond_1
.line 582
invoke-virtual {p2}, Lcom/viatech/gallery/FileInfo;->getSharePageUrl()Ljava/lang/String;
move-result-object v2
.line 585
:cond_1
iget-object v4, p2, Lcom/viatech/gallery/FileInfo;->thumbnailUrl:Ljava/lang/String;
.line 586
const-string v0, "VPAI_SocialShareUtil"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "shareLink2Facebook:contentURL"
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v3, "...imageURL:"
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 587
iget-object v3, p2, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
const-string v5, " "
move-object v0, p0
move-object v1, p1
invoke-virtual/range {v0 .. v5}, Lcom/viatech/util/SocialShareUtil;->shareLink2Facebook(Landroid/app/Activity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_0
.end method
.method public shareLink2Facebook(Landroid/app/Activity;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
.locals 2
.prologue
.line 591
new-instance v0, Lcom/facebook/share/model/ShareLinkContent$Builder;
invoke-direct {v0}, Lcom/facebook/share/model/ShareLinkContent$Builder;-><init>()V
.line 592
invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setContentUrl(Landroid/net/Uri;)Lcom/facebook/share/model/ShareContent$Builder;
move-result-object v0
check-cast v0, Lcom/facebook/share/model/ShareLinkContent$Builder;
.line 593
invoke-virtual {v0, p3}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setContentTitle(Ljava/lang/String;)Lcom/facebook/share/model/ShareLinkContent$Builder;
move-result-object v0
.line 594
invoke-static {p4}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setImageUrl(Landroid/net/Uri;)Lcom/facebook/share/model/ShareLinkContent$Builder;
move-result-object v0
.line 595
invoke-virtual {v0, p5}, Lcom/facebook/share/model/ShareLinkContent$Builder;->setContentDescription(Ljava/lang/String;)Lcom/facebook/share/model/ShareLinkContent$Builder;
move-result-object v0
.line 596
invoke-virtual {v0}, Lcom/facebook/share/model/ShareLinkContent$Builder;->build()Lcom/facebook/share/model/ShareLinkContent;
move-result-object v0
.line 597
invoke-static {p1, v0}, Lcom/facebook/share/widget/ShareDialog;->show(Landroid/app/Activity;Lcom/facebook/share/model/ShareContent;)V
.line 598
return-void
.end method
.method public shareLink2Others(Landroid/app/Activity;Ljava/lang/String;)V
.locals 2
.prologue
.line 496
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 497
const-string v1, "android.intent.action.SEND"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 498
const-string v1, "android.intent.extra.TEXT"
invoke-virtual {v0, v1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 499
const-string v1, "text/plain"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 501
const v1, 0x7f07017f
:try_start_0
invoke-virtual {p1, v1}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 505
:goto_0
return-void
.line 502
:catch_0
move-exception v0
.line 503
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_0
.end method
.method public shareLink2Others(Landroid/app/Activity;Ljava/util/List;)V
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
.line 475
invoke-static {}, Lcom/viatech/cloud/CloudConfig;->curUser()Lcom/viatech/cloud/CloudConfig$LoginUser;
move-result-object v0
invoke-virtual {v0}, Lcom/viatech/cloud/CloudConfig$LoginUser;->isCloudLogin()Z
move-result v0
if-nez v0, :cond_0
.line 493
:goto_0
return-void
.line 479
:cond_0
const-string v0, ""
.line 480
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
.line 481
const-string v1, "android.intent.action.SEND"
invoke-virtual {v2, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 482
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
move-object v1, v0
:goto_1
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_1
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 483
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getSharePageUrl()Ljava/lang/String;
move-result-object v0
.line 484
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v4, " "
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, 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
move-object v1, v0
.line 485
goto :goto_1
.line 486
:cond_1
const-string v0, "android.intent.extra.TEXT"
invoke-virtual {v2, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 487
const-string v0, "text/plain"
invoke-virtual {v2, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 489
const v0, 0x7f07017f
:try_start_0
invoke-virtual {p1, v0}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v0
invoke-static {v2, v0}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 490
:catch_0
move-exception v0
.line 491
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_0
.end method
.method public shareMultiplyPhoto2Facebook(Landroid/app/Activity;Ljava/util/List;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Landroid/net/Uri;",
">;",
"Lcom/facebook/CallbackManager;",
"Lcom/facebook/FacebookCallback",
"<",
"Lcom/facebook/share/Sharer$Result;",
">;",
"Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;",
")V"
}
.end annotation
.prologue
.line 142
if-eqz p1, :cond_0
if-eqz p2, :cond_0
invoke-interface {p2}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_1
.line 191
:cond_0
:goto_0
return-void
.line 146
:cond_1
invoke-interface {p2}, Ljava/util/List;->size()I
move-result v0
const/4 v1, 0x6
if-gt v0, v1, :cond_0
.line 150
invoke-static {p1}, Lcom/viatech/util/SocialShareUtil;->isFacebookInstalled(Landroid/app/Activity;)Z
move-result v0
if-nez v0, :cond_2
.line 151
const v0, 0x7f07012a
invoke-static {v0}, Lcom/viatech/VPaiApplication;->b(I)V
goto :goto_0
.line 155
:cond_2
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.line 156
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v2
:goto_1
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_3
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/net/Uri;
.line 157
new-instance v3, Lcom/facebook/share/model/SharePhoto$Builder;
invoke-direct {v3}, Lcom/facebook/share/model/SharePhoto$Builder;-><init>()V
invoke-virtual {v3, v0}, Lcom/facebook/share/model/SharePhoto$Builder;->setImageUrl(Landroid/net/Uri;)Lcom/facebook/share/model/SharePhoto$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/facebook/share/model/SharePhoto$Builder;->build()Lcom/facebook/share/model/SharePhoto;
move-result-object v0
.line 158
invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_1
.line 161
:cond_3
new-instance v0, Lcom/facebook/share/model/SharePhotoContent$Builder;
invoke-direct {v0}, Lcom/facebook/share/model/SharePhotoContent$Builder;-><init>()V
invoke-virtual {v0, v1}, Lcom/facebook/share/model/SharePhotoContent$Builder;->addPhotos(Ljava/util/List;)Lcom/facebook/share/model/SharePhotoContent$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/facebook/share/model/SharePhotoContent$Builder;->build()Lcom/facebook/share/model/SharePhotoContent;
move-result-object v0
.line 163
new-instance v1, Lcom/facebook/share/widget/ShareDialog;
invoke-direct {v1, p1}, Lcom/facebook/share/widget/ShareDialog;-><init>(Landroid/app/Activity;)V
.line 164
invoke-virtual {v1, p3, p4}, Lcom/facebook/share/widget/ShareDialog;->registerCallback(Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;)V
.line 165
const-string v2, "VPAI_SocialShareUtil"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "shareDialog.canShow(SharePhotoContent)="
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v1, v0}, Lcom/facebook/share/widget/ShareDialog;->canShow(Ljava/lang/Object;)Z
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 168
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->canShow(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)Z
move-result v2
if-eqz v2, :cond_4
.line 169
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->show(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)V
goto :goto_0
.line 171
:cond_4
new-instance v0, Lcom/viatech/util/SocialShareUtil$1;
invoke-direct {v0, p0}, Lcom/viatech/util/SocialShareUtil$1;-><init>(Lcom/viatech/util/SocialShareUtil;)V
invoke-virtual {p1, v0}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V
goto/16 :goto_0
.end method
.method public sharePhoto2Facebook(Landroid/app/Activity;Ljava/util/List;)V
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
const/4 v7, 0x1
const/4 v6, 0x0
.line 109
invoke-static {p2}, Lcom/viatech/util/SocialShareUtil;->getMediaListType(Ljava/util/List;)I
.line 110
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.line 111
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v2
:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_1
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/viatech/gallery/FileInfo;
.line 112
const-string v3, "VPAI_SocialShareUtil"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "sharePhoto2Facebook "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v5, v0, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, ", url "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v5, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 115
iget-object v3, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
if-eqz v3, :cond_0
.line 116
iget-object v0, v0, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v0
.line 122
:goto_1
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 118
:cond_0
new-instance v3, Ljava/io/File;
invoke-virtual {v0}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v0
invoke-direct {v3, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 119
invoke-static {v3}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v0
goto :goto_1
.line 125
:cond_1
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
.line 126
const-class v0, Lcom/viatech/gallery/SendPhotoActivity;
invoke-virtual {v2, p1, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
.line 127
invoke-static {v7}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 128
const-string v0, "share_facebook_key"
invoke-virtual {v2, v0, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 129
const-string v0, "android.intent.action.SEND"
invoke-virtual {v2, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 130
const-string v3, "android.intent.extra.STREAM"
invoke-virtual {v1, v6}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Parcelable;
invoke-virtual {v2, v3, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 131
const-string v1, "FileInfo"
invoke-interface {p2, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/Serializable;
invoke-virtual {v2, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
.line 133
:try_start_0
invoke-virtual {p1, v2}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 138
:goto_2
return-void
.line 134
:catch_0
move-exception v0
.line 135
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_2
.end method
.method public sharePhoto2Others(Landroid/app/Activity;Landroid/net/Uri;)V
.locals 6
.prologue
const/4 v5, 0x1
.line 519
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 520
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x18
if-lt v1, v2, :cond_0
.line 521
new-instance v1, Ljava/io/File;
new-instance v2, Ljava/net/URI;
invoke-virtual {p2}, Landroid/net/Uri;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {v2, v3}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/net/URI;)V
.line 522
const-string v2, "VPAI_SocialShareUtil"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "F = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 523
const-string v2, "com.via.vpai.provider"
invoke-static {p1, v2, v1}, Landroid/support/v4/content/FileProvider;->getUriForFile(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;)Landroid/net/Uri;
move-result-object v1
.line 524
const-string v2, "application/vnd.android.package-archive"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setDataAndType(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;
.line 525
const-string v2, "android.intent.action.SEND"
invoke-virtual {v0, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 526
invoke-static {v5}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 527
invoke-virtual {v0, v5}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 528
const-string v2, "android.intent.extra.STREAM"
invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 535
:goto_0
const v1, 0x7f07017f
:try_start_0
invoke-virtual {p1, v1}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 539
:goto_1
return-void
.line 530
:cond_0
const-string v1, "android.intent.action.SEND"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 531
invoke-static {v5}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 532
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v0, v1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
goto :goto_0
.line 536
:catch_0
move-exception v0
.line 537
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_1
.end method
.method public shareVideo2Facebook(Landroid/app/Activity;Landroid/net/Uri;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Landroid/net/Uri;",
"Lcom/facebook/CallbackManager;",
"Lcom/facebook/FacebookCallback",
"<",
"Lcom/facebook/share/Sharer$Result;",
">;",
"Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;",
")V"
}
.end annotation
.prologue
.line 202
invoke-static {p1}, Lcom/viatech/util/SocialShareUtil;->isFacebookInstalled(Landroid/app/Activity;)Z
move-result v0
if-nez v0, :cond_0
.line 203
const v0, 0x7f07012a
invoke-static {v0}, Lcom/viatech/VPaiApplication;->b(I)V
.line 238
:goto_0
return-void
.line 207
:cond_0
new-instance v0, Lcom/facebook/share/model/ShareVideo$Builder;
invoke-direct {v0}, Lcom/facebook/share/model/ShareVideo$Builder;-><init>()V
invoke-virtual {v0, p2}, Lcom/facebook/share/model/ShareVideo$Builder;->setLocalUrl(Landroid/net/Uri;)Lcom/facebook/share/model/ShareVideo$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/facebook/share/model/ShareVideo$Builder;->build()Lcom/facebook/share/model/ShareVideo;
move-result-object v0
.line 208
new-instance v1, Lcom/facebook/share/model/ShareVideoContent$Builder;
invoke-direct {v1}, Lcom/facebook/share/model/ShareVideoContent$Builder;-><init>()V
invoke-virtual {v1, v0}, Lcom/facebook/share/model/ShareVideoContent$Builder;->setVideo(Lcom/facebook/share/model/ShareVideo;)Lcom/facebook/share/model/ShareVideoContent$Builder;
move-result-object v0
invoke-virtual {v0}, Lcom/facebook/share/model/ShareVideoContent$Builder;->build()Lcom/facebook/share/model/ShareVideoContent;
move-result-object v0
.line 210
new-instance v1, Lcom/facebook/share/widget/ShareDialog;
invoke-direct {v1, p1}, Lcom/facebook/share/widget/ShareDialog;-><init>(Landroid/app/Activity;)V
.line 211
invoke-virtual {v1, p3, p4}, Lcom/facebook/share/widget/ShareDialog;->registerCallback(Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;)V
.line 212
const-string v2, "VPAI_SocialShareUtil"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "shareDialog.canShow(content)="
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v1, v0}, Lcom/facebook/share/widget/ShareDialog;->canShow(Ljava/lang/Object;)Z
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 215
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->canShow(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)Z
move-result v2
if-eqz v2, :cond_1
.line 216
sget-object v2, Lcom/facebook/share/widget/ShareDialog$Mode;->NATIVE:Lcom/facebook/share/widget/ShareDialog$Mode;
invoke-virtual {v1, v0, v2}, Lcom/facebook/share/widget/ShareDialog;->show(Lcom/facebook/share/model/ShareContent;Lcom/facebook/share/widget/ShareDialog$Mode;)V
goto :goto_0
.line 218
:cond_1
new-instance v0, Lcom/viatech/util/SocialShareUtil$2;
invoke-direct {v0, p0}, Lcom/viatech/util/SocialShareUtil$2;-><init>(Lcom/viatech/util/SocialShareUtil;)V
invoke-virtual {p1, v0}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V
goto :goto_0
.end method
.method public shareVideo2Facebook(Landroid/app/Activity;Ljava/lang/String;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/app/Activity;",
"Ljava/lang/String;",
"Lcom/facebook/CallbackManager;",
"Lcom/facebook/FacebookCallback",
"<",
"Lcom/facebook/share/Sharer$Result;",
">;",
"Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;",
")V"
}
.end annotation
.prologue
.line 195
new-instance v0, Ljava/io/File;
invoke-direct {v0, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 196
invoke-static {v0}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;
move-result-object v2
move-object v0, p0
move-object v1, p1
move-object v3, p3
move-object v4, p4
move-object v5, p5
invoke-virtual/range {v0 .. v5}, Lcom/viatech/util/SocialShareUtil;->shareVideo2Facebook(Landroid/app/Activity;Landroid/net/Uri;Lcom/facebook/CallbackManager;Lcom/facebook/FacebookCallback;Lcom/viatech/util/SocialShareUtil$MyFacebookShareCallback;)V
.line 197
return-void
.end method
.method public shareVideo2Others(Landroid/app/Activity;Landroid/net/Uri;)V
.locals 6
.prologue
const/4 v5, 0x2
.line 542
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 543
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x18
if-lt v1, v2, :cond_0
.line 544
new-instance v1, Ljava/io/File;
new-instance v2, Ljava/net/URI;
invoke-virtual {p2}, Landroid/net/Uri;->toString()Ljava/lang/String;
move-result-object v3
invoke-direct {v2, v3}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/net/URI;)V
.line 545
const-string v2, "VPAI_SocialShareUtil"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "F = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 546
const-string v2, "com.via.vpai.provider"
invoke-static {p1, v2, v1}, Landroid/support/v4/content/FileProvider;->getUriForFile(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;)Landroid/net/Uri;
move-result-object v1
.line 547
const-string v2, "application/vnd.android.package-archive"
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setDataAndType(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;
.line 548
const-string v2, "android.intent.action.SEND"
invoke-virtual {v0, v2}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 549
invoke-static {v5}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 550
const/4 v2, 0x1
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 551
const-string v2, "android.intent.extra.STREAM"
invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
.line 558
:goto_0
const v1, 0x7f07017f
:try_start_0
invoke-virtual {p1, v1}, Landroid/app/Activity;->getString(I)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 562
:goto_1
return-void
.line 553
:cond_0
const-string v1, "android.intent.action.SEND"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
.line 554
invoke-static {v5}, Lcom/viatech/common/util/FileMediaType;->getOpenMIMEType(I)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;
.line 555
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v0, v1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
goto :goto_0
.line 559
:catch_0
move-exception v0
.line 560
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_1
.end method