Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class AccessDeniedException extends FileSystemException {
public /* synthetic */ AccessDeniedException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public AccessDeniedException(File file, File file2, String str) {
super(file, file2, str);
Intrinsics.checkNotNullParameter(file, "file");
}
}

View File

@@ -0,0 +1,22 @@
package kotlin.io;
import java.io.InputStream;
import java.io.OutputStream;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public abstract class ByteStreamsKt {
public static final long copyTo(InputStream inputStream, OutputStream out, int i) {
Intrinsics.checkNotNullParameter(inputStream, "<this>");
Intrinsics.checkNotNullParameter(out, "out");
byte[] bArr = new byte[i];
int read = inputStream.read(bArr);
long j = 0;
while (read >= 0) {
out.write(bArr, 0, read);
j += read;
read = inputStream.read(bArr);
}
return j;
}
}

View File

@@ -0,0 +1,21 @@
package kotlin.io;
import java.io.Closeable;
import kotlin.ExceptionsKt__ExceptionsKt;
/* loaded from: classes5.dex */
public abstract class CloseableKt {
public static final void closeFinally(Closeable closeable, Throwable th) {
if (closeable != null) {
if (th == null) {
closeable.close();
return;
}
try {
closeable.close();
} catch (Throwable th2) {
ExceptionsKt__ExceptionsKt.addSuppressed(th, th2);
}
}
}
}

View File

@@ -0,0 +1,20 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public abstract class ExceptionsKt {
public static final String constructMessage(File file, File file2, String str) {
StringBuilder sb = new StringBuilder(file.toString());
if (file2 != null) {
sb.append(" -> " + file2);
}
if (str != null) {
sb.append(": " + str);
}
String sb2 = sb.toString();
Intrinsics.checkNotNullExpressionValue(sb2, "toString(...)");
return sb2;
}
}

View File

@@ -0,0 +1,13 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class FileAlreadyExistsException extends FileSystemException {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public FileAlreadyExistsException(File file, File file2, String str) {
super(file, file2, str);
Intrinsics.checkNotNullParameter(file, "file");
}
}

View File

@@ -0,0 +1,31 @@
package kotlin.io;
import java.io.File;
import java.io.IOException;
/* loaded from: classes5.dex */
public class FileSystemException extends IOException {
public final File file;
public final File other;
public final String reason;
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public FileSystemException(java.io.File r2, java.io.File r3, java.lang.String r4) {
/*
r1 = this;
java.lang.String r0 = "file"
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r2, r0)
java.lang.String r0 = kotlin.io.ExceptionsKt.access$constructMessage(r2, r3, r4)
r1.<init>(r0)
r1.file = r2
r1.other = r3
r1.reason = r4
return
*/
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.FileSystemException.<init>(java.io.File, java.io.File, java.lang.String):void");
}
}

View File

