Initial commit
This commit is contained in:
7
sources/com/facebook/share/ShareBuilder.java
Normal file
7
sources/com/facebook/share/ShareBuilder.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.facebook.share;
|
||||
|
||||
import com.facebook.share.ShareBuilder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ShareBuilder<P, E extends ShareBuilder> {
|
||||
}
|
10
sources/com/facebook/share/Sharer.java
Normal file
10
sources/com/facebook/share/Sharer.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.facebook.share;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Sharer {
|
||||
|
||||
public static class Result {
|
||||
public Result(String str) {
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum AppInviteDialogFeature implements DialogFeature {
|
||||
APP_INVITES_DIALOG(20140701);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
AppInviteDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.APPINVITES_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
@@ -0,0 +1,243 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.FacebookRequestError;
|
||||
import com.facebook.GraphRequest;
|
||||
import com.facebook.GraphResponse;
|
||||
import com.facebook.HttpMethod;
|
||||
import com.facebook.R$id;
|
||||
import com.facebook.R$layout;
|
||||
import com.facebook.R$string;
|
||||
import com.facebook.R$style;
|
||||
import com.facebook.devicerequests.internal.DeviceRequestsHelper;
|
||||
import com.facebook.internal.Validate;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DeviceShareDialogFragment extends DialogFragment {
|
||||
private static ScheduledThreadPoolExecutor p;
|
||||
private ProgressBar j;
|
||||
private TextView k;
|
||||
private Dialog l;
|
||||
private volatile RequestState m;
|
||||
private volatile ScheduledFuture n;
|
||||
private ShareContent o;
|
||||
|
||||
private static class RequestState implements Parcelable {
|
||||
public static final Parcelable.Creator<RequestState> CREATOR = new Parcelable.Creator<RequestState>() { // from class: com.facebook.share.internal.DeviceShareDialogFragment.RequestState.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RequestState createFromParcel(Parcel parcel) {
|
||||
return new RequestState(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RequestState[] newArray(int i) {
|
||||
return new RequestState[i];
|
||||
}
|
||||
};
|
||||
private long expiresIn;
|
||||
private String userCode;
|
||||
|
||||
RequestState() {
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getExpiresIn() {
|
||||
return this.expiresIn;
|
||||
}
|
||||
|
||||
public String getUserCode() {
|
||||
return this.userCode;
|
||||
}
|
||||
|
||||
public void setExpiresIn(long j) {
|
||||
this.expiresIn = j;
|
||||
}
|
||||
|
||||
public void setUserCode(String str) {
|
||||
this.userCode = str;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.userCode);
|
||||
parcel.writeLong(this.expiresIn);
|
||||
}
|
||||
|
||||
protected RequestState(Parcel parcel) {
|
||||
this.userCode = parcel.readString();
|
||||
this.expiresIn = parcel.readLong();
|
||||
}
|
||||
}
|
||||
|
||||
private void o() {
|
||||
if (isAdded()) {
|
||||
FragmentTransaction a = getFragmentManager().a();
|
||||
a.d(this);
|
||||
a.a();
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized ScheduledThreadPoolExecutor q() {
|
||||
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
|
||||
synchronized (DeviceShareDialogFragment.class) {
|
||||
if (p == null) {
|
||||
p = new ScheduledThreadPoolExecutor(1);
|
||||
}
|
||||
scheduledThreadPoolExecutor = p;
|
||||
}
|
||||
return scheduledThreadPoolExecutor;
|
||||
}
|
||||
|
||||
private Bundle v() {
|
||||
ShareContent shareContent = this.o;
|
||||
if (shareContent == null) {
|
||||
return null;
|
||||
}
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
return WebDialogParameters.a((ShareLinkContent) shareContent);
|
||||
}
|
||||
if (shareContent instanceof ShareOpenGraphContent) {
|
||||
return WebDialogParameters.a((ShareOpenGraphContent) shareContent);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void x() {
|
||||
Bundle v = v();
|
||||
if (v == null || v.size() == 0) {
|
||||
a(new FacebookRequestError(0, "", "Failed to get share content"));
|
||||
}
|
||||
v.putString(AccessToken.ACCESS_TOKEN_KEY, Validate.a() + "|" + Validate.b());
|
||||
v.putString("device_info", DeviceRequestsHelper.a());
|
||||
new GraphRequest(null, "device/share", v, HttpMethod.POST, new GraphRequest.Callback() { // from class: com.facebook.share.internal.DeviceShareDialogFragment.2
|
||||
@Override // com.facebook.GraphRequest.Callback
|
||||
public void a(GraphResponse graphResponse) {
|
||||
FacebookRequestError a = graphResponse.a();
|
||||
if (a != null) {
|
||||
DeviceShareDialogFragment.this.a(a);
|
||||
return;
|
||||
}
|
||||
JSONObject b = graphResponse.b();
|
||||
RequestState requestState = new RequestState();
|
||||
try {
|
||||
requestState.setUserCode(b.getString("user_code"));
|
||||
requestState.setExpiresIn(b.getLong(AccessToken.EXPIRES_IN_KEY));
|
||||
DeviceShareDialogFragment.this.a(requestState);
|
||||
} catch (JSONException unused) {
|
||||
DeviceShareDialogFragment.this.a(new FacebookRequestError(0, "", "Malformed server response"));
|
||||
}
|
||||
}
|
||||
}).b();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
RequestState requestState;
|
||||
View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle);
|
||||
if (bundle != null && (requestState = (RequestState) bundle.getParcelable("request_state")) != null) {
|
||||
a(requestState);
|
||||
}
|
||||
return onCreateView;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnDismissListener
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
super.onDismiss(dialogInterface);
|
||||
if (this.n != null) {
|
||||
this.n.cancel(true);
|
||||
}
|
||||
a(-1, new Intent());
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
|
||||
public void onSaveInstanceState(Bundle bundle) {
|
||||
super.onSaveInstanceState(bundle);
|
||||
if (this.m != null) {
|
||||
bundle.putParcelable("request_state", this.m);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.DialogFragment
|
||||
public Dialog a(Bundle bundle) {
|
||||
this.l = new Dialog(getActivity(), R$style.com_facebook_auth_dialog);
|
||||
View inflate = getActivity().getLayoutInflater().inflate(R$layout.com_facebook_device_auth_dialog_fragment, (ViewGroup) null);
|
||||
this.j = (ProgressBar) inflate.findViewById(R$id.progress_bar);
|
||||
this.k = (TextView) inflate.findViewById(R$id.confirmation_code);
|
||||
((Button) inflate.findViewById(R$id.cancel_button)).setOnClickListener(new View.OnClickListener() { // from class: com.facebook.share.internal.DeviceShareDialogFragment.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
DeviceShareDialogFragment.this.l.dismiss();
|
||||
}
|
||||
});
|
||||
((TextView) inflate.findViewById(R$id.com_facebook_device_auth_instructions)).setText(Html.fromHtml(getString(R$string.com_facebook_device_auth_instructions)));
|
||||
this.l.setContentView(inflate);
|
||||
x();
|
||||
return this.l;
|
||||
}
|
||||
|
||||
private void a(int i, Intent intent) {
|
||||
DeviceRequestsHelper.a(this.m.getUserCode());
|
||||
if (isAdded()) {
|
||||
FragmentActivity activity = getActivity();
|
||||
activity.setResult(i, intent);
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(ShareContent shareContent) {
|
||||
this.o = shareContent;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(FacebookRequestError facebookRequestError) {
|
||||
o();
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR, facebookRequestError);
|
||||
a(-1, intent);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(RequestState requestState) {
|
||||
this.m = requestState;
|
||||
this.k.setText(requestState.getUserCode());
|
||||
this.k.setVisibility(0);
|
||||
this.j.setVisibility(8);
|
||||
this.n = q().schedule(new Runnable() { // from class: com.facebook.share.internal.DeviceShareDialogFragment.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
DeviceShareDialogFragment.this.l.dismiss();
|
||||
}
|
||||
}, requestState.getExpiresIn(), TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.internal.Validate;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.facebook.share.model.ShareVideoContent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LegacyNativeDialogParameters {
|
||||
private static Bundle a(ShareVideoContent shareVideoContent, boolean z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Bundle a(UUID uuid, ShareContent shareContent, boolean z) {
|
||||
Validate.a(shareContent, "shareContent");
|
||||
Validate.a(uuid, "callId");
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
return a((ShareLinkContent) shareContent, z);
|
||||
}
|
||||
if (shareContent instanceof SharePhotoContent) {
|
||||
SharePhotoContent sharePhotoContent = (SharePhotoContent) shareContent;
|
||||
return a(sharePhotoContent, ShareInternalUtility.a(sharePhotoContent, uuid), z);
|
||||
}
|
||||
if (shareContent instanceof ShareVideoContent) {
|
||||
return a((ShareVideoContent) shareContent, z);
|
||||
}
|
||||
if (!(shareContent instanceof ShareOpenGraphContent)) {
|
||||
return null;
|
||||
}
|
||||
ShareOpenGraphContent shareOpenGraphContent = (ShareOpenGraphContent) shareContent;
|
||||
try {
|
||||
return a(shareOpenGraphContent, ShareInternalUtility.a(uuid, shareOpenGraphContent), z);
|
||||
} catch (JSONException e) {
|
||||
throw new FacebookException("Unable to create a JSON Object from the provided ShareOpenGraphContent: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static Bundle a(ShareLinkContent shareLinkContent, boolean z) {
|
||||
Bundle a = a((ShareContent) shareLinkContent, z);
|
||||
Utility.a(a, "com.facebook.platform.extra.TITLE", shareLinkContent.getContentTitle());
|
||||
Utility.a(a, "com.facebook.platform.extra.DESCRIPTION", shareLinkContent.getContentDescription());
|
||||
Utility.a(a, "com.facebook.platform.extra.IMAGE", shareLinkContent.getImageUrl());
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(SharePhotoContent sharePhotoContent, List<String> list, boolean z) {
|
||||
Bundle a = a(sharePhotoContent, z);
|
||||
a.putStringArrayList("com.facebook.platform.extra.PHOTOS", new ArrayList<>(list));
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareOpenGraphContent shareOpenGraphContent, JSONObject jSONObject, boolean z) {
|
||||
Bundle a = a(shareOpenGraphContent, z);
|
||||
Utility.a(a, "com.facebook.platform.extra.PREVIEW_PROPERTY_NAME", shareOpenGraphContent.getPreviewPropertyName());
|
||||
Utility.a(a, "com.facebook.platform.extra.ACTION_TYPE", shareOpenGraphContent.getAction().getActionType());
|
||||
Utility.a(a, "com.facebook.platform.extra.ACTION", jSONObject.toString());
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareContent shareContent, boolean z) {
|
||||
Bundle bundle = new Bundle();
|
||||
Utility.a(bundle, "com.facebook.platform.extra.LINK", shareContent.getContentUrl());
|
||||
Utility.a(bundle, "com.facebook.platform.extra.PLACE", shareContent.getPlaceId());
|
||||
Utility.a(bundle, "com.facebook.platform.extra.REF", shareContent.getRef());
|
||||
bundle.putBoolean("com.facebook.platform.extra.DATA_FAILURES_FATAL", z);
|
||||
List<String> peopleIds = shareContent.getPeopleIds();
|
||||
if (!Utility.a(peopleIds)) {
|
||||
bundle.putStringArrayList("com.facebook.platform.extra.FRIENDS", new ArrayList<>(peopleIds));
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeBoxCountView$LikeBoxCountViewCaretPosition {
|
||||
LEFT,
|
||||
TOP,
|
||||
RIGHT,
|
||||
BOTTOM
|
||||
}
|
59
sources/com/facebook/share/internal/LikeContent.java
Normal file
59
sources/com/facebook/share/internal/LikeContent.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareModel;
|
||||
import com.facebook.share.model.ShareModelBuilder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LikeContent implements ShareModel {
|
||||
public static final Parcelable.Creator<LikeContent> CREATOR = new Parcelable.Creator<LikeContent>() { // from class: com.facebook.share.internal.LikeContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public LikeContent createFromParcel(Parcel parcel) {
|
||||
return new LikeContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public LikeContent[] newArray(int i) {
|
||||
return new LikeContent[i];
|
||||
}
|
||||
};
|
||||
private final String objectId;
|
||||
private final String objectType;
|
||||
|
||||
public static class Builder implements ShareModelBuilder<LikeContent, Builder> {
|
||||
private String a;
|
||||
private String b;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public String getObjectType() {
|
||||
return this.objectType;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.objectId);
|
||||
parcel.writeString(this.objectType);
|
||||
}
|
||||
|
||||
private LikeContent(Builder builder) {
|
||||
this.objectId = builder.a;
|
||||
this.objectType = builder.b;
|
||||
}
|
||||
|
||||
LikeContent(Parcel parcel) {
|
||||
this.objectId = parcel.readString();
|
||||
this.objectType = parcel.readString();
|
||||
}
|
||||
}
|
24
sources/com/facebook/share/internal/LikeDialogFeature.java
Normal file
24
sources/com/facebook/share/internal/LikeDialogFeature.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum LikeDialogFeature implements DialogFeature {
|
||||
LIKE_DIALOG(20140701);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
LikeDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.LIKE_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum MessageDialogFeature implements DialogFeature {
|
||||
MESSAGE_DIALOG(20140204),
|
||||
PHOTOS(20140324),
|
||||
VIDEO(20141218);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
MessageDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.MESSAGE_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
104
sources/com/facebook/share/internal/NativeDialogParameters.java
Normal file
104
sources/com/facebook/share/internal/NativeDialogParameters.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.internal.Validate;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareHashtag;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareMediaContent;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.facebook.share.model.ShareVideoContent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NativeDialogParameters {
|
||||
public static Bundle a(UUID uuid, ShareContent shareContent, boolean z) {
|
||||
Validate.a(shareContent, "shareContent");
|
||||
Validate.a(uuid, "callId");
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
return a((ShareLinkContent) shareContent, z);
|
||||
}
|
||||
if (shareContent instanceof SharePhotoContent) {
|
||||
SharePhotoContent sharePhotoContent = (SharePhotoContent) shareContent;
|
||||
return a(sharePhotoContent, ShareInternalUtility.a(sharePhotoContent, uuid), z);
|
||||
}
|
||||
if (shareContent instanceof ShareVideoContent) {
|
||||
ShareVideoContent shareVideoContent = (ShareVideoContent) shareContent;
|
||||
return a(shareVideoContent, ShareInternalUtility.a(shareVideoContent, uuid), z);
|
||||
}
|
||||
if (!(shareContent instanceof ShareOpenGraphContent)) {
|
||||
if (!(shareContent instanceof ShareMediaContent)) {
|
||||
return null;
|
||||
}
|
||||
ShareMediaContent shareMediaContent = (ShareMediaContent) shareContent;
|
||||
return a(shareMediaContent, ShareInternalUtility.a(shareMediaContent, uuid), z);
|
||||
}
|
||||
ShareOpenGraphContent shareOpenGraphContent = (ShareOpenGraphContent) shareContent;
|
||||
try {
|
||||
return a(shareOpenGraphContent, ShareInternalUtility.a(ShareInternalUtility.a(uuid, shareOpenGraphContent), false), z);
|
||||
} catch (JSONException e) {
|
||||
throw new FacebookException("Unable to create a JSON Object from the provided ShareOpenGraphContent: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static Bundle a(ShareLinkContent shareLinkContent, boolean z) {
|
||||
Bundle a = a((ShareContent) shareLinkContent, z);
|
||||
Utility.a(a, "TITLE", shareLinkContent.getContentTitle());
|
||||
Utility.a(a, "DESCRIPTION", shareLinkContent.getContentDescription());
|
||||
Utility.a(a, "IMAGE", shareLinkContent.getImageUrl());
|
||||
Utility.a(a, "QUOTE", shareLinkContent.getQuote());
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(SharePhotoContent sharePhotoContent, List<String> list, boolean z) {
|
||||
Bundle a = a(sharePhotoContent, z);
|
||||
a.putStringArrayList("PHOTOS", new ArrayList<>(list));
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareVideoContent shareVideoContent, String str, boolean z) {
|
||||
Bundle a = a(shareVideoContent, z);
|
||||
Utility.a(a, "TITLE", shareVideoContent.getContentTitle());
|
||||
Utility.a(a, "DESCRIPTION", shareVideoContent.getContentDescription());
|
||||
Utility.a(a, "VIDEO", str);
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareMediaContent shareMediaContent, List<Bundle> list, boolean z) {
|
||||
Bundle a = a(shareMediaContent, z);
|
||||
a.putParcelableArrayList("MEDIA", new ArrayList<>(list));
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareOpenGraphContent shareOpenGraphContent, JSONObject jSONObject, boolean z) {
|
||||
Bundle a = a(shareOpenGraphContent, z);
|
||||
Utility.a(a, "PREVIEW_PROPERTY_NAME", (String) ShareInternalUtility.a(shareOpenGraphContent.getPreviewPropertyName()).second);
|
||||
Utility.a(a, "ACTION_TYPE", shareOpenGraphContent.getAction().getActionType());
|
||||
Utility.a(a, "ACTION", jSONObject.toString());
|
||||
return a;
|
||||
}
|
||||
|
||||
private static Bundle a(ShareContent shareContent, boolean z) {
|
||||
Bundle bundle = new Bundle();
|
||||
Utility.a(bundle, "LINK", shareContent.getContentUrl());
|
||||
Utility.a(bundle, "PLACE", shareContent.getPlaceId());
|
||||
Utility.a(bundle, "REF", shareContent.getRef());
|
||||
bundle.putBoolean("DATA_FAILURES_FATAL", z);
|
||||
List<String> peopleIds = shareContent.getPeopleIds();
|
||||
if (!Utility.a(peopleIds)) {
|
||||
bundle.putStringArrayList("FRIENDS", new ArrayList<>(peopleIds));
|
||||
}
|
||||
ShareHashtag shareHashtag = shareContent.getShareHashtag();
|
||||
if (shareHashtag != null) {
|
||||
Utility.a(bundle, "HASHTAG", shareHashtag.getHashtag());
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum OpenGraphActionDialogFeature implements DialogFeature {
|
||||
OG_ACTION_DIALOG(20130618);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
OpenGraphActionDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.OGACTIONPUBLISH_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.share.model.ShareOpenGraphAction;
|
||||
import com.facebook.share.model.ShareOpenGraphObject;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class OpenGraphJSONUtility {
|
||||
|
||||
public interface PhotoJSONProcessor {
|
||||
JSONObject a(SharePhoto sharePhoto);
|
||||
}
|
||||
|
||||
public static JSONObject a(ShareOpenGraphAction shareOpenGraphAction, PhotoJSONProcessor photoJSONProcessor) throws JSONException {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
for (String str : shareOpenGraphAction.keySet()) {
|
||||
jSONObject.put(str, a(shareOpenGraphAction.get(str), photoJSONProcessor));
|
||||
}
|
||||
return jSONObject;
|
||||
}
|
||||
|
||||
private static JSONObject a(ShareOpenGraphObject shareOpenGraphObject, PhotoJSONProcessor photoJSONProcessor) throws JSONException {
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
for (String str : shareOpenGraphObject.keySet()) {
|
||||
jSONObject.put(str, a(shareOpenGraphObject.get(str), photoJSONProcessor));
|
||||
}
|
||||
return jSONObject;
|
||||
}
|
||||
|
||||
private static JSONArray a(List list, PhotoJSONProcessor photoJSONProcessor) throws JSONException {
|
||||
JSONArray jSONArray = new JSONArray();
|
||||
Iterator it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
jSONArray.put(a(it.next(), photoJSONProcessor));
|
||||
}
|
||||
return jSONArray;
|
||||
}
|
||||
|
||||
public static Object a(Object obj, PhotoJSONProcessor photoJSONProcessor) throws JSONException {
|
||||
if (obj == null) {
|
||||
return JSONObject.NULL;
|
||||
}
|
||||
if ((obj instanceof String) || (obj instanceof Boolean) || (obj instanceof Double) || (obj instanceof Float) || (obj instanceof Integer) || (obj instanceof Long)) {
|
||||
return obj;
|
||||
}
|
||||
if (obj instanceof SharePhoto) {
|
||||
if (photoJSONProcessor != null) {
|
||||
return photoJSONProcessor.a((SharePhoto) obj);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (obj instanceof ShareOpenGraphObject) {
|
||||
return a((ShareOpenGraphObject) obj, photoJSONProcessor);
|
||||
}
|
||||
if (obj instanceof List) {
|
||||
return a((List) obj, photoJSONProcessor);
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid object found for JSON serialization: " + obj.toString());
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum OpenGraphMessageDialogFeature implements DialogFeature {
|
||||
OG_MESSAGE_DIALOG(20140204);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
OpenGraphMessageDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.OGMESSAGEPUBLISH_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
18
sources/com/facebook/share/internal/ResultProcessor.java
Normal file
18
sources/com/facebook/share/internal/ResultProcessor.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.internal.AppCall;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ResultProcessor {
|
||||
public ResultProcessor(FacebookCallback facebookCallback) {
|
||||
}
|
||||
|
||||
public abstract void a(AppCall appCall);
|
||||
|
||||
public abstract void a(AppCall appCall, Bundle bundle);
|
||||
|
||||
public abstract void a(AppCall appCall, FacebookException facebookException);
|
||||
}
|
343
sources/com/facebook/share/internal/ShareContentValidation.java
Normal file
343
sources/com/facebook/share/internal/ShareContentValidation.java
Normal file
@@ -0,0 +1,343 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.internal.Validate;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareMedia;
|
||||
import com.facebook.share.model.ShareMediaContent;
|
||||
import com.facebook.share.model.ShareOpenGraphAction;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.ShareOpenGraphObject;
|
||||
import com.facebook.share.model.ShareOpenGraphValueContainer;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.facebook.share.model.ShareVideo;
|
||||
import com.facebook.share.model.ShareVideoContent;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ShareContentValidation {
|
||||
private static Validator a;
|
||||
private static Validator b;
|
||||
|
||||
private static class Validator {
|
||||
private boolean a;
|
||||
|
||||
private Validator() {
|
||||
this.a = false;
|
||||
}
|
||||
|
||||
public void a(ShareLinkContent shareLinkContent) {
|
||||
ShareContentValidation.b(shareLinkContent, this);
|
||||
}
|
||||
|
||||
public void a(SharePhotoContent sharePhotoContent) {
|
||||
ShareContentValidation.b(sharePhotoContent, this);
|
||||
}
|
||||
|
||||
public void a(ShareVideoContent shareVideoContent) {
|
||||
ShareContentValidation.b(shareVideoContent, this);
|
||||
}
|
||||
|
||||
public void a(ShareMediaContent shareMediaContent) {
|
||||
ShareContentValidation.b(shareMediaContent, this);
|
||||
}
|
||||
|
||||
public void a(ShareOpenGraphContent shareOpenGraphContent) {
|
||||
this.a = true;
|
||||
ShareContentValidation.b(shareOpenGraphContent, this);
|
||||
}
|
||||
|
||||
public void a(ShareOpenGraphAction shareOpenGraphAction) {
|
||||
ShareContentValidation.b(shareOpenGraphAction, this);
|
||||
}
|
||||
|
||||
public void a(ShareOpenGraphObject shareOpenGraphObject) {
|
||||
ShareContentValidation.b(shareOpenGraphObject, this);
|
||||
}
|
||||
|
||||
public void a(ShareOpenGraphValueContainer shareOpenGraphValueContainer, boolean z) {
|
||||
ShareContentValidation.b(shareOpenGraphValueContainer, this, z);
|
||||
}
|
||||
|
||||
public void a(SharePhoto sharePhoto) {
|
||||
ShareContentValidation.d(sharePhoto, this);
|
||||
}
|
||||
|
||||
public void a(ShareVideo shareVideo) {
|
||||
ShareContentValidation.b(shareVideo, this);
|
||||
}
|
||||
|
||||
public void a(ShareMedia shareMedia) {
|
||||
ShareContentValidation.a(shareMedia, this);
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
private static class WebShareValidator extends Validator {
|
||||
private WebShareValidator() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.internal.ShareContentValidation.Validator
|
||||
public void a(ShareVideoContent shareVideoContent) {
|
||||
throw new FacebookException("Cannot share ShareVideoContent via web sharing dialogs");
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.internal.ShareContentValidation.Validator
|
||||
public void a(ShareMediaContent shareMediaContent) {
|
||||
throw new FacebookException("Cannot share ShareMediaContent via web sharing dialogs");
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.internal.ShareContentValidation.Validator
|
||||
public void a(SharePhoto sharePhoto) {
|
||||
ShareContentValidation.e(sharePhoto, this);
|
||||
}
|
||||
}
|
||||
|
||||
private static void c(SharePhoto sharePhoto, Validator validator) {
|
||||
a(sharePhoto);
|
||||
Bitmap bitmap = sharePhoto.getBitmap();
|
||||
Uri imageUrl = sharePhoto.getImageUrl();
|
||||
if (bitmap == null && Utility.e(imageUrl) && !validator.a()) {
|
||||
throw new FacebookException("Cannot set the ImageUrl of a SharePhoto to the Uri of an image on the web when sharing SharePhotoContent");
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void d(SharePhoto sharePhoto, Validator validator) {
|
||||
c(sharePhoto, validator);
|
||||
if (sharePhoto.getBitmap() == null && Utility.e(sharePhoto.getImageUrl())) {
|
||||
return;
|
||||
}
|
||||
Validate.a(FacebookSdk.b());
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void e(SharePhoto sharePhoto, Validator validator) {
|
||||
a(sharePhoto);
|
||||
}
|
||||
|
||||
public static void b(ShareContent shareContent) {
|
||||
a(shareContent, b());
|
||||
}
|
||||
|
||||
private static Validator b() {
|
||||
if (a == null) {
|
||||
a = new WebShareValidator();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareLinkContent shareLinkContent, Validator validator) {
|
||||
Uri imageUrl = shareLinkContent.getImageUrl();
|
||||
if (imageUrl != null && !Utility.e(imageUrl)) {
|
||||
throw new FacebookException("Image Url must be an http:// or https:// url");
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(SharePhotoContent sharePhotoContent, Validator validator) {
|
||||
List<SharePhoto> photos = sharePhotoContent.getPhotos();
|
||||
if (photos != null && !photos.isEmpty()) {
|
||||
if (photos.size() <= 6) {
|
||||
Iterator<SharePhoto> it = photos.iterator();
|
||||
while (it.hasNext()) {
|
||||
validator.a(it.next());
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new FacebookException(String.format(Locale.ROOT, "Cannot add more than %d photos.", 6));
|
||||
}
|
||||
throw new FacebookException("Must specify at least one Photo in SharePhotoContent.");
|
||||
}
|
||||
|
||||
public static void a(ShareContent shareContent) {
|
||||
a(shareContent, a());
|
||||
}
|
||||
|
||||
private static Validator a() {
|
||||
if (b == null) {
|
||||
b = new Validator();
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private static void a(ShareContent shareContent, Validator validator) throws FacebookException {
|
||||
if (shareContent != null) {
|
||||
if (shareContent instanceof ShareLinkContent) {
|
||||
validator.a((ShareLinkContent) shareContent);
|
||||
return;
|
||||
}
|
||||
if (shareContent instanceof SharePhotoContent) {
|
||||
validator.a((SharePhotoContent) shareContent);
|
||||
return;
|
||||
}
|
||||
if (shareContent instanceof ShareVideoContent) {
|
||||
validator.a((ShareVideoContent) shareContent);
|
||||
return;
|
||||
} else if (shareContent instanceof ShareOpenGraphContent) {
|
||||
validator.a((ShareOpenGraphContent) shareContent);
|
||||
return;
|
||||
} else {
|
||||
if (shareContent instanceof ShareMediaContent) {
|
||||
validator.a((ShareMediaContent) shareContent);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new FacebookException("Must provide non-null content to share");
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareVideoContent shareVideoContent, Validator validator) {
|
||||
validator.a(shareVideoContent.getVideo());
|
||||
SharePhoto previewPhoto = shareVideoContent.getPreviewPhoto();
|
||||
if (previewPhoto != null) {
|
||||
validator.a(previewPhoto);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareVideo shareVideo, Validator validator) {
|
||||
if (shareVideo != null) {
|
||||
Uri localUrl = shareVideo.getLocalUrl();
|
||||
if (localUrl != null) {
|
||||
if (!Utility.c(localUrl) && !Utility.d(localUrl)) {
|
||||
throw new FacebookException("ShareVideo must reference a video that is on the device");
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("ShareVideo does not have a LocalUrl specified");
|
||||
}
|
||||
throw new FacebookException("Cannot share a null ShareVideo");
|
||||
}
|
||||
|
||||
private static void a(SharePhoto sharePhoto) {
|
||||
if (sharePhoto != null) {
|
||||
Bitmap bitmap = sharePhoto.getBitmap();
|
||||
Uri imageUrl = sharePhoto.getImageUrl();
|
||||
if (bitmap == null && imageUrl == null) {
|
||||
throw new FacebookException("SharePhoto does not have a Bitmap or ImageUrl specified");
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("Cannot share a null SharePhoto");
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareMediaContent shareMediaContent, Validator validator) {
|
||||
List<ShareMedia> media = shareMediaContent.getMedia();
|
||||
if (media != null && !media.isEmpty()) {
|
||||
if (media.size() <= 6) {
|
||||
Iterator<ShareMedia> it = media.iterator();
|
||||
while (it.hasNext()) {
|
||||
validator.a(it.next());
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new FacebookException(String.format(Locale.ROOT, "Cannot add more than %d media.", 6));
|
||||
}
|
||||
throw new FacebookException("Must specify at least one medium in ShareMediaContent.");
|
||||
}
|
||||
|
||||
public static void a(ShareMedia shareMedia, Validator validator) {
|
||||
if (shareMedia instanceof SharePhoto) {
|
||||
validator.a((SharePhoto) shareMedia);
|
||||
} else {
|
||||
if (shareMedia instanceof ShareVideo) {
|
||||
validator.a((ShareVideo) shareMedia);
|
||||
return;
|
||||
}
|
||||
throw new FacebookException(String.format(Locale.ROOT, "Invalid media type: %s", shareMedia.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareOpenGraphContent shareOpenGraphContent, Validator validator) {
|
||||
validator.a(shareOpenGraphContent.getAction());
|
||||
String previewPropertyName = shareOpenGraphContent.getPreviewPropertyName();
|
||||
if (!Utility.c(previewPropertyName)) {
|
||||
if (shareOpenGraphContent.getAction().get(previewPropertyName) != null) {
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("Property \"" + previewPropertyName + "\" was not found on the action. The name of the preview property must match the name of an action property.");
|
||||
}
|
||||
throw new FacebookException("Must specify a previewPropertyName.");
|
||||
}
|
||||
|
||||
private static void a(String str, boolean z) {
|
||||
if (z) {
|
||||
String[] split = str.split(":");
|
||||
if (split.length >= 2) {
|
||||
for (String str2 : split) {
|
||||
if (str2.isEmpty()) {
|
||||
throw new FacebookException("Invalid key found in Open Graph dictionary: %s", str);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("Open Graph keys must be namespaced: %s", str);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareOpenGraphAction shareOpenGraphAction, Validator validator) {
|
||||
if (shareOpenGraphAction != null) {
|
||||
if (!Utility.c(shareOpenGraphAction.getActionType())) {
|
||||
validator.a(shareOpenGraphAction, false);
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("ShareOpenGraphAction must have a non-empty actionType");
|
||||
}
|
||||
throw new FacebookException("Must specify a non-null ShareOpenGraphAction");
|
||||
}
|
||||
|
||||
private static void a(Object obj, Validator validator) {
|
||||
if (obj instanceof ShareOpenGraphObject) {
|
||||
validator.a((ShareOpenGraphObject) obj);
|
||||
} else if (obj instanceof SharePhoto) {
|
||||
validator.a((SharePhoto) obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareOpenGraphObject shareOpenGraphObject, Validator validator) {
|
||||
if (shareOpenGraphObject != null) {
|
||||
validator.a(shareOpenGraphObject, true);
|
||||
return;
|
||||
}
|
||||
throw new FacebookException("Cannot share a null ShareOpenGraphObject");
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void b(ShareOpenGraphValueContainer shareOpenGraphValueContainer, Validator validator, boolean z) {
|
||||
for (String str : shareOpenGraphValueContainer.keySet()) {
|
||||
a(str, z);
|
||||
Object obj = shareOpenGraphValueContainer.get(str);
|
||||
if (obj instanceof List) {
|
||||
for (Object obj2 : (List) obj) {
|
||||
if (obj2 != null) {
|
||||
a(obj2, validator);
|
||||
} else {
|
||||
throw new FacebookException("Cannot put null objects in Lists in ShareOpenGraphObjects and ShareOpenGraphActions");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
a(obj, validator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
29
sources/com/facebook/share/internal/ShareDialogFeature.java
Normal file
29
sources/com/facebook/share/internal/ShareDialogFeature.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import com.facebook.internal.DialogFeature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum ShareDialogFeature implements DialogFeature {
|
||||
SHARE_DIALOG(20130618),
|
||||
PHOTOS(20140204),
|
||||
VIDEO(20141028),
|
||||
MULTIMEDIA(20160327),
|
||||
HASHTAG(20160327),
|
||||
LINK_SHARE_QUOTES(20160327);
|
||||
|
||||
private int minVersion;
|
||||
|
||||
ShareDialogFeature(int i) {
|
||||
this.minVersion = i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public String getAction() {
|
||||
return "com.facebook.platform.action.request.FEED_DIALOG";
|
||||
}
|
||||
|
||||
@Override // com.facebook.internal.DialogFeature
|
||||
public int getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
}
|
106
sources/com/facebook/share/internal/ShareFeedContent.java
Normal file
106
sources/com/facebook/share/internal/ShareFeedContent.java
Normal file
@@ -0,0 +1,106 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ShareFeedContent extends ShareContent<ShareFeedContent, Builder> {
|
||||
public static final Parcelable.Creator<ShareFeedContent> CREATOR = new Parcelable.Creator<ShareFeedContent>() { // from class: com.facebook.share.internal.ShareFeedContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareFeedContent createFromParcel(Parcel parcel) {
|
||||
return new ShareFeedContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareFeedContent[] newArray(int i) {
|
||||
return new ShareFeedContent[i];
|
||||
}
|
||||
};
|
||||
private final String link;
|
||||
private final String linkCaption;
|
||||
private final String linkDescription;
|
||||
private final String linkName;
|
||||
private final String mediaSource;
|
||||
private final String picture;
|
||||
private final String toId;
|
||||
|
||||
public static final class Builder extends ShareContent.Builder<ShareFeedContent, Builder> {
|
||||
private String f;
|
||||
private String g;
|
||||
private String h;
|
||||
private String i;
|
||||
private String j;
|
||||
private String k;
|
||||
private String l;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return this.link;
|
||||
}
|
||||
|
||||
public String getLinkCaption() {
|
||||
return this.linkCaption;
|
||||
}
|
||||
|
||||
public String getLinkDescription() {
|
||||
return this.linkDescription;
|
||||
}
|
||||
|
||||
public String getLinkName() {
|
||||
return this.linkName;
|
||||
}
|
||||
|
||||
public String getMediaSource() {
|
||||
return this.mediaSource;
|
||||
}
|
||||
|
||||
public String getPicture() {
|
||||
return this.picture;
|
||||
}
|
||||
|
||||
public String getToId() {
|
||||
return this.toId;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeString(this.toId);
|
||||
parcel.writeString(this.link);
|
||||
parcel.writeString(this.linkName);
|
||||
parcel.writeString(this.linkCaption);
|
||||
parcel.writeString(this.linkDescription);
|
||||
parcel.writeString(this.picture);
|
||||
parcel.writeString(this.mediaSource);
|
||||
}
|
||||
|
||||
private ShareFeedContent(Builder builder) {
|
||||
super(builder);
|
||||
this.toId = builder.f;
|
||||
this.link = builder.g;
|
||||
this.linkName = builder.h;
|
||||
this.linkCaption = builder.i;
|
||||
this.linkDescription = builder.j;
|
||||
this.picture = builder.k;
|
||||
this.mediaSource = builder.l;
|
||||
}
|
||||
|
||||
ShareFeedContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.toId = parcel.readString();
|
||||
this.link = parcel.readString();
|
||||
this.linkName = parcel.readString();
|
||||
this.linkCaption = parcel.readString();
|
||||
this.linkDescription = parcel.readString();
|
||||
this.picture = parcel.readString();
|
||||
this.mediaSource = parcel.readString();
|
||||
}
|
||||
}
|
384
sources/com/facebook/share/internal/ShareInternalUtility.java
Normal file
384
sources/com/facebook/share/internal/ShareInternalUtility.java
Normal file
@@ -0,0 +1,384 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Pair;
|
||||
import com.baidu.cloud.media.player.BDCloudMediaPlayer;
|
||||
import com.facebook.AccessToken;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.FacebookOperationCanceledException;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.facebook.GraphRequest;
|
||||
import com.facebook.HttpMethod;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.facebook.internal.AppCall;
|
||||
import com.facebook.internal.CallbackManagerImpl;
|
||||
import com.facebook.internal.NativeAppCallAttachmentStore;
|
||||
import com.facebook.internal.NativeProtocol;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.share.Sharer;
|
||||
import com.facebook.share.internal.OpenGraphJSONUtility;
|
||||
import com.facebook.share.model.ShareMedia;
|
||||
import com.facebook.share.model.ShareMediaContent;
|
||||
import com.facebook.share.model.ShareOpenGraphAction;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.facebook.share.model.ShareVideo;
|
||||
import com.facebook.share.model.ShareVideoContent;
|
||||
import com.ubt.jimu.base.dialog.SimpleQuestionDialog;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareInternalUtility {
|
||||
public static String b(Bundle bundle) {
|
||||
return bundle.containsKey("postId") ? bundle.getString("postId") : bundle.containsKey("com.facebook.platform.extra.POST_ID") ? bundle.getString("com.facebook.platform.extra.POST_ID") : bundle.getString("post_id");
|
||||
}
|
||||
|
||||
public static String a(Bundle bundle) {
|
||||
return bundle.containsKey("completionGesture") ? bundle.getString("completionGesture") : bundle.getString("com.facebook.platform.extra.COMPLETION_GESTURE");
|
||||
}
|
||||
|
||||
public static boolean a(int i, int i2, Intent intent, ResultProcessor resultProcessor) {
|
||||
AppCall a = a(i, i2, intent);
|
||||
if (a == null) {
|
||||
return false;
|
||||
}
|
||||
NativeAppCallAttachmentStore.a(a.a());
|
||||
if (resultProcessor == null) {
|
||||
return true;
|
||||
}
|
||||
FacebookException a2 = NativeProtocol.a(NativeProtocol.c(intent));
|
||||
if (a2 != null) {
|
||||
if (a2 instanceof FacebookOperationCanceledException) {
|
||||
resultProcessor.a(a);
|
||||
} else {
|
||||
resultProcessor.a(a, a2);
|
||||
}
|
||||
} else {
|
||||
resultProcessor.a(a, NativeProtocol.f(intent));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static NativeAppCallAttachmentStore.Attachment b(UUID uuid, ShareMedia shareMedia) {
|
||||
Uri uri;
|
||||
Bitmap bitmap;
|
||||
if (shareMedia instanceof SharePhoto) {
|
||||
SharePhoto sharePhoto = (SharePhoto) shareMedia;
|
||||
bitmap = sharePhoto.getBitmap();
|
||||
uri = sharePhoto.getImageUrl();
|
||||
} else if (shareMedia instanceof ShareVideo) {
|
||||
uri = ((ShareVideo) shareMedia).getLocalUrl();
|
||||
bitmap = null;
|
||||
} else {
|
||||
uri = null;
|
||||
bitmap = null;
|
||||
}
|
||||
if (bitmap != null) {
|
||||
return NativeAppCallAttachmentStore.a(uuid, bitmap);
|
||||
}
|
||||
if (uri != null) {
|
||||
return NativeAppCallAttachmentStore.a(uuid, uri);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ResultProcessor a(final FacebookCallback<Sharer.Result> facebookCallback) {
|
||||
return new ResultProcessor(facebookCallback) { // from class: com.facebook.share.internal.ShareInternalUtility.1
|
||||
@Override // com.facebook.share.internal.ResultProcessor
|
||||
public void a(AppCall appCall, Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
String a = ShareInternalUtility.a(bundle);
|
||||
if (a == null || "post".equalsIgnoreCase(a)) {
|
||||
ShareInternalUtility.a((FacebookCallback<Sharer.Result>) facebookCallback, ShareInternalUtility.b(bundle));
|
||||
} else if (SimpleQuestionDialog.KEY_CANCELBUTTON.equalsIgnoreCase(a)) {
|
||||
ShareInternalUtility.b((FacebookCallback<Sharer.Result>) facebookCallback);
|
||||
} else {
|
||||
ShareInternalUtility.a((FacebookCallback<Sharer.Result>) facebookCallback, new FacebookException("UnknownError"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.internal.ResultProcessor
|
||||
public void a(AppCall appCall) {
|
||||
ShareInternalUtility.b((FacebookCallback<Sharer.Result>) facebookCallback);
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.internal.ResultProcessor
|
||||
public void a(AppCall appCall, FacebookException facebookException) {
|
||||
ShareInternalUtility.a((FacebookCallback<Sharer.Result>) facebookCallback, facebookException);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static AppCall a(int i, int i2, Intent intent) {
|
||||
UUID b = NativeProtocol.b(intent);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
return AppCall.a(b, i);
|
||||
}
|
||||
|
||||
static void b(FacebookCallback<Sharer.Result> facebookCallback) {
|
||||
a("cancelled", (String) null);
|
||||
if (facebookCallback != null) {
|
||||
facebookCallback.onCancel();
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(final int i) {
|
||||
CallbackManagerImpl.b(i, new CallbackManagerImpl.Callback() { // from class: com.facebook.share.internal.ShareInternalUtility.2
|
||||
@Override // com.facebook.internal.CallbackManagerImpl.Callback
|
||||
public boolean a(int i2, Intent intent) {
|
||||
return ShareInternalUtility.a(i, i2, intent, ShareInternalUtility.a((FacebookCallback<Sharer.Result>) null));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static List<String> a(SharePhotoContent sharePhotoContent, final UUID uuid) {
|
||||
List<SharePhoto> photos;
|
||||
if (sharePhotoContent == null || (photos = sharePhotoContent.getPhotos()) == null) {
|
||||
return null;
|
||||
}
|
||||
List a = Utility.a((List) photos, (Utility.Mapper) new Utility.Mapper<SharePhoto, NativeAppCallAttachmentStore.Attachment>() { // from class: com.facebook.share.internal.ShareInternalUtility.4
|
||||
@Override // com.facebook.internal.Utility.Mapper
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public NativeAppCallAttachmentStore.Attachment apply(SharePhoto sharePhoto) {
|
||||
return ShareInternalUtility.b(uuid, sharePhoto);
|
||||
}
|
||||
});
|
||||
List<String> a2 = Utility.a(a, (Utility.Mapper) new Utility.Mapper<NativeAppCallAttachmentStore.Attachment, String>() { // from class: com.facebook.share.internal.ShareInternalUtility.5
|
||||
@Override // com.facebook.internal.Utility.Mapper
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public String apply(NativeAppCallAttachmentStore.Attachment attachment) {
|
||||
return attachment.a();
|
||||
}
|
||||
});
|
||||
NativeAppCallAttachmentStore.a(a);
|
||||
return a2;
|
||||
}
|
||||
|
||||
public static String a(ShareVideoContent shareVideoContent, UUID uuid) {
|
||||
if (shareVideoContent == null || shareVideoContent.getVideo() == null) {
|
||||
return null;
|
||||
}
|
||||
NativeAppCallAttachmentStore.Attachment a = NativeAppCallAttachmentStore.a(uuid, shareVideoContent.getVideo().getLocalUrl());
|
||||
ArrayList arrayList = new ArrayList(1);
|
||||
arrayList.add(a);
|
||||
NativeAppCallAttachmentStore.a(arrayList);
|
||||
return a.a();
|
||||
}
|
||||
|
||||
public static List<Bundle> a(ShareMediaContent shareMediaContent, final UUID uuid) {
|
||||
List<ShareMedia> media;
|
||||
if (shareMediaContent == null || (media = shareMediaContent.getMedia()) == null) {
|
||||
return null;
|
||||
}
|
||||
final ArrayList arrayList = new ArrayList();
|
||||
List<Bundle> a = Utility.a((List) media, (Utility.Mapper) new Utility.Mapper<ShareMedia, Bundle>() { // from class: com.facebook.share.internal.ShareInternalUtility.6
|
||||
@Override // com.facebook.internal.Utility.Mapper
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Bundle apply(ShareMedia shareMedia) {
|
||||
NativeAppCallAttachmentStore.Attachment b = ShareInternalUtility.b(uuid, shareMedia);
|
||||
arrayList.add(b);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("type", shareMedia.getMediaType().name());
|
||||
bundle.putString("uri", b.a());
|
||||
return bundle;
|
||||
}
|
||||
});
|
||||
NativeAppCallAttachmentStore.a(arrayList);
|
||||
return a;
|
||||
}
|
||||
|
||||
public static JSONObject a(final UUID uuid, ShareOpenGraphContent shareOpenGraphContent) throws JSONException {
|
||||
Set a;
|
||||
ShareOpenGraphAction action = shareOpenGraphContent.getAction();
|
||||
final ArrayList arrayList = new ArrayList();
|
||||
JSONObject a2 = OpenGraphJSONUtility.a(action, new OpenGraphJSONUtility.PhotoJSONProcessor() { // from class: com.facebook.share.internal.ShareInternalUtility.7
|
||||
@Override // com.facebook.share.internal.OpenGraphJSONUtility.PhotoJSONProcessor
|
||||
public JSONObject a(SharePhoto sharePhoto) {
|
||||
NativeAppCallAttachmentStore.Attachment b = ShareInternalUtility.b(uuid, sharePhoto);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
arrayList.add(b);
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
jSONObject.put("url", b.a());
|
||||
if (sharePhoto.getUserGenerated()) {
|
||||
jSONObject.put("user_generated", true);
|
||||
}
|
||||
return jSONObject;
|
||||
} catch (JSONException e) {
|
||||
throw new FacebookException("Unable to attach images", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
NativeAppCallAttachmentStore.a(arrayList);
|
||||
if (shareOpenGraphContent.getPlaceId() != null && Utility.c(a2.optString("place"))) {
|
||||
a2.put("place", shareOpenGraphContent.getPlaceId());
|
||||
}
|
||||
if (shareOpenGraphContent.getPeopleIds() != null) {
|
||||
JSONArray optJSONArray = a2.optJSONArray("tags");
|
||||
if (optJSONArray == null) {
|
||||
a = new HashSet();
|
||||
} else {
|
||||
a = Utility.a(optJSONArray);
|
||||
}
|
||||
Iterator<String> it = shareOpenGraphContent.getPeopleIds().iterator();
|
||||
while (it.hasNext()) {
|
||||
a.add(it.next());
|
||||
}
|
||||
a2.put("tags", new JSONArray((Collection) a));
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
public static JSONObject a(ShareOpenGraphContent shareOpenGraphContent) throws JSONException {
|
||||
return OpenGraphJSONUtility.a(shareOpenGraphContent.getAction(), new OpenGraphJSONUtility.PhotoJSONProcessor() { // from class: com.facebook.share.internal.ShareInternalUtility.8
|
||||
@Override // com.facebook.share.internal.OpenGraphJSONUtility.PhotoJSONProcessor
|
||||
public JSONObject a(SharePhoto sharePhoto) {
|
||||
Uri imageUrl = sharePhoto.getImageUrl();
|
||||
JSONObject jSONObject = new JSONObject();
|
||||
try {
|
||||
jSONObject.put("url", imageUrl.toString());
|
||||
return jSONObject;
|
||||
} catch (JSONException e) {
|
||||
throw new FacebookException("Unable to attach images", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static JSONArray a(JSONArray jSONArray, boolean z) throws JSONException {
|
||||
JSONArray jSONArray2 = new JSONArray();
|
||||
for (int i = 0; i < jSONArray.length(); i++) {
|
||||
Object obj = jSONArray.get(i);
|
||||
if (obj instanceof JSONArray) {
|
||||
obj = a((JSONArray) obj, z);
|
||||
} else if (obj instanceof JSONObject) {
|
||||
obj = a((JSONObject) obj, z);
|
||||
}
|
||||
jSONArray2.put(obj);
|
||||
}
|
||||
return jSONArray2;
|
||||
}
|
||||
|
||||
public static JSONObject a(JSONObject jSONObject, boolean z) {
|
||||
if (jSONObject == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject jSONObject2 = new JSONObject();
|
||||
JSONObject jSONObject3 = new JSONObject();
|
||||
JSONArray names = jSONObject.names();
|
||||
for (int i = 0; i < names.length(); i++) {
|
||||
String string = names.getString(i);
|
||||
Object obj = jSONObject.get(string);
|
||||
if (obj instanceof JSONObject) {
|
||||
obj = a((JSONObject) obj, true);
|
||||
} else if (obj instanceof JSONArray) {
|
||||
obj = a((JSONArray) obj, true);
|
||||
}
|
||||
Pair<String, String> a = a(string);
|
||||
String str = (String) a.first;
|
||||
String str2 = (String) a.second;
|
||||
if (z) {
|
||||
if (str != null && str.equals("fbsdk")) {
|
||||
jSONObject2.put(string, obj);
|
||||
} else {
|
||||
if (str != null && !str.equals("og")) {
|
||||
jSONObject3.put(str2, obj);
|
||||
}
|
||||
jSONObject2.put(str2, obj);
|
||||
}
|
||||
} else if (str != null && str.equals("fb")) {
|
||||
jSONObject2.put(string, obj);
|
||||
} else {
|
||||
jSONObject2.put(str2, obj);
|
||||
}
|
||||
}
|
||||
if (jSONObject3.length() > 0) {
|
||||
jSONObject2.put("data", jSONObject3);
|
||||
}
|
||||
return jSONObject2;
|
||||
} catch (JSONException unused) {
|
||||
throw new FacebookException("Failed to create json object from share content");
|
||||
}
|
||||
}
|
||||
|
||||
public static Pair<String, String> a(String str) {
|
||||
String str2;
|
||||
int i;
|
||||
int indexOf = str.indexOf(58);
|
||||
if (indexOf == -1 || str.length() <= (i = indexOf + 1)) {
|
||||
str2 = null;
|
||||
} else {
|
||||
str2 = str.substring(0, indexOf);
|
||||
str = str.substring(i);
|
||||
}
|
||||
return new Pair<>(str2, str);
|
||||
}
|
||||
|
||||
static void a(FacebookCallback<Sharer.Result> facebookCallback, String str) {
|
||||
a("succeeded", (String) null);
|
||||
if (facebookCallback != null) {
|
||||
facebookCallback.onSuccess(new Sharer.Result(str));
|
||||
}
|
||||
}
|
||||
|
||||
static void a(FacebookCallback<Sharer.Result> facebookCallback, FacebookException facebookException) {
|
||||
a(BDCloudMediaPlayer.OnNativeInvokeListener.ARG_ERROR, facebookException.getMessage());
|
||||
if (facebookCallback != null) {
|
||||
facebookCallback.a(facebookException);
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(String str, String str2) {
|
||||
AppEventsLogger b = AppEventsLogger.b(FacebookSdk.b());
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("fb_share_dialog_outcome", str);
|
||||
if (str2 != null) {
|
||||
bundle.putString("error_message", str2);
|
||||
}
|
||||
b.a("fb_share_dialog_result", (Double) null, bundle);
|
||||
}
|
||||
|
||||
public static GraphRequest a(AccessToken accessToken, File file, GraphRequest.Callback callback) throws FileNotFoundException {
|
||||
GraphRequest.ParcelableResourceWithMimeType parcelableResourceWithMimeType = new GraphRequest.ParcelableResourceWithMimeType(ParcelFileDescriptor.open(file, 268435456), "image/png");
|
||||
Bundle bundle = new Bundle(1);
|
||||
bundle.putParcelable("file", parcelableResourceWithMimeType);
|
||||
return new GraphRequest(accessToken, "me/staging_resources", bundle, HttpMethod.POST, callback);
|
||||
}
|
||||
|
||||
public static GraphRequest a(AccessToken accessToken, Uri uri, GraphRequest.Callback callback) throws FileNotFoundException {
|
||||
if (Utility.d(uri)) {
|
||||
return a(accessToken, new File(uri.getPath()), callback);
|
||||
}
|
||||
if (Utility.c(uri)) {
|
||||
GraphRequest.ParcelableResourceWithMimeType parcelableResourceWithMimeType = new GraphRequest.ParcelableResourceWithMimeType(uri, "image/png");
|
||||
Bundle bundle = new Bundle(1);
|
||||
bundle.putParcelable("file", parcelableResourceWithMimeType);
|
||||
return new GraphRequest(accessToken, "me/staging_resources", bundle, HttpMethod.POST, callback);
|
||||
}
|
||||
throw new FacebookException("The image Uri must be either a file:// or content:// Uri");
|
||||
}
|
||||
}
|
89
sources/com/facebook/share/internal/WebDialogParameters.java
Normal file
89
sources/com/facebook/share/internal/WebDialogParameters.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.facebook.share.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.internal.Utility;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareHashtag;
|
||||
import com.facebook.share.model.ShareLinkContent;
|
||||
import com.facebook.share.model.ShareOpenGraphContent;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import com.facebook.share.model.SharePhotoContent;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.unity3d.ads.metadata.MediationMetaData;
|
||||
import java.util.List;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WebDialogParameters {
|
||||
public static Bundle a(ShareLinkContent shareLinkContent) {
|
||||
Bundle a = a((ShareContent) shareLinkContent);
|
||||
Utility.a(a, "href", shareLinkContent.getContentUrl());
|
||||
Utility.a(a, "quote", shareLinkContent.getQuote());
|
||||
return a;
|
||||
}
|
||||
|
||||
public static Bundle b(ShareLinkContent shareLinkContent) {
|
||||
Bundle bundle = new Bundle();
|
||||
Utility.a(bundle, MediationMetaData.KEY_NAME, shareLinkContent.getContentTitle());
|
||||
Utility.a(bundle, SocialConstants.PARAM_COMMENT, shareLinkContent.getContentDescription());
|
||||
Utility.a(bundle, Constant.Community.SOURCE_LINK_TYPE, Utility.b(shareLinkContent.getContentUrl()));
|
||||
Utility.a(bundle, SocialConstants.PARAM_AVATAR_URI, Utility.b(shareLinkContent.getImageUrl()));
|
||||
Utility.a(bundle, "quote", shareLinkContent.getQuote());
|
||||
if (shareLinkContent.getShareHashtag() != null) {
|
||||
Utility.a(bundle, "hashtag", shareLinkContent.getShareHashtag().getHashtag());
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static Bundle a(ShareOpenGraphContent shareOpenGraphContent) {
|
||||
Bundle a = a((ShareContent) shareOpenGraphContent);
|
||||
Utility.a(a, "action_type", shareOpenGraphContent.getAction().getActionType());
|
||||
try {
|
||||
JSONObject a2 = ShareInternalUtility.a(ShareInternalUtility.a(shareOpenGraphContent), false);
|
||||
if (a2 != null) {
|
||||
Utility.a(a, "action_properties", a2.toString());
|
||||
}
|
||||
return a;
|
||||
} catch (JSONException e) {
|
||||
throw new FacebookException("Unable to serialize the ShareOpenGraphContent to JSON", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Bundle a(SharePhotoContent sharePhotoContent) {
|
||||
Bundle a = a((ShareContent) sharePhotoContent);
|
||||
String[] strArr = new String[sharePhotoContent.getPhotos().size()];
|
||||
Utility.a((List) sharePhotoContent.getPhotos(), (Utility.Mapper) new Utility.Mapper<SharePhoto, String>() { // from class: com.facebook.share.internal.WebDialogParameters.1
|
||||
@Override // com.facebook.internal.Utility.Mapper
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public String apply(SharePhoto sharePhoto) {
|
||||
return sharePhoto.getImageUrl().toString();
|
||||
}
|
||||
}).toArray(strArr);
|
||||
a.putStringArray("media", strArr);
|
||||
return a;
|
||||
}
|
||||
|
||||
public static Bundle a(ShareContent shareContent) {
|
||||
Bundle bundle = new Bundle();
|
||||
ShareHashtag shareHashtag = shareContent.getShareHashtag();
|
||||
if (shareHashtag != null) {
|
||||
Utility.a(bundle, "hashtag", shareHashtag.getHashtag());
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public static Bundle a(ShareFeedContent shareFeedContent) {
|
||||
Bundle bundle = new Bundle();
|
||||
Utility.a(bundle, "to", shareFeedContent.getToId());
|
||||
Utility.a(bundle, Constant.Community.SOURCE_LINK_TYPE, shareFeedContent.getLink());
|
||||
Utility.a(bundle, SocialConstants.PARAM_AVATAR_URI, shareFeedContent.getPicture());
|
||||
Utility.a(bundle, SocialConstants.PARAM_SOURCE, shareFeedContent.getMediaSource());
|
||||
Utility.a(bundle, MediationMetaData.KEY_NAME, shareFeedContent.getLinkName());
|
||||
Utility.a(bundle, "caption", shareFeedContent.getLinkCaption());
|
||||
Utility.a(bundle, SocialConstants.PARAM_COMMENT, shareFeedContent.getLinkDescription());
|
||||
return bundle;
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppGroupCreationContent implements ShareModel {
|
||||
public static final Parcelable.Creator<AppGroupCreationContent> CREATOR = new Parcelable.Creator<AppGroupCreationContent>() { // from class: com.facebook.share.model.AppGroupCreationContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public AppGroupCreationContent createFromParcel(Parcel parcel) {
|
||||
return new AppGroupCreationContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public AppGroupCreationContent[] newArray(int i) {
|
||||
return new AppGroupCreationContent[i];
|
||||
}
|
||||
};
|
||||
private final String description;
|
||||
private final String name;
|
||||
private AppGroupPrivacy privacy;
|
||||
|
||||
public enum AppGroupPrivacy {
|
||||
Open,
|
||||
Closed
|
||||
}
|
||||
|
||||
public static class Builder implements ShareModelBuilder<AppGroupCreationContent, Builder> {
|
||||
private String a;
|
||||
private String b;
|
||||
private AppGroupPrivacy c;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public AppGroupPrivacy getAppGroupPrivacy() {
|
||||
return this.privacy;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.name);
|
||||
parcel.writeString(this.description);
|
||||
parcel.writeSerializable(this.privacy);
|
||||
}
|
||||
|
||||
private AppGroupCreationContent(Builder builder) {
|
||||
this.name = builder.a;
|
||||
this.description = builder.b;
|
||||
this.privacy = builder.c;
|
||||
}
|
||||
|
||||
AppGroupCreationContent(Parcel parcel) {
|
||||
this.name = parcel.readString();
|
||||
this.description = parcel.readString();
|
||||
this.privacy = (AppGroupPrivacy) parcel.readSerializable();
|
||||
}
|
||||
}
|
113
sources/com/facebook/share/model/AppInviteContent.java
Normal file
113
sources/com/facebook/share/model/AppInviteContent.java
Normal file
@@ -0,0 +1,113 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AppInviteContent implements ShareModel {
|
||||
public static final Parcelable.Creator<AppInviteContent> CREATOR = new Parcelable.Creator<AppInviteContent>() { // from class: com.facebook.share.model.AppInviteContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public AppInviteContent createFromParcel(Parcel parcel) {
|
||||
return new AppInviteContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public AppInviteContent[] newArray(int i) {
|
||||
return new AppInviteContent[i];
|
||||
}
|
||||
};
|
||||
private final String applinkUrl;
|
||||
private final Builder.Destination destination;
|
||||
private final String previewImageUrl;
|
||||
private final String promoCode;
|
||||
private final String promoText;
|
||||
|
||||
public static class Builder implements ShareModelBuilder<AppInviteContent, Builder> {
|
||||
private String a;
|
||||
private String b;
|
||||
private String c;
|
||||
private String d;
|
||||
private Destination e;
|
||||
|
||||
public enum Destination {
|
||||
FACEBOOK("facebook"),
|
||||
MESSENGER("messenger");
|
||||
|
||||
private final String name;
|
||||
|
||||
Destination(String str) {
|
||||
this.name = str;
|
||||
}
|
||||
|
||||
public boolean equalsName(String str) {
|
||||
if (str == null) {
|
||||
return false;
|
||||
}
|
||||
return this.name.equals(str);
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getApplinkUrl() {
|
||||
return this.applinkUrl;
|
||||
}
|
||||
|
||||
public Builder.Destination getDestination() {
|
||||
Builder.Destination destination = this.destination;
|
||||
return destination != null ? destination : Builder.Destination.FACEBOOK;
|
||||
}
|
||||
|
||||
public String getPreviewImageUrl() {
|
||||
return this.previewImageUrl;
|
||||
}
|
||||
|
||||
public String getPromotionCode() {
|
||||
return this.promoCode;
|
||||
}
|
||||
|
||||
public String getPromotionText() {
|
||||
return this.promoText;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.applinkUrl);
|
||||
parcel.writeString(this.previewImageUrl);
|
||||
parcel.writeString(this.promoText);
|
||||
parcel.writeString(this.promoCode);
|
||||
parcel.writeString(this.destination.toString());
|
||||
}
|
||||
|
||||
private AppInviteContent(Builder builder) {
|
||||
this.applinkUrl = builder.a;
|
||||
this.previewImageUrl = builder.b;
|
||||
this.promoCode = builder.c;
|
||||
this.promoText = builder.d;
|
||||
this.destination = builder.e;
|
||||
}
|
||||
|
||||
AppInviteContent(Parcel parcel) {
|
||||
this.applinkUrl = parcel.readString();
|
||||
this.previewImageUrl = parcel.readString();
|
||||
this.promoText = parcel.readString();
|
||||
this.promoCode = parcel.readString();
|
||||
String readString = parcel.readString();
|
||||
if (readString.length() > 0) {
|
||||
this.destination = Builder.Destination.valueOf(readString);
|
||||
} else {
|
||||
this.destination = Builder.Destination.FACEBOOK;
|
||||
}
|
||||
}
|
||||
}
|
132
sources/com/facebook/share/model/GameRequestContent.java
Normal file
132
sources/com/facebook/share/model/GameRequestContent.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GameRequestContent implements ShareModel {
|
||||
public static final Parcelable.Creator<GameRequestContent> CREATOR = new Parcelable.Creator<GameRequestContent>() { // from class: com.facebook.share.model.GameRequestContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GameRequestContent createFromParcel(Parcel parcel) {
|
||||
return new GameRequestContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GameRequestContent[] newArray(int i) {
|
||||
return new GameRequestContent[i];
|
||||
}
|
||||
};
|
||||
private final ActionType actionType;
|
||||
private final String data;
|
||||
private final Filters filters;
|
||||
private final String message;
|
||||
private final String objectId;
|
||||
private final List<String> recipients;
|
||||
private final List<String> suggestions;
|
||||
private final String title;
|
||||
|
||||
public enum ActionType {
|
||||
SEND,
|
||||
ASKFOR,
|
||||
TURN
|
||||
}
|
||||
|
||||
public static class Builder implements ShareModelBuilder<GameRequestContent, Builder> {
|
||||
private String a;
|
||||
private List<String> b;
|
||||
private String c;
|
||||
private String d;
|
||||
private ActionType e;
|
||||
private String f;
|
||||
private Filters g;
|
||||
private List<String> h;
|
||||
}
|
||||
|
||||
public enum Filters {
|
||||
APP_USERS,
|
||||
APP_NON_USERS
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ActionType getActionType() {
|
||||
return this.actionType;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public Filters getFilters() {
|
||||
return this.filters;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public String getObjectId() {
|
||||
return this.objectId;
|
||||
}
|
||||
|
||||
public List<String> getRecipients() {
|
||||
return this.recipients;
|
||||
}
|
||||
|
||||
public List<String> getSuggestions() {
|
||||
return this.suggestions;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
if (getRecipients() != null) {
|
||||
return TextUtils.join(",", getRecipients());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.message);
|
||||
parcel.writeStringList(this.recipients);
|
||||
parcel.writeString(this.title);
|
||||
parcel.writeString(this.data);
|
||||
parcel.writeSerializable(this.actionType);
|
||||
parcel.writeString(this.objectId);
|
||||
parcel.writeSerializable(this.filters);
|
||||
parcel.writeStringList(this.suggestions);
|
||||
}
|
||||
|
||||
private GameRequestContent(Builder builder) {
|
||||
this.message = builder.a;
|
||||
this.recipients = builder.b;
|
||||
this.title = builder.d;
|
||||
this.data = builder.c;
|
||||
this.actionType = builder.e;
|
||||
this.objectId = builder.f;
|
||||
this.filters = builder.g;
|
||||
this.suggestions = builder.h;
|
||||
}
|
||||
|
||||
GameRequestContent(Parcel parcel) {
|
||||
this.message = parcel.readString();
|
||||
this.recipients = parcel.createStringArrayList();
|
||||
this.title = parcel.readString();
|
||||
this.data = parcel.readString();
|
||||
this.actionType = (ActionType) parcel.readSerializable();
|
||||
this.objectId = parcel.readString();
|
||||
this.filters = (Filters) parcel.readSerializable();
|
||||
this.suggestions = parcel.createStringArrayList();
|
||||
parcel.readStringList(this.suggestions);
|
||||
}
|
||||
}
|
119
sources/com/facebook/share/model/ShareContent.java
Normal file
119
sources/com/facebook/share/model/ShareContent.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareContent.Builder;
|
||||
import com.facebook.share.model.ShareHashtag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ShareContent<P extends ShareContent, E extends Builder> implements ShareModel {
|
||||
private final Uri contentUrl;
|
||||
private final ShareHashtag hashtag;
|
||||
private final List<String> peopleIds;
|
||||
private final String placeId;
|
||||
private final String ref;
|
||||
|
||||
public static abstract class Builder<P extends ShareContent, E extends Builder> implements ShareModelBuilder<P, E> {
|
||||
private Uri a;
|
||||
private List<String> b;
|
||||
private String c;
|
||||
private String d;
|
||||
private ShareHashtag e;
|
||||
|
||||
public E a(Uri uri) {
|
||||
this.a = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public E b(String str) {
|
||||
this.d = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public E a(List<String> list) {
|
||||
this.b = list == null ? null : Collections.unmodifiableList(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
public E a(String str) {
|
||||
this.c = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public E a(P p) {
|
||||
if (p == null) {
|
||||
return this;
|
||||
}
|
||||
a(p.getContentUrl());
|
||||
a(p.getPeopleIds());
|
||||
a(p.getPlaceId());
|
||||
b(p.getRef());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
protected ShareContent(Builder builder) {
|
||||
this.contentUrl = builder.a;
|
||||
this.peopleIds = builder.b;
|
||||
this.placeId = builder.c;
|
||||
this.ref = builder.d;
|
||||
this.hashtag = builder.e;
|
||||
}
|
||||
|
||||
private List<String> readUnmodifiableStringList(Parcel parcel) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
parcel.readStringList(arrayList);
|
||||
if (arrayList.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return Collections.unmodifiableList(arrayList);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Uri getContentUrl() {
|
||||
return this.contentUrl;
|
||||
}
|
||||
|
||||
public List<String> getPeopleIds() {
|
||||
return this.peopleIds;
|
||||
}
|
||||
|
||||
public String getPlaceId() {
|
||||
return this.placeId;
|
||||
}
|
||||
|
||||
public String getRef() {
|
||||
return this.ref;
|
||||
}
|
||||
|
||||
public ShareHashtag getShareHashtag() {
|
||||
return this.hashtag;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeParcelable(this.contentUrl, 0);
|
||||
parcel.writeStringList(this.peopleIds);
|
||||
parcel.writeString(this.placeId);
|
||||
parcel.writeString(this.ref);
|
||||
parcel.writeParcelable(this.hashtag, 0);
|
||||
}
|
||||
|
||||
protected ShareContent(Parcel parcel) {
|
||||
this.contentUrl = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
|
||||
this.peopleIds = readUnmodifiableStringList(parcel);
|
||||
this.placeId = parcel.readString();
|
||||
this.ref = parcel.readString();
|
||||
ShareHashtag.Builder builder = new ShareHashtag.Builder();
|
||||
builder.a(parcel);
|
||||
this.hashtag = builder.a();
|
||||
}
|
||||
}
|
70
sources/com/facebook/share/model/ShareHashtag.java
Normal file
70
sources/com/facebook/share/model/ShareHashtag.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ShareHashtag implements ShareModel {
|
||||
public static final Parcelable.Creator<ShareHashtag> CREATOR = new Parcelable.Creator<ShareHashtag>() { // from class: com.facebook.share.model.ShareHashtag.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareHashtag createFromParcel(Parcel parcel) {
|
||||
return new ShareHashtag(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareHashtag[] newArray(int i) {
|
||||
return new ShareHashtag[i];
|
||||
}
|
||||
};
|
||||
private final String hashtag;
|
||||
|
||||
public static class Builder implements ShareModelBuilder<ShareHashtag, Builder> {
|
||||
private String a;
|
||||
|
||||
public Builder a(String str) {
|
||||
this.a = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(ShareHashtag shareHashtag) {
|
||||
if (shareHashtag == null) {
|
||||
return this;
|
||||
}
|
||||
a(shareHashtag.getHashtag());
|
||||
return this;
|
||||
}
|
||||
|
||||
Builder a(Parcel parcel) {
|
||||
a((ShareHashtag) parcel.readParcelable(ShareHashtag.class.getClassLoader()));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareHashtag a() {
|
||||
return new ShareHashtag(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getHashtag() {
|
||||
return this.hashtag;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.hashtag);
|
||||
}
|
||||
|
||||
private ShareHashtag(Builder builder) {
|
||||
this.hashtag = builder.a;
|
||||
}
|
||||
|
||||
ShareHashtag(Parcel parcel) {
|
||||
this.hashtag = parcel.readString();
|
||||
}
|
||||
}
|
99
sources/com/facebook/share/model/ShareLinkContent.java
Normal file
99
sources/com/facebook/share/model/ShareLinkContent.java
Normal file
@@ -0,0 +1,99 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareLinkContent extends ShareContent<ShareLinkContent, Builder> {
|
||||
public static final Parcelable.Creator<ShareLinkContent> CREATOR = new Parcelable.Creator<ShareLinkContent>() { // from class: com.facebook.share.model.ShareLinkContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareLinkContent createFromParcel(Parcel parcel) {
|
||||
return new ShareLinkContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareLinkContent[] newArray(int i) {
|
||||
return new ShareLinkContent[i];
|
||||
}
|
||||
};
|
||||
|
||||
@Deprecated
|
||||
private final String contentDescription;
|
||||
|
||||
@Deprecated
|
||||
private final String contentTitle;
|
||||
|
||||
@Deprecated
|
||||
private final Uri imageUrl;
|
||||
private final String quote;
|
||||
|
||||
public static final class Builder extends ShareContent.Builder<ShareLinkContent, Builder> {
|
||||
|
||||
@Deprecated
|
||||
private String f;
|
||||
|
||||
@Deprecated
|
||||
private String g;
|
||||
|
||||
@Deprecated
|
||||
private Uri h;
|
||||
private String i;
|
||||
|
||||
public ShareLinkContent a() {
|
||||
return new ShareLinkContent(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getContentDescription() {
|
||||
return this.contentDescription;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getContentTitle() {
|
||||
return this.contentTitle;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Uri getImageUrl() {
|
||||
return this.imageUrl;
|
||||
}
|
||||
|
||||
public String getQuote() {
|
||||
return this.quote;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeString(this.contentDescription);
|
||||
parcel.writeString(this.contentTitle);
|
||||
parcel.writeParcelable(this.imageUrl, 0);
|
||||
parcel.writeString(this.quote);
|
||||
}
|
||||
|
||||
private ShareLinkContent(Builder builder) {
|
||||
super(builder);
|
||||
this.contentDescription = builder.f;
|
||||
this.contentTitle = builder.g;
|
||||
this.imageUrl = builder.h;
|
||||
this.quote = builder.i;
|
||||
}
|
||||
|
||||
ShareLinkContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.contentDescription = parcel.readString();
|
||||
this.contentTitle = parcel.readString();
|
||||
this.imageUrl = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
|
||||
this.quote = parcel.readString();
|
||||
}
|
||||
}
|
69
sources/com/facebook/share/model/ShareMedia.java
Normal file
69
sources/com/facebook/share/model/ShareMedia.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ShareMedia implements ShareModel {
|
||||
private final Bundle params;
|
||||
|
||||
public static abstract class Builder<M extends ShareMedia, B extends Builder> implements ShareModelBuilder<M, B> {
|
||||
private Bundle a = new Bundle();
|
||||
|
||||
@Deprecated
|
||||
public B a(Bundle bundle) {
|
||||
this.a.putAll(bundle);
|
||||
return this;
|
||||
}
|
||||
|
||||
public B a(M m) {
|
||||
if (m == null) {
|
||||
return this;
|
||||
}
|
||||
a(m.getParameters());
|
||||
return this;
|
||||
}
|
||||
|
||||
static List<ShareMedia> a(Parcel parcel) {
|
||||
Parcelable[] readParcelableArray = parcel.readParcelableArray(ShareMedia.class.getClassLoader());
|
||||
ArrayList arrayList = new ArrayList(readParcelableArray.length);
|
||||
for (Parcelable parcelable : readParcelableArray) {
|
||||
arrayList.add((ShareMedia) parcelable);
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
PHOTO,
|
||||
VIDEO
|
||||
}
|
||||
|
||||
protected ShareMedia(Builder builder) {
|
||||
this.params = new Bundle(builder.a);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public abstract Type getMediaType();
|
||||
|
||||
@Deprecated
|
||||
public Bundle getParameters() {
|
||||
return new Bundle(this.params);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeBundle(this.params);
|
||||
}
|
||||
|
||||
ShareMedia(Parcel parcel) {
|
||||
this.params = parcel.readBundle();
|
||||
}
|
||||
}
|
55
sources/com/facebook/share/model/ShareMediaContent.java
Normal file
55
sources/com/facebook/share/model/ShareMediaContent.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareMediaContent extends ShareContent<ShareMediaContent, Builder> {
|
||||
public static final Parcelable.Creator<ShareMediaContent> CREATOR = new Parcelable.Creator<ShareMediaContent>() { // from class: com.facebook.share.model.ShareMediaContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareMediaContent createFromParcel(Parcel parcel) {
|
||||
return new ShareMediaContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareMediaContent[] newArray(int i) {
|
||||
return new ShareMediaContent[i];
|
||||
}
|
||||
};
|
||||
private final List<ShareMedia> media;
|
||||
|
||||
public static class Builder extends ShareContent.Builder<ShareMediaContent, Builder> {
|
||||
private final List<ShareMedia> f;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public List<ShareMedia> getMedia() {
|
||||
return this.media;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeParcelableArray((ShareMedia[]) this.media.toArray(), i);
|
||||
}
|
||||
|
||||
private ShareMediaContent(Builder builder) {
|
||||
super(builder);
|
||||
this.media = Collections.unmodifiableList(builder.f);
|
||||
}
|
||||
|
||||
ShareMediaContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.media = Arrays.asList((ShareMedia[]) parcel.readParcelableArray(ShareMedia.class.getClassLoader()));
|
||||
}
|
||||
}
|
7
sources/com/facebook/share/model/ShareModel.java
Normal file
7
sources/com/facebook/share/model/ShareModel.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ShareModel extends Parcelable {
|
||||
}
|
9
sources/com/facebook/share/model/ShareModelBuilder.java
Normal file
9
sources/com/facebook/share/model/ShareModelBuilder.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import com.facebook.share.ShareBuilder;
|
||||
import com.facebook.share.model.ShareModel;
|
||||
import com.facebook.share.model.ShareModelBuilder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ShareModelBuilder<P extends ShareModel, E extends ShareModelBuilder> extends ShareBuilder<P, E> {
|
||||
}
|
59
sources/com/facebook/share/model/ShareOpenGraphAction.java
Normal file
59
sources/com/facebook/share/model/ShareOpenGraphAction.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareOpenGraphValueContainer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareOpenGraphAction extends ShareOpenGraphValueContainer<ShareOpenGraphAction, Builder> {
|
||||
public static final Parcelable.Creator<ShareOpenGraphAction> CREATOR = new Parcelable.Creator<ShareOpenGraphAction>() { // from class: com.facebook.share.model.ShareOpenGraphAction.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphAction createFromParcel(Parcel parcel) {
|
||||
return new ShareOpenGraphAction(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphAction[] newArray(int i) {
|
||||
return new ShareOpenGraphAction[i];
|
||||
}
|
||||
};
|
||||
|
||||
public static final class Builder extends ShareOpenGraphValueContainer.Builder<ShareOpenGraphAction, Builder> {
|
||||
public Builder a(String str) {
|
||||
a("og:type", str);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareOpenGraphAction a() {
|
||||
return new ShareOpenGraphAction(this);
|
||||
}
|
||||
|
||||
public Builder a(ShareOpenGraphAction shareOpenGraphAction) {
|
||||
if (shareOpenGraphAction == null) {
|
||||
return this;
|
||||
}
|
||||
super.a((Builder) shareOpenGraphAction);
|
||||
Builder builder = this;
|
||||
builder.a(shareOpenGraphAction.getActionType());
|
||||
return builder;
|
||||
}
|
||||
|
||||
Builder a(Parcel parcel) {
|
||||
return a((ShareOpenGraphAction) parcel.readParcelable(ShareOpenGraphAction.class.getClassLoader()));
|
||||
}
|
||||
}
|
||||
|
||||
public String getActionType() {
|
||||
return getString("og:type");
|
||||
}
|
||||
|
||||
private ShareOpenGraphAction(Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
ShareOpenGraphAction(Parcel parcel) {
|
||||
super(parcel);
|
||||
}
|
||||
}
|
62
sources/com/facebook/share/model/ShareOpenGraphContent.java
Normal file
62
sources/com/facebook/share/model/ShareOpenGraphContent.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.ShareOpenGraphAction;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareOpenGraphContent extends ShareContent<ShareOpenGraphContent, Builder> {
|
||||
public static final Parcelable.Creator<ShareOpenGraphContent> CREATOR = new Parcelable.Creator<ShareOpenGraphContent>() { // from class: com.facebook.share.model.ShareOpenGraphContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphContent createFromParcel(Parcel parcel) {
|
||||
return new ShareOpenGraphContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphContent[] newArray(int i) {
|
||||
return new ShareOpenGraphContent[i];
|
||||
}
|
||||
};
|
||||
private final ShareOpenGraphAction action;
|
||||
private final String previewPropertyName;
|
||||
|
||||
public static final class Builder extends ShareContent.Builder<ShareOpenGraphContent, Builder> {
|
||||
private ShareOpenGraphAction f;
|
||||
private String g;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ShareOpenGraphAction getAction() {
|
||||
return this.action;
|
||||
}
|
||||
|
||||
public String getPreviewPropertyName() {
|
||||
return this.previewPropertyName;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeParcelable(this.action, 0);
|
||||
parcel.writeString(this.previewPropertyName);
|
||||
}
|
||||
|
||||
private ShareOpenGraphContent(Builder builder) {
|
||||
super(builder);
|
||||
this.action = builder.f;
|
||||
this.previewPropertyName = builder.g;
|
||||
}
|
||||
|
||||
ShareOpenGraphContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.action = new ShareOpenGraphAction.Builder().a(parcel).a();
|
||||
this.previewPropertyName = parcel.readString();
|
||||
}
|
||||
}
|
33
sources/com/facebook/share/model/ShareOpenGraphObject.java
Normal file
33
sources/com/facebook/share/model/ShareOpenGraphObject.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareOpenGraphValueContainer;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareOpenGraphObject extends ShareOpenGraphValueContainer<ShareOpenGraphObject, Builder> {
|
||||
public static final Parcelable.Creator<ShareOpenGraphObject> CREATOR = new Parcelable.Creator<ShareOpenGraphObject>() { // from class: com.facebook.share.model.ShareOpenGraphObject.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphObject createFromParcel(Parcel parcel) {
|
||||
return new ShareOpenGraphObject(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareOpenGraphObject[] newArray(int i) {
|
||||
return new ShareOpenGraphObject[i];
|
||||
}
|
||||
};
|
||||
|
||||
public static final class Builder extends ShareOpenGraphValueContainer.Builder<ShareOpenGraphObject, Builder> {
|
||||
}
|
||||
|
||||
private ShareOpenGraphObject(Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
ShareOpenGraphObject(Parcel parcel) {
|
||||
super(parcel);
|
||||
}
|
||||
}
|
@@ -0,0 +1,149 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareOpenGraphValueContainer;
|
||||
import com.facebook.share.model.ShareOpenGraphValueContainer.Builder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ShareOpenGraphValueContainer<P extends ShareOpenGraphValueContainer, E extends Builder> implements ShareModel {
|
||||
private final Bundle bundle;
|
||||
|
||||
public static abstract class Builder<P extends ShareOpenGraphValueContainer, E extends Builder> implements ShareModelBuilder<P, E> {
|
||||
private Bundle a = new Bundle();
|
||||
|
||||
public E a(String str, String str2) {
|
||||
this.a.putString(str, str2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public E a(P p) {
|
||||
if (p != null) {
|
||||
this.a.putAll(p.getBundle());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
protected ShareOpenGraphValueContainer(Builder<P, E> builder) {
|
||||
this.bundle = (Bundle) ((Builder) builder).a.clone();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Object get(String str) {
|
||||
return this.bundle.get(str);
|
||||
}
|
||||
|
||||
public boolean getBoolean(String str, boolean z) {
|
||||
return this.bundle.getBoolean(str, z);
|
||||
}
|
||||
|
||||
public boolean[] getBooleanArray(String str) {
|
||||
return this.bundle.getBooleanArray(str);
|
||||
}
|
||||
|
||||
public Bundle getBundle() {
|
||||
return (Bundle) this.bundle.clone();
|
||||
}
|
||||
|
||||
public double getDouble(String str, double d) {
|
||||
return this.bundle.getDouble(str, d);
|
||||
}
|
||||
|
||||
public double[] getDoubleArray(String str) {
|
||||
return this.bundle.getDoubleArray(str);
|
||||
}
|
||||
|
||||
public int getInt(String str, int i) {
|
||||
return this.bundle.getInt(str, i);
|
||||
}
|
||||
|
||||
public int[] getIntArray(String str) {
|
||||
return this.bundle.getIntArray(str);
|
||||
}
|
||||
|
||||
public long getLong(String str, long j) {
|
||||
return this.bundle.getLong(str, j);
|
||||
}
|
||||
|
||||
public long[] getLongArray(String str) {
|
||||
return this.bundle.getLongArray(str);
|
||||
}
|
||||
|
||||
public ShareOpenGraphObject getObject(String str) {
|
||||
Object obj = this.bundle.get(str);
|
||||
if (obj instanceof ShareOpenGraphObject) {
|
||||
return (ShareOpenGraphObject) obj;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<ShareOpenGraphObject> getObjectArrayList(String str) {
|
||||
ArrayList parcelableArrayList = this.bundle.getParcelableArrayList(str);
|
||||
if (parcelableArrayList == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList<ShareOpenGraphObject> arrayList = new ArrayList<>();
|
||||
Iterator it = parcelableArrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
Parcelable parcelable = (Parcelable) it.next();
|
||||
if (parcelable instanceof ShareOpenGraphObject) {
|
||||
arrayList.add((ShareOpenGraphObject) parcelable);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public SharePhoto getPhoto(String str) {
|
||||
Parcelable parcelable = this.bundle.getParcelable(str);
|
||||
if (parcelable instanceof SharePhoto) {
|
||||
return (SharePhoto) parcelable;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<SharePhoto> getPhotoArrayList(String str) {
|
||||
ArrayList parcelableArrayList = this.bundle.getParcelableArrayList(str);
|
||||
if (parcelableArrayList == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList<SharePhoto> arrayList = new ArrayList<>();
|
||||
Iterator it = parcelableArrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
Parcelable parcelable = (Parcelable) it.next();
|
||||
if (parcelable instanceof SharePhoto) {
|
||||
arrayList.add((SharePhoto) parcelable);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public String getString(String str) {
|
||||
return this.bundle.getString(str);
|
||||
}
|
||||
|
||||
public ArrayList<String> getStringArrayList(String str) {
|
||||
return this.bundle.getStringArrayList(str);
|
||||
}
|
||||
|
||||
public Set<String> keySet() {
|
||||
return this.bundle.keySet();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeBundle(this.bundle);
|
||||
}
|
||||
|
||||
ShareOpenGraphValueContainer(Parcel parcel) {
|
||||
this.bundle = parcel.readBundle(Builder.class.getClassLoader());
|
||||
}
|
||||
}
|
156
sources/com/facebook/share/model/SharePhoto.java
Normal file
156
sources/com/facebook/share/model/SharePhoto.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareMedia;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class SharePhoto extends ShareMedia {
|
||||
public static final Parcelable.Creator<SharePhoto> CREATOR = new Parcelable.Creator<SharePhoto>() { // from class: com.facebook.share.model.SharePhoto.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SharePhoto createFromParcel(Parcel parcel) {
|
||||
return new SharePhoto(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SharePhoto[] newArray(int i) {
|
||||
return new SharePhoto[i];
|
||||
}
|
||||
};
|
||||
private final Bitmap bitmap;
|
||||
private final String caption;
|
||||
private final Uri imageUrl;
|
||||
private final boolean userGenerated;
|
||||
|
||||
public static final class Builder extends ShareMedia.Builder<SharePhoto, Builder> {
|
||||
private Bitmap b;
|
||||
private Uri c;
|
||||
private boolean d;
|
||||
private String e;
|
||||
|
||||
public Builder a(Bitmap bitmap) {
|
||||
this.b = bitmap;
|
||||
return this;
|
||||
}
|
||||
|
||||
Bitmap b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
Uri c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
static List<SharePhoto> c(Parcel parcel) {
|
||||
List<ShareMedia> a = ShareMedia.Builder.a(parcel);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (ShareMedia shareMedia : a) {
|
||||
if (shareMedia instanceof SharePhoto) {
|
||||
arrayList.add((SharePhoto) shareMedia);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public Builder a(Uri uri) {
|
||||
this.c = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
Builder b(Parcel parcel) {
|
||||
return a((SharePhoto) parcel.readParcelable(SharePhoto.class.getClassLoader()));
|
||||
}
|
||||
|
||||
public Builder a(boolean z) {
|
||||
this.d = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(String str) {
|
||||
this.e = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePhoto a() {
|
||||
return new SharePhoto(this);
|
||||
}
|
||||
|
||||
public Builder a(SharePhoto sharePhoto) {
|
||||
if (sharePhoto == null) {
|
||||
return this;
|
||||
}
|
||||
super.a((Builder) sharePhoto);
|
||||
Builder builder = this;
|
||||
builder.a(sharePhoto.getBitmap());
|
||||
builder.a(sharePhoto.getImageUrl());
|
||||
builder.a(sharePhoto.getUserGenerated());
|
||||
builder.a(sharePhoto.getCaption());
|
||||
return builder;
|
||||
}
|
||||
|
||||
static void a(Parcel parcel, int i, List<SharePhoto> list) {
|
||||
ShareMedia[] shareMediaArr = new ShareMedia[list.size()];
|
||||
for (int i2 = 0; i2 < list.size(); i2++) {
|
||||
shareMediaArr[i2] = list.get(i2);
|
||||
}
|
||||
parcel.writeParcelableArray(shareMediaArr, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Bitmap getBitmap() {
|
||||
return this.bitmap;
|
||||
}
|
||||
|
||||
public String getCaption() {
|
||||
return this.caption;
|
||||
}
|
||||
|
||||
public Uri getImageUrl() {
|
||||
return this.imageUrl;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia
|
||||
public ShareMedia.Type getMediaType() {
|
||||
return ShareMedia.Type.PHOTO;
|
||||
}
|
||||
|
||||
public boolean getUserGenerated() {
|
||||
return this.userGenerated;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeParcelable(this.bitmap, 0);
|
||||
parcel.writeParcelable(this.imageUrl, 0);
|
||||
parcel.writeByte(this.userGenerated ? (byte) 1 : (byte) 0);
|
||||
parcel.writeString(this.caption);
|
||||
}
|
||||
|
||||
private SharePhoto(Builder builder) {
|
||||
super(builder);
|
||||
this.bitmap = builder.b;
|
||||
this.imageUrl = builder.c;
|
||||
this.userGenerated = builder.d;
|
||||
this.caption = builder.e;
|
||||
}
|
||||
|
||||
SharePhoto(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.bitmap = (Bitmap) parcel.readParcelable(Bitmap.class.getClassLoader());
|
||||
this.imageUrl = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
|
||||
this.userGenerated = parcel.readByte() != 0;
|
||||
this.caption = parcel.readString();
|
||||
}
|
||||
}
|
94
sources/com/facebook/share/model/SharePhotoContent.java
Normal file
94
sources/com/facebook/share/model/SharePhotoContent.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class SharePhotoContent extends ShareContent<SharePhotoContent, Builder> {
|
||||
public static final Parcelable.Creator<SharePhotoContent> CREATOR = new Parcelable.Creator<SharePhotoContent>() { // from class: com.facebook.share.model.SharePhotoContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SharePhotoContent createFromParcel(Parcel parcel) {
|
||||
return new SharePhotoContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public SharePhotoContent[] newArray(int i) {
|
||||
return new SharePhotoContent[i];
|
||||
}
|
||||
};
|
||||
private final List<SharePhoto> photos;
|
||||
|
||||
public static class Builder extends ShareContent.Builder<SharePhotoContent, Builder> {
|
||||
private final List<SharePhoto> f = new ArrayList();
|
||||
|
||||
public Builder b(List<SharePhoto> list) {
|
||||
if (list != null) {
|
||||
Iterator<SharePhoto> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next());
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder c(List<SharePhoto> list) {
|
||||
this.f.clear();
|
||||
b(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(SharePhoto sharePhoto) {
|
||||
if (sharePhoto != null) {
|
||||
this.f.add(new SharePhoto.Builder().a(sharePhoto).a());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public SharePhotoContent a() {
|
||||
return new SharePhotoContent(this);
|
||||
}
|
||||
|
||||
public Builder a(SharePhotoContent sharePhotoContent) {
|
||||
if (sharePhotoContent == null) {
|
||||
return this;
|
||||
}
|
||||
super.a((Builder) sharePhotoContent);
|
||||
Builder builder = this;
|
||||
builder.b(sharePhotoContent.getPhotos());
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public List<SharePhoto> getPhotos() {
|
||||
return this.photos;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
SharePhoto.Builder.a(parcel, i, this.photos);
|
||||
}
|
||||
|
||||
private SharePhotoContent(Builder builder) {
|
||||
super(builder);
|
||||
this.photos = Collections.unmodifiableList(builder.f);
|
||||
}
|
||||
|
||||
SharePhotoContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.photos = Collections.unmodifiableList(SharePhoto.Builder.c(parcel));
|
||||
}
|
||||
}
|
81
sources/com/facebook/share/model/ShareVideo.java
Normal file
81
sources/com/facebook/share/model/ShareVideo.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareMedia;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareVideo extends ShareMedia {
|
||||
public static final Parcelable.Creator<ShareVideo> CREATOR = new Parcelable.Creator<ShareVideo>() { // from class: com.facebook.share.model.ShareVideo.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareVideo createFromParcel(Parcel parcel) {
|
||||
return new ShareVideo(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareVideo[] newArray(int i) {
|
||||
return new ShareVideo[i];
|
||||
}
|
||||
};
|
||||
private final Uri localUrl;
|
||||
|
||||
public static final class Builder extends ShareMedia.Builder<ShareVideo, Builder> {
|
||||
private Uri b;
|
||||
|
||||
Builder b(Parcel parcel) {
|
||||
return a((ShareVideo) parcel.readParcelable(ShareVideo.class.getClassLoader()));
|
||||
}
|
||||
|
||||
public Builder a(Uri uri) {
|
||||
this.b = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ShareVideo a() {
|
||||
return new ShareVideo(this);
|
||||
}
|
||||
|
||||
public Builder a(ShareVideo shareVideo) {
|
||||
if (shareVideo == null) {
|
||||
return this;
|
||||
}
|
||||
super.a((Builder) shareVideo);
|
||||
Builder builder = this;
|
||||
builder.a(shareVideo.getLocalUrl());
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Uri getLocalUrl() {
|
||||
return this.localUrl;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia
|
||||
public ShareMedia.Type getMediaType() {
|
||||
return ShareMedia.Type.VIDEO;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareMedia, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeParcelable(this.localUrl, 0);
|
||||
}
|
||||
|
||||
private ShareVideo(Builder builder) {
|
||||
super(builder);
|
||||
this.localUrl = builder.b;
|
||||
}
|
||||
|
||||
ShareVideo(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.localUrl = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
|
||||
}
|
||||
}
|
86
sources/com/facebook/share/model/ShareVideoContent.java
Normal file
86
sources/com/facebook/share/model/ShareVideoContent.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.facebook.share.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.facebook.share.model.ShareContent;
|
||||
import com.facebook.share.model.SharePhoto;
|
||||
import com.facebook.share.model.ShareVideo;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ShareVideoContent extends ShareContent<ShareVideoContent, Builder> implements ShareModel {
|
||||
public static final Parcelable.Creator<ShareVideoContent> CREATOR = new Parcelable.Creator<ShareVideoContent>() { // from class: com.facebook.share.model.ShareVideoContent.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareVideoContent createFromParcel(Parcel parcel) {
|
||||
return new ShareVideoContent(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ShareVideoContent[] newArray(int i) {
|
||||
return new ShareVideoContent[i];
|
||||
}
|
||||
};
|
||||
private final String contentDescription;
|
||||
private final String contentTitle;
|
||||
private final SharePhoto previewPhoto;
|
||||
private final ShareVideo video;
|
||||
|
||||
public static final class Builder extends ShareContent.Builder<ShareVideoContent, Builder> {
|
||||
private String f;
|
||||
private String g;
|
||||
private SharePhoto h;
|
||||
private ShareVideo i;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getContentDescription() {
|
||||
return this.contentDescription;
|
||||
}
|
||||
|
||||
public String getContentTitle() {
|
||||
return this.contentTitle;
|
||||
}
|
||||
|
||||
public SharePhoto getPreviewPhoto() {
|
||||
return this.previewPhoto;
|
||||
}
|
||||
|
||||
public ShareVideo getVideo() {
|
||||
return this.video;
|
||||
}
|
||||
|
||||
@Override // com.facebook.share.model.ShareContent, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeString(this.contentDescription);
|
||||
parcel.writeString(this.contentTitle);
|
||||
parcel.writeParcelable(this.previewPhoto, 0);
|
||||
parcel.writeParcelable(this.video, 0);
|
||||
}
|
||||
|
||||
private ShareVideoContent(Builder builder) {
|
||||
super(builder);
|
||||
this.contentDescription = builder.f;
|
||||
this.contentTitle = builder.g;
|
||||
this.previewPhoto = builder.h;
|
||||
this.video = builder.i;
|
||||
}
|
||||
|
||||
ShareVideoContent(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.contentDescription = parcel.readString();
|
||||
this.contentTitle = parcel.readString();
|
||||
SharePhoto.Builder b = new SharePhoto.Builder().b(parcel);
|
||||
if (b.c() == null && b.b() == null) {
|
||||
this.previewPhoto = null;
|
||||
} else {
|
||||
this.previewPhoto = b.a();
|
||||
}
|
||||
this.video = new ShareVideo.Builder().b(parcel).a();
|
||||
}
|
||||
}
|
@@ -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