正在查看: 火箭TNT加速 v1.5.4 应用的 FilesProvider.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 火箭TNT加速 v1.5.4 应用的 FilesProvider.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.github.kr328.clash.service;
import android.content.Context;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.os.Build;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsProvider;
import com.facebook.react.uimanager.events.PointerEventHelper;
import com.github.kr328.clash.common.util.PatternsKt;
import com.github.kr328.clash.service.document.Document;
import com.github.kr328.clash.service.document.Flag;
import com.github.kr328.clash.service.document.Picker;
import java.util.Iterator;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
@Metadata(d1 = {"\u0000V\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 ,2\u00020\u0001:\u0001,B\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u000bH\u0016J\u001c\u0010\u0011\u001a\u00020\n2\b\u0010\u0012\u001a\u0004\u0018\u00010\u000b2\b\u0010\u0010\u001a\u0004\u0018\u00010\u000bH\u0016J\b\u0010\u0013\u001a\u00020\nH\u0016J&\u0010\u0014\u001a\u00020\u00152\b\u0010\u0010\u001a\u0004\u0018\u00010\u000b2\b\u0010\u0016\u001a\u0004\u0018\u00010\u000b2\b\u0010\u0017\u001a\u0004\u0018\u00010\u0018H\u0016J3\u0010\u0019\u001a\u00020\u001a2\b\u0010\u0012\u001a\u0004\u0018\u00010\u000b2\u0010\u0010\u001b\u001a\f\u0012\u0006\b\u0001\u0012\u00020\u000b\u0018\u00010\u001c2\b\u0010\u001d\u001a\u0004\u0018\u00010\u000bH\u0016¢\u0006\u0002\u0010\u001eJ)\u0010\u001f\u001a\u00020\u001a2\b\u0010\u0010\u001a\u0004\u0018\u00010\u000b2\u0010\u0010\u001b\u001a\f\u0012\u0006\b\u0001\u0012\u00020\u000b\u0018\u00010\u001cH\u0016¢\u0006\u0002\u0010 J\u001f\u0010!\u001a\u00020\u001a2\u0010\u0010\u001b\u001a\f\u0012\u0006\b\u0001\u0012\u00020\u000b\u0018\u00010\u001cH\u0016¢\u0006\u0002\u0010\"J\u001c\u0010#\u001a\u00020\u000b2\b\u0010\u0010\u001a\u0004\u0018\u00010\u000b2\b\u0010$\u001a\u0004\u0018\u00010\u000bH\u0016J'\u0010%\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u000b0\u001c2\u0010\u0010\u001b\u001a\f\u0012\u0006\b\u0001\u0012\u00020\u000b\u0018\u00010\u001cH\u0002¢\u0006\u0002\u0010&J\u001c\u0010'\u001a\u00060(R\u00020)*\u00060(R\u00020)2\u0006\u0010*\u001a\u00020+H\u0002R\u001b\u0010\u0003\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\u0005\u0010\u0006R\u0018\u0010\t\u001a\u00020\n*\u00020\u000b8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\r¨\u0006-"}, d2 = {"Lcom/github/kr328/clash/service/FilesProvider;", "Landroid/provider/DocumentsProvider;", "()V", "picker", "Lcom/github/kr328/clash/service/document/Picker;", "getPicker", "()Lcom/github/kr328/clash/service/document/Picker;", "picker$delegate", "Lkotlin/Lazy;", "requestWrite", PointerEventHelper.POINTER_TYPE_UNKNOWN, PointerEventHelper.POINTER_TYPE_UNKNOWN, "getRequestWrite", "(Ljava/lang/String;)Z", "deleteDocument", PointerEventHelper.POINTER_TYPE_UNKNOWN, "documentId", "isChildDocument", "parentDocumentId", "onCreate", "openDocument", "Landroid/os/ParcelFileDescriptor;", "mode", "signal", "Landroid/os/CancellationSignal;", "queryChildDocuments", "Landroid/database/Cursor;", "projection", PointerEventHelper.POINTER_TYPE_UNKNOWN, "sortOrder", "(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "queryDocument", "(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;", "queryRoots", "([Ljava/lang/String;)Landroid/database/Cursor;", "renameDocument", "displayName", "resolveDocumentProjection", "([Ljava/lang/String;)[Ljava/lang/String;", "applyDocument", "Landroid/database/MatrixCursor$RowBuilder;", "Landroid/database/MatrixCursor;", "document", "Lcom/github/kr328/clash/service/document/Document;", "Companion", "service_meta-alphaRelease"}, k = 1, mv = {1, 7, 1}, xi = 48)
public final class FilesProvider extends DocumentsProvider {
private static final String[] DEFAULT_DOCUMENT_COLUMNS = {"document_id", "_display_name", "mime_type", "last_modified", "_size", "flags"};
private static final String[] DEFAULT_ROOT_COLUMNS = {"root_id", "flags", "icon", "title", "summary", "document_id"};
private static final String DEFAULT_ROOT_ID = "0";
private static final int FLAG_VIRTUAL;
private final Lazy picker = LazyKt.lazy(new Function0<Picker>() {
{
super(0);
}
public final Picker m102invoke() {
Context context = FilesProvider.this.getContext();
Intrinsics.checkNotNull(context);
return new Picker(context);
}
});
@Metadata(k = 3, mv = {1, 7, 1}, xi = 48)
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[Flag.values().length];
iArr[Flag.Writable.ordinal()] = 1;
iArr[Flag.Deletable.ordinal()] = 2;
iArr[Flag.Virtual.ordinal()] = 3;
$EnumSwitchMapping$0 = iArr;
}
}
@Override
public boolean onCreate() {
return true;
}
static {
FLAG_VIRTUAL = Build.VERSION.SDK_INT >= 24 ? 512 : 0;
}
public final Picker getPicker() {
return (Picker) this.picker.getValue();
}
@Override
public ParcelFileDescriptor openDocument(String documentId, String mode, CancellationSignal signal) {
Object runBlocking$default = BuildersKt.runBlocking$default((CoroutineContext) null, new FilesProvider$openDocument$1(documentId, this, mode, ParcelFileDescriptor.parseMode(mode), null), 1, (Object) null);
Intrinsics.checkNotNullExpressionValue(runBlocking$default, "override fun openDocumen….file, m)\n }\n }");
return (ParcelFileDescriptor) runBlocking$default;
}
@Override
public void deleteDocument(String documentId) {
BuildersKt.runBlocking$default((CoroutineContext) null, new FilesProvider$deleteDocument$1(documentId == null ? "/" : documentId, documentId, this, null), 1, (Object) null);
}
@Override
public String renameDocument(String documentId, String displayName) {
String str = displayName == null ? PointerEventHelper.POINTER_TYPE_UNKNOWN : displayName;
if (!PatternsKt.getPatternFileName().matches(str)) {
throw new IllegalArgumentException("invalid name " + displayName);
}
return (String) BuildersKt.runBlocking$default((CoroutineContext) null, new FilesProvider$renameDocument$1(documentId, this, str, null), 1, (Object) null);
}
@Override
public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder) {
return (Cursor) BuildersKt.runBlocking$default((CoroutineContext) null, new FilesProvider$queryChildDocuments$1(parentDocumentId, this, projection, null), 1, (Object) null);
}
@Override
public Cursor queryDocument(String documentId, String[] projection) {
return (Cursor) BuildersKt.runBlocking$default((CoroutineContext) null, new FilesProvider$queryDocument$1(documentId, this, projection, null), 1, (Object) null);
}
@Override
public Cursor queryRoots(String[] projection) {
if (projection == null) {
projection = DEFAULT_ROOT_COLUMNS;
}
MatrixCursor matrixCursor = new MatrixCursor(projection);
MatrixCursor.RowBuilder newRow = matrixCursor.newRow();
newRow.add("root_id", DEFAULT_ROOT_ID);
newRow.add("flags", 18);
newRow.add("icon", Integer.valueOf(R.drawable.ic_logo_service));
Context context = getContext();
Intrinsics.checkNotNull(context);
newRow.add("title", context.getString(R.string.clash_meta_for_android));
Context context2 = getContext();
Intrinsics.checkNotNull(context2);
newRow.add("summary", context2.getString(R.string.profiles_and_providers));
newRow.add("document_id", "/");
newRow.add("mime_types", "vnd.android.document/directory");
return matrixCursor;
}
@Override
public boolean isChildDocument(String parentDocumentId, String documentId) {
if (parentDocumentId == null || documentId == null) {
return false;
}
return StringsKt.startsWith$default(documentId, parentDocumentId, false, 2, (Object) null);
}
public final MatrixCursor.RowBuilder applyDocument(MatrixCursor.RowBuilder rowBuilder, Document document) {
Iterator<T> it = document.getFlags().iterator();
int i = 0;
while (it.hasNext()) {
int i2 = WhenMappings.$EnumSwitchMapping$0[((Flag) it.next()).ordinal()];
if (i2 == 1) {
i |= 2;
} else if (i2 == 2) {
i |= 4;
} else {
if (i2 != 3) {
throw new NoWhenBranchMatchedException();
}
i |= FLAG_VIRTUAL;
}
}
rowBuilder.add("_display_name", document.getName());
rowBuilder.add("mime_type", document.getMimeType());
rowBuilder.add("last_modified", Long.valueOf(document.getUpdatedAt()));
rowBuilder.add("_size", Long.valueOf(document.getSize()));
rowBuilder.add("flags", Integer.valueOf(i));
return rowBuilder;
}
public final String[] resolveDocumentProjection(String[] projection) {
return projection == null ? DEFAULT_DOCUMENT_COLUMNS : projection;
}
public final boolean getRequestWrite(String str) {
return StringsKt.contains(str, "w", true);
}
}