@@ -0,0 +1,329 @@
package kotlin.io;
import java.io.File;
import java.util.ArrayDeque;
import java.util.Iterator;
import kotlin.NoWhenBranchMatchedException;
import kotlin.collections.AbstractIterator;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
/* loaded from: classes5.dex */
public final class FileTreeWalk implements Sequence {
public final FileWalkDirection direction;
public final int maxDepth;
public final Function1 onEnter;
public final Function2 onFail;
public final Function1 onLeave;
public final File start;
public FileTreeWalk(File file, FileWalkDirection fileWalkDirection, Function1 function1, Function1 function12, Function2 function2, int i) {
this.start = file;
this.direction = fileWalkDirection;
this.onEnter = function1;
this.onLeave = function12;
this.onFail = function2;
this.maxDepth = i;
}
public /* synthetic */ FileTreeWalk(File file, FileWalkDirection fileWalkDirection, Function1 function1, Function1 function12, Function2 function2, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
this(file, (i2 & 2) != 0 ? FileWalkDirection.TOP_DOWN : fileWalkDirection, function1, function12, function2, (i2 & 32) != 0 ? Integer.MAX_VALUE : i);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public FileTreeWalk(File start, FileWalkDirection direction) {
this(start, direction, null, null, null, 0, 32, null);
Intrinsics.checkNotNullParameter(start, "start");
Intrinsics.checkNotNullParameter(direction, "direction");
}
@Override // kotlin.sequences.Sequence
public Iterator iterator() {
return new FileTreeWalkIterator();
}
public static abstract class WalkState {
public final File root;
public final File getRoot() {
return this.root;
}
public abstract File step();
public WalkState(File root) {
Intrinsics.checkNotNullParameter(root, "root");
this.root = root;
}
}
public static abstract class DirectoryState extends WalkState {
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public DirectoryState(File rootDir) {
super(rootDir);
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
}
}
public final class FileTreeWalkIterator extends AbstractIterator {
public final ArrayDeque state;
public /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[FileWalkDirection.values().length];
try {
iArr[FileWalkDirection.TOP_DOWN.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[FileWalkDirection.BOTTOM_UP.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
$EnumSwitchMapping$0 = iArr;
}
}
public FileTreeWalkIterator() {
ArrayDeque arrayDeque = new ArrayDeque();
this.state = arrayDeque;
if (FileTreeWalk.this.start.isDirectory()) {
arrayDeque.push(directoryState(FileTreeWalk.this.start));
} else if (FileTreeWalk.this.start.isFile()) {
arrayDeque.push(new SingleFileState(this, FileTreeWalk.this.start));
} else {
done();
}
}
@Override // kotlin.collections.AbstractIterator
public void computeNext() {
File gotoNext = gotoNext();
if (gotoNext != null) {
setNext(gotoNext);
} else {
done();
}
}
public final DirectoryState directoryState(File file) {
int i = WhenMappings.$EnumSwitchMapping$0[FileTreeWalk.this.direction.ordinal()];
if (i == 1) {
return new TopDownDirectoryState(this, file);
}
if (i == 2) {
return new BottomUpDirectoryState(this, file);
}
throw new NoWhenBranchMatchedException();
}
public final File gotoNext() {
File step;
while (true) {
WalkState walkState = (WalkState) this.state.peek();
if (walkState == null) {
return null;
}
step = walkState.step();
if (step == null) {
this.state.pop();
} else {
if (Intrinsics.areEqual(step, walkState.getRoot()) || !step.isDirectory() || this.state.size() >= FileTreeWalk.this.maxDepth) {
break;
}
this.state.push(directoryState(step));
}
}
return step;
}
public final class BottomUpDirectoryState extends DirectoryState {
public boolean failed;
public int fileIndex;
public File[] fileList;
public boolean rootVisited;
public final /* synthetic */ FileTreeWalkIterator this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public BottomUpDirectoryState(FileTreeWalkIterator fileTreeWalkIterator, File rootDir) {
super(rootDir);
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
this.this$0 = fileTreeWalkIterator;
}
@Override // kotlin.io.FileTreeWalk.WalkState
public File step() {
if (!this.failed && this.fileList == null) {
Function1 function1 = FileTreeWalk.this.onEnter;
if (function1 != null && !((Boolean) function1.invoke(getRoot())).booleanValue()) {
return null;
}
File[] listFiles = getRoot().listFiles();
this.fileList = listFiles;
if (listFiles == null) {
Function2 function2 = FileTreeWalk.this.onFail;
if (function2 != null) {
function2.invoke(getRoot(), new AccessDeniedException(getRoot(), null, "Cannot list files in a directory", 2, null));
}
this.failed = true;
}
}
File[] fileArr = this.fileList;
if (fileArr != null) {
int i = this.fileIndex;
Intrinsics.checkNotNull(fileArr);
if (i < fileArr.length) {
File[] fileArr2 = this.fileList;
Intrinsics.checkNotNull(fileArr2);
int i2 = this.fileIndex;
this.fileIndex = i2 + 1;
return fileArr2[i2];
}
}
if (this.rootVisited) {
Function1 function12 = FileTreeWalk.this.onLeave;
if (function12 != null) {
function12.invoke(getRoot());
}
return null;
}
this.rootVisited = true;
return getRoot();
}
}
public final class TopDownDirectoryState extends DirectoryState {
public int fileIndex;
public File[] fileList;
public boolean rootVisited;
public final /* synthetic */ FileTreeWalkIterator this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public TopDownDirectoryState(FileTreeWalkIterator fileTreeWalkIterator, File rootDir) {
super(rootDir);
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
this.this$0 = fileTreeWalkIterator;
}
/* JADX WARN: Code restructure failed: missing block: B:29:0x007f, code lost:
if (r0.length == 0) goto L31;
*/
@Override // kotlin.io.FileTreeWalk.WalkState
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public java.io.File step() {
/*
r10 = this;
boolean r0 = r10.rootVisited
r1 = 0
if (r0 != 0) goto L28
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnEnter$p(r0)
if (r0 == 0) goto L20
java.io.File r2 = r10.getRoot()
java.lang.Object r0 = r0.invoke(r2)
java.lang.Boolean r0 = (java.lang.Boolean) r0
boolean r0 = r0.booleanValue()
if (r0 != 0) goto L20
return r1
L20:
r0 = 1
r10.rootVisited = r0
java.io.File r0 = r10.getRoot()
return r0
L28:
java.io.File[] r0 = r10.fileList
if (r0 == 0) goto L47
int r2 = r10.fileIndex
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
int r0 = r0.length
if (r2 >= r0) goto L35
goto L47
L35:
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnLeave$p(r0)
if (r0 == 0) goto L46
java.io.File r2 = r10.getRoot()
r0.invoke(r2)
L46:
return r1
L47:
java.io.File[] r0 = r10.fileList
if (r0 != 0) goto L93
java.io.File r0 = r10.getRoot()
java.io.File[] r0 = r0.listFiles()
r10.fileList = r0
if (r0 != 0) goto L77
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
kotlin.jvm.functions.Function2 r0 = kotlin.io.FileTreeWalk.access$getOnFail$p(r0)
if (r0 == 0) goto L77
java.io.File r2 = r10.getRoot()
kotlin.io.AccessDeniedException r9 = new kotlin.io.AccessDeniedException
java.io.File r4 = r10.getRoot()
r5 = 0
java.lang.String r6 = "Cannot list files in a directory"
r7 = 2
r8 = 0
r3 = r9
r3.<init>(r4, r5, r6, r7, r8)
r0.invoke(r2, r9)
L77:
java.io.File[] r0 = r10.fileList
if (r0 == 0) goto L81
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
int r0 = r0.length
if (r0 != 0) goto L93
L81:
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnLeave$p(r0)
if (r0 == 0) goto L92
java.io.File r2 = r10.getRoot()
r0.invoke(r2)
L92:
return r1
L93:
java.io.File[] r0 = r10.fileList
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
int r1 = r10.fileIndex
int r2 = r1 + 1
r10.fileIndex = r2
r0 = r0[r1]
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.FileTreeWalk.FileTreeWalkIterator.TopDownDirectoryState.step():java.io.File");
}
}
public final class SingleFileState extends WalkState {
public final /* synthetic */ FileTreeWalkIterator this$0;
public boolean visited;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public SingleFileState(FileTreeWalkIterator fileTreeWalkIterator, File rootFile) {
super(rootFile);
Intrinsics.checkNotNullParameter(rootFile, "rootFile");
this.this$0 = fileTreeWalkIterator;
}
@Override // kotlin.io.FileTreeWalk.WalkState
public File step() {
if (this.visited) {
return null;
}
this.visited = true;
return getRoot();
}
}
}
}

View File

@@ -0,0 +1,39 @@
package kotlin.io;
import kotlin.enums.EnumEntries;
import kotlin.enums.EnumEntriesKt;
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* JADX WARN: Unknown enum class pattern. Please report as an issue! */
/* loaded from: classes5.dex */
public final class FileWalkDirection {
private static final /* synthetic */ EnumEntries $ENTRIES;
private static final /* synthetic */ FileWalkDirection[] $VALUES;
public static final FileWalkDirection TOP_DOWN = new FileWalkDirection("TOP_DOWN", 0);
public static final FileWalkDirection BOTTOM_UP = new FileWalkDirection("BOTTOM_UP", 1);
private static final /* synthetic */ FileWalkDirection[] $values() {
return new FileWalkDirection[]{TOP_DOWN, BOTTOM_UP};
}
public static EnumEntries getEntries() {
return $ENTRIES;
}
public static FileWalkDirection valueOf(String str) {
return (FileWalkDirection) Enum.valueOf(FileWalkDirection.class, str);
}
public static FileWalkDirection[] values() {
return (FileWalkDirection[]) $VALUES.clone();
}
private FileWalkDirection(String str, int i) {
}
static {
FileWalkDirection[] $values = $values();
$VALUES = $values;
$ENTRIES = EnumEntriesKt.enumEntries($values);
}
}

View File

@@ -0,0 +1,5 @@
package kotlin.io;
/* loaded from: classes5.dex */
public abstract class FilesKt extends FilesKt__UtilsKt {
}

View File

@@ -0,0 +1,39 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsKt;
/* loaded from: classes5.dex */
public abstract class FilesKt__FilePathComponentsKt {
public static final int getRootLength$FilesKt__FilePathComponentsKt(String str) {
boolean endsWith$default;
int indexOf$default;
char c = File.separatorChar;
int indexOf$default2 = StringsKt__StringsKt.indexOf$default((CharSequence) str, c, 0, false, 4, (Object) null);
if (indexOf$default2 == 0) {
if (str.length() <= 1 || str.charAt(1) != c || (indexOf$default = StringsKt__StringsKt.indexOf$default((CharSequence) str, c, 2, false, 4, (Object) null)) < 0) {
return 1;
}
int indexOf$default3 = StringsKt__StringsKt.indexOf$default((CharSequence) str, c, indexOf$default + 1, false, 4, (Object) null);
return indexOf$default3 >= 0 ? indexOf$default3 + 1 : str.length();
}
if (indexOf$default2 > 0 && str.charAt(indexOf$default2 - 1) == ':') {
return indexOf$default2 + 1;
}
if (indexOf$default2 == -1) {
endsWith$default = StringsKt__StringsKt.endsWith$default((CharSequence) str, ':', false, 2, (Object) null);
if (endsWith$default) {
return str.length();
}
}
return 0;
}
public static final boolean isRooted(File file) {
Intrinsics.checkNotNullParameter(file, "<this>");
String path = file.getPath();
Intrinsics.checkNotNullExpressionValue(path, "getPath(...)");
return getRootLength$FilesKt__FilePathComponentsKt(path) > 0;
}
}

View File

@@ -0,0 +1,95 @@
package kotlin.io;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
/* loaded from: classes5.dex */
public abstract class FilesKt__FileReadWriteKt extends FilesKt__FilePathComponentsKt {
public static final void writeBytes(File file, byte[] array) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(array, "array");
FileOutputStream fileOutputStream = new FileOutputStream(file);
try {
fileOutputStream.write(array);
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(fileOutputStream, null);
} finally {
}
}
public static final String readText(File file, Charset charset) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(charset, "charset");
InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
try {
String readText = TextStreamsKt.readText(inputStreamReader);
CloseableKt.closeFinally(inputStreamReader, null);
return readText;
} finally {
}
}
public static /* synthetic */ String readText$default(File file, Charset charset, int i, Object obj) {
if ((i & 1) != 0) {
charset = Charsets.UTF_8;
}
return readText(file, charset);
}
public static void writeText(File file, String text, Charset charset) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(text, "text");
Intrinsics.checkNotNullParameter(charset, "charset");
byte[] bytes = text.getBytes(charset);
Intrinsics.checkNotNullExpressionValue(bytes, "getBytes(...)");
writeBytes(file, bytes);
}
public static final void forEachLine(File file, Charset charset, Function1 action) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(charset, "charset");
Intrinsics.checkNotNullParameter(action, "action");
TextStreamsKt.forEachLine(new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)), action);
}
public static /* synthetic */ List readLines$default(File file, Charset charset, int i, Object obj) {
if ((i & 1) != 0) {
charset = Charsets.UTF_8;
}
return readLines(file, charset);
}
public static final List readLines(File file, Charset charset) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(charset, "charset");
final ArrayList arrayList = new ArrayList();
forEachLine(file, charset, new Function1() { // from class: kotlin.io.FilesKt__FileReadWriteKt$readLines$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
invoke((String) obj);
return Unit.INSTANCE;
}
public final void invoke(String it) {
Intrinsics.checkNotNullParameter(it, "it");
arrayList.add(it);
}
});
return arrayList;
}
}

