public class AabConversionCache
Disk-backed cache of converted AAB→APK artifacts, keyed by (AAB content hash + bundletool
version) so a rebuilt bundle or a bundletool upgrade invalidates the cached artifact — the
version is folded into the hash rather than kept as its own directory segment, to keep the
cache path short. Stored under a dedicated Katalon-managed directory (not the OS temp dir).
Each cache entry is its own subdirectory named by a short (7-char) hash — the APK file inside
keeps the original .aab's base name, so tools that surface the resolved app path
(Recorder, run logs) show a short, meaningful path instead of a long raw hash. Writes are
atomic (convert to a temp file, then Files.move into place) so a failed or concurrent
conversion can never leave a reusable partial APK visible under its final name. Bounded to
{
| Modifiers | Name | Description |
|---|---|---|
static String |
BUNDLETOOL_VERSION |
Pinned bundletool version (STUDIO-10661) — part of the cache key so an upgrade invalidates old entries. |
static long |
DEFAULT_MAX_CACHE_SIZE_BYTES |
Default bound: 2 GiB. |
| Constructor and description |
|---|
AabConversionCache
() |
AabConversionCache
(Path cacheDir, long maxCacheSizeBytes) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static String |
computeCacheKey(File aabFile)Hashes the AAB content together with BUNDLETOOL_VERSION (so a bundletool upgrade still invalidates old entries, even though the version no longer appears as its own directory segment) and returns the first {
|
|
public static Path |
defaultCacheDir() |
|
public Optional<Path> |
get(String cacheKey, String apkFileName)
|
|
public Path |
put(String cacheKey, String apkFileName, Path convertedApkFile)Atomically moves convertedApkFile into the cache under cacheKey, naming it
apkFileName, then triggers eviction if the cache now exceeds its size bound.
|
Pinned bundletool version (STUDIO-10661) — part of the cache key so an upgrade invalidates old entries.
Default bound: 2 GiB. Documented per STUDIO-10661's requirement that the limit be recorded.
Hashes the AAB content together with BUNDLETOOL_VERSION (so a bundletool upgrade still invalidates old entries, even though the version no longer appears as its own directory segment) and returns the first {
apkFileName - the desired file name for the cached APK — the original .aab's
base name (e.g. app-demo.apk), so a cache hit still returns a meaningfully
named path even though the entry itself is keyed by content hash.