正在查看: Hopscotch v9.7.2 应用的 FacebookContentProvider.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 FacebookContentProvider.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.facebook;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import android.util.Pair;
import com.facebook.internal.NativeAppCallAttachmentStore;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
@Metadata
public final class FacebookContentProvider extends ContentProvider {
@NotNull
private static final String ATTACHMENT_URL_BASE = "content://com.facebook.app.FacebookContentProvider";
@NotNull
private static final String INVALID_FILE_NAME = "..";
@NotNull
public static final Companion Companion = new Companion(null);
private static final String TAG = FacebookContentProvider.class.getName();
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@NotNull
public final String getAttachmentUrl(String str, @NotNull UUID uuid, String str2) {
Intrinsics.checkNotNullParameter(uuid, "callId");
StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
return android.support.v4.media.d.h(new Object[]{FacebookContentProvider.ATTACHMENT_URL_BASE, str, uuid.toString(), str2}, 4, "%s%s/%s/%s", "java.lang.String.format(format, *args)");
}
private Companion() {
}
}
@NotNull
public static final String getAttachmentUrl(String str, @NotNull UUID uuid, String str2) {
return Companion.getAttachmentUrl(str, uuid, str2);
}
private final Pair<UUID, String> parseCallIdAndAttachmentName(Uri uri) {
try {
String path = uri.getPath();
if (path == null) {
throw new IllegalStateException("Required value was null.".toString());
}
String substring = path.substring(1);
Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.String).substring(startIndex)");
Object[] array = StringsKt.U(substring, new String[]{"/"}, 0, 6).toArray(new String[0]);
if (array == null) {
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
}
String[] strArr = (String[]) array;
String str = strArr[0];
String str2 = strArr[1];
if (INVALID_FILE_NAME.contentEquals(str) || INVALID_FILE_NAME.contentEquals(str2)) {
throw new Exception();
}
return new Pair<>(UUID.fromString(str), str2);
} catch (Exception unused) {
return null;
}
}
@Override
public int delete(@NotNull Uri uri, String str, String[] strArr) {
Intrinsics.checkNotNullParameter(uri, "uri");
return 0;
}
@Override
public String getType(@NotNull Uri uri) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override
public Uri insert(@NotNull Uri uri, ContentValues contentValues) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override
public boolean onCreate() {
return true;
}
@Override
public ParcelFileDescriptor openFile(@NotNull Uri uri, @NotNull String str) throws FileNotFoundException {
Intrinsics.checkNotNullParameter(uri, "uri");
Intrinsics.checkNotNullParameter(str, "mode");
Pair<UUID, String> parseCallIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
if (parseCallIdAndAttachmentName == null) {
throw new FileNotFoundException();
}
try {
NativeAppCallAttachmentStore nativeAppCallAttachmentStore = NativeAppCallAttachmentStore.INSTANCE;
File openAttachment = NativeAppCallAttachmentStore.openAttachment((UUID) parseCallIdAndAttachmentName.first, (String) parseCallIdAndAttachmentName.second);
if (openAttachment != null) {
return ParcelFileDescriptor.open(openAttachment, 268435456);
}
throw new FileNotFoundException();
} catch (FileNotFoundException e) {
Log.e(TAG, Intrinsics.stringPlus("Got unexpected exception:", e));
throw e;
}
}
@Override
public Cursor query(@NotNull Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
Intrinsics.checkNotNullParameter(uri, "uri");
return null;
}
@Override
public int update(@NotNull Uri uri, ContentValues contentValues, String str, String[] strArr) {
Intrinsics.checkNotNullParameter(uri, "uri");
return 0;
}
}