View File

@@ -0,0 +1,18 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public abstract class FilesKt__FileTreeWalkKt extends FilesKt__FileReadWriteKt {
public static final FileTreeWalk walk(File file, FileWalkDirection direction) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(direction, "direction");
return new FileTreeWalk(file, direction);
}
public static final FileTreeWalk walkBottomUp(File file) {
Intrinsics.checkNotNullParameter(file, "<this>");
return walk(file, FileWalkDirection.BOTTOM_UP);
}
}

View File

@@ -0,0 +1,106 @@
package kotlin.io;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsKt;
/* loaded from: classes5.dex */
public abstract class FilesKt__UtilsKt extends FilesKt__FileTreeWalkKt {
public static String getExtension(File file) {
Intrinsics.checkNotNullParameter(file, "<this>");
String name = file.getName();
Intrinsics.checkNotNullExpressionValue(name, "getName(...)");
return StringsKt__StringsKt.substringAfterLast(name, '.', "");
}
public static /* synthetic */ File copyTo$default(File file, File file2, boolean z, int i, int i2, Object obj) {
if ((i2 & 2) != 0) {
z = false;
}
if ((i2 & 4) != 0) {
i = 8192;
}
return copyTo(file, file2, z, i);
}
public static final File copyTo(File file, File target, boolean z, int i) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
if (!file.exists()) {
throw new NoSuchFileException(file, null, "The source file doesn't exist.", 2, null);
}
if (target.exists()) {
if (!z) {
throw new FileAlreadyExistsException(file, target, "The destination file already exists.");
}
if (!target.delete()) {
throw new FileAlreadyExistsException(file, target, "Tried to overwrite the destination, but failed to delete it.");
}
}
if (file.isDirectory()) {
if (!target.mkdirs()) {
throw new FileSystemException(file, target, "Failed to create target directory.");
}
} else {
File parentFile = target.getParentFile();
if (parentFile != null) {
parentFile.mkdirs();
}
FileInputStream fileInputStream = new FileInputStream(file);
try {
FileOutputStream fileOutputStream = new FileOutputStream(target);
try {
ByteStreamsKt.copyTo(fileInputStream, fileOutputStream, i);
CloseableKt.closeFinally(fileOutputStream, null);
CloseableKt.closeFinally(fileInputStream, null);
} finally {
}
} finally {
}
}
return target;
}
public static boolean deleteRecursively(File file) {
Intrinsics.checkNotNullParameter(file, "<this>");
while (true) {
boolean z = true;
for (File file2 : FilesKt__FileTreeWalkKt.walkBottomUp(file)) {
if (file2.delete() || !file2.exists()) {
if (z) {
break;
}
}
z = false;
}
return z;
}
}
public static final File resolve(File file, File relative) {
boolean endsWith$default;
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(relative, "relative");
if (FilesKt__FilePathComponentsKt.isRooted(relative)) {
return relative;
}
String file2 = file.toString();
Intrinsics.checkNotNullExpressionValue(file2, "toString(...)");
if (file2.length() != 0) {
char c = File.separatorChar;
endsWith$default = StringsKt__StringsKt.endsWith$default((CharSequence) file2, c, false, 2, (Object) null);
if (!endsWith$default) {
return new File(file2 + c + relative);
}
}
return new File(file2 + relative);
}
public static File resolve(File file, String relative) {
Intrinsics.checkNotNullParameter(file, "<this>");
Intrinsics.checkNotNullParameter(relative, "relative");
return resolve(file, new File(relative));
}
}

