Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.facebook.share.widget;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeView$AuxiliaryViewPosition {
|
||||
BOTTOM("bottom", 0),
|
||||
INLINE("inline", 1),
|
||||
TOP("top", 2);
|
||||
|
||||
static LikeView$AuxiliaryViewPosition DEFAULT = BOTTOM;
|
||||
private int intValue;
|
||||
private String stringValue;
|
||||
|
||||
LikeView$AuxiliaryViewPosition(String str, int i) {
|
||||
this.stringValue = str;
|
||||
this.intValue = i;
|
||||
}
|
||||
|
||||
static LikeView$AuxiliaryViewPosition fromInt(int i) {
|
||||
for (LikeView$AuxiliaryViewPosition likeView$AuxiliaryViewPosition : values()) {
|
||||
if (likeView$AuxiliaryViewPosition.getValue() == i) {
|
||||
return likeView$AuxiliaryViewPosition;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public int getValue() {
|
||||
return this.intValue;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return this.stringValue;
|
||||
}
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
package com.facebook.share.widget;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeView$HorizontalAlignment {
|
||||
CENTER("center", 0),
|
||||
LEFT("left", 1),
|
||||
RIGHT("right", 2);
|
||||
|
||||
static LikeView$HorizontalAlignment DEFAULT = CENTER;
|
||||
private int intValue;
|
||||
private String stringValue;
|
||||
|
||||
LikeView$HorizontalAlignment(String str, int i) {
|
||||
this.stringValue = str;
|
||||
this.intValue = i;
|
||||
}
|
||||
|
||||
static LikeView$HorizontalAlignment fromInt(int i) {
|
||||
for (LikeView$HorizontalAlignment likeView$HorizontalAlignment : values()) {
|
||||
if (likeView$HorizontalAlignment.getValue() == i) {
|
||||
return likeView$HorizontalAlignment;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public int getValue() {
|
||||
return this.intValue;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return this.stringValue;
|
||||
}
|
||||
}
|
37
sources/com/facebook/share/widget/LikeView$ObjectType.java
Normal file
37
sources/com/facebook/share/widget/LikeView$ObjectType.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.facebook.share.widget;
|
||||
|
||||
import com.ubt.jimu.diy.model.CategoryModel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeView$ObjectType {
|
||||
UNKNOWN(CategoryModel.unknown, 0),
|
||||
OPEN_GRAPH("open_graph", 1),
|
||||
PAGE("page", 2);
|
||||
|
||||
private int intValue;
|
||||
private String stringValue;
|
||||
public static LikeView$ObjectType DEFAULT = UNKNOWN;
|
||||
|
||||
LikeView$ObjectType(String str, int i) {
|
||||
this.stringValue = str;
|
||||
this.intValue = i;
|
||||
}
|
||||
|
||||
public static LikeView$ObjectType fromInt(int i) {
|
||||
for (LikeView$ObjectType likeView$ObjectType : values()) {
|
||||
if (likeView$ObjectType.getValue() == i) {
|
||||
return likeView$ObjectType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return this.intValue;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return this.stringValue;
|
||||
}
|
||||
}
|
36
sources/com/facebook/share/widget/LikeView$Style.java
Normal file
36
sources/com/facebook/share/widget/LikeView$Style.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.facebook.share.widget;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeView$Style {
|
||||
STANDARD("standard", 0),
|
||||
BUTTON("button", 1),
|
||||
BOX_COUNT("box_count", 2);
|
||||
|
||||
private int intValue;
|
||||
private String stringValue;
|
||||
static LikeView$Style DEFAULT = STANDARD;
|
||||
|
||||
LikeView$Style(String str, int i) {
|
||||
this.stringValue = str;
|
||||
this.intValue = i;
|
||||
}
|
||||
|
||||
static LikeView$Style fromInt(int i) {
|
||||
for (LikeView$Style likeView$Style : values()) {
|
||||
if (likeView$Style.getValue() == i) {
|
||||
return likeView$Style;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public int getValue() {
|
||||
return this.intValue;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return this.stringValue;
|
||||
}
|
||||
}
|
318
sources/com/facebook/share/widget/ShareDialog.java
Normal file
318
sources/com/facebook/share/widget/ShareDialog.java
Normal file
@@ -0,0 +1,318 @@
|
||||
package com.facebook.share.widget;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.facebook.internal.AppCall;
|
||||
import com.facebook.internal.CallbackManagerImpl;
|
||||
import com.facebook.internal.DialogFeature;
|
||||
import com.facebook.internal.DialogPresenter;
|
||||
import com.facebook.internal.FacebookDialogBase;
|
||||
import com.facebook.internal.NativeAppCallAttachmentStore;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.internal.LegacyNativeDialogParameters;
|
||||
import com.facebook.share.internal.NativeDialogParameters;
|
||||
import com.facebook.share.internal.OpenGraphActionDialogFeature;
|
||||
import com.facebook.share.internal.ShareContentValidation;
|
||||
import com.facebook.share.internal.ShareDialogFeature;
|
||||
import com.facebook.share.internal.ShareFeedContent;
|
||||
import com.facebook.share.internal.ShareInternalUtility;
|
||||
import com.facebook.share.internal.WebDialogParameters;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareMediaContent;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.facebook.share.model.ShareVideoContent;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import com.ubt.jimu.diy.model.CategoryModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareDialog extends FacebookDialogBase<ShareContent, Sharer.Result> implements Sharer {
|
||||
private static final int h = CallbackManagerImpl.RequestCodeOffset.Share.toRequestCode();
|
||||
private boolean f;
|
||||
private boolean g;
|
||||
|
||||
/* renamed from: com.facebook.share.widget.ShareDialog$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[Mode.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[Mode.AUTOMATIC.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[Mode.WEB.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
a[Mode.NATIVE.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class FeedHandler extends FacebookDialogBase<ShareContent, Sharer.Result>.ModeHandler {
|
||||
private FeedHandler() {
|
||||
super(ShareDialog.this);
|
||||
}
|
||||
|
||||
/* synthetic */ FeedHandler(ShareDialog shareDialog, AnonymousClass1 anonymousClass1) {
|
||||
this();
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public Object a() {
|
||||
return Mode.FEED;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public boolean a(ShareContent shareContent, boolean z) {
|
||||
return (shareContent instanceof ShareLinkContent) || (shareContent instanceof ShareFeedContent);
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public AppCall a(ShareContent shareContent) {
|
||||
Bundle a;
|
||||
ShareDialog shareDialog = ShareDialog.this;
|
||||
shareDialog.a(shareDialog.b(), shareContent, Mode.FEED);
|
||||
AppCall a2 = ShareDialog.this.a();
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
ShareLinkContent shareLinkContent = (ShareLinkContent) shareContent;
|
||||
ShareContentValidation.b(shareLinkContent);
|
||||
a = WebDialogParameters.b(shareLinkContent);
|
||||
} else {
|
||||
a = WebDialogParameters.a((ShareFeedContent) shareContent);
|
||||
}
|
||||
DialogPresenter.a(a2, "feed", a);
|
||||
return a2;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Mode {
|
||||
AUTOMATIC,
|
||||
NATIVE,
|
||||
WEB,
|
||||
FEED
|
||||
}
|
||||
|
||||
private class NativeHandler extends FacebookDialogBase<ShareContent, Sharer.Result>.ModeHandler {
|
||||
private NativeHandler() {
|
||||
super(ShareDialog.this);
|
||||
}
|
||||
|
||||
/* synthetic */ NativeHandler(ShareDialog shareDialog, AnonymousClass1 anonymousClass1) {
|
||||
this();
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public Object a() {
|
||||
return Mode.NATIVE;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public boolean a(ShareContent shareContent, boolean z) {
|
||||
boolean z2;
|
||||
if (shareContent == null) {
|
||||
return false;
|
||||
}
|
||||
if (z) {
|
||||
z2 = true;
|
||||
} else {
|
||||
z2 = shareContent.getShareHashtag() != null ? DialogPresenter.a(ShareDialogFeature.HASHTAG) : true;
|
||||
if ((shareContent instanceof ShareLinkContent) && !Utility.c(((ShareLinkContent) shareContent).getQuote())) {
|
||||
z2 &= DialogPresenter.a(ShareDialogFeature.LINK_SHARE_QUOTES);
|
||||
}
|
||||
}
|
||||
return z2 && ShareDialog.d(shareContent.getClass());
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public AppCall a(final ShareContent shareContent) {
|
||||
ShareDialog shareDialog = ShareDialog.this;
|
||||
shareDialog.a(shareDialog.b(), shareContent, Mode.NATIVE);
|
||||
ShareContentValidation.a(shareContent);
|
||||
final AppCall a = ShareDialog.this.a();
|
||||
final boolean e = ShareDialog.this.e();
|
||||
DialogPresenter.a(a, new DialogPresenter.ParameterProvider(this) { // from class: com.facebook.share.widget.ShareDialog.NativeHandler.1
|
||||
@Override // com.facebook.internal.DialogPresenter.ParameterProvider
|
||||
public Bundle a() {
|
||||
return NativeDialogParameters.a(a.a(), shareContent, e);
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogPresenter.ParameterProvider
|
||||
public Bundle b() {
|
||||
return LegacyNativeDialogParameters.a(a.a(), shareContent, e);
|
||||
}
|
||||
}, ShareDialog.f(shareContent.getClass()));
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
private class WebShareHandler extends FacebookDialogBase<ShareContent, Sharer.Result>.ModeHandler {
|
||||
private WebShareHandler() {
|
||||
super(ShareDialog.this);
|
||||
}
|
||||
|
||||
private String b(ShareContent shareContent) {
|
||||
if ((shareContent instanceof ShareLinkContent) || (shareContent instanceof SharePhotoContent)) {
|
||||
return "share";
|
||||
}
|
||||
if (shareContent instanceof ShareOpenGraphContent) {
|
||||
return "share_open_graph";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* synthetic */ WebShareHandler(ShareDialog shareDialog, AnonymousClass1 anonymousClass1) {
|
||||
this();
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public Object a() {
|
||||
return Mode.WEB;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public boolean a(ShareContent shareContent, boolean z) {
|
||||
return shareContent != null && ShareDialog.e(shareContent.getClass());
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase.ModeHandler
|
||||
public AppCall a(ShareContent shareContent) {
|
||||
Bundle a;
|
||||
ShareDialog shareDialog = ShareDialog.this;
|
||||
shareDialog.a(shareDialog.b(), shareContent, Mode.WEB);
|
||||
AppCall a2 = ShareDialog.this.a();
|
||||
ShareContentValidation.b(shareContent);
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
a = WebDialogParameters.a((ShareLinkContent) shareContent);
|
||||
} else if (shareContent instanceof SharePhotoContent) {
|
||||
a = WebDialogParameters.a(a((SharePhotoContent) shareContent, a2.a()));
|
||||
} else {
|
||||
a = WebDialogParameters.a((ShareOpenGraphContent) shareContent);
|
||||
}
|
||||
DialogPresenter.a(a2, b(shareContent), a);
|
||||
return a2;
|
||||
}
|
||||
|
||||
private SharePhotoContent a(SharePhotoContent sharePhotoContent, UUID uuid) {
|
||||
SharePhotoContent.Builder a = new SharePhotoContent.Builder().a(sharePhotoContent);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
for (int i = 0; i < sharePhotoContent.getPhotos().size(); i++) {
|
||||
SharePhoto sharePhoto = sharePhotoContent.getPhotos().get(i);
|
||||
Bitmap bitmap = sharePhoto.getBitmap();
|
||||
if (bitmap != null) {
|
||||
NativeAppCallAttachmentStore.Attachment a2 = NativeAppCallAttachmentStore.a(uuid, bitmap);
|
||||
SharePhoto.Builder a3 = new SharePhoto.Builder().a(sharePhoto);
|
||||
a3.a(Uri.parse(a2.a()));
|
||||
a3.a((Bitmap) null);
|
||||
sharePhoto = a3.a();
|
||||
arrayList2.add(a2);
|
||||
}
|
||||
arrayList.add(sharePhoto);
|
||||
}
|
||||
a.c(arrayList);
|
||||
NativeAppCallAttachmentStore.a(arrayList2);
|
||||
return a.a();
|
||||
}
|
||||
}
|
||||
|
||||
public ShareDialog(Activity activity) {
|
||||
super(activity, h);
|
||||
this.f = false;
|
||||
this.g = true;
|
||||
ShareInternalUtility.a(h);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static boolean d(Class<? extends ShareContent> cls) {
|
||||
DialogFeature f = f(cls);
|
||||
return f != null && DialogPresenter.a(f);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static boolean e(Class<? extends ShareContent> cls) {
|
||||
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
|
||||
boolean z = (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true;
|
||||
if (ShareLinkContent.class.isAssignableFrom(cls) || ShareOpenGraphContent.class.isAssignableFrom(cls)) {
|
||||
return true;
|
||||
}
|
||||
return SharePhotoContent.class.isAssignableFrom(cls) && z;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static DialogFeature f(Class<? extends ShareContent> cls) {
|
||||
if (ShareLinkContent.class.isAssignableFrom(cls)) {
|
||||
return ShareDialogFeature.SHARE_DIALOG;
|
||||
}
|
||||
if (SharePhotoContent.class.isAssignableFrom(cls)) {
|
||||
return ShareDialogFeature.PHOTOS;
|
||||
}
|
||||
if (ShareVideoContent.class.isAssignableFrom(cls)) {
|
||||
return ShareDialogFeature.VIDEO;
|
||||
}
|
||||
if (ShareOpenGraphContent.class.isAssignableFrom(cls)) {
|
||||
return OpenGraphActionDialogFeature.OG_ACTION_DIALOG;
|
||||
}
|
||||
if (ShareMediaContent.class.isAssignableFrom(cls)) {
|
||||
return ShareDialogFeature.MULTIMEDIA;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase
|
||||
protected List<FacebookDialogBase<ShareContent, Sharer.Result>.ModeHandler> c() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
AnonymousClass1 anonymousClass1 = null;
|
||||
arrayList.add(new NativeHandler(this, anonymousClass1));
|
||||
arrayList.add(new FeedHandler(this, anonymousClass1));
|
||||
arrayList.add(new WebShareHandler(this, anonymousClass1));
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.FacebookDialogBase
|
||||
protected AppCall a() {
|
||||
return new AppCall(d());
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(Context context, ShareContent shareContent, Mode mode) {
|
||||
if (this.g) {
|
||||
mode = Mode.AUTOMATIC;
|
||||
}
|
||||
int i = AnonymousClass1.a[mode.ordinal()];
|
||||
String str = CategoryModel.unknown;
|
||||
String str2 = i != 1 ? i != 2 ? i != 3 ? CategoryModel.unknown : "native" : "web" : "automatic";
|
||||
DialogFeature f = f(shareContent.getClass());
|
||||
if (f == ShareDialogFeature.SHARE_DIALOG) {
|
||||
str = FileDownloadModel.STATUS;
|
||||
} else if (f == ShareDialogFeature.PHOTOS) {
|
||||
str = "photo";
|
||||
} else if (f == ShareDialogFeature.VIDEO) {
|
||||
str = "video";
|
||||
} else if (f == OpenGraphActionDialogFeature.OG_ACTION_DIALOG) {
|
||||
str = "open_graph";
|
||||
}
|
||||
AppEventsLogger b = AppEventsLogger.b(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("fb_share_dialog_show", str2);
|
||||
bundle.putString("fb_share_dialog_content_type", str);
|
||||
b.a("fb_share_dialog_show", (Double) null, bundle);
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return this.f;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user