- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
58 lines
1.9 KiB
Java
58 lines
1.9 KiB
Java
package com.helpshift.cache;
|
|
|
|
import com.helpshift.storage.HSPersistentStorage;
|
|
import java.io.File;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class HelpcenterCacheEvictionManager {
|
|
public final String appFileDirPath;
|
|
public final HSPersistentStorage persistentStorage;
|
|
public String subdirPath;
|
|
|
|
public HelpcenterCacheEvictionManager(HSPersistentStorage hSPersistentStorage, String str, String str2) {
|
|
this.persistentStorage = hSPersistentStorage;
|
|
this.appFileDirPath = str;
|
|
this.subdirPath = str2;
|
|
}
|
|
|
|
public void deleteOlderHelpcenterCachedFiles() {
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
long lastHCCacheEvictedTime = this.persistentStorage.getLastHCCacheEvictedTime();
|
|
if (lastHCCacheEvictedTime == 0) {
|
|
updateLastCacheEvictedTime(currentTimeMillis);
|
|
return;
|
|
}
|
|
if (currentTimeMillis - lastHCCacheEvictedTime < 604800000) {
|
|
return;
|
|
}
|
|
updateLastCacheEvictedTime(currentTimeMillis);
|
|
File[] listFiles = new File(getResourceCacheDirPath()).listFiles();
|
|
if (listFiles == null || listFiles.length == 0) {
|
|
return;
|
|
}
|
|
for (File file : listFiles) {
|
|
long lastModified = file.lastModified();
|
|
if (lastModified != 0 && currentTimeMillis - lastModified > 2592000000L) {
|
|
file.delete();
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void updateLastCacheEvictedTime(long j) {
|
|
this.persistentStorage.setLastHCCacheEvictedTime(j);
|
|
}
|
|
|
|
public final String getResourceCacheDirPath() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.appFileDirPath);
|
|
String str = File.separator;
|
|
sb.append(str);
|
|
sb.append("helpshift");
|
|
sb.append(str);
|
|
sb.append("resource_cache");
|
|
sb.append(str);
|
|
sb.append(this.subdirPath);
|
|
return sb.toString();
|
|
}
|
|
}
|