76 lines
2.4 KiB
Java
76 lines
2.4 KiB
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.FileNotFoundException;
|
|
import java.util.UUID;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FacebookContentProvider extends ContentProvider {
|
|
private static final String a = FacebookContentProvider.class.getName();
|
|
|
|
public static String a(String str, UUID uuid, String str2) {
|
|
return String.format("%s%s/%s/%s", "content://com.facebook.app.FacebookContentProvider", str, uuid.toString(), str2);
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public int delete(Uri uri, String str, String[] strArr) {
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public String getType(Uri uri) {
|
|
return null;
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public Uri insert(Uri uri, ContentValues contentValues) {
|
|
return null;
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public boolean onCreate() {
|
|
return true;
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public ParcelFileDescriptor openFile(Uri uri, String str) throws FileNotFoundException {
|
|
Pair<UUID, String> a2 = a(uri);
|
|
if (a2 == null) {
|
|
throw new FileNotFoundException();
|
|
}
|
|
try {
|
|
return ParcelFileDescriptor.open(NativeAppCallAttachmentStore.a((UUID) a2.first, (String) a2.second), 268435456);
|
|
} catch (FileNotFoundException e) {
|
|
Log.e(a, "Got unexpected exception:" + e);
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
|
|
return null;
|
|
}
|
|
|
|
@Override // android.content.ContentProvider
|
|
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
|
|
return 0;
|
|
}
|
|
|
|
Pair<UUID, String> a(Uri uri) {
|
|
try {
|
|
String[] split = uri.getPath().substring(1).split("/");
|
|
String str = split[0];
|
|
return new Pair<>(UUID.fromString(str), split[1]);
|
|
} catch (Exception unused) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|