View File

@@ -0,0 +1,48 @@
package kotlin.io;
import java.io.BufferedReader;
import java.util.Iterator;
import java.util.NoSuchElementException;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMappedMarker;
/* loaded from: classes5.dex */
public final class LinesSequence$iterator$1 implements Iterator, KMappedMarker {
public boolean done;
public String nextValue;
public final /* synthetic */ LinesSequence this$0;
@Override // java.util.Iterator
public void remove() {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
public LinesSequence$iterator$1(LinesSequence linesSequence) {
this.this$0 = linesSequence;
}
@Override // java.util.Iterator
public boolean hasNext() {
BufferedReader bufferedReader;
if (this.nextValue == null && !this.done) {
bufferedReader = this.this$0.reader;
String readLine = bufferedReader.readLine();
this.nextValue = readLine;
if (readLine == null) {
this.done = true;
}
}
return this.nextValue != null;
}
@Override // java.util.Iterator
public String next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
String str = this.nextValue;
this.nextValue = null;
Intrinsics.checkNotNull(str);
return str;
}
}

View File

@@ -0,0 +1,21 @@
package kotlin.io;
import java.io.BufferedReader;
import java.util.Iterator;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
/* loaded from: classes5.dex */
public final class LinesSequence implements Sequence {
public final BufferedReader reader;
public LinesSequence(BufferedReader reader) {
Intrinsics.checkNotNullParameter(reader, "reader");
this.reader = reader;
}
@Override // kotlin.sequences.Sequence
public Iterator iterator() {
return new LinesSequence$iterator$1(this);
}
}

