169 lines
6.1 KiB
Java
169 lines
6.1 KiB
Java
package com.liulishuo.filedownloader.download;
|
|
|
|
import com.liulishuo.filedownloader.connection.FileDownloadConnection;
|
|
import com.liulishuo.filedownloader.database.FileDownloadDatabase;
|
|
import com.liulishuo.filedownloader.services.DownloadMgrInitialParams;
|
|
import com.liulishuo.filedownloader.services.ForegroundServiceConfig;
|
|
import com.liulishuo.filedownloader.stream.FileDownloadOutputStream;
|
|
import com.liulishuo.filedownloader.util.FileDownloadHelper;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class CustomComponentHolder {
|
|
private DownloadMgrInitialParams a;
|
|
private FileDownloadHelper.ConnectionCountAdapter b;
|
|
private FileDownloadHelper.ConnectionCreator c;
|
|
private FileDownloadHelper.OutputStreamCreator d;
|
|
private FileDownloadDatabase e;
|
|
private FileDownloadHelper.IdGenerator f;
|
|
private ForegroundServiceConfig g;
|
|
|
|
private static final class LazyLoader {
|
|
private static final CustomComponentHolder a = new CustomComponentHolder();
|
|
}
|
|
|
|
private FileDownloadHelper.ConnectionCountAdapter f() {
|
|
FileDownloadHelper.ConnectionCountAdapter connectionCountAdapter = this.b;
|
|
if (connectionCountAdapter != null) {
|
|
return connectionCountAdapter;
|
|
}
|
|
synchronized (this) {
|
|
if (this.b == null) {
|
|
this.b = h().a();
|
|
}
|
|
}
|
|
return this.b;
|
|
}
|
|
|
|
private FileDownloadHelper.ConnectionCreator g() {
|
|
FileDownloadHelper.ConnectionCreator connectionCreator = this.c;
|
|
if (connectionCreator != null) {
|
|
return connectionCreator;
|
|
}
|
|
synchronized (this) {
|
|
if (this.c == null) {
|
|
this.c = h().b();
|
|
}
|
|
}
|
|
return this.c;
|
|
}
|
|
|
|
private DownloadMgrInitialParams h() {
|
|
DownloadMgrInitialParams downloadMgrInitialParams = this.a;
|
|
if (downloadMgrInitialParams != null) {
|
|
return downloadMgrInitialParams;
|
|
}
|
|
synchronized (this) {
|
|
if (this.a == null) {
|
|
this.a = new DownloadMgrInitialParams();
|
|
}
|
|
}
|
|
return this.a;
|
|
}
|
|
|
|
public static CustomComponentHolder i() {
|
|
return LazyLoader.a;
|
|
}
|
|
|
|
private FileDownloadHelper.OutputStreamCreator j() {
|
|
FileDownloadHelper.OutputStreamCreator outputStreamCreator = this.d;
|
|
if (outputStreamCreator != null) {
|
|
return outputStreamCreator;
|
|
}
|
|
synchronized (this) {
|
|
if (this.d == null) {
|
|
this.d = h().f();
|
|
}
|
|
}
|
|
return this.d;
|
|
}
|
|
|
|
public FileDownloadConnection a(String str) throws IOException {
|
|
return g().a(str);
|
|
}
|
|
|
|
public ForegroundServiceConfig b() {
|
|
ForegroundServiceConfig foregroundServiceConfig = this.g;
|
|
if (foregroundServiceConfig != null) {
|
|
return foregroundServiceConfig;
|
|
}
|
|
synchronized (this) {
|
|
if (this.g == null) {
|
|
this.g = h().d();
|
|
}
|
|
}
|
|
return this.g;
|
|
}
|
|
|
|
public FileDownloadHelper.IdGenerator c() {
|
|
FileDownloadHelper.IdGenerator idGenerator = this.f;
|
|
if (idGenerator != null) {
|
|
return idGenerator;
|
|
}
|
|
synchronized (this) {
|
|
if (this.f == null) {
|
|
this.f = h().e();
|
|
}
|
|
}
|
|
return this.f;
|
|
}
|
|
|
|
public int d() {
|
|
return h().g();
|
|
}
|
|
|
|
public boolean e() {
|
|
return j().a();
|
|
}
|
|
|
|
public FileDownloadOutputStream a(File file) throws IOException {
|
|
return j().a(file);
|
|
}
|
|
|
|
public FileDownloadDatabase a() {
|
|
FileDownloadDatabase fileDownloadDatabase = this.e;
|
|
if (fileDownloadDatabase != null) {
|
|
return fileDownloadDatabase;
|
|
}
|
|
synchronized (this) {
|
|
if (this.e == null) {
|
|
this.e = h().c();
|
|
a(this.e.a());
|
|
}
|
|
}
|
|
return this.e;
|
|
}
|
|
|
|
public int a(int i, String str, String str2, long j) {
|
|
return f().a(i, str, str2, j);
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:55:0x00d4, code lost:
|
|
|
|
if (r8.getSoFar() > 0) goto L46;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:79:0x0051, code lost:
|
|
|
|
if (r8.getSoFar() <= 0) goto L18;
|
|
*/
|
|
/* JADX WARN: Removed duplicated region for block: B:12:0x005c */
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x00fb A[Catch: all -> 0x013f, TryCatch #3 {all -> 0x013f, blocks: (B:26:0x00f1, B:15:0x00fb, B:17:0x0111, B:19:0x0115, B:20:0x012d, B:21:0x0134, B:51:0x00a3, B:52:0x00c5, B:54:0x00cc, B:57:0x00da, B:60:0x00e5), top: B:25:0x00f1 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:25:0x00f1 A[EXC_TOP_SPLITTER, SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:33:0x019b */
|
|
/* JADX WARN: Removed duplicated region for block: B:36:0x0065 A[Catch: all -> 0x0141, TryCatch #0 {all -> 0x0141, blocks: (B:72:0x0034, B:74:0x003b, B:76:0x0042, B:78:0x0049, B:10:0x0056, B:36:0x0065, B:38:0x0070, B:9:0x0053), top: B:71:0x0034 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:54:0x00cc A[Catch: all -> 0x013f, TryCatch #3 {all -> 0x013f, blocks: (B:26:0x00f1, B:15:0x00fb, B:17:0x0111, B:19:0x0115, B:20:0x012d, B:21:0x0134, B:51:0x00a3, B:52:0x00c5, B:54:0x00cc, B:57:0x00da, B:60:0x00e5), top: B:25:0x00f1 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:64:0x00d8 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
private static void a(com.liulishuo.filedownloader.database.FileDownloadDatabase.Maintainer r26) {
|
|
/*
|
|
Method dump skipped, instructions count: 452
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.liulishuo.filedownloader.download.CustomComponentHolder.a(com.liulishuo.filedownloader.database.FileDownloadDatabase$Maintainer):void");
|
|
}
|
|
}
|