Add Discord community version (64-bit only)

- Added realracing3-community.apk (71.57 MB)
- Removed 32-bit support (armeabi-v7a)
- Only includes arm64-v8a libraries
- Decompiled source code included
- Added README-community.md with analysis
This commit is contained in:
2026-02-18 15:48:36 -08:00
parent c19eb3d7ff
commit c080f0d97f
26930 changed files with 2529574 additions and 0 deletions

View File

@@ -0,0 +1,141 @@
package androidx.core.util;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/* loaded from: classes.dex */
public class AtomicFile {
private static final String LOG_TAG = "AtomicFile";
private final File mBaseName;
private final File mLegacyBackupName;
private final File mNewName;
@NonNull
public File getBaseFile() {
return this.mBaseName;
}
public AtomicFile(@NonNull File file) {
this.mBaseName = file;
this.mNewName = new File(file.getPath() + ".new");
this.mLegacyBackupName = new File(file.getPath() + ".bak");
}
public void delete() {
this.mBaseName.delete();
this.mNewName.delete();
this.mLegacyBackupName.delete();
}
@NonNull
public FileOutputStream startWrite() throws IOException {
if (this.mLegacyBackupName.exists()) {
rename(this.mLegacyBackupName, this.mBaseName);
}
try {
return new FileOutputStream(this.mNewName);
} catch (FileNotFoundException unused) {
if (!this.mNewName.getParentFile().mkdirs()) {
throw new IOException("Failed to create directory for " + this.mNewName);
}
try {
return new FileOutputStream(this.mNewName);
} catch (FileNotFoundException e) {
throw new IOException("Failed to create new file " + this.mNewName, e);
}
}
}
public void finishWrite(@Nullable FileOutputStream fileOutputStream) {
if (fileOutputStream == null) {
return;
}
if (!sync(fileOutputStream)) {
Log.e(LOG_TAG, "Failed to sync file output stream");
}
try {
fileOutputStream.close();
} catch (IOException e) {
Log.e(LOG_TAG, "Failed to close file output stream", e);
}
rename(this.mNewName, this.mBaseName);
}
public void failWrite(@Nullable FileOutputStream fileOutputStream) {
if (fileOutputStream == null) {
return;
}
if (!sync(fileOutputStream)) {
Log.e(LOG_TAG, "Failed to sync file output stream");
}
try {
fileOutputStream.close();
} catch (IOException e) {
Log.e(LOG_TAG, "Failed to close file output stream", e);
}
if (this.mNewName.delete()) {
return;
}
Log.e(LOG_TAG, "Failed to delete new file " + this.mNewName);
}
@NonNull
public FileInputStream openRead() throws FileNotFoundException {
if (this.mLegacyBackupName.exists()) {
rename(this.mLegacyBackupName, this.mBaseName);
}
if (this.mNewName.exists() && this.mBaseName.exists() && !this.mNewName.delete()) {
Log.e(LOG_TAG, "Failed to delete outdated new file " + this.mNewName);
}
return new FileInputStream(this.mBaseName);
}
@NonNull
public byte[] readFully() throws IOException {
FileInputStream openRead = openRead();
try {
byte[] bArr = new byte[openRead.available()];
int i = 0;
while (true) {
int read = openRead.read(bArr, i, bArr.length - i);
if (read <= 0) {
return bArr;
}
i += read;
int available = openRead.available();
if (available > bArr.length - i) {
byte[] bArr2 = new byte[available + i];
System.arraycopy(bArr, 0, bArr2, 0, i);
bArr = bArr2;
}
}
} finally {
openRead.close();
}
}
private static boolean sync(@NonNull FileOutputStream fileOutputStream) {
try {
fileOutputStream.getFD().sync();
return true;
} catch (IOException unused) {
return false;
}
}
private static void rename(@NonNull File file, @NonNull File file2) {
if (file2.isDirectory() && !file2.delete()) {
Log.e(LOG_TAG, "Failed to delete file which is a directory " + file2);
}
if (file.renameTo(file2)) {
return;
}
Log.e(LOG_TAG, "Failed to rename " + file + " to " + file2);
}
}