- 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
58 lines
1.7 KiB
Java
58 lines
1.7 KiB
Java
package androidx.profileinstaller;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
import androidx.profileinstaller.ProfileInstallReceiver;
|
|
import java.io.File;
|
|
|
|
/* loaded from: classes.dex */
|
|
class BenchmarkOperation {
|
|
private BenchmarkOperation() {
|
|
}
|
|
|
|
public static void dropShaderCache(@NonNull Context context, @NonNull ProfileInstallReceiver.ResultDiagnostics resultDiagnostics) {
|
|
if (deleteFilesRecursively(Api24ContextHelper.getDeviceProtectedCodeCacheDir(context))) {
|
|
resultDiagnostics.onResultReceived(14, null);
|
|
} else {
|
|
resultDiagnostics.onResultReceived(15, null);
|
|
}
|
|
}
|
|
|
|
public static boolean deleteFilesRecursively(File file) {
|
|
if (file.isDirectory()) {
|
|
File[] listFiles = file.listFiles();
|
|
if (listFiles == null) {
|
|
return false;
|
|
}
|
|
boolean z = true;
|
|
for (File file2 : listFiles) {
|
|
z = deleteFilesRecursively(file2) && z;
|
|
}
|
|
return z;
|
|
}
|
|
file.delete();
|
|
return true;
|
|
}
|
|
|
|
@RequiresApi(api = 21)
|
|
public static class Api21ContextHelper {
|
|
private Api21ContextHelper() {
|
|
}
|
|
|
|
public static File getCodeCacheDir(Context context) {
|
|
return context.getCodeCacheDir();
|
|
}
|
|
}
|
|
|
|
@RequiresApi(api = 24)
|
|
public static class Api24ContextHelper {
|
|
private Api24ContextHelper() {
|
|
}
|
|
|
|
public static File getDeviceProtectedCodeCacheDir(Context context) {
|
|
return context.createDeviceProtectedStorageContext().getCodeCacheDir();
|
|
}
|
|
}
|
|
}
|