- 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
65 lines
2.6 KiB
Java
65 lines
2.6 KiB
Java
package com.firemint.realracing;
|
|
|
|
import android.content.Intent;
|
|
import android.os.ParcelFileDescriptor;
|
|
import androidx.documentfile.provider.DocumentFile;
|
|
import com.google.android.gms.drive.DriveFile;
|
|
import java.io.File;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class PendingImageToSave {
|
|
private int m_dataSize;
|
|
private String m_filename;
|
|
private int m_height;
|
|
private File m_picturesFolder;
|
|
private int[] m_pixelData;
|
|
private int m_width;
|
|
|
|
public PendingImageToSave(int[] iArr, int i, int i2, int i3, String str, File file) {
|
|
this.m_pixelData = iArr;
|
|
this.m_dataSize = i;
|
|
this.m_width = i2;
|
|
this.m_height = i3;
|
|
this.m_filename = str;
|
|
this.m_picturesFolder = file;
|
|
}
|
|
|
|
public String GetFileExtension() {
|
|
int length = this.m_filename.length();
|
|
return this.m_filename.substring(length - 3, length);
|
|
}
|
|
|
|
public boolean SaveImage(Intent intent) {
|
|
ParcelFileDescriptor open;
|
|
MainActivity mainActivity = MainActivity.instance;
|
|
String string = mainActivity.getString(R.string.screenshot_folder_name);
|
|
try {
|
|
if (MainActivity.IsBelowAPI(29)) {
|
|
if (MainActivity.IsAtLeastAPI(24)) {
|
|
DocumentFile fromTreeUri = DocumentFile.fromTreeUri(mainActivity, intent.getData());
|
|
DocumentFile findFile = fromTreeUri.findFile(string);
|
|
if (findFile == null) {
|
|
findFile = fromTreeUri.createDirectory(string);
|
|
}
|
|
open = mainActivity.getContentResolver().openFileDescriptor(findFile.createFile("image/" + GetFileExtension(), this.m_filename).getUri(), "w");
|
|
} else {
|
|
File file = new File(this.m_picturesFolder, string);
|
|
if (!file.exists()) {
|
|
file.mkdirs();
|
|
}
|
|
File file2 = new File(file, this.m_filename);
|
|
file2.createNewFile();
|
|
open = ParcelFileDescriptor.open(file2, DriveFile.MODE_WRITE_ONLY);
|
|
}
|
|
boolean saveToImageGalleryImpl = Platform.saveToImageGalleryImpl(this.m_pixelData, this.m_dataSize, this.m_width, this.m_height, this.m_filename, open.getFileDescriptor());
|
|
open.close();
|
|
return saveToImageGalleryImpl;
|
|
}
|
|
return Platform.saveToImageGalleryImpl(this.m_pixelData, this.m_dataSize, this.m_width, this.m_height, this.m_filename, null);
|
|
} catch (Exception e) {
|
|
MainActivity.loge("Error: " + e.toString());
|
|
return false;
|
|
}
|
|
}
|
|
}
|