View File

@@ -0,0 +1,18 @@
package kotlin.io;
import java.io.File;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes5.dex */
public final class NoSuchFileException extends FileSystemException {
public /* synthetic */ NoSuchFileException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public NoSuchFileException(File file, File file2, String str) {
super(file, file2, str);
Intrinsics.checkNotNullParameter(file, "file");
}
}

View File

@@ -0,0 +1,67 @@
package kotlin.io;
import java.io.BufferedReader;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Iterator;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt__SequencesKt;
/* loaded from: classes5.dex */
public abstract class TextStreamsKt {
public static final void forEachLine(Reader reader, Function1 action) {
Intrinsics.checkNotNullParameter(reader, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
BufferedReader bufferedReader = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader, 8192);
try {
Iterator it = lineSequence(bufferedReader).iterator();
while (it.hasNext()) {
action.invoke(it.next());
}
Unit unit = Unit.INSTANCE;
CloseableKt.closeFinally(bufferedReader, null);
} finally {
}
}
public static final Sequence lineSequence(BufferedReader bufferedReader) {
Sequence constrainOnce;
Intrinsics.checkNotNullParameter(bufferedReader, "<this>");
constrainOnce = SequencesKt__SequencesKt.constrainOnce(new LinesSequence(bufferedReader));
return constrainOnce;
}
public static final String readText(Reader reader) {
Intrinsics.checkNotNullParameter(reader, "<this>");
StringWriter stringWriter = new StringWriter();
copyTo$default(reader, stringWriter, 0, 2, null);
String stringWriter2 = stringWriter.toString();
Intrinsics.checkNotNullExpressionValue(stringWriter2, "toString(...)");
return stringWriter2;
}
public static /* synthetic */ long copyTo$default(Reader reader, Writer writer, int i, int i2, Object obj) {
if ((i2 & 2) != 0) {
i = 8192;
}
return copyTo(reader, writer, i);
}
public static final long copyTo(Reader reader, Writer out, int i) {
Intrinsics.checkNotNullParameter(reader, "<this>");
Intrinsics.checkNotNullParameter(out, "out");
char[] cArr = new char[i];
int read = reader.read(cArr);
long j = 0;
while (read >= 0) {
out.write(cArr, 0, read);
j += read;
read = reader.read(cArr);
}
return j;
}
}