package c.f.j.p; import android.content.res.AssetFileDescriptor; import android.content.res.Resources; import c.f.d.g.g; import c.f.j.j.e; import com.facebook.imagepipeline.request.ImageRequest; import java.io.IOException; import java.io.InputStream; import java.util.concurrent.Executor; /* compiled from: LocalResourceFetchProducer */ public class i0 extends g0 { /* renamed from: c reason: collision with root package name */ public final Resources f476c; public i0(Executor executor, g gVar, Resources resources) { super(executor, gVar); this.f476c = resources; } /* JADX WARNING: Code restructure failed: missing block: B:12:0x0038, code lost: if (r1 == null) goto L_0x003d; */ @Override // c.f.j.p.g0 public e d(ImageRequest imageRequest) throws IOException { int i; InputStream openRawResource = this.f476c.openRawResource(Integer.parseInt(imageRequest.f2182c.getPath().substring(1))); AssetFileDescriptor assetFileDescriptor = null; try { assetFileDescriptor = this.f476c.openRawResourceFd(Integer.parseInt(imageRequest.f2182c.getPath().substring(1))); i = (int) assetFileDescriptor.getLength(); } catch (Resources.NotFoundException unused) { i = -1; } catch (Throwable th) { if (assetFileDescriptor != null) { try { assetFileDescriptor.close(); } catch (IOException unused2) { } } throw th; } try { assetFileDescriptor.close(); } catch (IOException unused3) { } return c(openRawResource, i); } @Override // c.f.j.p.g0 public String e() { return "LocalResourceFetchProducer"; } }