CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 u.java 源代码,内容仅作参考
package i.h.f0.c;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import com.facebook.FacebookException;
import com.facebook.share.model.ShareMedia;
import com.facebook.share.model.ShareMediaContent;
import com.facebook.share.model.ShareOpenGraphValueContainer;
import com.facebook.share.model.SharePhoto;
import com.facebook.share.model.ShareStoryContent;
import com.facebook.share.model.ShareVideo;
import com.facebook.share.model.ShareVideoContent;
import i.h.b0.f0;
import i.h.b0.h0;
import java.util.List;
import java.util.Locale;
public class u {
public boolean a = false;
public u(s sVar) {
}
public void a(ShareMedia shareMedia) {
if (shareMedia instanceof SharePhoto) {
d((SharePhoto) shareMedia);
} else if (shareMedia instanceof ShareVideo) {
f((ShareVideo) shareMedia);
} else {
throw new FacebookException(String.format(Locale.ROOT, "Invalid media type: %s", shareMedia.getClass().getSimpleName()));
}
}
public void b(ShareMediaContent shareMediaContent) {
List<ShareMedia> media = shareMediaContent.getMedia();
if (media != null && !media.isEmpty()) {
if (media.size() <= 6) {
for (ShareMedia shareMedia : media) {
a(shareMedia);
}
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 void c(ShareOpenGraphValueContainer shareOpenGraphValueContainer, boolean z) {
for (String str : shareOpenGraphValueContainer.keySet()) {
if (z) {
String[] split = str.split(":");
if (split.length < 2) {
throw new FacebookException("Open Graph keys must be namespaced: %s", str);
}
for (String str2 : split) {
if (str2.isEmpty()) {
throw new FacebookException("Invalid key found in Open Graph dictionary: %s", str);
}
}
}
Object obj = shareOpenGraphValueContainer.get(str);
if (obj instanceof List) {
for (Object obj2 : (List) obj) {
if (obj2 != null) {
i.c.a.c.y.f1(obj2, this);
} else {
throw new FacebookException("Cannot put null objects in Lists in ShareOpenGraphObjects and ShareOpenGraphActions");
}
}
continue;
} else {
i.c.a.c.y.f1(obj, this);
}
}
}
public void d(SharePhoto sharePhoto) {
i.c.a.c.y.g1(sharePhoto);
Bitmap bitmap = sharePhoto.getBitmap();
Uri imageUrl = sharePhoto.getImageUrl();
if (bitmap == null && f0.H(imageUrl) && !this.a) {
throw new FacebookException("Cannot set the ImageUrl of a SharePhoto to the Uri of an image on the web when sharing SharePhotoContent");
}
if (sharePhoto.getBitmap() == null && f0.H(sharePhoto.getImageUrl())) {
return;
}
Context b = i.h.i.b();
n.i.b.h.e(b, "context");
h0.h(b, "context");
String c = i.h.i.c();
PackageManager packageManager = b.getPackageManager();
if (packageManager != null) {
String r2 = i.a.b.a.a.r("com.facebook.app.FacebookContentProvider", c);
if (packageManager.resolveContentProvider(r2, 0) == null) {
throw new IllegalStateException(i.a.b.a.a.F(new Object[]{r2}, 1, "A ContentProvider for this app was not set up in the AndroidManifest.xml, please add %s as a provider to your AndroidManifest.xml file. See https://developers.facebook.com/docs/sharing/android for more info.", "java.lang.String.format(format, *args)").toString());
}
}
}
public void e(ShareStoryContent shareStoryContent) {
i.c.a.c.y.b(shareStoryContent, this);
}
public void f(ShareVideo shareVideo) {
if (shareVideo != null) {
Uri localUrl = shareVideo.getLocalUrl();
if (localUrl != null) {
if (!f0.C(localUrl) && !f0.E(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");
}
public void g(ShareVideoContent shareVideoContent) {
f(shareVideoContent.getVideo());
SharePhoto previewPhoto = shareVideoContent.getPreviewPhoto();
if (previewPhoto != null) {
d(previewPhoto);
}
}
}