Initial commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user