Files
rr3-apk/decompiled/sources/com/helpshift/cache/HelpcenterCacheEvictionManager.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

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();
}
}