diff --git a/.gradle/7.5/checksums/checksums.lock b/.gradle/7.5/checksums/checksums.lock index ccb7c61..cba6792 100644 Binary files a/.gradle/7.5/checksums/checksums.lock and b/.gradle/7.5/checksums/checksums.lock differ diff --git a/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock b/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock index 7a35ab4..7e6a7c4 100644 Binary files a/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock and b/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/7.5/executionHistory/executionHistory.lock b/.gradle/7.5/executionHistory/executionHistory.lock index 2adbf74..d3ec56b 100644 Binary files a/.gradle/7.5/executionHistory/executionHistory.lock and b/.gradle/7.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.5/fileHashes/fileHashes.lock b/.gradle/7.5/fileHashes/fileHashes.lock index 27fa423..6eabe16 100644 Binary files a/.gradle/7.5/fileHashes/fileHashes.lock and b/.gradle/7.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 055d648..4286bd9 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/app/build.gradle b/app/build.gradle index 01ad388..8c89023 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,4 +78,7 @@ dependencies { implementation 'com.github.bumptech.glide:glide:5.0.0-rc01' // https://mvnrepository.com/artifact/com.example.chartviewlibrary/chartviewlibrary implementation 'com.example.chartviewlibrary:chartviewlibrary:0.0.1' + // https://mvnrepository.com/artifact/com.nostra13.universalimageloader/universal-image-loader + implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' + } diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/DiskCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/DiskCache.java deleted file mode 100644 index 016a8c1..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/DiskCache.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.utils.IoUtils; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public interface DiskCache { - void clear(); - - void close(); - - File get(String str); - - File getDirectory(); - - boolean remove(String str); - - boolean save(String str, Bitmap bitmap) throws IOException; - - boolean save(String str, InputStream inputStream, IoUtils.CopyListener copyListener) throws IOException; -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/BaseDiskCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/BaseDiskCache.java deleted file mode 100644 index 73a3959..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/BaseDiskCache.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import com.nostra13.universalimageloader.core.DefaultConfigurationFactory; -import com.nostra13.universalimageloader.utils.IoUtils; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public abstract class BaseDiskCache implements DiskCache { - public static final int DEFAULT_BUFFER_SIZE = 32768; - public static final Bitmap.CompressFormat DEFAULT_COMPRESS_FORMAT = Bitmap.CompressFormat.PNG; - public static final int DEFAULT_COMPRESS_QUALITY = 100; - private static final String ERROR_ARG_NULL = " argument must be not null"; - private static final String TEMP_IMAGE_POSTFIX = ".tmp"; - protected int bufferSize; - protected final File cacheDir; - protected Bitmap.CompressFormat compressFormat; - protected int compressQuality; - protected final FileNameGenerator fileNameGenerator; - protected final File reserveCacheDir; - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public void close() { - } - - public BaseDiskCache(File file) { - this(file, null); - } - - public BaseDiskCache(File file, File file2) { - this(file, file2, DefaultConfigurationFactory.createFileNameGenerator()); - } - - public BaseDiskCache(File file, File file2, FileNameGenerator fileNameGenerator) { - this.bufferSize = 32768; - this.compressFormat = DEFAULT_COMPRESS_FORMAT; - this.compressQuality = 100; - if (file == null) { - throw new IllegalArgumentException("cacheDir argument must be not null"); - } - if (fileNameGenerator == null) { - throw new IllegalArgumentException("fileNameGenerator argument must be not null"); - } - this.cacheDir = file; - this.reserveCacheDir = file2; - this.fileNameGenerator = fileNameGenerator; - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public File getDirectory() { - return this.cacheDir; - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public File get(String str) { - return getFile(str); - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, InputStream inputStream, IoUtils.CopyListener copyListener) throws IOException { - boolean z; - BufferedOutputStream bufferedOutputStream; - File file = getFile(str); - File file2 = new File(file.getAbsolutePath() + TEMP_IMAGE_POSTFIX); - boolean z2 = false; - try { - bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file2), this.bufferSize); - z = IoUtils.copyStream(inputStream, bufferedOutputStream, copyListener, this.bufferSize); - } catch (Throwable th) { - th = th; - z = false; - } - try { - IoUtils.closeSilently(bufferedOutputStream); - if (!z || file2.renameTo(file)) { - z2 = z; - } - if (!z2) { - file2.delete(); - } - return z2; - } catch (Throwable th2) { - th = th2; - if (!z || file2.renameTo(file)) { - z2 = z; - } - if (!z2) { - file2.delete(); - } - throw th; - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, Bitmap bitmap) throws IOException { - File file = getFile(str); - File file2 = new File(file.getAbsolutePath() + TEMP_IMAGE_POSTFIX); - BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file2), this.bufferSize); - try { - boolean compress = bitmap.compress(this.compressFormat, this.compressQuality, bufferedOutputStream); - IoUtils.closeSilently(bufferedOutputStream); - if (compress && !file2.renameTo(file)) { - compress = false; - } - if (!compress) { - file2.delete(); - } - bitmap.recycle(); - return compress; - } catch (Throwable th) { - IoUtils.closeSilently(bufferedOutputStream); - file2.delete(); - throw th; - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean remove(String str) { - return getFile(str).delete(); - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public void clear() { - File[] listFiles = this.cacheDir.listFiles(); - if (listFiles != null) { - for (File file : listFiles) { - file.delete(); - } - } - } - - /* JADX INFO: Access modifiers changed from: protected */ - public File getFile(String str) { - File file; - String generate = this.fileNameGenerator.generate(str); - File file2 = this.cacheDir; - if (!file2.exists() && !this.cacheDir.mkdirs() && (file = this.reserveCacheDir) != null && (file.exists() || this.reserveCacheDir.mkdirs())) { - file2 = this.reserveCacheDir; - } - return new File(file2, generate); - } - - public void setBufferSize(int i) { - this.bufferSize = i; - } - - public void setCompressFormat(Bitmap.CompressFormat compressFormat) { - this.compressFormat = compressFormat; - } - - public void setCompressQuality(int i) { - this.compressQuality = i; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/LimitedAgeDiskCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/LimitedAgeDiskCache.java deleted file mode 100644 index 508e676..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/LimitedAgeDiskCache.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import com.nostra13.universalimageloader.core.DefaultConfigurationFactory; -import com.nostra13.universalimageloader.utils.IoUtils; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/* loaded from: classes.dex */ -public class LimitedAgeDiskCache extends BaseDiskCache { - private final Map loadingDates; - private final long maxFileAge; - - public LimitedAgeDiskCache(File file, long j) { - this(file, null, DefaultConfigurationFactory.createFileNameGenerator(), j); - } - - public LimitedAgeDiskCache(File file, File file2, long j) { - this(file, file2, DefaultConfigurationFactory.createFileNameGenerator(), j); - } - - public LimitedAgeDiskCache(File file, File file2, FileNameGenerator fileNameGenerator, long j) { - super(file, file2, fileNameGenerator); - this.loadingDates = Collections.synchronizedMap(new HashMap()); - this.maxFileAge = j * 1000; - } - - @Override // com.nostra13.universalimageloader.cache.disc.impl.BaseDiskCache, com.nostra13.universalimageloader.cache.disc.DiskCache - public File get(String str) { - boolean z; - File file = super.get(str); - if (file != null && file.exists()) { - Long l = this.loadingDates.get(file); - if (l == null) { - l = Long.valueOf(file.lastModified()); - z = false; - } else { - z = true; - } - if (System.currentTimeMillis() - l.longValue() > this.maxFileAge) { - file.delete(); - this.loadingDates.remove(file); - } else if (!z) { - this.loadingDates.put(file, l); - } - } - return file; - } - - @Override // com.nostra13.universalimageloader.cache.disc.impl.BaseDiskCache, com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, InputStream inputStream, IoUtils.CopyListener copyListener) throws IOException { - boolean save = super.save(str, inputStream, copyListener); - rememberUsage(str); - return save; - } - - @Override // com.nostra13.universalimageloader.cache.disc.impl.BaseDiskCache, com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, Bitmap bitmap) throws IOException { - boolean save = super.save(str, bitmap); - rememberUsage(str); - return save; - } - - @Override // com.nostra13.universalimageloader.cache.disc.impl.BaseDiskCache, com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean remove(String str) { - this.loadingDates.remove(getFile(str)); - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.disc.impl.BaseDiskCache, com.nostra13.universalimageloader.cache.disc.DiskCache - public void clear() { - super.clear(); - this.loadingDates.clear(); - } - - private void rememberUsage(String str) { - File file = getFile(str); - long currentTimeMillis = System.currentTimeMillis(); - file.setLastModified(currentTimeMillis); - this.loadingDates.put(file, Long.valueOf(currentTimeMillis)); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/UnlimitedDiskCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/UnlimitedDiskCache.java deleted file mode 100644 index bb705c3..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/UnlimitedDiskCache.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl; - -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import java.io.File; - -/* loaded from: classes.dex */ -public class UnlimitedDiskCache extends BaseDiskCache { - public UnlimitedDiskCache(File file) { - super(file); - } - - public UnlimitedDiskCache(File file, File file2) { - super(file, file2); - } - - public UnlimitedDiskCache(File file, File file2, FileNameGenerator fileNameGenerator) { - super(file, file2, fileNameGenerator); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java deleted file mode 100644 index 9b8012b..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java +++ /dev/null @@ -1,746 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl.ext; - -import java.io.BufferedWriter; -import java.io.Closeable; -import java.io.EOFException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FilterOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintStream; -import java.io.Writer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.concurrent.Callable; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.regex.Pattern; -import org.apache.http.message.TokenParser; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public final class DiskLruCache implements Closeable { - static final long ANY_SEQUENCE_NUMBER = -1; - private static final String CLEAN = "CLEAN"; - private static final String DIRTY = "DIRTY"; - static final String JOURNAL_FILE = "journal"; - static final String JOURNAL_FILE_BACKUP = "journal.bkp"; - static final String JOURNAL_FILE_TEMP = "journal.tmp"; - static final String MAGIC = "libcore.io.DiskLruCache"; - private static final String READ = "READ"; - private static final String REMOVE = "REMOVE"; - static final String VERSION_1 = "1"; - private final int appVersion; - private final File directory; - private final File journalFile; - private final File journalFileBackup; - private final File journalFileTmp; - private Writer journalWriter; - private int maxFileCount; - private long maxSize; - private int redundantOpCount; - private final int valueCount; - static final Pattern LEGAL_KEY_PATTERN = Pattern.compile("[a-z0-9_-]{1,64}"); - private static final OutputStream NULL_OUTPUT_STREAM = new OutputStream() { // from class: com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.2 - @Override // java.io.OutputStream - public void write(int i) throws IOException { - } - }; - private long size = 0; - private int fileCount = 0; - private final LinkedHashMap lruEntries = new LinkedHashMap<>(0, 0.75f, true); - private long nextSequenceNumber = 0; - final ThreadPoolExecutor executorService = new ThreadPoolExecutor(0, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue()); - private final Callable cleanupCallable = new Callable() { // from class: com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.1 - @Override // java.util.concurrent.Callable - public Void call() throws Exception { - synchronized (DiskLruCache.this) { - if (DiskLruCache.this.journalWriter == null) { - return null; - } - DiskLruCache.this.trimToSize(); - DiskLruCache.this.trimToFileCount(); - if (DiskLruCache.this.journalRebuildRequired()) { - DiskLruCache.this.rebuildJournal(); - DiskLruCache.this.redundantOpCount = 0; - } - return null; - } - } - }; - - private DiskLruCache(File file, int i, int i2, long j, int i3) { - this.directory = file; - this.appVersion = i; - this.journalFile = new File(file, JOURNAL_FILE); - this.journalFileTmp = new File(file, JOURNAL_FILE_TEMP); - this.journalFileBackup = new File(file, JOURNAL_FILE_BACKUP); - this.valueCount = i2; - this.maxSize = j; - this.maxFileCount = i3; - } - - public static DiskLruCache open(File file, int i, int i2, long j, int i3) throws IOException { - if (j > 0) { - if (i3 > 0) { - if (i2 <= 0) { - throw new IllegalArgumentException("valueCount <= 0"); - } - File file2 = new File(file, JOURNAL_FILE_BACKUP); - if (file2.exists()) { - File file3 = new File(file, JOURNAL_FILE); - if (file3.exists()) { - file2.delete(); - } else { - renameTo(file2, file3, false); - } - } - DiskLruCache diskLruCache = new DiskLruCache(file, i, i2, j, i3); - if (diskLruCache.journalFile.exists()) { - try { - diskLruCache.readJournal(); - diskLruCache.processJournal(); - diskLruCache.journalWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(diskLruCache.journalFile, true), Util.US_ASCII)); - return diskLruCache; - } catch (IOException e) { - PrintStream printStream = System.out; - printStream.println("DiskLruCache " + file + " is corrupt: " + e.getMessage() + ", removing"); - diskLruCache.delete(); - } - } - file.mkdirs(); - DiskLruCache diskLruCache2 = new DiskLruCache(file, i, i2, j, i3); - diskLruCache2.rebuildJournal(); - return diskLruCache2; - } - throw new IllegalArgumentException("maxFileCount <= 0"); - } - throw new IllegalArgumentException("maxSize <= 0"); - } - - private void readJournal() throws IOException { - StrictLineReader strictLineReader = new StrictLineReader(new FileInputStream(this.journalFile), Util.US_ASCII); - try { - String readLine = strictLineReader.readLine(); - String readLine2 = strictLineReader.readLine(); - String readLine3 = strictLineReader.readLine(); - String readLine4 = strictLineReader.readLine(); - String readLine5 = strictLineReader.readLine(); - if (!MAGIC.equals(readLine) || !VERSION_1.equals(readLine2) || !Integer.toString(this.appVersion).equals(readLine3) || !Integer.toString(this.valueCount).equals(readLine4) || !"".equals(readLine5)) { - throw new IOException("unexpected journal header: [" + readLine + ", " + readLine2 + ", " + readLine4 + ", " + readLine5 + "]"); - } - int i = 0; - while (true) { - try { - readJournalLine(strictLineReader.readLine()); - i++; - } catch (EOFException unused) { - this.redundantOpCount = i - this.lruEntries.size(); - Util.closeQuietly(strictLineReader); - return; - } - } - } catch (Throwable th) { - Util.closeQuietly(strictLineReader); - throw th; - } - } - - private void readJournalLine(String str) throws IOException { - String substring; - int indexOf = str.indexOf(32); - if (indexOf == -1) { - throw new IOException("unexpected journal line: " + str); - } - int i = indexOf + 1; - int indexOf2 = str.indexOf(32, i); - if (indexOf2 == -1) { - substring = str.substring(i); - if (indexOf == 6 && str.startsWith(REMOVE)) { - this.lruEntries.remove(substring); - return; - } - } else { - substring = str.substring(i, indexOf2); - } - Entry entry = this.lruEntries.get(substring); - if (entry == null) { - entry = new Entry(substring); - this.lruEntries.put(substring, entry); - } - if (indexOf2 != -1 && indexOf == 5 && str.startsWith(CLEAN)) { - String[] split = str.substring(indexOf2 + 1).split(" "); - entry.readable = true; - entry.currentEditor = null; - entry.setLengths(split); - } else if (indexOf2 != -1 || indexOf != 5 || !str.startsWith(DIRTY)) { - if (indexOf2 == -1 && indexOf == 4 && str.startsWith(READ)) { - return; - } - throw new IOException("unexpected journal line: " + str); - } else { - entry.currentEditor = new Editor(entry); - } - } - - private void processJournal() throws IOException { - deleteIfExists(this.journalFileTmp); - Iterator it = this.lruEntries.values().iterator(); - while (it.hasNext()) { - Entry next = it.next(); - int i = 0; - if (next.currentEditor == null) { - while (i < this.valueCount) { - this.size += next.lengths[i]; - this.fileCount++; - i++; - } - } else { - next.currentEditor = null; - while (i < this.valueCount) { - deleteIfExists(next.getCleanFile(i)); - deleteIfExists(next.getDirtyFile(i)); - i++; - } - it.remove(); - } - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized void rebuildJournal() throws IOException { - Writer writer = this.journalWriter; - if (writer != null) { - writer.close(); - } - BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.journalFileTmp), Util.US_ASCII)); - bufferedWriter.write(MAGIC); - bufferedWriter.write("\n"); - bufferedWriter.write(VERSION_1); - bufferedWriter.write("\n"); - bufferedWriter.write(Integer.toString(this.appVersion)); - bufferedWriter.write("\n"); - bufferedWriter.write(Integer.toString(this.valueCount)); - bufferedWriter.write("\n"); - bufferedWriter.write("\n"); - for (Entry entry : this.lruEntries.values()) { - if (entry.currentEditor != null) { - bufferedWriter.write("DIRTY " + entry.key + '\n'); - } else { - bufferedWriter.write("CLEAN " + entry.key + entry.getLengths() + '\n'); - } - } - bufferedWriter.close(); - if (this.journalFile.exists()) { - renameTo(this.journalFile, this.journalFileBackup, true); - } - renameTo(this.journalFileTmp, this.journalFile, false); - this.journalFileBackup.delete(); - this.journalWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.journalFile, true), Util.US_ASCII)); - } - - private static void deleteIfExists(File file) throws IOException { - if (file.exists() && !file.delete()) { - throw new IOException(); - } - } - - private static void renameTo(File file, File file2, boolean z) throws IOException { - if (z) { - deleteIfExists(file2); - } - if (!file.renameTo(file2)) { - throw new IOException(); - } - } - - public synchronized Snapshot get(String str) throws IOException { - checkNotClosed(); - validateKey(str); - Entry entry = this.lruEntries.get(str); - if (entry == null) { - return null; - } - if (entry.readable) { - int i = this.valueCount; - File[] fileArr = new File[i]; - InputStream[] inputStreamArr = new InputStream[i]; - for (int i2 = 0; i2 < this.valueCount; i2++) { - try { - File cleanFile = entry.getCleanFile(i2); - fileArr[i2] = cleanFile; - inputStreamArr[i2] = new FileInputStream(cleanFile); - } catch (FileNotFoundException unused) { - for (int i3 = 0; i3 < this.valueCount && inputStreamArr[i3] != null; i3++) { - Util.closeQuietly(inputStreamArr[i3]); - } - return null; - } - } - this.redundantOpCount++; - this.journalWriter.append((CharSequence) ("READ " + str + '\n')); - if (journalRebuildRequired()) { - this.executorService.submit(this.cleanupCallable); - } - return new Snapshot(str, entry.sequenceNumber, fileArr, inputStreamArr, entry.lengths); - } - return null; - } - - public Editor edit(String str) throws IOException { - return edit(str, -1L); - } - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized Editor edit(String str, long j) throws IOException { - checkNotClosed(); - validateKey(str); - Entry entry = this.lruEntries.get(str); - if (j == -1 || (entry != null && entry.sequenceNumber == j)) { - if (entry == null) { - entry = new Entry(str); - this.lruEntries.put(str, entry); - } else if (entry.currentEditor != null) { - return null; - } - Editor editor = new Editor(entry); - entry.currentEditor = editor; - Writer writer = this.journalWriter; - writer.write("DIRTY " + str + '\n'); - this.journalWriter.flush(); - return editor; - } - return null; - } - - public File getDirectory() { - return this.directory; - } - - public synchronized long getMaxSize() { - return this.maxSize; - } - - public synchronized int getMaxFileCount() { - return this.maxFileCount; - } - - public synchronized void setMaxSize(long j) { - this.maxSize = j; - this.executorService.submit(this.cleanupCallable); - } - - public synchronized long size() { - return this.size; - } - - public synchronized long fileCount() { - return this.fileCount; - } - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized void completeEdit(Editor editor, boolean z) throws IOException { - Entry entry = editor.entry; - if (entry.currentEditor != editor) { - throw new IllegalStateException(); - } - if (z && !entry.readable) { - for (int i = 0; i < this.valueCount; i++) { - if (!editor.written[i]) { - editor.abort(); - throw new IllegalStateException("Newly created entry didn't create value for index " + i); - } else if (!entry.getDirtyFile(i).exists()) { - editor.abort(); - return; - } - } - } - for (int i2 = 0; i2 < this.valueCount; i2++) { - File dirtyFile = entry.getDirtyFile(i2); - if (z) { - if (dirtyFile.exists()) { - File cleanFile = entry.getCleanFile(i2); - dirtyFile.renameTo(cleanFile); - long j = entry.lengths[i2]; - long length = cleanFile.length(); - entry.lengths[i2] = length; - this.size = (this.size - j) + length; - this.fileCount++; - } - } else { - deleteIfExists(dirtyFile); - } - } - this.redundantOpCount++; - entry.currentEditor = null; - if (entry.readable | z) { - entry.readable = true; - this.journalWriter.write("CLEAN " + entry.key + entry.getLengths() + '\n'); - if (z) { - long j2 = this.nextSequenceNumber; - this.nextSequenceNumber = 1 + j2; - entry.sequenceNumber = j2; - } - } else { - this.lruEntries.remove(entry.key); - this.journalWriter.write("REMOVE " + entry.key + '\n'); - } - this.journalWriter.flush(); - if (this.size > this.maxSize || this.fileCount > this.maxFileCount || journalRebuildRequired()) { - this.executorService.submit(this.cleanupCallable); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public boolean journalRebuildRequired() { - int i = this.redundantOpCount; - return i >= 2000 && i >= this.lruEntries.size(); - } - - public synchronized boolean remove(String str) throws IOException { - checkNotClosed(); - validateKey(str); - Entry entry = this.lruEntries.get(str); - if (entry != null && entry.currentEditor == null) { - for (int i = 0; i < this.valueCount; i++) { - File cleanFile = entry.getCleanFile(i); - if (cleanFile.exists() && !cleanFile.delete()) { - throw new IOException("failed to delete " + cleanFile); - } - this.size -= entry.lengths[i]; - this.fileCount--; - entry.lengths[i] = 0; - } - this.redundantOpCount++; - this.journalWriter.append((CharSequence) ("REMOVE " + str + '\n')); - this.lruEntries.remove(str); - if (journalRebuildRequired()) { - this.executorService.submit(this.cleanupCallable); - } - return true; - } - return false; - } - - public synchronized boolean isClosed() { - return this.journalWriter == null; - } - - private void checkNotClosed() { - if (this.journalWriter == null) { - throw new IllegalStateException("cache is closed"); - } - } - - public synchronized void flush() throws IOException { - checkNotClosed(); - trimToSize(); - trimToFileCount(); - this.journalWriter.flush(); - } - - @Override // java.io.Closeable, java.lang.AutoCloseable - public synchronized void close() throws IOException { - if (this.journalWriter == null) { - return; - } - Iterator it = new ArrayList(this.lruEntries.values()).iterator(); - while (it.hasNext()) { - Entry entry = (Entry) it.next(); - if (entry.currentEditor != null) { - entry.currentEditor.abort(); - } - } - trimToSize(); - trimToFileCount(); - this.journalWriter.close(); - this.journalWriter = null; - } - - /* JADX INFO: Access modifiers changed from: private */ - public void trimToSize() throws IOException { - while (this.size > this.maxSize) { - remove(this.lruEntries.entrySet().iterator().next().getKey()); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void trimToFileCount() throws IOException { - while (this.fileCount > this.maxFileCount) { - remove(this.lruEntries.entrySet().iterator().next().getKey()); - } - } - - public void delete() throws IOException { - close(); - Util.deleteContents(this.directory); - } - - private void validateKey(String str) { - if (LEGAL_KEY_PATTERN.matcher(str).matches()) { - return; - } - throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,64}: \"" + str + "\""); - } - - /* JADX INFO: Access modifiers changed from: private */ - public static String inputStreamToString(InputStream inputStream) throws IOException { - return Util.readFully(new InputStreamReader(inputStream, Util.UTF_8)); - } - - /* loaded from: classes.dex */ - public final class Snapshot implements Closeable { - private File[] files; - private final InputStream[] ins; - private final String key; - private final long[] lengths; - private final long sequenceNumber; - - private Snapshot(String str, long j, File[] fileArr, InputStream[] inputStreamArr, long[] jArr) { - this.key = str; - this.sequenceNumber = j; - this.files = fileArr; - this.ins = inputStreamArr; - this.lengths = jArr; - } - - public Editor edit() throws IOException { - return DiskLruCache.this.edit(this.key, this.sequenceNumber); - } - - public File getFile(int i) { - return this.files[i]; - } - - public InputStream getInputStream(int i) { - return this.ins[i]; - } - - public String getString(int i) throws IOException { - return DiskLruCache.inputStreamToString(getInputStream(i)); - } - - public long getLength(int i) { - return this.lengths[i]; - } - - @Override // java.io.Closeable, java.lang.AutoCloseable - public void close() { - for (InputStream inputStream : this.ins) { - Util.closeQuietly(inputStream); - } - } - } - - /* loaded from: classes.dex */ - public final class Editor { - private boolean committed; - private final Entry entry; - private boolean hasErrors; - private final boolean[] written; - - private Editor(Entry entry) { - this.entry = entry; - this.written = entry.readable ? null : new boolean[DiskLruCache.this.valueCount]; - } - - public InputStream newInputStream(int i) throws IOException { - synchronized (DiskLruCache.this) { - if (this.entry.currentEditor != this) { - throw new IllegalStateException(); - } - if (this.entry.readable) { - try { - return new FileInputStream(this.entry.getCleanFile(i)); - } catch (FileNotFoundException unused) { - return null; - } - } - return null; - } - } - - public String getString(int i) throws IOException { - InputStream newInputStream = newInputStream(i); - if (newInputStream != null) { - return DiskLruCache.inputStreamToString(newInputStream); - } - return null; - } - - public OutputStream newOutputStream(int i) throws IOException { - FileOutputStream fileOutputStream; - FaultHidingOutputStream faultHidingOutputStream; - synchronized (DiskLruCache.this) { - if (this.entry.currentEditor != this) { - throw new IllegalStateException(); - } - if (!this.entry.readable) { - this.written[i] = true; - } - File dirtyFile = this.entry.getDirtyFile(i); - try { - fileOutputStream = new FileOutputStream(dirtyFile); - } catch (FileNotFoundException unused) { - DiskLruCache.this.directory.mkdirs(); - try { - fileOutputStream = new FileOutputStream(dirtyFile); - } catch (FileNotFoundException unused2) { - return DiskLruCache.NULL_OUTPUT_STREAM; - } - } - faultHidingOutputStream = new FaultHidingOutputStream(fileOutputStream); - } - return faultHidingOutputStream; - } - - public void set(int i, String str) throws IOException { - OutputStreamWriter outputStreamWriter; - OutputStreamWriter outputStreamWriter2 = null; - try { - outputStreamWriter = new OutputStreamWriter(newOutputStream(i), Util.UTF_8); - } catch (Throwable th) { - th = th; - } - try { - outputStreamWriter.write(str); - Util.closeQuietly(outputStreamWriter); - } catch (Throwable th2) { - th = th2; - outputStreamWriter2 = outputStreamWriter; - Util.closeQuietly(outputStreamWriter2); - throw th; - } - } - - public void commit() throws IOException { - if (this.hasErrors) { - DiskLruCache.this.completeEdit(this, false); - DiskLruCache.this.remove(this.entry.key); - } else { - DiskLruCache.this.completeEdit(this, true); - } - this.committed = true; - } - - public void abort() throws IOException { - DiskLruCache.this.completeEdit(this, false); - } - - public void abortUnlessCommitted() { - if (this.committed) { - return; - } - try { - abort(); - } catch (IOException unused) { - } - } - - /* JADX INFO: Access modifiers changed from: private */ - /* loaded from: classes.dex */ - public class FaultHidingOutputStream extends FilterOutputStream { - private FaultHidingOutputStream(OutputStream outputStream) { - super(outputStream); - } - - @Override // java.io.FilterOutputStream, java.io.OutputStream - public void write(int i) { - try { - this.out.write(i); - } catch (IOException unused) { - Editor.this.hasErrors = true; - } - } - - @Override // java.io.FilterOutputStream, java.io.OutputStream - public void write(byte[] bArr, int i, int i2) { - try { - this.out.write(bArr, i, i2); - } catch (IOException unused) { - Editor.this.hasErrors = true; - } - } - - @Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable - public void close() { - try { - this.out.close(); - } catch (IOException unused) { - Editor.this.hasErrors = true; - } - } - - @Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Flushable - public void flush() { - try { - this.out.flush(); - } catch (IOException unused) { - Editor.this.hasErrors = true; - } - } - } - } - - /* JADX INFO: Access modifiers changed from: private */ - /* loaded from: classes.dex */ - public final class Entry { - private Editor currentEditor; - private final String key; - private final long[] lengths; - private boolean readable; - private long sequenceNumber; - - private Entry(String str) { - this.key = str; - this.lengths = new long[DiskLruCache.this.valueCount]; - } - - public String getLengths() throws IOException { - long[] jArr; - StringBuilder sb = new StringBuilder(); - for (long j : this.lengths) { - sb.append(TokenParser.SP); - sb.append(j); - } - return sb.toString(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void setLengths(String[] strArr) throws IOException { - if (strArr.length != DiskLruCache.this.valueCount) { - throw invalidLengths(strArr); - } - for (int i = 0; i < strArr.length; i++) { - try { - this.lengths[i] = Long.parseLong(strArr[i]); - } catch (NumberFormatException unused) { - throw invalidLengths(strArr); - } - } - } - - private IOException invalidLengths(String[] strArr) throws IOException { - throw new IOException("unexpected journal line: " + Arrays.toString(strArr)); - } - - public File getCleanFile(int i) { - File file = DiskLruCache.this.directory; - return new File(file, this.key + "" + i); - } - - public File getDirtyFile(int i) { - File file = DiskLruCache.this.directory; - return new File(file, this.key + "" + i + ".tmp"); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiskCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiskCache.java deleted file mode 100644 index eab9bb9..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/LruDiskCache.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl.ext; - -import android.graphics.Bitmap; -import androidx.appcompat.widget.ActivityChooserView; -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache; -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import com.nostra13.universalimageloader.utils.IoUtils; -import com.nostra13.universalimageloader.utils.L; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public class LruDiskCache implements DiskCache { - public static final int DEFAULT_BUFFER_SIZE = 32768; - public static final Bitmap.CompressFormat DEFAULT_COMPRESS_FORMAT = Bitmap.CompressFormat.PNG; - public static final int DEFAULT_COMPRESS_QUALITY = 100; - private static final String ERROR_ARG_NEGATIVE = " argument must be positive number"; - private static final String ERROR_ARG_NULL = " argument must be not null"; - protected int bufferSize; - protected DiskLruCache cache; - protected Bitmap.CompressFormat compressFormat; - protected int compressQuality; - protected final FileNameGenerator fileNameGenerator; - private File reserveCacheDir; - - public LruDiskCache(File file, FileNameGenerator fileNameGenerator, long j) throws IOException { - this(file, null, fileNameGenerator, j, 0); - } - - public LruDiskCache(File file, File file2, FileNameGenerator fileNameGenerator, long j, int i) throws IOException { - this.bufferSize = 32768; - this.compressFormat = DEFAULT_COMPRESS_FORMAT; - this.compressQuality = 100; - if (file == null) { - throw new IllegalArgumentException("cacheDir argument must be not null"); - } - if (j < 0) { - throw new IllegalArgumentException("cacheMaxSize argument must be positive number"); - } - if (i < 0) { - throw new IllegalArgumentException("cacheMaxFileCount argument must be positive number"); - } - if (fileNameGenerator == null) { - throw new IllegalArgumentException("fileNameGenerator argument must be not null"); - } - long j2 = j == 0 ? Long.MAX_VALUE : j; - int i2 = i == 0 ? ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED : i; - this.reserveCacheDir = file2; - this.fileNameGenerator = fileNameGenerator; - initCache(file, file2, j2, i2); - } - - private void initCache(File file, File file2, long j, int i) throws IOException { - try { - this.cache = DiskLruCache.open(file, 1, 1, j, i); - } catch (IOException e) { - L.e(e); - if (file2 != null) { - initCache(file2, null, j, i); - } - if (this.cache == null) { - throw e; - } - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public File getDirectory() { - return this.cache.getDirectory(); - } - - /* JADX WARN: Removed duplicated region for block: B:23:0x002e */ - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public java.io.File get(java.lang.String r4) { - /* - r3 = this; - r0 = 0 - com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache r1 = r3.cache // Catch: java.lang.Throwable -> L1b java.io.IOException -> L20 - java.lang.String r4 = r3.getKey(r4) // Catch: java.lang.Throwable -> L1b java.io.IOException -> L20 - com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache$Snapshot r4 = r1.get(r4) // Catch: java.lang.Throwable -> L1b java.io.IOException -> L20 - if (r4 != 0) goto Le - goto L13 - Le: - r1 = 0 - java.io.File r0 = r4.getFile(r1) // Catch: java.io.IOException -> L19 java.lang.Throwable -> L2b - L13: - if (r4 == 0) goto L18 - r4.close() - L18: - return r0 - L19: - r1 = move-exception - goto L22 - L1b: - r4 = move-exception - r2 = r0 - r0 = r4 - r4 = r2 - goto L2c - L20: - r1 = move-exception - r4 = r0 - L22: - com.nostra13.universalimageloader.utils.L.e(r1) // Catch: java.lang.Throwable -> L2b - if (r4 == 0) goto L2a - r4.close() - L2a: - return r0 - L2b: - r0 = move-exception - L2c: - if (r4 == 0) goto L31 - r4.close() - L31: - throw r0 - */ - throw new UnsupportedOperationException("Method not decompiled: com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache.get(java.lang.String):java.io.File"); - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, InputStream inputStream, IoUtils.CopyListener copyListener) throws IOException { - DiskLruCache.Editor edit = this.cache.edit(getKey(str)); - if (edit == null) { - return false; - } - BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(edit.newOutputStream(0), this.bufferSize); - try { - boolean copyStream = IoUtils.copyStream(inputStream, bufferedOutputStream, copyListener, this.bufferSize); - IoUtils.closeSilently(bufferedOutputStream); - if (copyStream) { - edit.commit(); - } else { - edit.abort(); - } - return copyStream; - } catch (Throwable th) { - IoUtils.closeSilently(bufferedOutputStream); - edit.abort(); - throw th; - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean save(String str, Bitmap bitmap) throws IOException { - DiskLruCache.Editor edit = this.cache.edit(getKey(str)); - if (edit == null) { - return false; - } - BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(edit.newOutputStream(0), this.bufferSize); - try { - boolean compress = bitmap.compress(this.compressFormat, this.compressQuality, bufferedOutputStream); - if (compress) { - edit.commit(); - } else { - edit.abort(); - } - return compress; - } finally { - IoUtils.closeSilently(bufferedOutputStream); - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public boolean remove(String str) { - try { - return this.cache.remove(getKey(str)); - } catch (IOException e) { - L.e(e); - return false; - } - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public void close() { - try { - this.cache.close(); - } catch (IOException e) { - L.e(e); - } - this.cache = null; - } - - @Override // com.nostra13.universalimageloader.cache.disc.DiskCache - public void clear() { - try { - this.cache.delete(); - } catch (IOException e) { - L.e(e); - } - try { - initCache(this.cache.getDirectory(), this.reserveCacheDir, this.cache.getMaxSize(), this.cache.getMaxFileCount()); - } catch (IOException e2) { - L.e(e2); - } - } - - private String getKey(String str) { - return this.fileNameGenerator.generate(str); - } - - public void setBufferSize(int i) { - this.bufferSize = i; - } - - public void setCompressFormat(Bitmap.CompressFormat compressFormat) { - this.compressFormat = compressFormat; - } - - public void setCompressQuality(int i) { - this.compressQuality = i; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/StrictLineReader.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/StrictLineReader.java deleted file mode 100644 index 652fa54..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/StrictLineReader.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl.ext; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; - -/* loaded from: classes.dex */ -class StrictLineReader implements Closeable { - private static final byte CR = 13; - private static final byte LF = 10; - private byte[] buf; - private final Charset charset; - private int end; - - /* renamed from: in reason: collision with root package name */ - private final InputStream f20in; - private int pos; - - public StrictLineReader(InputStream inputStream, Charset charset) { - this(inputStream, 8192, charset); - } - - public StrictLineReader(InputStream inputStream, int i, Charset charset) { - if (inputStream == null || charset == null) { - throw null; - } - if (i < 0) { - throw new IllegalArgumentException("capacity <= 0"); - } - if (!charset.equals(Util.US_ASCII)) { - throw new IllegalArgumentException("Unsupported encoding"); - } - this.f20in = inputStream; - this.charset = charset; - this.buf = new byte[i]; - } - - @Override // java.io.Closeable, java.lang.AutoCloseable - public void close() throws IOException { - synchronized (this.f20in) { - if (this.buf != null) { - this.buf = null; - this.f20in.close(); - } - } - } - - public String readLine() throws IOException { - int i; - byte[] bArr; - int i2; - synchronized (this.f20in) { - if (this.buf == null) { - throw new IOException("LineReader is closed"); - } - if (this.pos >= this.end) { - fillBuf(); - } - for (int i3 = this.pos; i3 != this.end; i3++) { - byte[] bArr2 = this.buf; - if (bArr2[i3] == 10) { - int i4 = this.pos; - if (i3 != i4) { - i2 = i3 - 1; - if (bArr2[i2] == 13) { - String str = new String(bArr2, i4, i2 - i4, this.charset.name()); - this.pos = i3 + 1; - return str; - } - } - i2 = i3; - String str2 = new String(bArr2, i4, i2 - i4, this.charset.name()); - this.pos = i3 + 1; - return str2; - } - } - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream((this.end - this.pos) + 80) { // from class: com.nostra13.universalimageloader.cache.disc.impl.ext.StrictLineReader.1 - @Override // java.io.ByteArrayOutputStream - public String toString() { - try { - return new String(this.buf, 0, (this.count <= 0 || this.buf[this.count + (-1)] != 13) ? this.count : this.count - 1, StrictLineReader.this.charset.name()); - } catch (UnsupportedEncodingException e) { - throw new AssertionError(e); - } - } - }; - loop1: while (true) { - byte[] bArr3 = this.buf; - int i5 = this.pos; - byteArrayOutputStream.write(bArr3, i5, this.end - i5); - this.end = -1; - fillBuf(); - i = this.pos; - while (i != this.end) { - bArr = this.buf; - if (bArr[i] == 10) { - break loop1; - } - i++; - } - } - int i6 = this.pos; - if (i != i6) { - byteArrayOutputStream.write(bArr, i6, i - i6); - } - this.pos = i + 1; - return byteArrayOutputStream.toString(); - } - } - - private void fillBuf() throws IOException { - InputStream inputStream = this.f20in; - byte[] bArr = this.buf; - int read = inputStream.read(bArr, 0, bArr.length); - if (read == -1) { - throw new EOFException(); - } - this.pos = 0; - this.end = read; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/Util.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/Util.java deleted file mode 100644 index 806f42c..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/Util.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.impl.ext; - -import java.io.Closeable; -import java.io.File; -import java.io.IOException; -import java.io.Reader; -import java.io.StringWriter; -import java.nio.charset.Charset; - -/* loaded from: classes.dex */ -final class Util { - static final Charset US_ASCII = Charset.forName("US-ASCII"); - static final Charset UTF_8 = Charset.forName("UTF-8"); - - private Util() { - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public static String readFully(Reader reader) throws IOException { - try { - StringWriter stringWriter = new StringWriter(); - char[] cArr = new char[1024]; - while (true) { - int read = reader.read(cArr); - if (read != -1) { - stringWriter.write(cArr, 0, read); - } else { - return stringWriter.toString(); - } - } - } finally { - reader.close(); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public static void deleteContents(File file) throws IOException { - File[] listFiles = file.listFiles(); - if (listFiles == null) { - throw new IOException("not a readable directory: " + file); - } - for (File file2 : listFiles) { - if (file2.isDirectory()) { - deleteContents(file2); - } - if (!file2.delete()) { - throw new IOException("failed to delete file: " + file2); - } - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public static void closeQuietly(Closeable closeable) { - if (closeable != null) { - try { - closeable.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception unused) { - } - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/FileNameGenerator.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/FileNameGenerator.java deleted file mode 100644 index 3e620aa..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/FileNameGenerator.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.naming; - -/* loaded from: classes.dex */ -public interface FileNameGenerator { - String generate(String str); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/HashCodeFileNameGenerator.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/HashCodeFileNameGenerator.java deleted file mode 100644 index 08e0ce2..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/HashCodeFileNameGenerator.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.naming; - -/* loaded from: classes.dex */ -public class HashCodeFileNameGenerator implements FileNameGenerator { - @Override // com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator - public String generate(String str) { - return String.valueOf(str.hashCode()); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/Md5FileNameGenerator.java b/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/Md5FileNameGenerator.java deleted file mode 100644 index 0b7b3f8..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/disc/naming/Md5FileNameGenerator.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.nostra13.universalimageloader.cache.disc.naming; - -import com.nostra13.universalimageloader.utils.L; -import java.math.BigInteger; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -/* loaded from: classes.dex */ -public class Md5FileNameGenerator implements FileNameGenerator { - private static final String HASH_ALGORITHM = "MD5"; - private static final int RADIX = 36; - - @Override // com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator - public String generate(String str) { - return new BigInteger(getMD5(str.getBytes())).abs().toString(36); - } - - private byte[] getMD5(byte[] bArr) { - try { - MessageDigest messageDigest = MessageDigest.getInstance(HASH_ALGORITHM); - messageDigest.update(bArr); - return messageDigest.digest(); - } catch (NoSuchAlgorithmException e) { - L.e(e); - return null; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/BaseMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/BaseMemoryCache.java deleted file mode 100644 index 66922db..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/BaseMemoryCache.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory; - -import android.graphics.Bitmap; -import java.lang.ref.Reference; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; - -/* loaded from: classes.dex */ -public abstract class BaseMemoryCache implements MemoryCache { - private final Map> softMap = Collections.synchronizedMap(new HashMap()); - - protected abstract Reference createReference(Bitmap bitmap); - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap get(String str) { - Reference reference = this.softMap.get(str); - if (reference != null) { - return reference.get(); - } - return null; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - this.softMap.put(str, createReference(bitmap)); - return true; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - Reference remove = this.softMap.remove(str); - if (remove == null) { - return null; - } - return remove.get(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Collection keys() { - HashSet hashSet; - synchronized (this.softMap) { - hashSet = new HashSet(this.softMap.keySet()); - } - return hashSet; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.softMap.clear(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/LimitedMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/LimitedMemoryCache.java deleted file mode 100644 index f1e047a..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/LimitedMemoryCache.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.utils.L; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -/* loaded from: classes.dex */ -public abstract class LimitedMemoryCache extends BaseMemoryCache { - private static final int MAX_NORMAL_CACHE_SIZE = 16777216; - private static final int MAX_NORMAL_CACHE_SIZE_IN_MB = 16; - private final int sizeLimit; - private final List hardCache = Collections.synchronizedList(new LinkedList()); - private final AtomicInteger cacheSize = new AtomicInteger(); - - protected abstract int getSize(Bitmap bitmap); - - protected abstract Bitmap removeNext(); - - public LimitedMemoryCache(int i) { - this.sizeLimit = i; - if (i > 16777216) { - L.w("You set too large memory cache size (more than %1$d Mb)", 16); - } - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - boolean z; - int size = getSize(bitmap); - int sizeLimit = getSizeLimit(); - int i = this.cacheSize.get(); - if (size < sizeLimit) { - while (i + size > sizeLimit) { - Bitmap removeNext = removeNext(); - if (this.hardCache.remove(removeNext)) { - i = this.cacheSize.addAndGet(-getSize(removeNext)); - } - } - this.hardCache.add(bitmap); - this.cacheSize.addAndGet(size); - z = true; - } else { - z = false; - } - super.put(str, bitmap); - return z; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - Bitmap bitmap = super.get(str); - if (bitmap != null && this.hardCache.remove(bitmap)) { - this.cacheSize.addAndGet(-getSize(bitmap)); - } - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.hardCache.clear(); - this.cacheSize.set(0); - super.clear(); - } - - protected int getSizeLimit() { - return this.sizeLimit; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/MemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/MemoryCache.java deleted file mode 100644 index d603e15..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/MemoryCache.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory; - -import android.graphics.Bitmap; -import java.util.Collection; - -/* loaded from: classes.dex */ -public interface MemoryCache { - void clear(); - - Bitmap get(String str); - - Collection keys(); - - boolean put(String str, Bitmap bitmap); - - Bitmap remove(String str); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FIFOLimitedMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FIFOLimitedMemoryCache.java deleted file mode 100644 index f557392..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FIFOLimitedMemoryCache.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -/* loaded from: classes.dex */ -public class FIFOLimitedMemoryCache extends LimitedMemoryCache { - private final List queue; - - public FIFOLimitedMemoryCache(int i) { - super(i); - this.queue = Collections.synchronizedList(new LinkedList()); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - if (super.put(str, bitmap)) { - this.queue.add(bitmap); - return true; - } - return false; - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - Bitmap bitmap = super.get(str); - if (bitmap != null) { - this.queue.remove(bitmap); - } - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.queue.clear(); - super.clear(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected int getSize(Bitmap bitmap) { - return bitmap.getRowBytes() * bitmap.getHeight(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected Bitmap removeNext() { - return this.queue.remove(0); - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache - protected Reference createReference(Bitmap bitmap) { - return new WeakReference(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FuzzyKeyMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FuzzyKeyMemoryCache.java deleted file mode 100644 index ed6acb8..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/FuzzyKeyMemoryCache.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import java.util.Collection; -import java.util.Comparator; -import java.util.Iterator; - -/* loaded from: classes.dex */ -public class FuzzyKeyMemoryCache implements MemoryCache { - private final MemoryCache cache; - private final Comparator keyComparator; - - public FuzzyKeyMemoryCache(MemoryCache memoryCache, Comparator comparator) { - this.cache = memoryCache; - this.keyComparator = comparator; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - synchronized (this.cache) { - String str2 = null; - Iterator it = this.cache.keys().iterator(); - while (true) { - if (!it.hasNext()) { - break; - } - String next = it.next(); - if (this.keyComparator.compare(str, next) == 0) { - str2 = next; - break; - } - } - if (str2 != null) { - this.cache.remove(str2); - } - } - return this.cache.put(str, bitmap); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap get(String str) { - return this.cache.get(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - return this.cache.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.cache.clear(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Collection keys() { - return this.cache.keys(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LRULimitedMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LRULimitedMemoryCache.java deleted file mode 100644 index 955d06e..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LRULimitedMemoryCache.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; - -/* loaded from: classes.dex */ -public class LRULimitedMemoryCache extends LimitedMemoryCache { - private static final int INITIAL_CAPACITY = 10; - private static final float LOAD_FACTOR = 1.1f; - private final Map lruCache; - - public LRULimitedMemoryCache(int i) { - super(i); - this.lruCache = Collections.synchronizedMap(new LinkedHashMap(10, LOAD_FACTOR, true)); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - if (super.put(str, bitmap)) { - this.lruCache.put(str, bitmap); - return true; - } - return false; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap get(String str) { - this.lruCache.get(str); - return super.get(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - this.lruCache.remove(str); - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.lruCache.clear(); - super.clear(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected int getSize(Bitmap bitmap) { - return bitmap.getRowBytes() * bitmap.getHeight(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected Bitmap removeNext() { - Bitmap bitmap; - synchronized (this.lruCache) { - Iterator> it = this.lruCache.entrySet().iterator(); - if (it.hasNext()) { - bitmap = it.next().getValue(); - it.remove(); - } else { - bitmap = null; - } - } - return bitmap; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache - protected Reference createReference(Bitmap bitmap) { - return new WeakReference(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LargestLimitedMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LargestLimitedMemoryCache.java deleted file mode 100644 index 3550e0d..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LargestLimitedMemoryCache.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/* loaded from: classes.dex */ -public class LargestLimitedMemoryCache extends LimitedMemoryCache { - private final Map valueSizes; - - public LargestLimitedMemoryCache(int i) { - super(i); - this.valueSizes = Collections.synchronizedMap(new HashMap()); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - if (super.put(str, bitmap)) { - this.valueSizes.put(bitmap, Integer.valueOf(getSize(bitmap))); - return true; - } - return false; - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - Bitmap bitmap = super.get(str); - if (bitmap != null) { - this.valueSizes.remove(bitmap); - } - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.valueSizes.clear(); - super.clear(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected int getSize(Bitmap bitmap) { - return bitmap.getRowBytes() * bitmap.getHeight(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected Bitmap removeNext() { - Bitmap bitmap; - Set> entrySet = this.valueSizes.entrySet(); - synchronized (this.valueSizes) { - bitmap = null; - Integer num = null; - for (Map.Entry entry : entrySet) { - if (bitmap == null) { - bitmap = entry.getKey(); - num = entry.getValue(); - } else { - Integer value = entry.getValue(); - if (value.intValue() > num.intValue()) { - bitmap = entry.getKey(); - num = value; - } - } - } - } - this.valueSizes.remove(bitmap); - return bitmap; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache - protected Reference createReference(Bitmap bitmap) { - return new WeakReference(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LimitedAgeMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LimitedAgeMemoryCache.java deleted file mode 100644 index 5463f95..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LimitedAgeMemoryCache.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/* loaded from: classes.dex */ -public class LimitedAgeMemoryCache implements MemoryCache { - private final MemoryCache cache; - private final Map loadingDates = Collections.synchronizedMap(new HashMap()); - private final long maxAge; - - public LimitedAgeMemoryCache(MemoryCache memoryCache, long j) { - this.cache = memoryCache; - this.maxAge = j * 1000; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - boolean put = this.cache.put(str, bitmap); - if (put) { - this.loadingDates.put(str, Long.valueOf(System.currentTimeMillis())); - } - return put; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap get(String str) { - Long l = this.loadingDates.get(str); - if (l != null && System.currentTimeMillis() - l.longValue() > this.maxAge) { - this.cache.remove(str); - this.loadingDates.remove(str); - } - return this.cache.get(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - this.loadingDates.remove(str); - return this.cache.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Collection keys() { - return this.cache.keys(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.cache.clear(); - this.loadingDates.clear(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java deleted file mode 100644 index 3169162..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Objects; - -/* loaded from: classes.dex */ -public class LruMemoryCache implements MemoryCache { - private final LinkedHashMap map; - private final int maxSize; - private int size; - - public LruMemoryCache(int i) { - if (i <= 0) { - throw new IllegalArgumentException("maxSize <= 0"); - } - this.maxSize = i; - this.map = new LinkedHashMap<>(0, 0.75f, true); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public final Bitmap get(String str) { - Bitmap bitmap; - Objects.requireNonNull(str, "key == null"); - synchronized (this) { - bitmap = this.map.get(str); - } - return bitmap; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public final boolean put(String str, Bitmap bitmap) { - if (str == null || bitmap == null) { - throw new NullPointerException("key == null || value == null"); - } - synchronized (this) { - this.size += sizeOf(str, bitmap); - Bitmap put = this.map.put(str, bitmap); - if (put != null) { - this.size -= sizeOf(str, put); - } - } - trimToSize(this.maxSize); - return true; - } - - /* JADX WARN: Code restructure failed: missing block: B:24:0x006e, code lost: - throw new java.lang.IllegalStateException(getClass().getName() + ".sizeOf() is reporting inconsistent results!"); - */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private void trimToSize(int r4) { - /* - r3 = this; - L0: - monitor-enter(r3) - int r0 = r3.size // Catch: java.lang.Throwable -> L6f - if (r0 < 0) goto L50 - java.util.LinkedHashMap r0 = r3.map // Catch: java.lang.Throwable -> L6f - boolean r0 = r0.isEmpty() // Catch: java.lang.Throwable -> L6f - if (r0 == 0) goto L11 - int r0 = r3.size // Catch: java.lang.Throwable -> L6f - if (r0 != 0) goto L50 - L11: - int r0 = r3.size // Catch: java.lang.Throwable -> L6f - if (r0 <= r4) goto L4e - java.util.LinkedHashMap r0 = r3.map // Catch: java.lang.Throwable -> L6f - boolean r0 = r0.isEmpty() // Catch: java.lang.Throwable -> L6f - if (r0 == 0) goto L1e - goto L4e - L1e: - java.util.LinkedHashMap r0 = r3.map // Catch: java.lang.Throwable -> L6f - java.util.Set r0 = r0.entrySet() // Catch: java.lang.Throwable -> L6f - java.util.Iterator r0 = r0.iterator() // Catch: java.lang.Throwable -> L6f - java.lang.Object r0 = r0.next() // Catch: java.lang.Throwable -> L6f - java.util.Map$Entry r0 = (java.util.Map.Entry) r0 // Catch: java.lang.Throwable -> L6f - if (r0 != 0) goto L32 - monitor-exit(r3) // Catch: java.lang.Throwable -> L6f - goto L4f - L32: - java.lang.Object r1 = r0.getKey() // Catch: java.lang.Throwable -> L6f - java.lang.String r1 = (java.lang.String) r1 // Catch: java.lang.Throwable -> L6f - java.lang.Object r0 = r0.getValue() // Catch: java.lang.Throwable -> L6f - android.graphics.Bitmap r0 = (android.graphics.Bitmap) r0 // Catch: java.lang.Throwable -> L6f - java.util.LinkedHashMap r2 = r3.map // Catch: java.lang.Throwable -> L6f - r2.remove(r1) // Catch: java.lang.Throwable -> L6f - int r2 = r3.size // Catch: java.lang.Throwable -> L6f - int r0 = r3.sizeOf(r1, r0) // Catch: java.lang.Throwable -> L6f - int r2 = r2 - r0 - r3.size = r2 // Catch: java.lang.Throwable -> L6f - monitor-exit(r3) // Catch: java.lang.Throwable -> L6f - goto L0 - L4e: - monitor-exit(r3) // Catch: java.lang.Throwable -> L6f - L4f: - return - L50: - java.lang.IllegalStateException r4 = new java.lang.IllegalStateException // Catch: java.lang.Throwable -> L6f - java.lang.StringBuilder r0 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L6f - r0.() // Catch: java.lang.Throwable -> L6f - java.lang.Class r1 = r3.getClass() // Catch: java.lang.Throwable -> L6f - java.lang.String r1 = r1.getName() // Catch: java.lang.Throwable -> L6f - r0.append(r1) // Catch: java.lang.Throwable -> L6f - java.lang.String r1 = ".sizeOf() is reporting inconsistent results!" - r0.append(r1) // Catch: java.lang.Throwable -> L6f - java.lang.String r0 = r0.toString() // Catch: java.lang.Throwable -> L6f - r4.(r0) // Catch: java.lang.Throwable -> L6f - throw r4 // Catch: java.lang.Throwable -> L6f - L6f: - r4 = move-exception - monitor-exit(r3) // Catch: java.lang.Throwable -> L6f - goto L73 - L72: - throw r4 - L73: - goto L72 - */ - throw new UnsupportedOperationException("Method not decompiled: com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache.trimToSize(int):void"); - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public final Bitmap remove(String str) { - Bitmap remove; - Objects.requireNonNull(str, "key == null"); - synchronized (this) { - remove = this.map.remove(str); - if (remove != null) { - this.size -= sizeOf(str, remove); - } - } - return remove; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public Collection keys() { - HashSet hashSet; - synchronized (this) { - hashSet = new HashSet(this.map.keySet()); - } - return hashSet; - } - - @Override // com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - trimToSize(-1); - } - - private int sizeOf(String str, Bitmap bitmap) { - return bitmap.getRowBytes() * bitmap.getHeight(); - } - - public final synchronized String toString() { - return String.format("LruCache[maxSize=%d]", Integer.valueOf(this.maxSize)); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/UsingFreqLimitedMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/UsingFreqLimitedMemoryCache.java deleted file mode 100644 index 9046d10..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/UsingFreqLimitedMemoryCache.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/* loaded from: classes.dex */ -public class UsingFreqLimitedMemoryCache extends LimitedMemoryCache { - private final Map usingCounts; - - public UsingFreqLimitedMemoryCache(int i) { - super(i); - this.usingCounts = Collections.synchronizedMap(new HashMap()); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public boolean put(String str, Bitmap bitmap) { - if (super.put(str, bitmap)) { - this.usingCounts.put(bitmap, 0); - return true; - } - return false; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap get(String str) { - Integer num; - Bitmap bitmap = super.get(str); - if (bitmap != null && (num = this.usingCounts.get(bitmap)) != null) { - this.usingCounts.put(bitmap, Integer.valueOf(num.intValue() + 1)); - } - return bitmap; - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public Bitmap remove(String str) { - Bitmap bitmap = super.get(str); - if (bitmap != null) { - this.usingCounts.remove(bitmap); - } - return super.remove(str); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache, com.nostra13.universalimageloader.cache.memory.BaseMemoryCache, com.nostra13.universalimageloader.cache.memory.MemoryCache - public void clear() { - this.usingCounts.clear(); - super.clear(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected int getSize(Bitmap bitmap) { - return bitmap.getRowBytes() * bitmap.getHeight(); - } - - @Override // com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache - protected Bitmap removeNext() { - Bitmap bitmap; - Set> entrySet = this.usingCounts.entrySet(); - synchronized (this.usingCounts) { - bitmap = null; - Integer num = null; - for (Map.Entry entry : entrySet) { - if (bitmap == null) { - bitmap = entry.getKey(); - num = entry.getValue(); - } else { - Integer value = entry.getValue(); - if (value.intValue() < num.intValue()) { - bitmap = entry.getKey(); - num = value; - } - } - } - } - this.usingCounts.remove(bitmap); - return bitmap; - } - - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache - protected Reference createReference(Bitmap bitmap) { - return new WeakReference(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/WeakMemoryCache.java b/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/WeakMemoryCache.java deleted file mode 100644 index 8ebe6a0..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/WeakMemoryCache.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.nostra13.universalimageloader.cache.memory.impl; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.BaseMemoryCache; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; - -/* loaded from: classes.dex */ -public class WeakMemoryCache extends BaseMemoryCache { - @Override // com.nostra13.universalimageloader.cache.memory.BaseMemoryCache - protected Reference createReference(Bitmap bitmap) { - return new WeakReference(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java b/app/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java deleted file mode 100644 index a52b629..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.app.ActivityManager; -import android.content.Context; -import android.os.Build; -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache; -import com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache; -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache; -import com.nostra13.universalimageloader.core.assist.QueueProcessingType; -import com.nostra13.universalimageloader.core.assist.deque.LIFOLinkedBlockingDeque; -import com.nostra13.universalimageloader.core.decode.BaseImageDecoder; -import com.nostra13.universalimageloader.core.decode.ImageDecoder; -import com.nostra13.universalimageloader.core.display.BitmapDisplayer; -import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer; -import com.nostra13.universalimageloader.core.download.BaseImageDownloader; -import com.nostra13.universalimageloader.core.download.ImageDownloader; -import com.nostra13.universalimageloader.utils.L; -import com.nostra13.universalimageloader.utils.StorageUtils; -import java.io.File; -import java.io.IOException; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/* loaded from: classes.dex */ -public class DefaultConfigurationFactory { - public static Executor createExecutor(int i, int i2, QueueProcessingType queueProcessingType) { - return new ThreadPoolExecutor(i, i, 0L, TimeUnit.MILLISECONDS, queueProcessingType == QueueProcessingType.LIFO ? new LIFOLinkedBlockingDeque() : new LinkedBlockingQueue(), createThreadFactory(i2, "uil-pool-")); - } - - public static Executor createTaskDistributor() { - return Executors.newCachedThreadPool(createThreadFactory(5, "uil-pool-d-")); - } - - public static FileNameGenerator createFileNameGenerator() { - return new HashCodeFileNameGenerator(); - } - - public static DiskCache createDiskCache(Context context, FileNameGenerator fileNameGenerator, long j, int i) { - File createReserveDiskCacheDir = createReserveDiskCacheDir(context); - if (j > 0 || i > 0) { - try { - return new LruDiskCache(StorageUtils.getIndividualCacheDirectory(context), createReserveDiskCacheDir, fileNameGenerator, j, i); - } catch (IOException e) { - L.e(e); - } - } - return new UnlimitedDiskCache(StorageUtils.getCacheDirectory(context), createReserveDiskCacheDir, fileNameGenerator); - } - - private static File createReserveDiskCacheDir(Context context) { - File cacheDirectory = StorageUtils.getCacheDirectory(context, false); - File file = new File(cacheDirectory, "uil-images"); - return (file.exists() || file.mkdir()) ? file : cacheDirectory; - } - - public static MemoryCache createMemoryCache(Context context, int i) { - if (i == 0) { - ActivityManager activityManager = (ActivityManager) context.getSystemService("activity"); - int memoryClass = activityManager.getMemoryClass(); - if (hasHoneycomb() && isLargeHeap(context)) { - memoryClass = getLargeMemoryClass(activityManager); - } - i = (memoryClass * 1048576) / 8; - } - return new LruMemoryCache(i); - } - - private static boolean hasHoneycomb() { - return Build.VERSION.SDK_INT >= 11; - } - - private static boolean isLargeHeap(Context context) { - return (context.getApplicationInfo().flags & 1048576) != 0; - } - - private static int getLargeMemoryClass(ActivityManager activityManager) { - return activityManager.getLargeMemoryClass(); - } - - public static ImageDownloader createImageDownloader(Context context) { - return new BaseImageDownloader(context); - } - - public static ImageDecoder createImageDecoder(boolean z) { - return new BaseImageDecoder(z); - } - - public static BitmapDisplayer createBitmapDisplayer() { - return new SimpleBitmapDisplayer(); - } - - private static ThreadFactory createThreadFactory(int i, String str) { - return new DefaultThreadFactory(i, str); - } - - /* JADX INFO: Access modifiers changed from: private */ - /* loaded from: classes.dex */ - public static class DefaultThreadFactory implements ThreadFactory { - private static final AtomicInteger poolNumber = new AtomicInteger(1); - private final String namePrefix; - private final int threadPriority; - private final AtomicInteger threadNumber = new AtomicInteger(1); - private final ThreadGroup group = Thread.currentThread().getThreadGroup(); - - DefaultThreadFactory(int i, String str) { - this.threadPriority = i; - this.namePrefix = str + poolNumber.getAndIncrement() + "-thread-"; - } - - @Override // java.util.concurrent.ThreadFactory - public Thread newThread(Runnable runnable) { - ThreadGroup threadGroup = this.group; - Thread thread = new Thread(threadGroup, runnable, this.namePrefix + this.threadNumber.getAndIncrement(), 0L); - if (thread.isDaemon()) { - thread.setDaemon(false); - } - thread.setPriority(this.threadPriority); - return thread; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/DisplayBitmapTask.java b/app/src/main/java/com/nostra13/universalimageloader/core/DisplayBitmapTask.java deleted file mode 100644 index bdef732..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/DisplayBitmapTask.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.display.BitmapDisplayer; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; -import com.nostra13.universalimageloader.utils.L; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public final class DisplayBitmapTask implements Runnable { - private static final String LOG_DISPLAY_IMAGE_IN_IMAGEAWARE = "Display image in ImageAware (loaded from %1$s) [%2$s]"; - private static final String LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED = "ImageAware was collected by GC. Task is cancelled. [%s]"; - private static final String LOG_TASK_CANCELLED_IMAGEAWARE_REUSED = "ImageAware is reused for another image. Task is cancelled. [%s]"; - private final Bitmap bitmap; - private final BitmapDisplayer displayer; - private final ImageLoaderEngine engine; - private final ImageAware imageAware; - private final String imageUri; - private final ImageLoadingListener listener; - private final LoadedFrom loadedFrom; - private final String memoryCacheKey; - - public DisplayBitmapTask(Bitmap bitmap, ImageLoadingInfo imageLoadingInfo, ImageLoaderEngine imageLoaderEngine, LoadedFrom loadedFrom) { - this.bitmap = bitmap; - this.imageUri = imageLoadingInfo.uri; - this.imageAware = imageLoadingInfo.imageAware; - this.memoryCacheKey = imageLoadingInfo.memoryCacheKey; - this.displayer = imageLoadingInfo.options.getDisplayer(); - this.listener = imageLoadingInfo.listener; - this.engine = imageLoaderEngine; - this.loadedFrom = loadedFrom; - } - - @Override // java.lang.Runnable - public void run() { - if (this.imageAware.isCollected()) { - L.d(LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED, this.memoryCacheKey); - this.listener.onLoadingCancelled(this.imageUri, this.imageAware.getWrappedView()); - } else if (isViewWasReused()) { - L.d(LOG_TASK_CANCELLED_IMAGEAWARE_REUSED, this.memoryCacheKey); - this.listener.onLoadingCancelled(this.imageUri, this.imageAware.getWrappedView()); - } else { - L.d(LOG_DISPLAY_IMAGE_IN_IMAGEAWARE, this.loadedFrom, this.memoryCacheKey); - this.displayer.display(this.bitmap, this.imageAware, this.loadedFrom); - this.engine.cancelDisplayTaskFor(this.imageAware); - this.listener.onLoadingComplete(this.imageUri, this.imageAware.getWrappedView(), this.bitmap); - } - } - - private boolean isViewWasReused() { - return !this.memoryCacheKey.equals(this.engine.getLoadingUriForView(this.imageAware)); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/DisplayImageOptions.java b/app/src/main/java/com/nostra13/universalimageloader/core/DisplayImageOptions.java deleted file mode 100644 index 0eb9b56..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/DisplayImageOptions.java +++ /dev/null @@ -1,338 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.drawable.Drawable; -import android.os.Handler; -import com.nostra13.universalimageloader.core.assist.ImageScaleType; -import com.nostra13.universalimageloader.core.display.BitmapDisplayer; -import com.nostra13.universalimageloader.core.process.BitmapProcessor; - -/* loaded from: classes.dex */ -public final class DisplayImageOptions { - private final boolean cacheInMemory; - private final boolean cacheOnDisk; - private final boolean considerExifParams; - private final BitmapFactory.Options decodingOptions; - private final int delayBeforeLoading; - private final BitmapDisplayer displayer; - private final Object extraForDownloader; - private final Handler handler; - private final Drawable imageForEmptyUri; - private final Drawable imageOnFail; - private final Drawable imageOnLoading; - private final int imageResForEmptyUri; - private final int imageResOnFail; - private final int imageResOnLoading; - private final ImageScaleType imageScaleType; - private final boolean isSyncLoading; - private final BitmapProcessor postProcessor; - private final BitmapProcessor preProcessor; - private final boolean resetViewBeforeLoading; - - private DisplayImageOptions(Builder builder) { - this.imageResOnLoading = builder.imageResOnLoading; - this.imageResForEmptyUri = builder.imageResForEmptyUri; - this.imageResOnFail = builder.imageResOnFail; - this.imageOnLoading = builder.imageOnLoading; - this.imageForEmptyUri = builder.imageForEmptyUri; - this.imageOnFail = builder.imageOnFail; - this.resetViewBeforeLoading = builder.resetViewBeforeLoading; - this.cacheInMemory = builder.cacheInMemory; - this.cacheOnDisk = builder.cacheOnDisk; - this.imageScaleType = builder.imageScaleType; - this.decodingOptions = builder.decodingOptions; - this.delayBeforeLoading = builder.delayBeforeLoading; - this.considerExifParams = builder.considerExifParams; - this.extraForDownloader = builder.extraForDownloader; - this.preProcessor = builder.preProcessor; - this.postProcessor = builder.postProcessor; - this.displayer = builder.displayer; - this.handler = builder.handler; - this.isSyncLoading = builder.isSyncLoading; - } - - public boolean shouldShowImageOnLoading() { - return (this.imageOnLoading == null && this.imageResOnLoading == 0) ? false : true; - } - - public boolean shouldShowImageForEmptyUri() { - return (this.imageForEmptyUri == null && this.imageResForEmptyUri == 0) ? false : true; - } - - public boolean shouldShowImageOnFail() { - return (this.imageOnFail == null && this.imageResOnFail == 0) ? false : true; - } - - public boolean shouldPreProcess() { - return this.preProcessor != null; - } - - public boolean shouldPostProcess() { - return this.postProcessor != null; - } - - public boolean shouldDelayBeforeLoading() { - return this.delayBeforeLoading > 0; - } - - public Drawable getImageOnLoading(Resources resources) { - int i = this.imageResOnLoading; - return i != 0 ? resources.getDrawable(i) : this.imageOnLoading; - } - - public Drawable getImageForEmptyUri(Resources resources) { - int i = this.imageResForEmptyUri; - return i != 0 ? resources.getDrawable(i) : this.imageForEmptyUri; - } - - public Drawable getImageOnFail(Resources resources) { - int i = this.imageResOnFail; - return i != 0 ? resources.getDrawable(i) : this.imageOnFail; - } - - public boolean isResetViewBeforeLoading() { - return this.resetViewBeforeLoading; - } - - public boolean isCacheInMemory() { - return this.cacheInMemory; - } - - public boolean isCacheOnDisk() { - return this.cacheOnDisk; - } - - public ImageScaleType getImageScaleType() { - return this.imageScaleType; - } - - public BitmapFactory.Options getDecodingOptions() { - return this.decodingOptions; - } - - public int getDelayBeforeLoading() { - return this.delayBeforeLoading; - } - - public boolean isConsiderExifParams() { - return this.considerExifParams; - } - - public Object getExtraForDownloader() { - return this.extraForDownloader; - } - - public BitmapProcessor getPreProcessor() { - return this.preProcessor; - } - - public BitmapProcessor getPostProcessor() { - return this.postProcessor; - } - - public BitmapDisplayer getDisplayer() { - return this.displayer; - } - - public Handler getHandler() { - return this.handler; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public boolean isSyncLoading() { - return this.isSyncLoading; - } - - /* loaded from: classes.dex */ - public static class Builder { - private int imageResOnLoading = 0; - private int imageResForEmptyUri = 0; - private int imageResOnFail = 0; - private Drawable imageOnLoading = null; - private Drawable imageForEmptyUri = null; - private Drawable imageOnFail = null; - private boolean resetViewBeforeLoading = false; - private boolean cacheInMemory = false; - private boolean cacheOnDisk = false; - private ImageScaleType imageScaleType = ImageScaleType.IN_SAMPLE_POWER_OF_2; - private BitmapFactory.Options decodingOptions = new BitmapFactory.Options(); - private int delayBeforeLoading = 0; - private boolean considerExifParams = false; - private Object extraForDownloader = null; - private BitmapProcessor preProcessor = null; - private BitmapProcessor postProcessor = null; - private BitmapDisplayer displayer = DefaultConfigurationFactory.createBitmapDisplayer(); - private Handler handler = null; - private boolean isSyncLoading = false; - - @Deprecated - public Builder showStubImage(int i) { - this.imageResOnLoading = i; - return this; - } - - public Builder showImageOnLoading(int i) { - this.imageResOnLoading = i; - return this; - } - - public Builder showImageOnLoading(Drawable drawable) { - this.imageOnLoading = drawable; - return this; - } - - public Builder showImageForEmptyUri(int i) { - this.imageResForEmptyUri = i; - return this; - } - - public Builder showImageForEmptyUri(Drawable drawable) { - this.imageForEmptyUri = drawable; - return this; - } - - public Builder showImageOnFail(int i) { - this.imageResOnFail = i; - return this; - } - - public Builder showImageOnFail(Drawable drawable) { - this.imageOnFail = drawable; - return this; - } - - public Builder resetViewBeforeLoading() { - this.resetViewBeforeLoading = true; - return this; - } - - public Builder resetViewBeforeLoading(boolean z) { - this.resetViewBeforeLoading = z; - return this; - } - - @Deprecated - public Builder cacheInMemory() { - this.cacheInMemory = true; - return this; - } - - public Builder cacheInMemory(boolean z) { - this.cacheInMemory = z; - return this; - } - - @Deprecated - public Builder cacheOnDisc() { - return cacheOnDisk(true); - } - - @Deprecated - public Builder cacheOnDisc(boolean z) { - return cacheOnDisk(z); - } - - public Builder cacheOnDisk(boolean z) { - this.cacheOnDisk = z; - return this; - } - - public Builder imageScaleType(ImageScaleType imageScaleType) { - this.imageScaleType = imageScaleType; - return this; - } - - public Builder bitmapConfig(Bitmap.Config config) { - if (config == null) { - throw new IllegalArgumentException("bitmapConfig can't be null"); - } - this.decodingOptions.inPreferredConfig = config; - return this; - } - - public Builder decodingOptions(BitmapFactory.Options options) { - if (options == null) { - throw new IllegalArgumentException("decodingOptions can't be null"); - } - this.decodingOptions = options; - return this; - } - - public Builder delayBeforeLoading(int i) { - this.delayBeforeLoading = i; - return this; - } - - public Builder extraForDownloader(Object obj) { - this.extraForDownloader = obj; - return this; - } - - public Builder considerExifParams(boolean z) { - this.considerExifParams = z; - return this; - } - - public Builder preProcessor(BitmapProcessor bitmapProcessor) { - this.preProcessor = bitmapProcessor; - return this; - } - - public Builder postProcessor(BitmapProcessor bitmapProcessor) { - this.postProcessor = bitmapProcessor; - return this; - } - - public Builder displayer(BitmapDisplayer bitmapDisplayer) { - if (bitmapDisplayer == null) { - throw new IllegalArgumentException("displayer can't be null"); - } - this.displayer = bitmapDisplayer; - return this; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public Builder syncLoading(boolean z) { - this.isSyncLoading = z; - return this; - } - - public Builder handler(Handler handler) { - this.handler = handler; - return this; - } - - public Builder cloneFrom(DisplayImageOptions displayImageOptions) { - this.imageResOnLoading = displayImageOptions.imageResOnLoading; - this.imageResForEmptyUri = displayImageOptions.imageResForEmptyUri; - this.imageResOnFail = displayImageOptions.imageResOnFail; - this.imageOnLoading = displayImageOptions.imageOnLoading; - this.imageForEmptyUri = displayImageOptions.imageForEmptyUri; - this.imageOnFail = displayImageOptions.imageOnFail; - this.resetViewBeforeLoading = displayImageOptions.resetViewBeforeLoading; - this.cacheInMemory = displayImageOptions.cacheInMemory; - this.cacheOnDisk = displayImageOptions.cacheOnDisk; - this.imageScaleType = displayImageOptions.imageScaleType; - this.decodingOptions = displayImageOptions.decodingOptions; - this.delayBeforeLoading = displayImageOptions.delayBeforeLoading; - this.considerExifParams = displayImageOptions.considerExifParams; - this.extraForDownloader = displayImageOptions.extraForDownloader; - this.preProcessor = displayImageOptions.preProcessor; - this.postProcessor = displayImageOptions.postProcessor; - this.displayer = displayImageOptions.displayer; - this.handler = displayImageOptions.handler; - this.isSyncLoading = displayImageOptions.isSyncLoading; - return this; - } - - public DisplayImageOptions build() { - return new DisplayImageOptions(this); - } - } - - public static DisplayImageOptions createSimple() { - return new Builder().build(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java b/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java deleted file mode 100644 index ca1fb21..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java +++ /dev/null @@ -1,338 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.graphics.Bitmap; -import android.os.Handler; -import android.os.Looper; -import android.text.TextUtils; -import android.view.View; -import android.widget.ImageView; -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import com.nostra13.universalimageloader.core.DisplayImageOptions; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; -import com.nostra13.universalimageloader.core.imageaware.NonViewAware; -import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; -import com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener; -import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; -import com.nostra13.universalimageloader.utils.ImageSizeUtils; -import com.nostra13.universalimageloader.utils.L; -import com.nostra13.universalimageloader.utils.MemoryCacheUtils; - -/* loaded from: classes.dex */ -public class ImageLoader { - private static final String ERROR_INIT_CONFIG_WITH_NULL = "ImageLoader configuration can not be initialized with null"; - private static final String ERROR_NOT_INIT = "ImageLoader must be init with configuration before using"; - private static final String ERROR_WRONG_ARGUMENTS = "Wrong arguments were passed to displayImage() method (ImageView reference must not be null)"; - static final String LOG_DESTROY = "Destroy ImageLoader"; - static final String LOG_INIT_CONFIG = "Initialize ImageLoader with configuration"; - static final String LOG_LOAD_IMAGE_FROM_MEMORY_CACHE = "Load image from memory cache [%s]"; - public static final String TAG = "ImageLoader"; - private static final String WARNING_RE_INIT_CONFIG = "Try to initialize ImageLoader which had already been initialized before. To re-init ImageLoader with new configuration call ImageLoader.destroy() at first."; - private static volatile ImageLoader instance; - private ImageLoaderConfiguration configuration; - private ImageLoadingListener defaultListener = new SimpleImageLoadingListener(); - private ImageLoaderEngine engine; - - public static ImageLoader getInstance() { - if (instance == null) { - synchronized (ImageLoader.class) { - if (instance == null) { - instance = new ImageLoader(); - } - } - } - return instance; - } - - protected ImageLoader() { - } - - public synchronized void init(ImageLoaderConfiguration imageLoaderConfiguration) { - if (imageLoaderConfiguration == null) { - throw new IllegalArgumentException(ERROR_INIT_CONFIG_WITH_NULL); - } - if (this.configuration == null) { - L.d(LOG_INIT_CONFIG, new Object[0]); - this.engine = new ImageLoaderEngine(imageLoaderConfiguration); - this.configuration = imageLoaderConfiguration; - } else { - L.w(WARNING_RE_INIT_CONFIG, new Object[0]); - } - } - - public boolean isInited() { - return this.configuration != null; - } - - public void displayImage(String str, ImageAware imageAware) { - displayImage(str, imageAware, (DisplayImageOptions) null, (ImageLoadingListener) null, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageAware imageAware, ImageLoadingListener imageLoadingListener) { - displayImage(str, imageAware, (DisplayImageOptions) null, imageLoadingListener, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageAware imageAware, DisplayImageOptions displayImageOptions) { - displayImage(str, imageAware, displayImageOptions, (ImageLoadingListener) null, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageAware imageAware, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener) { - displayImage(str, imageAware, displayImageOptions, imageLoadingListener, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageAware imageAware, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener, ImageLoadingProgressListener imageLoadingProgressListener) { - displayImage(str, imageAware, displayImageOptions, null, imageLoadingListener, imageLoadingProgressListener); - } - - public void displayImage(String str, ImageAware imageAware, DisplayImageOptions displayImageOptions, ImageSize imageSize, ImageLoadingListener imageLoadingListener, ImageLoadingProgressListener imageLoadingProgressListener) { - checkConfiguration(); - if (imageAware == null) { - throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS); - } - if (imageLoadingListener == null) { - imageLoadingListener = this.defaultListener; - } - ImageLoadingListener imageLoadingListener2 = imageLoadingListener; - if (displayImageOptions == null) { - displayImageOptions = this.configuration.defaultDisplayImageOptions; - } - if (TextUtils.isEmpty(str)) { - this.engine.cancelDisplayTaskFor(imageAware); - imageLoadingListener2.onLoadingStarted(str, imageAware.getWrappedView()); - if (displayImageOptions.shouldShowImageForEmptyUri()) { - imageAware.setImageDrawable(displayImageOptions.getImageForEmptyUri(this.configuration.resources)); - } else { - imageAware.setImageDrawable(null); - } - imageLoadingListener2.onLoadingComplete(str, imageAware.getWrappedView(), null); - return; - } - if (imageSize == null) { - imageSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration.getMaxImageSize()); - } - ImageSize imageSize2 = imageSize; - String generateKey = MemoryCacheUtils.generateKey(str, imageSize2); - this.engine.prepareDisplayTaskFor(imageAware, generateKey); - imageLoadingListener2.onLoadingStarted(str, imageAware.getWrappedView()); - Bitmap bitmap = this.configuration.memoryCache.get(generateKey); - if (bitmap != null && !bitmap.isRecycled()) { - L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, generateKey); - if (displayImageOptions.shouldPostProcess()) { - ProcessAndDisplayImageTask processAndDisplayImageTask = new ProcessAndDisplayImageTask(this.engine, bitmap, new ImageLoadingInfo(str, imageAware, imageSize2, generateKey, displayImageOptions, imageLoadingListener2, imageLoadingProgressListener, this.engine.getLockForUri(str)), defineHandler(displayImageOptions)); - if (displayImageOptions.isSyncLoading()) { - processAndDisplayImageTask.run(); - return; - } else { - this.engine.submit(processAndDisplayImageTask); - return; - } - } - displayImageOptions.getDisplayer().display(bitmap, imageAware, LoadedFrom.MEMORY_CACHE); - imageLoadingListener2.onLoadingComplete(str, imageAware.getWrappedView(), bitmap); - return; - } - if (displayImageOptions.shouldShowImageOnLoading()) { - imageAware.setImageDrawable(displayImageOptions.getImageOnLoading(this.configuration.resources)); - } else if (displayImageOptions.isResetViewBeforeLoading()) { - imageAware.setImageDrawable(null); - } - LoadAndDisplayImageTask loadAndDisplayImageTask = new LoadAndDisplayImageTask(this.engine, new ImageLoadingInfo(str, imageAware, imageSize2, generateKey, displayImageOptions, imageLoadingListener2, imageLoadingProgressListener, this.engine.getLockForUri(str)), defineHandler(displayImageOptions)); - if (displayImageOptions.isSyncLoading()) { - loadAndDisplayImageTask.run(); - } else { - this.engine.submit(loadAndDisplayImageTask); - } - } - - public void displayImage(String str, ImageView imageView) { - displayImage(str, new ImageViewAware(imageView), (DisplayImageOptions) null, (ImageLoadingListener) null, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageView imageView, ImageSize imageSize) { - displayImage(str, new ImageViewAware(imageView), null, imageSize, null, null); - } - - public void displayImage(String str, ImageView imageView, DisplayImageOptions displayImageOptions) { - displayImage(str, new ImageViewAware(imageView), displayImageOptions, (ImageLoadingListener) null, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageView imageView, ImageLoadingListener imageLoadingListener) { - displayImage(str, new ImageViewAware(imageView), (DisplayImageOptions) null, imageLoadingListener, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageView imageView, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener) { - displayImage(str, imageView, displayImageOptions, imageLoadingListener, (ImageLoadingProgressListener) null); - } - - public void displayImage(String str, ImageView imageView, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener, ImageLoadingProgressListener imageLoadingProgressListener) { - displayImage(str, new ImageViewAware(imageView), displayImageOptions, imageLoadingListener, imageLoadingProgressListener); - } - - public void loadImage(String str, ImageLoadingListener imageLoadingListener) { - loadImage(str, null, null, imageLoadingListener, null); - } - - public void loadImage(String str, ImageSize imageSize, ImageLoadingListener imageLoadingListener) { - loadImage(str, imageSize, null, imageLoadingListener, null); - } - - public void loadImage(String str, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener) { - loadImage(str, null, displayImageOptions, imageLoadingListener, null); - } - - public void loadImage(String str, ImageSize imageSize, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener) { - loadImage(str, imageSize, displayImageOptions, imageLoadingListener, null); - } - - public void loadImage(String str, ImageSize imageSize, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener, ImageLoadingProgressListener imageLoadingProgressListener) { - checkConfiguration(); - if (imageSize == null) { - imageSize = this.configuration.getMaxImageSize(); - } - if (displayImageOptions == null) { - displayImageOptions = this.configuration.defaultDisplayImageOptions; - } - displayImage(str, new NonViewAware(str, imageSize, ViewScaleType.CROP), displayImageOptions, imageLoadingListener, imageLoadingProgressListener); - } - - public Bitmap loadImageSync(String str) { - return loadImageSync(str, null, null); - } - - public Bitmap loadImageSync(String str, DisplayImageOptions displayImageOptions) { - return loadImageSync(str, null, displayImageOptions); - } - - public Bitmap loadImageSync(String str, ImageSize imageSize) { - return loadImageSync(str, imageSize, null); - } - - public Bitmap loadImageSync(String str, ImageSize imageSize, DisplayImageOptions displayImageOptions) { - if (displayImageOptions == null) { - displayImageOptions = this.configuration.defaultDisplayImageOptions; - } - DisplayImageOptions build = new DisplayImageOptions.Builder().cloneFrom(displayImageOptions).syncLoading(true).build(); - SyncImageLoadingListener syncImageLoadingListener = new SyncImageLoadingListener(); - loadImage(str, imageSize, build, syncImageLoadingListener); - return syncImageLoadingListener.getLoadedBitmap(); - } - - private void checkConfiguration() { - if (this.configuration == null) { - throw new IllegalStateException(ERROR_NOT_INIT); - } - } - - public void setDefaultLoadingListener(ImageLoadingListener imageLoadingListener) { - if (imageLoadingListener == null) { - imageLoadingListener = new SimpleImageLoadingListener(); - } - this.defaultListener = imageLoadingListener; - } - - public MemoryCache getMemoryCache() { - checkConfiguration(); - return this.configuration.memoryCache; - } - - public void clearMemoryCache() { - checkConfiguration(); - this.configuration.memoryCache.clear(); - } - - @Deprecated - public DiskCache getDiscCache() { - return getDiskCache(); - } - - public DiskCache getDiskCache() { - checkConfiguration(); - return this.configuration.diskCache; - } - - @Deprecated - public void clearDiscCache() { - clearDiskCache(); - } - - public void clearDiskCache() { - checkConfiguration(); - this.configuration.diskCache.clear(); - } - - public String getLoadingUriForView(ImageAware imageAware) { - return this.engine.getLoadingUriForView(imageAware); - } - - public String getLoadingUriForView(ImageView imageView) { - return this.engine.getLoadingUriForView(new ImageViewAware(imageView)); - } - - public void cancelDisplayTask(ImageAware imageAware) { - this.engine.cancelDisplayTaskFor(imageAware); - } - - public void cancelDisplayTask(ImageView imageView) { - this.engine.cancelDisplayTaskFor(new ImageViewAware(imageView)); - } - - public void denyNetworkDownloads(boolean z) { - this.engine.denyNetworkDownloads(z); - } - - public void handleSlowNetwork(boolean z) { - this.engine.handleSlowNetwork(z); - } - - public void pause() { - this.engine.pause(); - } - - public void resume() { - this.engine.resume(); - } - - public void stop() { - this.engine.stop(); - } - - public void destroy() { - if (this.configuration != null) { - L.d(LOG_DESTROY, new Object[0]); - } - stop(); - this.configuration.diskCache.close(); - this.engine = null; - this.configuration = null; - } - - private static Handler defineHandler(DisplayImageOptions displayImageOptions) { - Handler handler = displayImageOptions.getHandler(); - if (displayImageOptions.isSyncLoading()) { - return null; - } - return (handler == null && Looper.myLooper() == Looper.getMainLooper()) ? new Handler() : handler; - } - - /* JADX INFO: Access modifiers changed from: private */ - /* loaded from: classes.dex */ - public static class SyncImageLoadingListener extends SimpleImageLoadingListener { - private Bitmap loadedImage; - - private SyncImageLoadingListener() { - } - - @Override // com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener, com.nostra13.universalimageloader.core.listener.ImageLoadingListener - public void onLoadingComplete(String str, View view, Bitmap bitmap) { - this.loadedImage = bitmap; - } - - public Bitmap getLoadedBitmap() { - return this.loadedImage; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderConfiguration.java b/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderConfiguration.java deleted file mode 100644 index cee3685..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderConfiguration.java +++ /dev/null @@ -1,403 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.content.Context; -import android.content.res.Resources; -import android.util.DisplayMetrics; -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import com.nostra13.universalimageloader.cache.memory.impl.FuzzyKeyMemoryCache; -import com.nostra13.universalimageloader.core.assist.FlushedInputStream; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.QueueProcessingType; -import com.nostra13.universalimageloader.core.decode.ImageDecoder; -import com.nostra13.universalimageloader.core.download.ImageDownloader; -import com.nostra13.universalimageloader.core.process.BitmapProcessor; -import com.nostra13.universalimageloader.utils.L; -import com.nostra13.universalimageloader.utils.MemoryCacheUtils; -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.Executor; - -/* loaded from: classes.dex */ -public final class ImageLoaderConfiguration { - final boolean customExecutor; - final boolean customExecutorForCachedImages; - final ImageDecoder decoder; - final DisplayImageOptions defaultDisplayImageOptions; - final DiskCache diskCache; - final ImageDownloader downloader; - final int maxImageHeightForDiskCache; - final int maxImageHeightForMemoryCache; - final int maxImageWidthForDiskCache; - final int maxImageWidthForMemoryCache; - final MemoryCache memoryCache; - final ImageDownloader networkDeniedDownloader; - final BitmapProcessor processorForDiskCache; - final Resources resources; - final ImageDownloader slowNetworkDownloader; - final Executor taskExecutor; - final Executor taskExecutorForCachedImages; - final QueueProcessingType tasksProcessingType; - final int threadPoolSize; - final int threadPriority; - - /* synthetic */ ImageLoaderConfiguration(Builder builder, AnonymousClass1 anonymousClass1) { - this(builder); - } - - private ImageLoaderConfiguration(Builder builder) { - this.resources = builder.context.getResources(); - this.maxImageWidthForMemoryCache = builder.maxImageWidthForMemoryCache; - this.maxImageHeightForMemoryCache = builder.maxImageHeightForMemoryCache; - this.maxImageWidthForDiskCache = builder.maxImageWidthForDiskCache; - this.maxImageHeightForDiskCache = builder.maxImageHeightForDiskCache; - this.processorForDiskCache = builder.processorForDiskCache; - this.taskExecutor = builder.taskExecutor; - this.taskExecutorForCachedImages = builder.taskExecutorForCachedImages; - this.threadPoolSize = builder.threadPoolSize; - this.threadPriority = builder.threadPriority; - this.tasksProcessingType = builder.tasksProcessingType; - this.diskCache = builder.diskCache; - this.memoryCache = builder.memoryCache; - this.defaultDisplayImageOptions = builder.defaultDisplayImageOptions; - ImageDownloader imageDownloader = builder.downloader; - this.downloader = imageDownloader; - this.decoder = builder.decoder; - this.customExecutor = builder.customExecutor; - this.customExecutorForCachedImages = builder.customExecutorForCachedImages; - this.networkDeniedDownloader = new NetworkDeniedImageDownloader(imageDownloader); - this.slowNetworkDownloader = new SlowNetworkImageDownloader(imageDownloader); - L.writeDebugLogs(builder.writeLogs); - } - - public static ImageLoaderConfiguration createDefault(Context context) { - return new Builder(context).build(); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public ImageSize getMaxImageSize() { - DisplayMetrics displayMetrics = this.resources.getDisplayMetrics(); - int i = this.maxImageWidthForMemoryCache; - if (i <= 0) { - i = displayMetrics.widthPixels; - } - int i2 = this.maxImageHeightForMemoryCache; - if (i2 <= 0) { - i2 = displayMetrics.heightPixels; - } - return new ImageSize(i, i2); - } - - /* loaded from: classes.dex */ - public static class Builder { - public static final QueueProcessingType DEFAULT_TASK_PROCESSING_TYPE = QueueProcessingType.FIFO; - public static final int DEFAULT_THREAD_POOL_SIZE = 3; - public static final int DEFAULT_THREAD_PRIORITY = 3; - private static final String WARNING_OVERLAP_DISK_CACHE_NAME_GENERATOR = "diskCache() and diskCacheFileNameGenerator() calls overlap each other"; - private static final String WARNING_OVERLAP_DISK_CACHE_PARAMS = "diskCache(), diskCacheSize() and diskCacheFileCount calls overlap each other"; - private static final String WARNING_OVERLAP_EXECUTOR = "threadPoolSize(), threadPriority() and tasksProcessingOrder() calls can overlap taskExecutor() and taskExecutorForCachedImages() calls."; - private static final String WARNING_OVERLAP_MEMORY_CACHE = "memoryCache() and memoryCacheSize() calls overlap each other"; - private Context context; - private ImageDecoder decoder; - private int maxImageWidthForMemoryCache = 0; - private int maxImageHeightForMemoryCache = 0; - private int maxImageWidthForDiskCache = 0; - private int maxImageHeightForDiskCache = 0; - private BitmapProcessor processorForDiskCache = null; - private Executor taskExecutor = null; - private Executor taskExecutorForCachedImages = null; - private boolean customExecutor = false; - private boolean customExecutorForCachedImages = false; - private int threadPoolSize = 3; - private int threadPriority = 3; - private boolean denyCacheImageMultipleSizesInMemory = false; - private QueueProcessingType tasksProcessingType = DEFAULT_TASK_PROCESSING_TYPE; - private int memoryCacheSize = 0; - private long diskCacheSize = 0; - private int diskCacheFileCount = 0; - private MemoryCache memoryCache = null; - private DiskCache diskCache = null; - private FileNameGenerator diskCacheFileNameGenerator = null; - private ImageDownloader downloader = null; - private DisplayImageOptions defaultDisplayImageOptions = null; - private boolean writeLogs = false; - - public Builder(Context context) { - this.context = context.getApplicationContext(); - } - - public Builder memoryCacheExtraOptions(int i, int i2) { - this.maxImageWidthForMemoryCache = i; - this.maxImageHeightForMemoryCache = i2; - return this; - } - - @Deprecated - public Builder discCacheExtraOptions(int i, int i2, BitmapProcessor bitmapProcessor) { - return diskCacheExtraOptions(i, i2, bitmapProcessor); - } - - public Builder diskCacheExtraOptions(int i, int i2, BitmapProcessor bitmapProcessor) { - this.maxImageWidthForDiskCache = i; - this.maxImageHeightForDiskCache = i2; - this.processorForDiskCache = bitmapProcessor; - return this; - } - - public Builder taskExecutor(Executor executor) { - if (this.threadPoolSize != 3 || this.threadPriority != 3 || this.tasksProcessingType != DEFAULT_TASK_PROCESSING_TYPE) { - L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]); - } - this.taskExecutor = executor; - return this; - } - - public Builder taskExecutorForCachedImages(Executor executor) { - if (this.threadPoolSize != 3 || this.threadPriority != 3 || this.tasksProcessingType != DEFAULT_TASK_PROCESSING_TYPE) { - L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]); - } - this.taskExecutorForCachedImages = executor; - return this; - } - - public Builder threadPoolSize(int i) { - if (this.taskExecutor != null || this.taskExecutorForCachedImages != null) { - L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]); - } - this.threadPoolSize = i; - return this; - } - - public Builder threadPriority(int i) { - if (this.taskExecutor != null || this.taskExecutorForCachedImages != null) { - L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]); - } - if (i < 1) { - this.threadPriority = 1; - } else if (i > 10) { - this.threadPriority = 10; - } else { - this.threadPriority = i; - } - return this; - } - - public Builder denyCacheImageMultipleSizesInMemory() { - this.denyCacheImageMultipleSizesInMemory = true; - return this; - } - - public Builder tasksProcessingOrder(QueueProcessingType queueProcessingType) { - if (this.taskExecutor != null || this.taskExecutorForCachedImages != null) { - L.w(WARNING_OVERLAP_EXECUTOR, new Object[0]); - } - this.tasksProcessingType = queueProcessingType; - return this; - } - - public Builder memoryCacheSize(int i) { - if (i <= 0) { - throw new IllegalArgumentException("memoryCacheSize must be a positive number"); - } - if (this.memoryCache != null) { - L.w(WARNING_OVERLAP_MEMORY_CACHE, new Object[0]); - } - this.memoryCacheSize = i; - return this; - } - - public Builder memoryCacheSizePercentage(int i) { - if (i <= 0 || i >= 100) { - throw new IllegalArgumentException("availableMemoryPercent must be in range (0 < % < 100)"); - } - if (this.memoryCache != null) { - L.w(WARNING_OVERLAP_MEMORY_CACHE, new Object[0]); - } - this.memoryCacheSize = (int) (((float) Runtime.getRuntime().maxMemory()) * (i / 100.0f)); - return this; - } - - public Builder memoryCache(MemoryCache memoryCache) { - if (this.memoryCacheSize != 0) { - L.w(WARNING_OVERLAP_MEMORY_CACHE, new Object[0]); - } - this.memoryCache = memoryCache; - return this; - } - - @Deprecated - public Builder discCacheSize(int i) { - return diskCacheSize(i); - } - - public Builder diskCacheSize(int i) { - if (i <= 0) { - throw new IllegalArgumentException("maxCacheSize must be a positive number"); - } - if (this.diskCache != null) { - L.w(WARNING_OVERLAP_DISK_CACHE_PARAMS, new Object[0]); - } - this.diskCacheSize = i; - return this; - } - - @Deprecated - public Builder discCacheFileCount(int i) { - return diskCacheFileCount(i); - } - - public Builder diskCacheFileCount(int i) { - if (i <= 0) { - throw new IllegalArgumentException("maxFileCount must be a positive number"); - } - if (this.diskCache != null) { - L.w(WARNING_OVERLAP_DISK_CACHE_PARAMS, new Object[0]); - } - this.diskCacheFileCount = i; - return this; - } - - @Deprecated - public Builder discCacheFileNameGenerator(FileNameGenerator fileNameGenerator) { - return diskCacheFileNameGenerator(fileNameGenerator); - } - - public Builder diskCacheFileNameGenerator(FileNameGenerator fileNameGenerator) { - if (this.diskCache != null) { - L.w(WARNING_OVERLAP_DISK_CACHE_NAME_GENERATOR, new Object[0]); - } - this.diskCacheFileNameGenerator = fileNameGenerator; - return this; - } - - @Deprecated - public Builder discCache(DiskCache diskCache) { - return diskCache(diskCache); - } - - public Builder diskCache(DiskCache diskCache) { - if (this.diskCacheSize > 0 || this.diskCacheFileCount > 0) { - L.w(WARNING_OVERLAP_DISK_CACHE_PARAMS, new Object[0]); - } - if (this.diskCacheFileNameGenerator != null) { - L.w(WARNING_OVERLAP_DISK_CACHE_NAME_GENERATOR, new Object[0]); - } - this.diskCache = diskCache; - return this; - } - - public Builder imageDownloader(ImageDownloader imageDownloader) { - this.downloader = imageDownloader; - return this; - } - - public Builder imageDecoder(ImageDecoder imageDecoder) { - this.decoder = imageDecoder; - return this; - } - - public Builder defaultDisplayImageOptions(DisplayImageOptions displayImageOptions) { - this.defaultDisplayImageOptions = displayImageOptions; - return this; - } - - public Builder writeDebugLogs() { - this.writeLogs = true; - return this; - } - - public ImageLoaderConfiguration build() { - initEmptyFieldsWithDefaultValues(); - return new ImageLoaderConfiguration(this, null); - } - - private void initEmptyFieldsWithDefaultValues() { - if (this.taskExecutor == null) { - this.taskExecutor = DefaultConfigurationFactory.createExecutor(this.threadPoolSize, this.threadPriority, this.tasksProcessingType); - } else { - this.customExecutor = true; - } - if (this.taskExecutorForCachedImages == null) { - this.taskExecutorForCachedImages = DefaultConfigurationFactory.createExecutor(this.threadPoolSize, this.threadPriority, this.tasksProcessingType); - } else { - this.customExecutorForCachedImages = true; - } - if (this.diskCache == null) { - if (this.diskCacheFileNameGenerator == null) { - this.diskCacheFileNameGenerator = DefaultConfigurationFactory.createFileNameGenerator(); - } - this.diskCache = DefaultConfigurationFactory.createDiskCache(this.context, this.diskCacheFileNameGenerator, this.diskCacheSize, this.diskCacheFileCount); - } - if (this.memoryCache == null) { - this.memoryCache = DefaultConfigurationFactory.createMemoryCache(this.context, this.memoryCacheSize); - } - if (this.denyCacheImageMultipleSizesInMemory) { - this.memoryCache = new FuzzyKeyMemoryCache(this.memoryCache, MemoryCacheUtils.createFuzzyKeyComparator()); - } - if (this.downloader == null) { - this.downloader = DefaultConfigurationFactory.createImageDownloader(this.context); - } - if (this.decoder == null) { - this.decoder = DefaultConfigurationFactory.createImageDecoder(this.writeLogs); - } - if (this.defaultDisplayImageOptions == null) { - this.defaultDisplayImageOptions = DisplayImageOptions.createSimple(); - } - } - } - - /* loaded from: classes.dex */ - private static class NetworkDeniedImageDownloader implements ImageDownloader { - private final ImageDownloader wrappedDownloader; - - public NetworkDeniedImageDownloader(ImageDownloader imageDownloader) { - this.wrappedDownloader = imageDownloader; - } - - @Override // com.nostra13.universalimageloader.core.download.ImageDownloader - public InputStream getStream(String str, Object obj) throws IOException { - int i = AnonymousClass1.$SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.ofUri(str).ordinal()]; - if (i == 1 || i == 2) { - throw new IllegalStateException(); - } - return this.wrappedDownloader.getStream(str, obj); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - /* renamed from: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$1 reason: invalid class name */ - /* loaded from: classes.dex */ - public static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme; - - static { - int[] iArr = new int[ImageDownloader.Scheme.values().length]; - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme = iArr; - try { - iArr[ImageDownloader.Scheme.HTTP.ordinal()] = 1; - } catch (NoSuchFieldError unused) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.HTTPS.ordinal()] = 2; - } catch (NoSuchFieldError unused2) { - } - } - } - - /* loaded from: classes.dex */ - private static class SlowNetworkImageDownloader implements ImageDownloader { - private final ImageDownloader wrappedDownloader; - - public SlowNetworkImageDownloader(ImageDownloader imageDownloader) { - this.wrappedDownloader = imageDownloader; - } - - @Override // com.nostra13.universalimageloader.core.download.ImageDownloader - public InputStream getStream(String str, Object obj) throws IOException { - InputStream stream = this.wrappedDownloader.getStream(str, obj); - int i = AnonymousClass1.$SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.ofUri(str).ordinal()]; - return (i == 1 || i == 2) ? new FlushedInputStream(stream) : stream; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderEngine.java b/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderEngine.java deleted file mode 100644 index afe57b9..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoaderEngine.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import java.io.File; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.WeakHashMap; -import java.util.concurrent.Executor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.locks.ReentrantLock; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public class ImageLoaderEngine { - final ImageLoaderConfiguration configuration; - private Executor taskExecutor; - private Executor taskExecutorForCachedImages; - private final Map cacheKeysForImageAwares = Collections.synchronizedMap(new HashMap()); - private final Map uriLocks = new WeakHashMap(); - private final AtomicBoolean paused = new AtomicBoolean(false); - private final AtomicBoolean networkDenied = new AtomicBoolean(false); - private final AtomicBoolean slowNetwork = new AtomicBoolean(false); - private final Object pauseLock = new Object(); - private Executor taskDistributor = DefaultConfigurationFactory.createTaskDistributor(); - - /* JADX INFO: Access modifiers changed from: package-private */ - public ImageLoaderEngine(ImageLoaderConfiguration imageLoaderConfiguration) { - this.configuration = imageLoaderConfiguration; - this.taskExecutor = imageLoaderConfiguration.taskExecutor; - this.taskExecutorForCachedImages = imageLoaderConfiguration.taskExecutorForCachedImages; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void submit(final LoadAndDisplayImageTask loadAndDisplayImageTask) { - this.taskDistributor.execute(new Runnable() { // from class: com.nostra13.universalimageloader.core.ImageLoaderEngine.1 - @Override // java.lang.Runnable - public void run() { - File file = ImageLoaderEngine.this.configuration.diskCache.get(loadAndDisplayImageTask.getLoadingUri()); - boolean z = file != null && file.exists(); - ImageLoaderEngine.this.initExecutorsIfNeed(); - if (z) { - ImageLoaderEngine.this.taskExecutorForCachedImages.execute(loadAndDisplayImageTask); - } else { - ImageLoaderEngine.this.taskExecutor.execute(loadAndDisplayImageTask); - } - } - }); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void submit(ProcessAndDisplayImageTask processAndDisplayImageTask) { - initExecutorsIfNeed(); - this.taskExecutorForCachedImages.execute(processAndDisplayImageTask); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void initExecutorsIfNeed() { - if (!this.configuration.customExecutor && ((ExecutorService) this.taskExecutor).isShutdown()) { - this.taskExecutor = createTaskExecutor(); - } - if (this.configuration.customExecutorForCachedImages || !((ExecutorService) this.taskExecutorForCachedImages).isShutdown()) { - return; - } - this.taskExecutorForCachedImages = createTaskExecutor(); - } - - private Executor createTaskExecutor() { - return DefaultConfigurationFactory.createExecutor(this.configuration.threadPoolSize, this.configuration.threadPriority, this.configuration.tasksProcessingType); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getLoadingUriForView(ImageAware imageAware) { - return this.cacheKeysForImageAwares.get(Integer.valueOf(imageAware.getId())); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void prepareDisplayTaskFor(ImageAware imageAware, String str) { - this.cacheKeysForImageAwares.put(Integer.valueOf(imageAware.getId()), str); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void cancelDisplayTaskFor(ImageAware imageAware) { - this.cacheKeysForImageAwares.remove(Integer.valueOf(imageAware.getId())); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void denyNetworkDownloads(boolean z) { - this.networkDenied.set(z); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void handleSlowNetwork(boolean z) { - this.slowNetwork.set(z); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void pause() { - this.paused.set(true); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void resume() { - this.paused.set(false); - synchronized (this.pauseLock) { - this.pauseLock.notifyAll(); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void stop() { - if (!this.configuration.customExecutor) { - ((ExecutorService) this.taskExecutor).shutdownNow(); - } - if (!this.configuration.customExecutorForCachedImages) { - ((ExecutorService) this.taskExecutorForCachedImages).shutdownNow(); - } - this.cacheKeysForImageAwares.clear(); - this.uriLocks.clear(); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public void fireCallback(Runnable runnable) { - this.taskDistributor.execute(runnable); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public ReentrantLock getLockForUri(String str) { - ReentrantLock reentrantLock = this.uriLocks.get(str); - if (reentrantLock == null) { - ReentrantLock reentrantLock2 = new ReentrantLock(); - this.uriLocks.put(str, reentrantLock2); - return reentrantLock2; - } - return reentrantLock; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public AtomicBoolean getPause() { - return this.paused; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public Object getPauseLock() { - return this.pauseLock; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public boolean isNetworkDenied() { - return this.networkDenied.get(); - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public boolean isSlowNetwork() { - return this.slowNetwork.get(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoadingInfo.java b/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoadingInfo.java deleted file mode 100644 index 181d312..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoadingInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; -import com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener; -import java.util.concurrent.locks.ReentrantLock; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public final class ImageLoadingInfo { - final ImageAware imageAware; - final ImageLoadingListener listener; - final ReentrantLock loadFromUriLock; - final String memoryCacheKey; - final DisplayImageOptions options; - final ImageLoadingProgressListener progressListener; - final ImageSize targetSize; - final String uri; - - public ImageLoadingInfo(String str, ImageAware imageAware, ImageSize imageSize, String str2, DisplayImageOptions displayImageOptions, ImageLoadingListener imageLoadingListener, ImageLoadingProgressListener imageLoadingProgressListener, ReentrantLock reentrantLock) { - this.uri = str; - this.imageAware = imageAware; - this.targetSize = imageSize; - this.options = displayImageOptions; - this.listener = imageLoadingListener; - this.progressListener = imageLoadingProgressListener; - this.loadFromUriLock = reentrantLock; - this.memoryCacheKey = str2; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java b/app/src/main/java/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java deleted file mode 100644 index e686638..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/LoadAndDisplayImageTask.java +++ /dev/null @@ -1,395 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.graphics.Bitmap; -import android.os.Handler; -import com.nostra13.universalimageloader.core.DisplayImageOptions; -import com.nostra13.universalimageloader.core.assist.FailReason; -import com.nostra13.universalimageloader.core.assist.ImageScaleType; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.core.decode.ImageDecoder; -import com.nostra13.universalimageloader.core.decode.ImageDecodingInfo; -import com.nostra13.universalimageloader.core.download.ImageDownloader; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; -import com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener; -import com.nostra13.universalimageloader.utils.IoUtils; -import com.nostra13.universalimageloader.utils.L; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.atomic.AtomicBoolean; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public final class LoadAndDisplayImageTask implements Runnable, IoUtils.CopyListener { - private static final String ERROR_NO_IMAGE_STREAM = "No stream for image [%s]"; - private static final String ERROR_POST_PROCESSOR_NULL = "Post-processor returned null [%s]"; - private static final String ERROR_PRE_PROCESSOR_NULL = "Pre-processor returned null [%s]"; - private static final String ERROR_PROCESSOR_FOR_DISK_CACHE_NULL = "Bitmap processor for disk cache returned null [%s]"; - private static final String LOG_CACHE_IMAGE_IN_MEMORY = "Cache image in memory [%s]"; - private static final String LOG_CACHE_IMAGE_ON_DISK = "Cache image on disk [%s]"; - private static final String LOG_DELAY_BEFORE_LOADING = "Delay %d ms before loading... [%s]"; - private static final String LOG_GET_IMAGE_FROM_MEMORY_CACHE_AFTER_WAITING = "...Get cached bitmap from memory after waiting. [%s]"; - private static final String LOG_LOAD_IMAGE_FROM_DISK_CACHE = "Load image from disk cache [%s]"; - private static final String LOG_LOAD_IMAGE_FROM_NETWORK = "Load image from network [%s]"; - private static final String LOG_POSTPROCESS_IMAGE = "PostProcess image before displaying [%s]"; - private static final String LOG_PREPROCESS_IMAGE = "PreProcess image before caching in memory [%s]"; - private static final String LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISK = "Process image before cache on disk [%s]"; - private static final String LOG_RESIZE_CACHED_IMAGE_FILE = "Resize image in disk cache [%s]"; - private static final String LOG_RESUME_AFTER_PAUSE = ".. Resume loading [%s]"; - private static final String LOG_START_DISPLAY_IMAGE_TASK = "Start display image task [%s]"; - private static final String LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED = "ImageAware was collected by GC. Task is cancelled. [%s]"; - private static final String LOG_TASK_CANCELLED_IMAGEAWARE_REUSED = "ImageAware is reused for another image. Task is cancelled. [%s]"; - private static final String LOG_TASK_INTERRUPTED = "Task was interrupted [%s]"; - private static final String LOG_WAITING_FOR_IMAGE_LOADED = "Image already is loading. Waiting... [%s]"; - private static final String LOG_WAITING_FOR_RESUME = "ImageLoader is paused. Waiting... [%s]"; - private final ImageLoaderConfiguration configuration; - private final ImageDecoder decoder; - private final ImageDownloader downloader; - private final ImageLoaderEngine engine; - private final Handler handler; - final ImageAware imageAware; - private final ImageLoadingInfo imageLoadingInfo; - final ImageLoadingListener listener; - private LoadedFrom loadedFrom = LoadedFrom.NETWORK; - private final String memoryCacheKey; - private final ImageDownloader networkDeniedDownloader; - final DisplayImageOptions options; - final ImageLoadingProgressListener progressListener; - private final ImageDownloader slowNetworkDownloader; - private final boolean syncLoading; - private final ImageSize targetSize; - final String uri; - - public LoadAndDisplayImageTask(ImageLoaderEngine imageLoaderEngine, ImageLoadingInfo imageLoadingInfo, Handler handler) { - this.engine = imageLoaderEngine; - this.imageLoadingInfo = imageLoadingInfo; - this.handler = handler; - ImageLoaderConfiguration imageLoaderConfiguration = imageLoaderEngine.configuration; - this.configuration = imageLoaderConfiguration; - this.downloader = imageLoaderConfiguration.downloader; - this.networkDeniedDownloader = imageLoaderConfiguration.networkDeniedDownloader; - this.slowNetworkDownloader = imageLoaderConfiguration.slowNetworkDownloader; - this.decoder = imageLoaderConfiguration.decoder; - this.uri = imageLoadingInfo.uri; - this.memoryCacheKey = imageLoadingInfo.memoryCacheKey; - this.imageAware = imageLoadingInfo.imageAware; - this.targetSize = imageLoadingInfo.targetSize; - DisplayImageOptions displayImageOptions = imageLoadingInfo.options; - this.options = displayImageOptions; - this.listener = imageLoadingInfo.listener; - this.progressListener = imageLoadingInfo.progressListener; - this.syncLoading = displayImageOptions.isSyncLoading(); - } - - /* JADX WARN: Removed duplicated region for block: B:36:0x00d2 A[Catch: all -> 0x00fb, TaskCancelledException -> 0x00fd, Merged into TryCatch #1 {all -> 0x00fb, TaskCancelledException -> 0x00fd, blocks: (B:12:0x0033, B:14:0x0042, B:17:0x0049, B:32:0x00b3, B:34:0x00bb, B:36:0x00d2, B:37:0x00dd, B:18:0x0059, B:22:0x0063, B:24:0x0071, B:26:0x0088, B:28:0x0095, B:30:0x009d, B:42:0x00fd), top: B:47:0x0033 }] */ - @Override // java.lang.Runnable - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void run() { - /* - Method dump skipped, instructions count: 264 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run():void"); - } - - private boolean waitIfPaused() { - AtomicBoolean pause = this.engine.getPause(); - if (pause.get()) { - synchronized (this.engine.getPauseLock()) { - if (pause.get()) { - L.d(LOG_WAITING_FOR_RESUME, this.memoryCacheKey); - try { - this.engine.getPauseLock().wait(); - L.d(LOG_RESUME_AFTER_PAUSE, this.memoryCacheKey); - } catch (InterruptedException unused) { - L.e(LOG_TASK_INTERRUPTED, this.memoryCacheKey); - return true; - } - } - } - } - return isTaskNotActual(); - } - - private boolean delayIfNeed() { - if (this.options.shouldDelayBeforeLoading()) { - L.d(LOG_DELAY_BEFORE_LOADING, Integer.valueOf(this.options.getDelayBeforeLoading()), this.memoryCacheKey); - try { - Thread.sleep(this.options.getDelayBeforeLoading()); - return isTaskNotActual(); - } catch (InterruptedException unused) { - L.e(LOG_TASK_INTERRUPTED, this.memoryCacheKey); - return true; - } - } - return false; - } - - private Bitmap tryLoadBitmap() throws TaskCancelledException { - Bitmap bitmap; - File file; - Bitmap bitmap2 = null; - try { - try { - File file2 = this.configuration.diskCache.get(this.uri); - if (file2 == null || !file2.exists() || file2.length() <= 0) { - bitmap = null; - } else { - L.d(LOG_LOAD_IMAGE_FROM_DISK_CACHE, this.memoryCacheKey); - this.loadedFrom = LoadedFrom.DISC_CACHE; - checkTaskNotActual(); - bitmap = decodeImage(ImageDownloader.Scheme.FILE.wrap(file2.getAbsolutePath())); - } - if (bitmap != null) { - try { - if (bitmap.getWidth() > 0 && bitmap.getHeight() > 0) { - return bitmap; - } - } catch (IOException e) { - Bitmap bitmap3 = bitmap; - e = e; - bitmap2 = bitmap3; - L.e(e); - fireFailEvent(FailReason.FailType.IO_ERROR, e); - return bitmap2; - } catch (IllegalStateException unused) { - fireFailEvent(FailReason.FailType.NETWORK_DENIED, null); - return bitmap; - } catch (OutOfMemoryError e2) { - Bitmap bitmap4 = bitmap; - e = e2; - bitmap2 = bitmap4; - L.e(e); - fireFailEvent(FailReason.FailType.OUT_OF_MEMORY, e); - return bitmap2; - } catch (Throwable th) { - Bitmap bitmap5 = bitmap; - th = th; - bitmap2 = bitmap5; - L.e(th); - fireFailEvent(FailReason.FailType.UNKNOWN, th); - return bitmap2; - } - } - L.d(LOG_LOAD_IMAGE_FROM_NETWORK, this.memoryCacheKey); - this.loadedFrom = LoadedFrom.NETWORK; - String str = this.uri; - if (this.options.isCacheOnDisk() && tryCacheImageOnDisk() && (file = this.configuration.diskCache.get(this.uri)) != null) { - str = ImageDownloader.Scheme.FILE.wrap(file.getAbsolutePath()); - } - checkTaskNotActual(); - bitmap = decodeImage(str); - if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) { - fireFailEvent(FailReason.FailType.DECODING_ERROR, null); - return bitmap; - } - return bitmap; - } catch (IOException e3) { - e = e3; - } catch (IllegalStateException unused2) { - bitmap = null; - } catch (OutOfMemoryError e4) { - e = e4; - } catch (Throwable th2) { - th = th2; - } - } catch (TaskCancelledException e5) { - throw e5; - } - } - - private Bitmap decodeImage(String str) throws IOException { - return this.decoder.decode(new ImageDecodingInfo(this.memoryCacheKey, str, this.uri, this.targetSize, this.imageAware.getScaleType(), getDownloader(), this.options)); - } - - private boolean tryCacheImageOnDisk() throws TaskCancelledException { - L.d(LOG_CACHE_IMAGE_ON_DISK, this.memoryCacheKey); - try { - boolean downloadImage = downloadImage(); - if (downloadImage) { - int i = this.configuration.maxImageWidthForDiskCache; - int i2 = this.configuration.maxImageHeightForDiskCache; - if (i > 0 || i2 > 0) { - L.d(LOG_RESIZE_CACHED_IMAGE_FILE, this.memoryCacheKey); - resizeAndSaveImage(i, i2); - } - } - return downloadImage; - } catch (IOException e) { - L.e(e); - return false; - } - } - - private boolean downloadImage() throws IOException { - InputStream stream = getDownloader().getStream(this.uri, this.options.getExtraForDownloader()); - if (stream == null) { - L.e(ERROR_NO_IMAGE_STREAM, this.memoryCacheKey); - return false; - } - try { - return this.configuration.diskCache.save(this.uri, stream, this); - } finally { - IoUtils.closeSilently(stream); - } - } - - private boolean resizeAndSaveImage(int i, int i2) throws IOException { - File file = this.configuration.diskCache.get(this.uri); - if (file == null || !file.exists()) { - return false; - } - Bitmap decode = this.decoder.decode(new ImageDecodingInfo(this.memoryCacheKey, ImageDownloader.Scheme.FILE.wrap(file.getAbsolutePath()), this.uri, new ImageSize(i, i2), ViewScaleType.FIT_INSIDE, getDownloader(), new DisplayImageOptions.Builder().cloneFrom(this.options).imageScaleType(ImageScaleType.IN_SAMPLE_INT).build())); - if (decode != null && this.configuration.processorForDiskCache != null) { - L.d(LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISK, this.memoryCacheKey); - decode = this.configuration.processorForDiskCache.process(decode); - if (decode == null) { - L.e(ERROR_PROCESSOR_FOR_DISK_CACHE_NULL, this.memoryCacheKey); - } - } - if (decode != null) { - boolean save = this.configuration.diskCache.save(this.uri, decode); - decode.recycle(); - return save; - } - return false; - } - - @Override // com.nostra13.universalimageloader.utils.IoUtils.CopyListener - public boolean onBytesCopied(int i, int i2) { - return this.syncLoading || fireProgressEvent(i, i2); - } - - private boolean fireProgressEvent(final int i, final int i2) { - if (isTaskInterrupted() || isTaskNotActual()) { - return false; - } - if (this.progressListener != null) { - runTask(new Runnable() { // from class: com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.1 - @Override // java.lang.Runnable - public void run() { - LoadAndDisplayImageTask.this.progressListener.onProgressUpdate(LoadAndDisplayImageTask.this.uri, LoadAndDisplayImageTask.this.imageAware.getWrappedView(), i, i2); - } - }, false, this.handler, this.engine); - return true; - } - return true; - } - - private void fireFailEvent(final FailReason.FailType failType, final Throwable th) { - if (this.syncLoading || isTaskInterrupted() || isTaskNotActual()) { - return; - } - runTask(new Runnable() { // from class: com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.2 - @Override // java.lang.Runnable - public void run() { - if (LoadAndDisplayImageTask.this.options.shouldShowImageOnFail()) { - LoadAndDisplayImageTask.this.imageAware.setImageDrawable(LoadAndDisplayImageTask.this.options.getImageOnFail(LoadAndDisplayImageTask.this.configuration.resources)); - } - LoadAndDisplayImageTask.this.listener.onLoadingFailed(LoadAndDisplayImageTask.this.uri, LoadAndDisplayImageTask.this.imageAware.getWrappedView(), new FailReason(failType, th)); - } - }, false, this.handler, this.engine); - } - - private void fireCancelEvent() { - if (this.syncLoading || isTaskInterrupted()) { - return; - } - runTask(new Runnable() { // from class: com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.3 - @Override // java.lang.Runnable - public void run() { - LoadAndDisplayImageTask.this.listener.onLoadingCancelled(LoadAndDisplayImageTask.this.uri, LoadAndDisplayImageTask.this.imageAware.getWrappedView()); - } - }, false, this.handler, this.engine); - } - - private ImageDownloader getDownloader() { - if (this.engine.isNetworkDenied()) { - return this.networkDeniedDownloader; - } - if (this.engine.isSlowNetwork()) { - return this.slowNetworkDownloader; - } - return this.downloader; - } - - private void checkTaskNotActual() throws TaskCancelledException { - checkViewCollected(); - checkViewReused(); - } - - private boolean isTaskNotActual() { - return isViewCollected() || isViewReused(); - } - - private void checkViewCollected() throws TaskCancelledException { - if (isViewCollected()) { - throw new TaskCancelledException(); - } - } - - private boolean isViewCollected() { - if (this.imageAware.isCollected()) { - L.d(LOG_TASK_CANCELLED_IMAGEAWARE_COLLECTED, this.memoryCacheKey); - return true; - } - return false; - } - - private void checkViewReused() throws TaskCancelledException { - if (isViewReused()) { - throw new TaskCancelledException(); - } - } - - private boolean isViewReused() { - if (!this.memoryCacheKey.equals(this.engine.getLoadingUriForView(this.imageAware))) { - L.d(LOG_TASK_CANCELLED_IMAGEAWARE_REUSED, this.memoryCacheKey); - return true; - } - return false; - } - - private void checkTaskInterrupted() throws TaskCancelledException { - if (isTaskInterrupted()) { - throw new TaskCancelledException(); - } - } - - private boolean isTaskInterrupted() { - if (Thread.interrupted()) { - L.d(LOG_TASK_INTERRUPTED, this.memoryCacheKey); - return true; - } - return false; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public String getLoadingUri() { - return this.uri; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - public static void runTask(Runnable runnable, boolean z, Handler handler, ImageLoaderEngine imageLoaderEngine) { - if (z) { - runnable.run(); - } else if (handler == null) { - imageLoaderEngine.fireCallback(runnable); - } else { - handler.post(runnable); - } - } - - /* JADX INFO: Access modifiers changed from: package-private */ - /* loaded from: classes.dex */ - public class TaskCancelledException extends Exception { - TaskCancelledException() { - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/ProcessAndDisplayImageTask.java b/app/src/main/java/com/nostra13/universalimageloader/core/ProcessAndDisplayImageTask.java deleted file mode 100644 index 886bb1b..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/ProcessAndDisplayImageTask.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.nostra13.universalimageloader.core; - -import android.graphics.Bitmap; -import android.os.Handler; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.utils.L; - -/* JADX INFO: Access modifiers changed from: package-private */ -/* loaded from: classes.dex */ -public final class ProcessAndDisplayImageTask implements Runnable { - private static final String LOG_POSTPROCESS_IMAGE = "PostProcess image before displaying [%s]"; - private final Bitmap bitmap; - private final ImageLoaderEngine engine; - private final Handler handler; - private final ImageLoadingInfo imageLoadingInfo; - - public ProcessAndDisplayImageTask(ImageLoaderEngine imageLoaderEngine, Bitmap bitmap, ImageLoadingInfo imageLoadingInfo, Handler handler) { - this.engine = imageLoaderEngine; - this.bitmap = bitmap; - this.imageLoadingInfo = imageLoadingInfo; - this.handler = handler; - } - - @Override // java.lang.Runnable - public void run() { - L.d(LOG_POSTPROCESS_IMAGE, this.imageLoadingInfo.memoryCacheKey); - LoadAndDisplayImageTask.runTask(new DisplayBitmapTask(this.imageLoadingInfo.options.getPostProcessor().process(this.bitmap), this.imageLoadingInfo, this.engine, LoadedFrom.MEMORY_CACHE), this.imageLoadingInfo.options.isSyncLoading(), this.handler, this.engine); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ContentLengthInputStream.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/ContentLengthInputStream.java deleted file mode 100644 index 3679954..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ContentLengthInputStream.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public class ContentLengthInputStream extends InputStream { - private final int length; - private final InputStream stream; - - public ContentLengthInputStream(InputStream inputStream, int i) { - this.stream = inputStream; - this.length = i; - } - - @Override // java.io.InputStream - public int available() { - return this.length; - } - - @Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable - public void close() throws IOException { - this.stream.close(); - } - - @Override // java.io.InputStream - public void mark(int i) { - this.stream.mark(i); - } - - @Override // java.io.InputStream - public int read() throws IOException { - return this.stream.read(); - } - - @Override // java.io.InputStream - public int read(byte[] bArr) throws IOException { - return this.stream.read(bArr); - } - - @Override // java.io.InputStream - public int read(byte[] bArr, int i, int i2) throws IOException { - return this.stream.read(bArr, i, i2); - } - - @Override // java.io.InputStream - public void reset() throws IOException { - this.stream.reset(); - } - - @Override // java.io.InputStream - public long skip(long j) throws IOException { - return this.stream.skip(j); - } - - @Override // java.io.InputStream - public boolean markSupported() { - return this.stream.markSupported(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/FailReason.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/FailReason.java deleted file mode 100644 index 4ec07c4..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/FailReason.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -/* loaded from: classes.dex */ -public class FailReason { - private final Throwable cause; - private final FailType type; - - /* loaded from: classes.dex */ - public enum FailType { - IO_ERROR, - DECODING_ERROR, - NETWORK_DENIED, - OUT_OF_MEMORY, - UNKNOWN - } - - public FailReason(FailType failType, Throwable th) { - this.type = failType; - this.cause = th; - } - - public FailType getType() { - return this.type; - } - - public Throwable getCause() { - return this.cause; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/FlushedInputStream.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/FlushedInputStream.java deleted file mode 100644 index 65718b1..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/FlushedInputStream.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public class FlushedInputStream extends FilterInputStream { - public FlushedInputStream(InputStream inputStream) { - super(inputStream); - } - - @Override // java.io.FilterInputStream, java.io.InputStream - public long skip(long j) throws IOException { - long j2 = 0; - while (j2 < j) { - long skip = this.in.skip(j - j2); - if (skip == 0) { - if (read() < 0) { - break; - } - skip = 1; - } - j2 += skip; - } - return j2; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageScaleType.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageScaleType.java deleted file mode 100644 index 368040c..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageScaleType.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -/* loaded from: classes.dex */ -public enum ImageScaleType { - NONE, - NONE_SAFE, - IN_SAMPLE_POWER_OF_2, - IN_SAMPLE_INT, - EXACTLY, - EXACTLY_STRETCHED -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageSize.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageSize.java deleted file mode 100644 index fb110a6..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ImageSize.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -import com.luck.picture.lib.widget.longimage.SubsamplingScaleImageView; - -/* loaded from: classes.dex */ -public class ImageSize { - private static final String SEPARATOR = "x"; - private static final int TO_STRING_MAX_LENGHT = 9; - private final int height; - private final int width; - - public ImageSize(int i, int i2) { - this.width = i; - this.height = i2; - } - - public ImageSize(int i, int i2, int i3) { - if (i3 % SubsamplingScaleImageView.ORIENTATION_180 == 0) { - this.width = i; - this.height = i2; - return; - } - this.width = i2; - this.height = i; - } - - public int getWidth() { - return this.width; - } - - public int getHeight() { - return this.height; - } - - public ImageSize scaleDown(int i) { - return new ImageSize(this.width / i, this.height / i); - } - - public ImageSize scale(float f) { - return new ImageSize((int) (this.width * f), (int) (this.height * f)); - } - - public String toString() { - StringBuilder sb = new StringBuilder(9); - sb.append(this.width); - sb.append(SEPARATOR); - sb.append(this.height); - return sb.toString(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/LoadedFrom.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/LoadedFrom.java deleted file mode 100644 index 0f83702..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/LoadedFrom.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -/* loaded from: classes.dex */ -public enum LoadedFrom { - NETWORK, - DISC_CACHE, - MEMORY_CACHE -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/QueueProcessingType.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/QueueProcessingType.java deleted file mode 100644 index 8031f85..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/QueueProcessingType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -/* loaded from: classes.dex */ -public enum QueueProcessingType { - FIFO, - LIFO -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ViewScaleType.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/ViewScaleType.java deleted file mode 100644 index 77124a2..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/ViewScaleType.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.nostra13.universalimageloader.core.assist; - -import android.widget.ImageView; - -/* loaded from: classes.dex */ -public enum ViewScaleType { - FIT_INSIDE, - CROP; - - /* renamed from: com.nostra13.universalimageloader.core.assist.ViewScaleType$1 reason: invalid class name */ - /* loaded from: classes.dex */ - static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$android$widget$ImageView$ScaleType; - - static { - int[] iArr = new int[ImageView.ScaleType.values().length]; - $SwitchMap$android$widget$ImageView$ScaleType = iArr; - try { - iArr[ImageView.ScaleType.FIT_CENTER.ordinal()] = 1; - } catch (NoSuchFieldError unused) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.FIT_XY.ordinal()] = 2; - } catch (NoSuchFieldError unused2) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.FIT_START.ordinal()] = 3; - } catch (NoSuchFieldError unused3) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.FIT_END.ordinal()] = 4; - } catch (NoSuchFieldError unused4) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.CENTER_INSIDE.ordinal()] = 5; - } catch (NoSuchFieldError unused5) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.MATRIX.ordinal()] = 6; - } catch (NoSuchFieldError unused6) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.CENTER.ordinal()] = 7; - } catch (NoSuchFieldError unused7) { - } - try { - $SwitchMap$android$widget$ImageView$ScaleType[ImageView.ScaleType.CENTER_CROP.ordinal()] = 8; - } catch (NoSuchFieldError unused8) { - } - } - } - - public static ViewScaleType fromImageView(ImageView imageView) { - int i = AnonymousClass1.$SwitchMap$android$widget$ImageView$ScaleType[imageView.getScaleType().ordinal()]; - if (i == 1 || i == 2 || i == 3 || i == 4 || i == 5) { - return FIT_INSIDE; - } - return CROP; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/BlockingDeque.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/BlockingDeque.java deleted file mode 100644 index a059b63..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/BlockingDeque.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.nostra13.universalimageloader.core.assist.deque; - -import java.util.Iterator; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.TimeUnit; - -/* loaded from: classes.dex */ -public interface BlockingDeque extends BlockingQueue, Deque { - @Override // java.util.concurrent.BlockingQueue, java.util.Queue, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean add(E e); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - void addFirst(E e); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - void addLast(E e); - - @Override // java.util.concurrent.BlockingQueue, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean contains(Object obj); - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - E element(); - - @Override // java.util.Collection, java.lang.Iterable, com.nostra13.universalimageloader.core.assist.deque.Deque - Iterator iterator(); - - @Override // java.util.concurrent.BlockingQueue, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean offer(E e); - - @Override // java.util.concurrent.BlockingQueue - boolean offer(E e, long j, TimeUnit timeUnit) throws InterruptedException; - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - boolean offerFirst(E e); - - boolean offerFirst(E e, long j, TimeUnit timeUnit) throws InterruptedException; - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - boolean offerLast(E e); - - boolean offerLast(E e, long j, TimeUnit timeUnit) throws InterruptedException; - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - E peek(); - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - E poll(); - - @Override // java.util.concurrent.BlockingQueue - E poll(long j, TimeUnit timeUnit) throws InterruptedException; - - E pollFirst(long j, TimeUnit timeUnit) throws InterruptedException; - - E pollLast(long j, TimeUnit timeUnit) throws InterruptedException; - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - void push(E e); - - @Override // java.util.concurrent.BlockingQueue - void put(E e) throws InterruptedException; - - void putFirst(E e) throws InterruptedException; - - void putLast(E e) throws InterruptedException; - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - E remove(); - - @Override // java.util.concurrent.BlockingQueue, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean remove(Object obj); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - boolean removeFirstOccurrence(Object obj); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - boolean removeLastOccurrence(Object obj); - - @Override // java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - int size(); - - @Override // java.util.concurrent.BlockingQueue - E take() throws InterruptedException; - - E takeFirst() throws InterruptedException; - - E takeLast() throws InterruptedException; -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/Deque.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/Deque.java deleted file mode 100644 index a53f9e9..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/Deque.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.nostra13.universalimageloader.core.assist.deque; - -import java.util.Iterator; -import java.util.Queue; - -/* loaded from: classes.dex */ -public interface Deque extends Queue { - @Override // java.util.Queue, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean add(E e); - - void addFirst(E e); - - void addLast(E e); - - @Override // java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean contains(Object obj); - - Iterator descendingIterator(); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - E element(); - - E getFirst(); - - E getLast(); - - @Override // java.lang.Iterable, com.nostra13.universalimageloader.core.assist.deque.Deque - Iterator iterator(); - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean offer(E e); - - boolean offerFirst(E e); - - boolean offerLast(E e); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - E peek(); - - E peekFirst(); - - E peekLast(); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - E poll(); - - E pollFirst(); - - E pollLast(); - - E pop(); - - void push(E e); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - E remove(); - - @Override // java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.Deque - boolean remove(Object obj); - - E removeFirst(); - - boolean removeFirstOccurrence(Object obj); - - E removeLast(); - - boolean removeLastOccurrence(Object obj); - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - int size(); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LIFOLinkedBlockingDeque.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LIFOLinkedBlockingDeque.java deleted file mode 100644 index 599da9d..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LIFOLinkedBlockingDeque.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.nostra13.universalimageloader.core.assist.deque; - -/* loaded from: classes.dex */ -public class LIFOLinkedBlockingDeque extends LinkedBlockingDeque { - private static final long serialVersionUID = -4114786347960826192L; - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean offer(T t) { - return super.offerFirst(t); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque, java.util.AbstractQueue, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public T remove() { - return (T) super.removeFirst(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LinkedBlockingDeque.java b/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LinkedBlockingDeque.java deleted file mode 100644 index 920aae9..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/assist/deque/LinkedBlockingDeque.java +++ /dev/null @@ -1,873 +0,0 @@ -package com.nostra13.universalimageloader.core.assist.deque; - -import androidx.appcompat.widget.ActivityChooserView; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.lang.reflect.Array; -import java.util.AbstractQueue; -import java.util.Collection; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantLock; -import org.apache.http.message.TokenParser; - -/* loaded from: classes.dex */ -public class LinkedBlockingDeque extends AbstractQueue implements BlockingDeque, Serializable { - private static final long serialVersionUID = -387911632671998426L; - private final int capacity; - private transient int count; - transient Node first; - transient Node last; - final ReentrantLock lock; - private final Condition notEmpty; - private final Condition notFull; - - /* JADX INFO: Access modifiers changed from: package-private */ - /* loaded from: classes.dex */ - public static final class Node { - E item; - Node next; - Node prev; - - Node(E e) { - this.item = e; - } - } - - public LinkedBlockingDeque() { - this((int) ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED); - } - - public LinkedBlockingDeque(int i) { - ReentrantLock reentrantLock = new ReentrantLock(); - this.lock = reentrantLock; - this.notEmpty = reentrantLock.newCondition(); - this.notFull = reentrantLock.newCondition(); - if (i <= 0) { - throw new IllegalArgumentException(); - } - this.capacity = i; - } - - public LinkedBlockingDeque(Collection collection) { - this((int) ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - for (E e : collection) { - if (e == null) { - throw new NullPointerException(); - } - if (!linkLast(new Node<>(e))) { - throw new IllegalStateException("Deque full"); - } - } - } finally { - reentrantLock.unlock(); - } - } - - private boolean linkFirst(Node node) { - if (this.count >= this.capacity) { - return false; - } - Node node2 = this.first; - node.next = node2; - this.first = node; - if (this.last == null) { - this.last = node; - } else { - node2.prev = node; - } - this.count++; - this.notEmpty.signal(); - return true; - } - - private boolean linkLast(Node node) { - if (this.count >= this.capacity) { - return false; - } - Node node2 = this.last; - node.prev = node2; - this.last = node; - if (this.first == null) { - this.first = node; - } else { - node2.next = node; - } - this.count++; - this.notEmpty.signal(); - return true; - } - - private E unlinkFirst() { - Node node = this.first; - if (node == null) { - return null; - } - Node node2 = node.next; - E e = node.item; - node.item = null; - node.next = node; - this.first = node2; - if (node2 == null) { - this.last = null; - } else { - node2.prev = null; - } - this.count--; - this.notFull.signal(); - return e; - } - - private E unlinkLast() { - Node node = this.last; - if (node == null) { - return null; - } - Node node2 = node.prev; - E e = node.item; - node.item = null; - node.prev = node; - this.last = node2; - if (node2 == null) { - this.first = null; - } else { - node2.next = null; - } - this.count--; - this.notFull.signal(); - return e; - } - - void unlink(Node node) { - Node node2 = node.prev; - Node node3 = node.next; - if (node2 == null) { - unlinkFirst(); - } else if (node3 == null) { - unlinkLast(); - } else { - node2.next = node3; - node3.prev = node2; - node.item = null; - this.count--; - this.notFull.signal(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public void addFirst(E e) { - if (!offerFirst(e)) { - throw new IllegalStateException("Deque full"); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public void addLast(E e) { - if (!offerLast(e)) { - throw new IllegalStateException("Deque full"); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean offerFirst(E e) { - Objects.requireNonNull(e); - Node node = new Node<>(e); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return linkFirst(node); - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean offerLast(E e) { - Objects.requireNonNull(e); - Node node = new Node<>(e); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return linkLast(node); - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public void putFirst(E e) throws InterruptedException { - Objects.requireNonNull(e); - Node node = new Node<>(e); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - while (!linkFirst(node)) { - try { - this.notFull.await(); - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public void putLast(E e) throws InterruptedException { - Objects.requireNonNull(e); - Node node = new Node<>(e); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - while (!linkLast(node)) { - try { - this.notFull.await(); - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public boolean offerFirst(E e, long j, TimeUnit timeUnit) throws InterruptedException { - boolean z; - Objects.requireNonNull(e); - Node node = new Node<>(e); - long nanos = timeUnit.toNanos(j); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lockInterruptibly(); - while (true) { - try { - if (linkFirst(node)) { - z = true; - break; - } else if (nanos <= 0) { - z = false; - break; - } else { - nanos = this.notFull.awaitNanos(nanos); - } - } finally { - reentrantLock.unlock(); - } - } - return z; - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public boolean offerLast(E e, long j, TimeUnit timeUnit) throws InterruptedException { - boolean z; - Objects.requireNonNull(e); - Node node = new Node<>(e); - long nanos = timeUnit.toNanos(j); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lockInterruptibly(); - while (true) { - try { - if (linkLast(node)) { - z = true; - break; - } else if (nanos <= 0) { - z = false; - break; - } else { - nanos = this.notFull.awaitNanos(nanos); - } - } finally { - reentrantLock.unlock(); - } - } - return z; - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E removeFirst() { - E pollFirst = pollFirst(); - if (pollFirst != null) { - return pollFirst; - } - throw new NoSuchElementException(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E removeLast() { - E pollLast = pollLast(); - if (pollLast != null) { - return pollLast; - } - throw new NoSuchElementException(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E pollFirst() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return unlinkFirst(); - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E pollLast() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return unlinkLast(); - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public E takeFirst() throws InterruptedException { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - while (true) { - try { - E unlinkFirst = unlinkFirst(); - if (unlinkFirst != null) { - return unlinkFirst; - } - this.notEmpty.await(); - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public E takeLast() throws InterruptedException { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - while (true) { - try { - E unlinkLast = unlinkLast(); - if (unlinkLast != null) { - return unlinkLast; - } - this.notEmpty.await(); - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public E pollFirst(long j, TimeUnit timeUnit) throws InterruptedException { - long nanos = timeUnit.toNanos(j); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lockInterruptibly(); - while (true) { - try { - E unlinkFirst = unlinkFirst(); - if (unlinkFirst != null) { - return unlinkFirst; - } - if (nanos > 0) { - nanos = this.notEmpty.awaitNanos(nanos); - } else { - return null; - } - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque - public E pollLast(long j, TimeUnit timeUnit) throws InterruptedException { - long nanos = timeUnit.toNanos(j); - ReentrantLock reentrantLock = this.lock; - reentrantLock.lockInterruptibly(); - while (true) { - try { - E unlinkLast = unlinkLast(); - if (unlinkLast != null) { - return unlinkLast; - } - if (nanos > 0) { - nanos = this.notEmpty.awaitNanos(nanos); - } else { - return null; - } - } finally { - reentrantLock.unlock(); - } - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E getFirst() { - E peekFirst = peekFirst(); - if (peekFirst != null) { - return peekFirst; - } - throw new NoSuchElementException(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E getLast() { - E peekLast = peekLast(); - if (peekLast != null) { - return peekLast; - } - throw new NoSuchElementException(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E peekFirst() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - Node node = this.first; - return node == null ? null : node.item; - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E peekLast() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - Node node = this.last; - return node == null ? null : node.item; - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean removeFirstOccurrence(Object obj) { - if (obj == null) { - return false; - } - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - for (Node node = this.first; node != null; node = node.next) { - if (obj.equals(node.item)) { - unlink(node); - return true; - } - } - return false; - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean removeLastOccurrence(Object obj) { - if (obj == null) { - return false; - } - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - for (Node node = this.last; node != null; node = node.prev) { - if (obj.equals(node.item)) { - unlink(node); - return true; - } - } - return false; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractQueue, java.util.AbstractCollection, java.util.Collection, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean add(E e) { - addLast(e); - return true; - } - - public boolean offer(E e) { - return offerLast(e); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue - public void put(E e) throws InterruptedException { - putLast(e); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue - public boolean offer(E e, long j, TimeUnit timeUnit) throws InterruptedException { - return offerLast(e, j, timeUnit); - } - - @Override // java.util.AbstractQueue, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public E remove() { - return removeFirst(); - } - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public E poll() { - return pollFirst(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue - public E take() throws InterruptedException { - return takeFirst(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue - public E poll(long j, TimeUnit timeUnit) throws InterruptedException { - return pollFirst(j, timeUnit); - } - - @Override // java.util.AbstractQueue, java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public E element() { - return getFirst(); - } - - @Override // java.util.Queue, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public E peek() { - return peekFirst(); - } - - @Override // java.util.concurrent.BlockingQueue - public int remainingCapacity() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return this.capacity - this.count; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.concurrent.BlockingQueue - public int drainTo(Collection collection) { - return drainTo(collection, ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED); - } - - @Override // java.util.concurrent.BlockingQueue - public int drainTo(Collection collection, int i) { - Objects.requireNonNull(collection); - if (collection == this) { - throw new IllegalArgumentException(); - } - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - int min = Math.min(i, this.count); - for (int i2 = 0; i2 < min; i2++) { - collection.add((E) this.first.item); - unlinkFirst(); - } - return min; - } finally { - reentrantLock.unlock(); - } - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public void push(E e) { - addFirst(e); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public E pop() { - return removeFirst(); - } - - @Override // java.util.AbstractCollection, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean remove(Object obj) { - return removeFirstOccurrence(obj); - } - - @Override // java.util.AbstractCollection, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public int size() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - return this.count; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractCollection, java.util.Collection, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, java.util.concurrent.BlockingQueue, com.nostra13.universalimageloader.core.assist.deque.Deque - public boolean contains(Object obj) { - if (obj == null) { - return false; - } - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - for (Node node = this.first; node != null; node = node.next) { - if (obj.equals(node.item)) { - return true; - } - } - return false; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractCollection, java.util.Collection - public Object[] toArray() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - Object[] objArr = new Object[this.count]; - int i = 0; - Node node = this.first; - while (node != null) { - int i2 = i + 1; - objArr[i] = node.item; - node = node.next; - i = i2; - } - return objArr; - } finally { - reentrantLock.unlock(); - } - } - - /* JADX WARN: Multi-variable type inference failed */ - @Override // java.util.AbstractCollection, java.util.Collection - public T[] toArray(T[] tArr) { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - if (tArr.length < this.count) { - tArr = (T[]) ((Object[]) Array.newInstance(tArr.getClass().getComponentType(), this.count)); - } - int i = 0; - Node node = this.first; - while (node != null) { - tArr[i] = node.item; - node = node.next; - i++; - } - if (tArr.length > i) { - tArr[i] = null; - } - return tArr; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractCollection - public String toString() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - Node node = this.first; - if (node == null) { - return "[]"; - } - StringBuilder sb = new StringBuilder(); - sb.append('['); - while (true) { - Object obj = node.item; - if (obj == this) { - obj = "(this Collection)"; - } - sb.append(obj); - node = node.next; - if (node == null) { - sb.append(']'); - return sb.toString(); - } - sb.append(','); - sb.append(TokenParser.SP); - } - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractQueue, java.util.AbstractCollection, java.util.Collection - public void clear() { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - Node node = this.first; - while (node != null) { - node.item = null; - Node node2 = node.next; - node.prev = null; - node.next = null; - node = node2; - } - this.last = null; - this.first = null; - this.count = 0; - this.notFull.signalAll(); - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, com.nostra13.universalimageloader.core.assist.deque.BlockingDeque, com.nostra13.universalimageloader.core.assist.deque.Deque - public Iterator iterator() { - return new Itr(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.Deque - public Iterator descendingIterator() { - return new DescendingItr(); - } - - /* loaded from: classes.dex */ - private abstract class AbstractItr implements Iterator { - private Node lastRet; - Node next; - E nextItem; - - abstract Node firstNode(); - - abstract Node nextNode(Node node); - - AbstractItr() { - ReentrantLock reentrantLock = LinkedBlockingDeque.this.lock; - reentrantLock.lock(); - try { - Node firstNode = firstNode(); - this.next = firstNode; - this.nextItem = firstNode == null ? null : firstNode.item; - } finally { - reentrantLock.unlock(); - } - } - - private Node succ(Node node) { - while (true) { - Node nextNode = nextNode(node); - if (nextNode == null) { - return null; - } - if (nextNode.item != null) { - return nextNode; - } - if (nextNode == node) { - return firstNode(); - } - node = nextNode; - } - } - - void advance() { - ReentrantLock reentrantLock = LinkedBlockingDeque.this.lock; - reentrantLock.lock(); - try { - Node succ = succ(this.next); - this.next = succ; - this.nextItem = succ == null ? null : succ.item; - } finally { - reentrantLock.unlock(); - } - } - - @Override // java.util.Iterator - public boolean hasNext() { - return this.next != null; - } - - @Override // java.util.Iterator - public E next() { - Node node = this.next; - if (node == null) { - throw new NoSuchElementException(); - } - this.lastRet = node; - E e = this.nextItem; - advance(); - return e; - } - - @Override // java.util.Iterator - public void remove() { - Node node = this.lastRet; - if (node == null) { - throw new IllegalStateException(); - } - this.lastRet = null; - ReentrantLock reentrantLock = LinkedBlockingDeque.this.lock; - reentrantLock.lock(); - try { - if (node.item != null) { - LinkedBlockingDeque.this.unlink(node); - } - } finally { - reentrantLock.unlock(); - } - } - } - - /* loaded from: classes.dex */ - private class Itr extends LinkedBlockingDeque.AbstractItr { - private Itr() { - super(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque.AbstractItr - Node firstNode() { - return LinkedBlockingDeque.this.first; - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque.AbstractItr - Node nextNode(Node node) { - return node.next; - } - } - - /* loaded from: classes.dex */ - private class DescendingItr extends LinkedBlockingDeque.AbstractItr { - private DescendingItr() { - super(); - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque.AbstractItr - Node firstNode() { - return LinkedBlockingDeque.this.last; - } - - @Override // com.nostra13.universalimageloader.core.assist.deque.LinkedBlockingDeque.AbstractItr - Node nextNode(Node node) { - return node.prev; - } - } - - private void writeObject(ObjectOutputStream objectOutputStream) throws IOException { - ReentrantLock reentrantLock = this.lock; - reentrantLock.lock(); - try { - objectOutputStream.defaultWriteObject(); - for (Node node = this.first; node != null; node = node.next) { - objectOutputStream.writeObject(node.item); - } - objectOutputStream.writeObject(null); - } finally { - reentrantLock.unlock(); - } - } - - /* JADX WARN: Multi-variable type inference failed */ - private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { - objectInputStream.defaultReadObject(); - this.count = 0; - this.first = null; - this.last = null; - while (true) { - Object readObject = objectInputStream.readObject(); - if (readObject == null) { - return; - } - add(readObject); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/decode/BaseImageDecoder.java b/app/src/main/java/com/nostra13/universalimageloader/core/decode/BaseImageDecoder.java deleted file mode 100644 index 4ebf50b..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/decode/BaseImageDecoder.java +++ /dev/null @@ -1,212 +0,0 @@ -package com.nostra13.universalimageloader.core.decode; - -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Matrix; -import android.media.ExifInterface; -import com.luck.picture.lib.config.PictureMimeType; -import com.luck.picture.lib.widget.longimage.SubsamplingScaleImageView; -import com.nostra13.universalimageloader.core.assist.ImageScaleType; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.download.ImageDownloader; -import com.nostra13.universalimageloader.utils.ImageSizeUtils; -import com.nostra13.universalimageloader.utils.IoUtils; -import com.nostra13.universalimageloader.utils.L; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public class BaseImageDecoder implements ImageDecoder { - protected static final String ERROR_CANT_DECODE_IMAGE = "Image can't be decoded [%s]"; - protected static final String ERROR_NO_IMAGE_STREAM = "No stream for image [%s]"; - protected static final String LOG_FLIP_IMAGE = "Flip image horizontally [%s]"; - protected static final String LOG_ROTATE_IMAGE = "Rotate image on %1$d° [%2$s]"; - protected static final String LOG_SCALE_IMAGE = "Scale subsampled image (%1$s) to %2$s (scale = %3$.5f) [%4$s]"; - protected static final String LOG_SUBSAMPLE_IMAGE = "Subsample original image (%1$s) to %2$s (scale = %3$d) [%4$s]"; - protected final boolean loggingEnabled; - - public BaseImageDecoder(boolean z) { - this.loggingEnabled = z; - } - - @Override // com.nostra13.universalimageloader.core.decode.ImageDecoder - public Bitmap decode(ImageDecodingInfo imageDecodingInfo) throws IOException { - InputStream imageStream = getImageStream(imageDecodingInfo); - if (imageStream == null) { - L.e(ERROR_NO_IMAGE_STREAM, imageDecodingInfo.getImageKey()); - return null; - } - try { - ImageFileInfo defineImageSizeAndRotation = defineImageSizeAndRotation(imageStream, imageDecodingInfo); - imageStream = resetStream(imageStream, imageDecodingInfo); - Bitmap decodeStream = BitmapFactory.decodeStream(imageStream, null, prepareDecodingOptions(defineImageSizeAndRotation.imageSize, imageDecodingInfo)); - if (decodeStream == null) { - L.e(ERROR_CANT_DECODE_IMAGE, imageDecodingInfo.getImageKey()); - return decodeStream; - } - return considerExactScaleAndOrientatiton(decodeStream, imageDecodingInfo, defineImageSizeAndRotation.exif.rotation, defineImageSizeAndRotation.exif.flipHorizontal); - } finally { - IoUtils.closeSilently(imageStream); - } - } - - protected InputStream getImageStream(ImageDecodingInfo imageDecodingInfo) throws IOException { - return imageDecodingInfo.getDownloader().getStream(imageDecodingInfo.getImageUri(), imageDecodingInfo.getExtraForDownloader()); - } - - protected ImageFileInfo defineImageSizeAndRotation(InputStream inputStream, ImageDecodingInfo imageDecodingInfo) throws IOException { - ExifInfo exifInfo; - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - BitmapFactory.decodeStream(inputStream, null, options); - String imageUri = imageDecodingInfo.getImageUri(); - if (imageDecodingInfo.shouldConsiderExifParams() && canDefineExifParams(imageUri, options.outMimeType)) { - exifInfo = defineExifOrientation(imageUri); - } else { - exifInfo = new ExifInfo(); - } - return new ImageFileInfo(new ImageSize(options.outWidth, options.outHeight, exifInfo.rotation), exifInfo); - } - - private boolean canDefineExifParams(String str, String str2) { - return PictureMimeType.MIME_TYPE_IMAGE.equalsIgnoreCase(str2) && ImageDownloader.Scheme.ofUri(str) == ImageDownloader.Scheme.FILE; - } - - /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ - /* JADX WARN: Multi-variable type inference failed */ - protected ExifInfo defineExifOrientation(String str) { - int i = 0; - boolean z = 1; - try { - } catch (IOException unused) { - L.w("Can't read EXIF tags from file [%s]", str); - } - switch (new ExifInterface(ImageDownloader.Scheme.FILE.crop(str)).getAttributeInt(androidx.exifinterface.media.ExifInterface.TAG_ORIENTATION, 1)) { - case 1: - default: - z = 0; - break; - case 2: - break; - case 3: - z = i; - i = SubsamplingScaleImageView.ORIENTATION_180; - break; - case 4: - i = 1; - z = i; - i = SubsamplingScaleImageView.ORIENTATION_180; - break; - case 5: - i = 1; - z = i; - i = SubsamplingScaleImageView.ORIENTATION_270; - break; - case 6: - z = i; - i = 90; - break; - case 7: - i = 1; - z = i; - i = 90; - break; - case 8: - z = i; - i = SubsamplingScaleImageView.ORIENTATION_270; - break; - } - return new ExifInfo(i, z); - } - - protected BitmapFactory.Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo imageDecodingInfo) { - int computeImageSampleSize; - ImageScaleType imageScaleType = imageDecodingInfo.getImageScaleType(); - if (imageScaleType == ImageScaleType.NONE) { - computeImageSampleSize = 1; - } else if (imageScaleType == ImageScaleType.NONE_SAFE) { - computeImageSampleSize = ImageSizeUtils.computeMinImageSampleSize(imageSize); - } else { - computeImageSampleSize = ImageSizeUtils.computeImageSampleSize(imageSize, imageDecodingInfo.getTargetSize(), imageDecodingInfo.getViewScaleType(), imageScaleType == ImageScaleType.IN_SAMPLE_POWER_OF_2); - } - if (computeImageSampleSize > 1 && this.loggingEnabled) { - L.d(LOG_SUBSAMPLE_IMAGE, imageSize, imageSize.scaleDown(computeImageSampleSize), Integer.valueOf(computeImageSampleSize), imageDecodingInfo.getImageKey()); - } - BitmapFactory.Options decodingOptions = imageDecodingInfo.getDecodingOptions(); - decodingOptions.inSampleSize = computeImageSampleSize; - return decodingOptions; - } - - protected InputStream resetStream(InputStream inputStream, ImageDecodingInfo imageDecodingInfo) throws IOException { - if (inputStream.markSupported()) { - try { - inputStream.reset(); - return inputStream; - } catch (IOException unused) { - } - } - IoUtils.closeSilently(inputStream); - return getImageStream(imageDecodingInfo); - } - - protected Bitmap considerExactScaleAndOrientatiton(Bitmap bitmap, ImageDecodingInfo imageDecodingInfo, int i, boolean z) { - Matrix matrix = new Matrix(); - ImageScaleType imageScaleType = imageDecodingInfo.getImageScaleType(); - if (imageScaleType == ImageScaleType.EXACTLY || imageScaleType == ImageScaleType.EXACTLY_STRETCHED) { - ImageSize imageSize = new ImageSize(bitmap.getWidth(), bitmap.getHeight(), i); - float computeImageScale = ImageSizeUtils.computeImageScale(imageSize, imageDecodingInfo.getTargetSize(), imageDecodingInfo.getViewScaleType(), imageScaleType == ImageScaleType.EXACTLY_STRETCHED); - if (Float.compare(computeImageScale, 1.0f) != 0) { - matrix.setScale(computeImageScale, computeImageScale); - if (this.loggingEnabled) { - L.d(LOG_SCALE_IMAGE, imageSize, imageSize.scale(computeImageScale), Float.valueOf(computeImageScale), imageDecodingInfo.getImageKey()); - } - } - } - if (z) { - matrix.postScale(-1.0f, 1.0f); - if (this.loggingEnabled) { - L.d(LOG_FLIP_IMAGE, imageDecodingInfo.getImageKey()); - } - } - if (i != 0) { - matrix.postRotate(i); - if (this.loggingEnabled) { - L.d(LOG_ROTATE_IMAGE, Integer.valueOf(i), imageDecodingInfo.getImageKey()); - } - } - Bitmap createBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); - if (createBitmap != bitmap) { - bitmap.recycle(); - } - return createBitmap; - } - - /* JADX INFO: Access modifiers changed from: protected */ - /* loaded from: classes.dex */ - public static class ExifInfo { - public final boolean flipHorizontal; - public final int rotation; - - protected ExifInfo() { - this.rotation = 0; - this.flipHorizontal = false; - } - - protected ExifInfo(int i, boolean z) { - this.rotation = i; - this.flipHorizontal = z; - } - } - - /* JADX INFO: Access modifiers changed from: protected */ - /* loaded from: classes.dex */ - public static class ImageFileInfo { - public final ExifInfo exif; - public final ImageSize imageSize; - - protected ImageFileInfo(ImageSize imageSize, ExifInfo exifInfo) { - this.imageSize = imageSize; - this.exif = exifInfo; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecoder.java b/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecoder.java deleted file mode 100644 index 0fcf47a..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecoder.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.nostra13.universalimageloader.core.decode; - -import android.graphics.Bitmap; -import java.io.IOException; - -/* loaded from: classes.dex */ -public interface ImageDecoder { - Bitmap decode(ImageDecodingInfo imageDecodingInfo) throws IOException; -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecodingInfo.java b/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecodingInfo.java deleted file mode 100644 index 0e742ff..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/decode/ImageDecodingInfo.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.nostra13.universalimageloader.core.decode; - -import android.graphics.BitmapFactory; -import android.os.Build; -import com.nostra13.universalimageloader.core.DisplayImageOptions; -import com.nostra13.universalimageloader.core.assist.ImageScaleType; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.core.download.ImageDownloader; - -/* loaded from: classes.dex */ -public class ImageDecodingInfo { - private final boolean considerExifParams; - private final BitmapFactory.Options decodingOptions; - private final ImageDownloader downloader; - private final Object extraForDownloader; - private final String imageKey; - private final ImageScaleType imageScaleType; - private final String imageUri; - private final String originalImageUri; - private final ImageSize targetSize; - private final ViewScaleType viewScaleType; - - public ImageDecodingInfo(String str, String str2, String str3, ImageSize imageSize, ViewScaleType viewScaleType, ImageDownloader imageDownloader, DisplayImageOptions displayImageOptions) { - this.imageKey = str; - this.imageUri = str2; - this.originalImageUri = str3; - this.targetSize = imageSize; - this.imageScaleType = displayImageOptions.getImageScaleType(); - this.viewScaleType = viewScaleType; - this.downloader = imageDownloader; - this.extraForDownloader = displayImageOptions.getExtraForDownloader(); - this.considerExifParams = displayImageOptions.isConsiderExifParams(); - BitmapFactory.Options options = new BitmapFactory.Options(); - this.decodingOptions = options; - copyOptions(displayImageOptions.getDecodingOptions(), options); - } - - private void copyOptions(BitmapFactory.Options options, BitmapFactory.Options options2) { - options2.inDensity = options.inDensity; - options2.inDither = options.inDither; - options2.inInputShareable = options.inInputShareable; - options2.inJustDecodeBounds = options.inJustDecodeBounds; - options2.inPreferredConfig = options.inPreferredConfig; - options2.inPurgeable = options.inPurgeable; - options2.inSampleSize = options.inSampleSize; - options2.inScaled = options.inScaled; - options2.inScreenDensity = options.inScreenDensity; - options2.inTargetDensity = options.inTargetDensity; - options2.inTempStorage = options.inTempStorage; - if (Build.VERSION.SDK_INT >= 10) { - copyOptions10(options, options2); - } - if (Build.VERSION.SDK_INT >= 11) { - copyOptions11(options, options2); - } - } - - private void copyOptions10(BitmapFactory.Options options, BitmapFactory.Options options2) { - options2.inPreferQualityOverSpeed = options.inPreferQualityOverSpeed; - } - - private void copyOptions11(BitmapFactory.Options options, BitmapFactory.Options options2) { - options2.inBitmap = options.inBitmap; - options2.inMutable = options.inMutable; - } - - public String getImageKey() { - return this.imageKey; - } - - public String getImageUri() { - return this.imageUri; - } - - public String getOriginalImageUri() { - return this.originalImageUri; - } - - public ImageSize getTargetSize() { - return this.targetSize; - } - - public ImageScaleType getImageScaleType() { - return this.imageScaleType; - } - - public ViewScaleType getViewScaleType() { - return this.viewScaleType; - } - - public ImageDownloader getDownloader() { - return this.downloader; - } - - public Object getExtraForDownloader() { - return this.extraForDownloader; - } - - public boolean shouldConsiderExifParams() { - return this.considerExifParams; - } - - public BitmapFactory.Options getDecodingOptions() { - return this.decodingOptions; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/BitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/BitmapDisplayer.java deleted file mode 100644 index 01506eb..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/BitmapDisplayer.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; - -/* loaded from: classes.dex */ -public interface BitmapDisplayer { - void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/CircleBitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/CircleBitmapDisplayer.java deleted file mode 100644 index fc782ec..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/CircleBitmapDisplayer.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import android.graphics.BitmapShader; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.graphics.Rect; -import android.graphics.RectF; -import android.graphics.Shader; -import android.graphics.drawable.Drawable; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; - -/* loaded from: classes.dex */ -public class CircleBitmapDisplayer implements BitmapDisplayer { - protected final Integer strokeColor; - protected final float strokeWidth; - - public CircleBitmapDisplayer() { - this(null); - } - - public CircleBitmapDisplayer(Integer num) { - this(num, 0.0f); - } - - public CircleBitmapDisplayer(Integer num, float f) { - this.strokeColor = num; - this.strokeWidth = f; - } - - @Override // com.nostra13.universalimageloader.core.display.BitmapDisplayer - public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) { - if (!(imageAware instanceof ImageViewAware)) { - throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected."); - } - imageAware.setImageDrawable(new CircleDrawable(bitmap, this.strokeColor, this.strokeWidth)); - } - - /* loaded from: classes.dex */ - public static class CircleDrawable extends Drawable { - protected final BitmapShader bitmapShader; - protected final RectF mBitmapRect; - protected final RectF mRect = new RectF(); - protected final Paint paint; - protected float radius; - protected final Paint strokePaint; - protected float strokeRadius; - protected final float strokeWidth; - - @Override // android.graphics.drawable.Drawable - public int getOpacity() { - return -3; - } - - public CircleDrawable(Bitmap bitmap, Integer num, float f) { - this.radius = Math.min(bitmap.getWidth(), bitmap.getHeight()) / 2; - BitmapShader bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); - this.bitmapShader = bitmapShader; - this.mBitmapRect = new RectF(0.0f, 0.0f, bitmap.getWidth(), bitmap.getHeight()); - Paint paint = new Paint(); - this.paint = paint; - paint.setAntiAlias(true); - paint.setShader(bitmapShader); - paint.setFilterBitmap(true); - paint.setDither(true); - if (num == null) { - this.strokePaint = null; - } else { - Paint paint2 = new Paint(); - this.strokePaint = paint2; - paint2.setStyle(Paint.Style.STROKE); - paint2.setColor(num.intValue()); - paint2.setStrokeWidth(f); - paint2.setAntiAlias(true); - } - this.strokeWidth = f; - this.strokeRadius = this.radius - (f / 2.0f); - } - - @Override // android.graphics.drawable.Drawable - protected void onBoundsChange(Rect rect) { - super.onBoundsChange(rect); - this.mRect.set(0.0f, 0.0f, rect.width(), rect.height()); - float min = Math.min(rect.width(), rect.height()) / 2; - this.radius = min; - this.strokeRadius = min - (this.strokeWidth / 2.0f); - Matrix matrix = new Matrix(); - matrix.setRectToRect(this.mBitmapRect, this.mRect, Matrix.ScaleToFit.FILL); - this.bitmapShader.setLocalMatrix(matrix); - } - - @Override // android.graphics.drawable.Drawable - public void draw(Canvas canvas) { - float f = this.radius; - canvas.drawCircle(f, f, f, this.paint); - Paint paint = this.strokePaint; - if (paint != null) { - float f2 = this.radius; - canvas.drawCircle(f2, f2, this.strokeRadius, paint); - } - } - - @Override // android.graphics.drawable.Drawable - public void setAlpha(int i) { - this.paint.setAlpha(i); - } - - @Override // android.graphics.drawable.Drawable - public void setColorFilter(ColorFilter colorFilter) { - this.paint.setColorFilter(colorFilter); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/FadeInBitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/FadeInBitmapDisplayer.java deleted file mode 100644 index e082cfd..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/FadeInBitmapDisplayer.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import android.view.View; -import android.view.animation.AlphaAnimation; -import android.view.animation.DecelerateInterpolator; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; - -/* loaded from: classes.dex */ -public class FadeInBitmapDisplayer implements BitmapDisplayer { - private final boolean animateFromDisk; - private final boolean animateFromMemory; - private final boolean animateFromNetwork; - private final int durationMillis; - - public FadeInBitmapDisplayer(int i) { - this(i, true, true, true); - } - - public FadeInBitmapDisplayer(int i, boolean z, boolean z2, boolean z3) { - this.durationMillis = i; - this.animateFromNetwork = z; - this.animateFromDisk = z2; - this.animateFromMemory = z3; - } - - @Override // com.nostra13.universalimageloader.core.display.BitmapDisplayer - public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) { - imageAware.setImageBitmap(bitmap); - if ((this.animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) || ((this.animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) || (this.animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE))) { - animate(imageAware.getWrappedView(), this.durationMillis); - } - } - - public static void animate(View view, int i) { - if (view != null) { - AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f); - alphaAnimation.setDuration(i); - alphaAnimation.setInterpolator(new DecelerateInterpolator()); - view.startAnimation(alphaAnimation); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedBitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedBitmapDisplayer.java deleted file mode 100644 index d2c4956..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedBitmapDisplayer.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import android.graphics.BitmapShader; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.graphics.Rect; -import android.graphics.RectF; -import android.graphics.Shader; -import android.graphics.drawable.Drawable; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; - -/* loaded from: classes.dex */ -public class RoundedBitmapDisplayer implements BitmapDisplayer { - protected final int cornerRadius; - protected final int margin; - - public RoundedBitmapDisplayer(int i) { - this(i, 0); - } - - public RoundedBitmapDisplayer(int i, int i2) { - this.cornerRadius = i; - this.margin = i2; - } - - @Override // com.nostra13.universalimageloader.core.display.BitmapDisplayer - public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) { - if (!(imageAware instanceof ImageViewAware)) { - throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected."); - } - imageAware.setImageDrawable(new RoundedDrawable(bitmap, this.cornerRadius, this.margin)); - } - - /* loaded from: classes.dex */ - public static class RoundedDrawable extends Drawable { - protected final BitmapShader bitmapShader; - protected final float cornerRadius; - protected final RectF mBitmapRect; - protected final RectF mRect = new RectF(); - protected final int margin; - protected final Paint paint; - - @Override // android.graphics.drawable.Drawable - public int getOpacity() { - return -3; - } - - public RoundedDrawable(Bitmap bitmap, int i, int i2) { - this.cornerRadius = i; - this.margin = i2; - BitmapShader bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); - this.bitmapShader = bitmapShader; - float f = i2; - this.mBitmapRect = new RectF(f, f, bitmap.getWidth() - i2, bitmap.getHeight() - i2); - Paint paint = new Paint(); - this.paint = paint; - paint.setAntiAlias(true); - paint.setShader(bitmapShader); - paint.setFilterBitmap(true); - paint.setDither(true); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // android.graphics.drawable.Drawable - public void onBoundsChange(Rect rect) { - super.onBoundsChange(rect); - RectF rectF = this.mRect; - int i = this.margin; - rectF.set(i, i, rect.width() - this.margin, rect.height() - this.margin); - Matrix matrix = new Matrix(); - matrix.setRectToRect(this.mBitmapRect, this.mRect, Matrix.ScaleToFit.FILL); - this.bitmapShader.setLocalMatrix(matrix); - } - - @Override // android.graphics.drawable.Drawable - public void draw(Canvas canvas) { - RectF rectF = this.mRect; - float f = this.cornerRadius; - canvas.drawRoundRect(rectF, f, f, this.paint); - } - - @Override // android.graphics.drawable.Drawable - public void setAlpha(int i) { - this.paint.setAlpha(i); - } - - @Override // android.graphics.drawable.Drawable - public void setColorFilter(ColorFilter colorFilter) { - this.paint.setColorFilter(colorFilter); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedVignetteBitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedVignetteBitmapDisplayer.java deleted file mode 100644 index 8f7e0cf..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/RoundedVignetteBitmapDisplayer.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import android.graphics.ComposeShader; -import android.graphics.Matrix; -import android.graphics.PorterDuff; -import android.graphics.RadialGradient; -import android.graphics.Rect; -import android.graphics.Shader; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; -import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; - -/* loaded from: classes.dex */ -public class RoundedVignetteBitmapDisplayer extends RoundedBitmapDisplayer { - public RoundedVignetteBitmapDisplayer(int i, int i2) { - super(i, i2); - } - - @Override // com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer, com.nostra13.universalimageloader.core.display.BitmapDisplayer - public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) { - if (!(imageAware instanceof ImageViewAware)) { - throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected."); - } - imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, this.cornerRadius, this.margin)); - } - - /* loaded from: classes.dex */ - protected static class RoundedVignetteDrawable extends RoundedBitmapDisplayer.RoundedDrawable { - RoundedVignetteDrawable(Bitmap bitmap, int i, int i2) { - super(bitmap, i, i2); - } - - /* JADX INFO: Access modifiers changed from: protected */ - @Override // com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer.RoundedDrawable, android.graphics.drawable.Drawable - public void onBoundsChange(Rect rect) { - super.onBoundsChange(rect); - RadialGradient radialGradient = new RadialGradient(this.mRect.centerX(), (this.mRect.centerY() * 1.0f) / 0.7f, 1.3f * this.mRect.centerX(), new int[]{0, 0, 2130706432}, new float[]{0.0f, 0.7f, 1.0f}, Shader.TileMode.CLAMP); - Matrix matrix = new Matrix(); - matrix.setScale(1.0f, 0.7f); - radialGradient.setLocalMatrix(matrix); - this.paint.setShader(new ComposeShader(this.bitmapShader, radialGradient, PorterDuff.Mode.SRC_OVER)); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/display/SimpleBitmapDisplayer.java b/app/src/main/java/com/nostra13/universalimageloader/core/display/SimpleBitmapDisplayer.java deleted file mode 100644 index 9e0c692..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/display/SimpleBitmapDisplayer.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.nostra13.universalimageloader.core.display; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.core.assist.LoadedFrom; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; - -/* loaded from: classes.dex */ -public final class SimpleBitmapDisplayer implements BitmapDisplayer { - @Override // com.nostra13.universalimageloader.core.display.BitmapDisplayer - public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) { - imageAware.setImageBitmap(bitmap); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java b/app/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java deleted file mode 100644 index 4339141..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.nostra13.universalimageloader.core.download; - -import android.content.ContentResolver; -import android.content.Context; -import android.graphics.Bitmap; -import android.media.ThumbnailUtils; -import android.net.Uri; -import android.os.Build; -import android.provider.ContactsContract; -import android.provider.MediaStore; -import android.webkit.MimeTypeMap; -import com.nostra13.universalimageloader.core.assist.ContentLengthInputStream; -import com.nostra13.universalimageloader.core.download.ImageDownloader; -import com.nostra13.universalimageloader.utils.IoUtils; -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import org.apache.http.HttpHeaders; - -/* loaded from: classes.dex */ -public class BaseImageDownloader implements ImageDownloader { - protected static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%"; - protected static final int BUFFER_SIZE = 32768; - protected static final String CONTENT_CONTACTS_URI_PREFIX = "content://com.android.contacts/"; - public static final int DEFAULT_HTTP_CONNECT_TIMEOUT = 5000; - public static final int DEFAULT_HTTP_READ_TIMEOUT = 20000; - private static final String ERROR_UNSUPPORTED_SCHEME = "UIL doesn't support scheme(protocol) by default [%s]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))"; - protected static final int MAX_REDIRECT_COUNT = 5; - protected final int connectTimeout; - protected final Context context; - protected final int readTimeout; - - public BaseImageDownloader(Context context) { - this(context, 5000, DEFAULT_HTTP_READ_TIMEOUT); - } - - public BaseImageDownloader(Context context, int i, int i2) { - this.context = context.getApplicationContext(); - this.connectTimeout = i; - this.readTimeout = i2; - } - - /* renamed from: com.nostra13.universalimageloader.core.download.BaseImageDownloader$1 reason: invalid class name */ - /* loaded from: classes.dex */ - static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme; - - static { - int[] iArr = new int[ImageDownloader.Scheme.values().length]; - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme = iArr; - try { - iArr[ImageDownloader.Scheme.HTTP.ordinal()] = 1; - } catch (NoSuchFieldError unused) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.HTTPS.ordinal()] = 2; - } catch (NoSuchFieldError unused2) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.FILE.ordinal()] = 3; - } catch (NoSuchFieldError unused3) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.CONTENT.ordinal()] = 4; - } catch (NoSuchFieldError unused4) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.ASSETS.ordinal()] = 5; - } catch (NoSuchFieldError unused5) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.DRAWABLE.ordinal()] = 6; - } catch (NoSuchFieldError unused6) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.UNKNOWN.ordinal()] = 7; - } catch (NoSuchFieldError unused7) { - } - } - } - - @Override // com.nostra13.universalimageloader.core.download.ImageDownloader - public InputStream getStream(String str, Object obj) throws IOException { - switch (AnonymousClass1.$SwitchMap$com$nostra13$universalimageloader$core$download$ImageDownloader$Scheme[ImageDownloader.Scheme.ofUri(str).ordinal()]) { - case 1: - case 2: - return getStreamFromNetwork(str, obj); - case 3: - return getStreamFromFile(str, obj); - case 4: - return getStreamFromContent(str, obj); - case 5: - return getStreamFromAssets(str, obj); - case 6: - return getStreamFromDrawable(str, obj); - default: - return getStreamFromOtherSource(str, obj); - } - } - - protected InputStream getStreamFromNetwork(String str, Object obj) throws IOException { - HttpURLConnection createConnection = createConnection(str, obj); - for (int i = 0; createConnection.getResponseCode() / 100 == 3 && i < 5; i++) { - createConnection = createConnection(createConnection.getHeaderField(HttpHeaders.LOCATION), obj); - } - try { - InputStream inputStream = createConnection.getInputStream(); - if (!shouldBeProcessed(createConnection)) { - IoUtils.closeSilently(inputStream); - throw new IOException("Image request failed with response code " + createConnection.getResponseCode()); - } - return new ContentLengthInputStream(new BufferedInputStream(inputStream, 32768), createConnection.getContentLength()); - } catch (IOException e) { - IoUtils.readAndCloseStream(createConnection.getErrorStream()); - throw e; - } - } - - protected boolean shouldBeProcessed(HttpURLConnection httpURLConnection) throws IOException { - return httpURLConnection.getResponseCode() == 200; - } - - protected HttpURLConnection createConnection(String str, Object obj) throws IOException { - HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(Uri.encode(str, ALLOWED_URI_CHARS)).openConnection(); - httpURLConnection.setConnectTimeout(this.connectTimeout); - httpURLConnection.setReadTimeout(this.readTimeout); - return httpURLConnection; - } - - protected InputStream getStreamFromFile(String str, Object obj) throws IOException { - String crop = ImageDownloader.Scheme.FILE.crop(str); - if (isVideoFileUri(str)) { - return getVideoThumbnailStream(crop); - } - return new ContentLengthInputStream(new BufferedInputStream(new FileInputStream(crop), 32768), (int) new File(crop).length()); - } - - private InputStream getVideoThumbnailStream(String str) { - Bitmap createVideoThumbnail; - if (Build.VERSION.SDK_INT < 8 || (createVideoThumbnail = ThumbnailUtils.createVideoThumbnail(str, 2)) == null) { - return null; - } - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - createVideoThumbnail.compress(Bitmap.CompressFormat.PNG, 0, byteArrayOutputStream); - return new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); - } - - protected InputStream getStreamFromContent(String str, Object obj) throws FileNotFoundException { - ContentResolver contentResolver = this.context.getContentResolver(); - Uri parse = Uri.parse(str); - if (isVideoContentUri(parse)) { - Bitmap thumbnail = MediaStore.Video.Thumbnails.getThumbnail(contentResolver, Long.valueOf(parse.getLastPathSegment()).longValue(), 1, null); - if (thumbnail != null) { - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - thumbnail.compress(Bitmap.CompressFormat.PNG, 0, byteArrayOutputStream); - return new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); - } - } else if (str.startsWith(CONTENT_CONTACTS_URI_PREFIX)) { - return getContactPhotoStream(parse); - } - return contentResolver.openInputStream(parse); - } - - protected InputStream getContactPhotoStream(Uri uri) { - ContentResolver contentResolver = this.context.getContentResolver(); - if (Build.VERSION.SDK_INT >= 14) { - return ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, uri, true); - } - return ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, uri); - } - - protected InputStream getStreamFromAssets(String str, Object obj) throws IOException { - return this.context.getAssets().open(ImageDownloader.Scheme.ASSETS.crop(str)); - } - - protected InputStream getStreamFromDrawable(String str, Object obj) { - return this.context.getResources().openRawResource(Integer.parseInt(ImageDownloader.Scheme.DRAWABLE.crop(str))); - } - - protected InputStream getStreamFromOtherSource(String str, Object obj) throws IOException { - throw new UnsupportedOperationException(String.format(ERROR_UNSUPPORTED_SCHEME, str)); - } - - private boolean isVideoContentUri(Uri uri) { - String type = this.context.getContentResolver().getType(uri); - return type != null && type.startsWith("video/"); - } - - private boolean isVideoFileUri(String str) { - String mimeTypeFromExtension = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(str)); - return mimeTypeFromExtension != null && mimeTypeFromExtension.startsWith("video/"); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/download/ImageDownloader.java b/app/src/main/java/com/nostra13/universalimageloader/core/download/ImageDownloader.java deleted file mode 100644 index d259bfe..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/download/ImageDownloader.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.nostra13.universalimageloader.core.download; - -import com.home.utils.Utils; -import java.io.IOException; -import java.io.InputStream; -import java.util.Locale; -import org.apache.http.HttpHost; - -/* loaded from: classes.dex */ -public interface ImageDownloader { - InputStream getStream(String str, Object obj) throws IOException; - - /* loaded from: classes.dex */ - public enum Scheme { - HTTP(HttpHost.DEFAULT_SCHEME_NAME), - HTTPS("https"), - FILE("file"), - CONTENT(Utils.RESPONSE_CONTENT), - ASSETS("assets"), - DRAWABLE("drawable"), - UNKNOWN(""); - - private String scheme; - private String uriPrefix; - - Scheme(String str) { - this.scheme = str; - this.uriPrefix = str + "://"; - } - - public static Scheme ofUri(String str) { - Scheme[] values; - if (str != null) { - for (Scheme scheme : values()) { - if (scheme.belongsTo(str)) { - return scheme; - } - } - } - return UNKNOWN; - } - - private boolean belongsTo(String str) { - return str.toLowerCase(Locale.US).startsWith(this.uriPrefix); - } - - public String wrap(String str) { - return this.uriPrefix + str; - } - - public String crop(String str) { - if (!belongsTo(str)) { - throw new IllegalArgumentException(String.format("URI [%1$s] doesn't have expected scheme [%2$s]", str, this.scheme)); - } - return str.substring(this.uriPrefix.length()); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageAware.java b/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageAware.java deleted file mode 100644 index d53789a..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageAware.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.nostra13.universalimageloader.core.imageaware; - -import android.graphics.Bitmap; -import android.graphics.drawable.Drawable; -import android.view.View; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; - -/* loaded from: classes.dex */ -public interface ImageAware { - int getHeight(); - - int getId(); - - ViewScaleType getScaleType(); - - int getWidth(); - - View getWrappedView(); - - boolean isCollected(); - - boolean setImageBitmap(Bitmap bitmap); - - boolean setImageDrawable(Drawable drawable); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageViewAware.java b/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageViewAware.java deleted file mode 100644 index 4c9223f..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ImageViewAware.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.nostra13.universalimageloader.core.imageaware; - -import android.graphics.Bitmap; -import android.graphics.drawable.AnimationDrawable; -import android.graphics.drawable.Drawable; -import android.view.View; -import android.widget.ImageView; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.utils.L; -import java.lang.reflect.Field; - -/* loaded from: classes.dex */ -public class ImageViewAware extends ViewAware { - public ImageViewAware(ImageView imageView) { - super(imageView); - } - - public ImageViewAware(ImageView imageView, boolean z) { - super(imageView, z); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware, com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getWidth() { - ImageView imageView; - int width = super.getWidth(); - return (width > 0 || (imageView = (ImageView) this.viewRef.get()) == null) ? width : getImageViewFieldValue(imageView, "mMaxWidth"); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware, com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getHeight() { - ImageView imageView; - int height = super.getHeight(); - return (height > 0 || (imageView = (ImageView) this.viewRef.get()) == null) ? height : getImageViewFieldValue(imageView, "mMaxHeight"); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware, com.nostra13.universalimageloader.core.imageaware.ImageAware - public ViewScaleType getScaleType() { - ImageView imageView = (ImageView) this.viewRef.get(); - if (imageView != null) { - return ViewScaleType.fromImageView(imageView); - } - return super.getScaleType(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware, com.nostra13.universalimageloader.core.imageaware.ImageAware - public ImageView getWrappedView() { - return (ImageView) super.getWrappedView(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware - protected void setImageDrawableInto(Drawable drawable, View view) { - ((ImageView) view).setImageDrawable(drawable); - if (drawable instanceof AnimationDrawable) { - ((AnimationDrawable) drawable).start(); - } - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ViewAware - protected void setImageBitmapInto(Bitmap bitmap, View view) { - ((ImageView) view).setImageBitmap(bitmap); - } - - private static int getImageViewFieldValue(Object obj, String str) { - try { - Field declaredField = ImageView.class.getDeclaredField(str); - declaredField.setAccessible(true); - int intValue = ((Integer) declaredField.get(obj)).intValue(); - if (intValue <= 0 || intValue >= Integer.MAX_VALUE) { - return 0; - } - return intValue; - } catch (Exception e) { - L.e(e); - return 0; - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/NonViewAware.java b/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/NonViewAware.java deleted file mode 100644 index 135163e..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/NonViewAware.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.nostra13.universalimageloader.core.imageaware; - -import android.graphics.Bitmap; -import android.graphics.drawable.Drawable; -import android.text.TextUtils; -import android.view.View; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; - -/* loaded from: classes.dex */ -public class NonViewAware implements ImageAware { - protected final ImageSize imageSize; - protected final String imageUri; - protected final ViewScaleType scaleType; - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public View getWrappedView() { - return null; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean isCollected() { - return false; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean setImageBitmap(Bitmap bitmap) { - return true; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean setImageDrawable(Drawable drawable) { - return true; - } - - public NonViewAware(ImageSize imageSize, ViewScaleType viewScaleType) { - this(null, imageSize, viewScaleType); - } - - public NonViewAware(String str, ImageSize imageSize, ViewScaleType viewScaleType) { - if (imageSize == null) { - throw new IllegalArgumentException("imageSize must not be null"); - } - if (viewScaleType == null) { - throw new IllegalArgumentException("scaleType must not be null"); - } - this.imageUri = str; - this.imageSize = imageSize; - this.scaleType = viewScaleType; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getWidth() { - return this.imageSize.getWidth(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getHeight() { - return this.imageSize.getHeight(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public ViewScaleType getScaleType() { - return this.scaleType; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getId() { - return TextUtils.isEmpty(this.imageUri) ? super.hashCode() : this.imageUri.hashCode(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ViewAware.java b/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ViewAware.java deleted file mode 100644 index 67d5ec9..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/imageaware/ViewAware.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.nostra13.universalimageloader.core.imageaware; - -import android.graphics.Bitmap; -import android.graphics.drawable.Drawable; -import android.os.Looper; -import android.view.View; -import android.view.ViewGroup; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.utils.L; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; - -/* loaded from: classes.dex */ -public abstract class ViewAware implements ImageAware { - public static final String WARN_CANT_SET_BITMAP = "Can't set a bitmap into view. You should call ImageLoader on UI thread for it."; - public static final String WARN_CANT_SET_DRAWABLE = "Can't set a drawable into view. You should call ImageLoader on UI thread for it."; - protected boolean checkActualViewSize; - protected Reference viewRef; - - protected abstract void setImageBitmapInto(Bitmap bitmap, View view); - - protected abstract void setImageDrawableInto(Drawable drawable, View view); - - public ViewAware(View view) { - this(view, true); - } - - public ViewAware(View view, boolean z) { - if (view == null) { - throw new IllegalArgumentException("view must not be null"); - } - this.viewRef = new WeakReference(view); - this.checkActualViewSize = z; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getWidth() { - View view = this.viewRef.get(); - int i = 0; - if (view != null) { - ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); - if (this.checkActualViewSize && layoutParams != null && layoutParams.width != -2) { - i = view.getWidth(); - } - return (i > 0 || layoutParams == null) ? i : layoutParams.width; - } - return 0; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getHeight() { - View view = this.viewRef.get(); - int i = 0; - if (view != null) { - ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); - if (this.checkActualViewSize && layoutParams != null && layoutParams.height != -2) { - i = view.getHeight(); - } - return (i > 0 || layoutParams == null) ? i : layoutParams.height; - } - return 0; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public ViewScaleType getScaleType() { - return ViewScaleType.CROP; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public View getWrappedView() { - return this.viewRef.get(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean isCollected() { - return this.viewRef.get() == null; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public int getId() { - View view = this.viewRef.get(); - return view == null ? super.hashCode() : view.hashCode(); - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean setImageDrawable(Drawable drawable) { - if (Looper.myLooper() == Looper.getMainLooper()) { - View view = this.viewRef.get(); - if (view != null) { - setImageDrawableInto(drawable, view); - return true; - } - } else { - L.w(WARN_CANT_SET_DRAWABLE, new Object[0]); - } - return false; - } - - @Override // com.nostra13.universalimageloader.core.imageaware.ImageAware - public boolean setImageBitmap(Bitmap bitmap) { - if (Looper.myLooper() == Looper.getMainLooper()) { - View view = this.viewRef.get(); - if (view != null) { - setImageBitmapInto(bitmap, view); - return true; - } - } else { - L.w(WARN_CANT_SET_BITMAP, new Object[0]); - } - return false; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingListener.java b/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingListener.java deleted file mode 100644 index 06c4502..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.nostra13.universalimageloader.core.listener; - -import android.graphics.Bitmap; -import android.view.View; -import com.nostra13.universalimageloader.core.assist.FailReason; - -/* loaded from: classes.dex */ -public interface ImageLoadingListener { - void onLoadingCancelled(String str, View view); - - void onLoadingComplete(String str, View view, Bitmap bitmap); - - void onLoadingFailed(String str, View view, FailReason failReason); - - void onLoadingStarted(String str, View view); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingProgressListener.java b/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingProgressListener.java deleted file mode 100644 index 8e128f6..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/listener/ImageLoadingProgressListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.nostra13.universalimageloader.core.listener; - -import android.view.View; - -/* loaded from: classes.dex */ -public interface ImageLoadingProgressListener { - void onProgressUpdate(String str, View view, int i, int i2); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/listener/PauseOnScrollListener.java b/app/src/main/java/com/nostra13/universalimageloader/core/listener/PauseOnScrollListener.java deleted file mode 100644 index c0e9b1b..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/listener/PauseOnScrollListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.nostra13.universalimageloader.core.listener; - -import android.widget.AbsListView; -import com.nostra13.universalimageloader.core.ImageLoader; - -/* loaded from: classes.dex */ -public class PauseOnScrollListener implements AbsListView.OnScrollListener { - private final AbsListView.OnScrollListener externalListener; - private ImageLoader imageLoader; - private final boolean pauseOnFling; - private final boolean pauseOnScroll; - - public PauseOnScrollListener(ImageLoader imageLoader, boolean z, boolean z2) { - this(imageLoader, z, z2, null); - } - - public PauseOnScrollListener(ImageLoader imageLoader, boolean z, boolean z2, AbsListView.OnScrollListener onScrollListener) { - this.imageLoader = imageLoader; - this.pauseOnScroll = z; - this.pauseOnFling = z2; - this.externalListener = onScrollListener; - } - - @Override // android.widget.AbsListView.OnScrollListener - public void onScrollStateChanged(AbsListView absListView, int i) { - if (i == 0) { - this.imageLoader.resume(); - } else if (i == 1) { - if (this.pauseOnScroll) { - this.imageLoader.pause(); - } - } else if (i == 2 && this.pauseOnFling) { - this.imageLoader.pause(); - } - AbsListView.OnScrollListener onScrollListener = this.externalListener; - if (onScrollListener != null) { - onScrollListener.onScrollStateChanged(absListView, i); - } - } - - @Override // android.widget.AbsListView.OnScrollListener - public void onScroll(AbsListView absListView, int i, int i2, int i3) { - AbsListView.OnScrollListener onScrollListener = this.externalListener; - if (onScrollListener != null) { - onScrollListener.onScroll(absListView, i, i2, i3); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/listener/SimpleImageLoadingListener.java b/app/src/main/java/com/nostra13/universalimageloader/core/listener/SimpleImageLoadingListener.java deleted file mode 100644 index cabec27..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/listener/SimpleImageLoadingListener.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.nostra13.universalimageloader.core.listener; - -import android.graphics.Bitmap; -import android.view.View; -import com.nostra13.universalimageloader.core.assist.FailReason; - -/* loaded from: classes.dex */ -public class SimpleImageLoadingListener implements ImageLoadingListener { - @Override // com.nostra13.universalimageloader.core.listener.ImageLoadingListener - public void onLoadingCancelled(String str, View view) { - } - - @Override // com.nostra13.universalimageloader.core.listener.ImageLoadingListener - public void onLoadingComplete(String str, View view, Bitmap bitmap) { - } - - @Override // com.nostra13.universalimageloader.core.listener.ImageLoadingListener - public void onLoadingFailed(String str, View view, FailReason failReason) { - } - - @Override // com.nostra13.universalimageloader.core.listener.ImageLoadingListener - public void onLoadingStarted(String str, View view) { - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/core/process/BitmapProcessor.java b/app/src/main/java/com/nostra13/universalimageloader/core/process/BitmapProcessor.java deleted file mode 100644 index 38b084d..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/core/process/BitmapProcessor.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.nostra13.universalimageloader.core.process; - -import android.graphics.Bitmap; - -/* loaded from: classes.dex */ -public interface BitmapProcessor { - Bitmap process(Bitmap bitmap); -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/DiskCacheUtils.java b/app/src/main/java/com/nostra13/universalimageloader/utils/DiskCacheUtils.java deleted file mode 100644 index 3673df3..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/DiskCacheUtils.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import com.nostra13.universalimageloader.cache.disc.DiskCache; -import java.io.File; - -/* loaded from: classes.dex */ -public final class DiskCacheUtils { - private DiskCacheUtils() { - } - - public static File findInCache(String str, DiskCache diskCache) { - File file = diskCache.get(str); - if (file == null || !file.exists()) { - return null; - } - return file; - } - - public static boolean removeFromCache(String str, DiskCache diskCache) { - File file = diskCache.get(str); - return file != null && file.exists() && file.delete(); - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/ImageSizeUtils.java b/app/src/main/java/com/nostra13/universalimageloader/utils/ImageSizeUtils.java deleted file mode 100644 index 73f3a57..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/ImageSizeUtils.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import android.opengl.GLES10; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import com.nostra13.universalimageloader.core.assist.ViewScaleType; -import com.nostra13.universalimageloader.core.imageaware.ImageAware; - -/* loaded from: classes.dex */ -public final class ImageSizeUtils { - private static final int DEFAULT_MAX_BITMAP_DIMENSION = 2048; - private static ImageSize maxBitmapSize; - - static { - int[] iArr = new int[1]; - GLES10.glGetIntegerv(3379, iArr, 0); - int max = Math.max(iArr[0], 2048); - maxBitmapSize = new ImageSize(max, max); - } - - private ImageSizeUtils() { - } - - public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize imageSize) { - int width = imageAware.getWidth(); - if (width <= 0) { - width = imageSize.getWidth(); - } - int height = imageAware.getHeight(); - if (height <= 0) { - height = imageSize.getHeight(); - } - return new ImageSize(width, height); - } - - public static int computeImageSampleSize(ImageSize imageSize, ImageSize imageSize2, ViewScaleType viewScaleType, boolean z) { - int max; - int width = imageSize.getWidth(); - int height = imageSize.getHeight(); - int width2 = imageSize2.getWidth(); - int height2 = imageSize2.getHeight(); - int i = AnonymousClass1.$SwitchMap$com$nostra13$universalimageloader$core$assist$ViewScaleType[viewScaleType.ordinal()]; - if (i != 1) { - if (i != 2) { - max = 1; - } else if (z) { - int i2 = width / 2; - int i3 = height / 2; - max = 1; - while (i2 / max > width2 && i3 / max > height2) { - max *= 2; - } - } else { - max = Math.min(width / width2, height / height2); - } - } else if (z) { - int i4 = width / 2; - int i5 = height / 2; - max = 1; - while (true) { - if (i4 / max <= width2 && i5 / max <= height2) { - break; - } - max *= 2; - } - } else { - max = Math.max(width / width2, height / height2); - } - return considerMaxTextureSize(width, height, max >= 1 ? max : 1, z); - } - - /* renamed from: com.nostra13.universalimageloader.utils.ImageSizeUtils$1 reason: invalid class name */ - /* loaded from: classes.dex */ - static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$com$nostra13$universalimageloader$core$assist$ViewScaleType; - - static { - int[] iArr = new int[ViewScaleType.values().length]; - $SwitchMap$com$nostra13$universalimageloader$core$assist$ViewScaleType = iArr; - try { - iArr[ViewScaleType.FIT_INSIDE.ordinal()] = 1; - } catch (NoSuchFieldError unused) { - } - try { - $SwitchMap$com$nostra13$universalimageloader$core$assist$ViewScaleType[ViewScaleType.CROP.ordinal()] = 2; - } catch (NoSuchFieldError unused2) { - } - } - } - - private static int considerMaxTextureSize(int i, int i2, int i3, boolean z) { - int width = maxBitmapSize.getWidth(); - int height = maxBitmapSize.getHeight(); - while (true) { - if (i / i3 <= width && i2 / i3 <= height) { - return i3; - } - i3 = z ? i3 * 2 : i3 + 1; - } - } - - public static int computeMinImageSampleSize(ImageSize imageSize) { - int width = imageSize.getWidth(); - int height = imageSize.getHeight(); - return Math.max((int) Math.ceil(width / maxBitmapSize.getWidth()), (int) Math.ceil(height / maxBitmapSize.getHeight())); - } - - public static float computeImageScale(ImageSize imageSize, ImageSize imageSize2, ViewScaleType viewScaleType, boolean z) { - int width = imageSize.getWidth(); - int height = imageSize.getHeight(); - int width2 = imageSize2.getWidth(); - int height2 = imageSize2.getHeight(); - float f = width; - float f2 = f / width2; - float f3 = height; - float f4 = f3 / height2; - if ((viewScaleType != ViewScaleType.FIT_INSIDE || f2 < f4) && (viewScaleType != ViewScaleType.CROP || f2 >= f4)) { - width2 = (int) (f / f4); - } else { - height2 = (int) (f3 / f2); - } - if ((z || width2 >= width || height2 >= height) && (!z || width2 == width || height2 == height)) { - return 1.0f; - } - return width2 / f; - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/IoUtils.java b/app/src/main/java/com/nostra13/universalimageloader/utils/IoUtils.java deleted file mode 100644 index 9655a04..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/IoUtils.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/* loaded from: classes.dex */ -public final class IoUtils { - public static final int CONTINUE_LOADING_PERCENTAGE = 75; - public static final int DEFAULT_BUFFER_SIZE = 32768; - public static final int DEFAULT_IMAGE_TOTAL_SIZE = 512000; - - /* loaded from: classes.dex */ - public interface CopyListener { - boolean onBytesCopied(int i, int i2); - } - - private IoUtils() { - } - - public static boolean copyStream(InputStream inputStream, OutputStream outputStream, CopyListener copyListener) throws IOException { - return copyStream(inputStream, outputStream, copyListener, 32768); - } - - public static boolean copyStream(InputStream inputStream, OutputStream outputStream, CopyListener copyListener, int i) throws IOException { - int available = inputStream.available(); - if (available <= 0) { - available = DEFAULT_IMAGE_TOTAL_SIZE; - } - byte[] bArr = new byte[i]; - if (shouldStopLoading(copyListener, 0, available)) { - return false; - } - int i2 = 0; - do { - int read = inputStream.read(bArr, 0, i); - if (read != -1) { - outputStream.write(bArr, 0, read); - i2 += read; - } else { - outputStream.flush(); - return true; - } - } while (!shouldStopLoading(copyListener, i2, available)); - return false; - } - - private static boolean shouldStopLoading(CopyListener copyListener, int i, int i2) { - return (copyListener == null || copyListener.onBytesCopied(i, i2) || (i * 100) / i2 >= 75) ? false : true; - } - - public static void readAndCloseStream(InputStream inputStream) { - do { - try { - } catch (IOException unused) { - } catch (Throwable th) { - closeSilently(inputStream); - throw th; - } - } while (inputStream.read(new byte[32768], 0, 32768) != -1); - closeSilently(inputStream); - } - - public static void closeSilently(Closeable closeable) { - if (closeable != null) { - try { - closeable.close(); - } catch (Exception unused) { - } - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/L.java b/app/src/main/java/com/nostra13/universalimageloader/utils/L.java deleted file mode 100644 index fb587b6..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/L.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import android.util.Log; -import com.nostra13.universalimageloader.core.ImageLoader; - -/* loaded from: classes.dex */ -public final class L { - private static final String LOG_FORMAT = "%1$s\n%2$s"; - private static volatile boolean writeDebugLogs = false; - private static volatile boolean writeLogs = true; - - private L() { - } - - @Deprecated - public static void enableLogging() { - writeLogs(true); - } - - @Deprecated - public static void disableLogging() { - writeLogs(false); - } - - public static void writeDebugLogs(boolean z) { - writeDebugLogs = z; - } - - public static void writeLogs(boolean z) { - writeLogs = z; - } - - public static void d(String str, Object... objArr) { - if (writeDebugLogs) { - log(3, null, str, objArr); - } - } - - public static void i(String str, Object... objArr) { - log(4, null, str, objArr); - } - - public static void w(String str, Object... objArr) { - log(5, null, str, objArr); - } - - public static void e(Throwable th) { - log(6, th, null, new Object[0]); - } - - public static void e(String str, Object... objArr) { - log(6, null, str, objArr); - } - - public static void e(Throwable th, String str, Object... objArr) { - log(6, th, str, objArr); - } - - private static void log(int i, Throwable th, String str, Object... objArr) { - if (writeLogs) { - if (objArr.length > 0) { - str = String.format(str, objArr); - } - if (th != null) { - if (str == null) { - str = th.getMessage(); - } - str = String.format(LOG_FORMAT, str, Log.getStackTraceString(th)); - } - Log.println(i, ImageLoader.TAG, str); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/MemoryCacheUtils.java b/app/src/main/java/com/nostra13/universalimageloader/utils/MemoryCacheUtils.java deleted file mode 100644 index d61e871..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/MemoryCacheUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import android.graphics.Bitmap; -import com.nostra13.universalimageloader.cache.memory.MemoryCache; -import com.nostra13.universalimageloader.core.assist.ImageSize; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -/* loaded from: classes.dex */ -public final class MemoryCacheUtils { - private static final String URI_AND_SIZE_SEPARATOR = "_"; - private static final String WIDTH_AND_HEIGHT_SEPARATOR = "x"; - - private MemoryCacheUtils() { - } - - public static String generateKey(String str, ImageSize imageSize) { - return str + URI_AND_SIZE_SEPARATOR + imageSize.getWidth() + WIDTH_AND_HEIGHT_SEPARATOR + imageSize.getHeight(); - } - - public static Comparator createFuzzyKeyComparator() { - return new Comparator() { // from class: com.nostra13.universalimageloader.utils.MemoryCacheUtils.1 - @Override // java.util.Comparator - public int compare(String str, String str2) { - return str.substring(0, str.lastIndexOf(MemoryCacheUtils.URI_AND_SIZE_SEPARATOR)).compareTo(str2.substring(0, str2.lastIndexOf(MemoryCacheUtils.URI_AND_SIZE_SEPARATOR))); - } - }; - } - - public static List findCachedBitmapsForImageUri(String str, MemoryCache memoryCache) { - ArrayList arrayList = new ArrayList(); - for (String str2 : memoryCache.keys()) { - if (str2.startsWith(str)) { - arrayList.add(memoryCache.get(str2)); - } - } - return arrayList; - } - - public static List findCacheKeysForImageUri(String str, MemoryCache memoryCache) { - ArrayList arrayList = new ArrayList(); - for (String str2 : memoryCache.keys()) { - if (str2.startsWith(str)) { - arrayList.add(str2); - } - } - return arrayList; - } - - public static void removeFromCache(String str, MemoryCache memoryCache) { - ArrayList arrayList = new ArrayList(); - for (String str2 : memoryCache.keys()) { - if (str2.startsWith(str)) { - arrayList.add(str2); - } - } - for (String str3 : arrayList) { - memoryCache.remove(str3); - } - } -} diff --git a/app/src/main/java/com/nostra13/universalimageloader/utils/StorageUtils.java b/app/src/main/java/com/nostra13/universalimageloader/utils/StorageUtils.java deleted file mode 100644 index 405fdc7..0000000 --- a/app/src/main/java/com/nostra13/universalimageloader/utils/StorageUtils.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.nostra13.universalimageloader.utils; - -import android.content.Context; -import android.os.Environment; -import java.io.File; -import java.io.IOException; - -/* loaded from: classes.dex */ -public final class StorageUtils { - private static final String EXTERNAL_STORAGE_PERMISSION = "android.permission.WRITE_EXTERNAL_STORAGE"; - private static final String INDIVIDUAL_DIR_NAME = "uil-images"; - - private StorageUtils() { - } - - public static File getCacheDirectory(Context context) { - return getCacheDirectory(context, true); - } - - public static File getCacheDirectory(Context context, boolean z) { - String str = ""; - try { - str = Environment.getExternalStorageState(); - } catch (IncompatibleClassChangeError | NullPointerException unused) { - } - File externalCacheDir = (z && "mounted".equals(str) && hasExternalStoragePermission(context)) ? getExternalCacheDir(context) : null; - if (externalCacheDir == null) { - externalCacheDir = context.getCacheDir(); - } - if (externalCacheDir == null) { - String str2 = "/data/data/" + context.getPackageName() + "/cache/"; - L.w("Can't define system cache directory! '%s' will be used.", str2); - return new File(str2); - } - return externalCacheDir; - } - - public static File getIndividualCacheDirectory(Context context) { - return getIndividualCacheDirectory(context, INDIVIDUAL_DIR_NAME); - } - - public static File getIndividualCacheDirectory(Context context, String str) { - File cacheDirectory = getCacheDirectory(context); - File file = new File(cacheDirectory, str); - return (file.exists() || file.mkdir()) ? file : cacheDirectory; - } - - public static File getOwnCacheDirectory(Context context, String str) { - File file = ("mounted".equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context)) ? new File(Environment.getExternalStorageDirectory(), str) : null; - return (file == null || !(file.exists() || file.mkdirs())) ? context.getCacheDir() : file; - } - - public static File getOwnCacheDirectory(Context context, String str, boolean z) { - File file = (z && "mounted".equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context)) ? new File(Environment.getExternalStorageDirectory(), str) : null; - return (file == null || !(file.exists() || file.mkdirs())) ? context.getCacheDir() : file; - } - - private static File getExternalCacheDir(Context context) { - File file = new File(new File(new File(new File(Environment.getExternalStorageDirectory(), "Android"), "data"), context.getPackageName()), "cache"); - if (!file.exists()) { - if (!file.mkdirs()) { - L.w("Unable to create external cache directory", new Object[0]); - return null; - } - try { - new File(file, ".nomedia").createNewFile(); - } catch (IOException unused) { - L.i("Can't create \".nomedia\" file in application external cache directory", new Object[0]); - } - } - return file; - } - - private static boolean hasExternalStoragePermission(Context context) { - return context.checkCallingOrSelfPermission(EXTERNAL_STORAGE_PERMISSION) == 0; - } -}