com-dot-app-sancharsaathi-1-5-0.apk
Download file
package J;
import P.g;
import android.content.Context;
import android.content.res.Resources;
import android.net.Uri;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.StrictMode;
import android.util.Log;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public abstract class i {
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException unused) {
}
}
}
public static boolean b(File file, Resources resources, int i4) {
InputStream inputStream;
try {
inputStream = resources.openRawResource(i4);
try {
boolean c4 = c(file, inputStream);
a(inputStream);
return c4;
} catch (Throwable th) {
th = th;
a(inputStream);
throw th;
}
} catch (Throwable th2) {
th = th2;
inputStream = null;
a(inputStream);
throw th;
}
}
public static boolean c(File file, InputStream inputStream) {
StrictMode.ThreadPolicy allowThreadDiskWrites = StrictMode.allowThreadDiskWrites();
FileOutputStream fileOutputStream = null;
try {
FileOutputStream fileOutputStream2 = new FileOutputStream(file, false);
try {
byte[] bArr = new byte[1024];
while (true) {
int read = inputStream.read(bArr);
if (read != -1) {
fileOutputStream2.write(bArr, 0, read);
} else {
a(fileOutputStream2);
StrictMode.setThreadPolicy(allowThreadDiskWrites);
return true;
}
}
} catch (IOException e4) {
e = e4;
fileOutputStream = fileOutputStream2;
try {
Log.e("TypefaceCompatUtil", "Error copying resource contents to temp file: " + e.getMessage());
a(fileOutputStream);
StrictMode.setThreadPolicy(allowThreadDiskWrites);
return false;
} catch (Throwable th) {
th = th;
a(fileOutputStream);
StrictMode.setThreadPolicy(allowThreadDiskWrites);
throw th;
}
} catch (Throwable th2) {
th = th2;
fileOutputStream = fileOutputStream2;
a(fileOutputStream);
StrictMode.setThreadPolicy(allowThreadDiskWrites);
throw th;
}
} catch (IOException e5) {
e = e5;
Log.e("TypefaceCompatUtil", "Error copying resource contents to temp file: " + e.getMessage());
a(fileOutputStream);
StrictMode.setThreadPolicy(allowThreadDiskWrites);
return false;
}
}
public static File d(Context context) {
File cacheDir = context.getCacheDir();
if (cacheDir == null) {
return null;
}
String str = ".font" + Process.myPid() + "-" + Process.myTid() + "-";
int i4 = 0;
while (i4 < 100) {
File file = new File(cacheDir, str + i4);
try {
if (file.createNewFile()) {
return file;
}
i4++;
} catch (IOException unused) {
}
}
return null;
}
public static ByteBuffer e(Context context, CancellationSignal cancellationSignal, Uri uri) {
ParcelFileDescriptor openFileDescriptor;
FileInputStream fileInputStream;
try {
openFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r", cancellationSignal);
if (openFileDescriptor == null) {
if (openFileDescriptor != null) {
openFileDescriptor.close();
}
return null;
}
fileInputStream = new FileInputStream(openFileDescriptor.getFileDescriptor());
FileChannel channel = fileInputStream.getChannel();
MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
fileInputStream.close();
openFileDescriptor.close();
return map;
throw th;
throw th;
} catch (IOException unused) {
return null;
} catch (Throwable th) {
th.addSuppressed(th);
}
}
public static Map f(Context context, g.b[] bVarArr, CancellationSignal cancellationSignal) {
HashMap hashMap = new HashMap();
for (g.b bVar : bVarArr) {
if (bVar.b() == 0) {
Uri d4 = bVar.d();
if (!hashMap.containsKey(d4)) {
hashMap.put(d4, e(context, cancellationSignal, d4));
}
}
}
return Collections.unmodifiableMap(hashMap);
}
}
Download file