The app supports 100+ downloadable Bible versions across many languages. Versions use the custom YES2 binary format. Users can also import PalmBible+ PDB files, which are converted to YES2.
Alkitab/src/main/java/yuku/alkitab/versionmanager/VersionsActivity.kt— Version management UIAlkitab/src/main/java/yuku/alkitab/versionmanager/VersionListFragment.kt— Lists downloadable and installed versions;RecyclerView+ItemTouchHelperfor the downloaded-tab reorderAlkitab/src/main/java/yuku/alkitab/versionmanager/VersionFileImporter.kt— Imports .yes, .pdb, .yes.gz, .pdb.gz filesAlkitab/src/main/java/yuku/alkitab/base/config/VersionConfig.java— JSON catalog of available versionsAlkitab/src/main/java/yuku/alkitab/base/storage/YesReaderFactory.java— Factory for loading YES1/YES2 readersAlkitab/src/main/java/yuku/alkitab/base/util/VersionDownloadWorker.kt—CoroutineWorker(OkHttp + Range-based resume) used to download.yesfilesAlkitab/src/main/java/yuku/alkitab/base/util/DownloadMapper.kt— In-process tracker that observesWorkManager.getWorkInfoByIdFlowand mirrors state intoDownloadManager.STATUS_*constants for the list UIAlkitab/src/main/java/yuku/alkitab/base/storage/VersionDao.kt— Facade DAO routing through RoomAlkitab/src/main/java/yuku/alkitab/base/storage/room/VersionEntity.kt/VersionRoomDao.kt— Room entity/DAO
MVersion (abstract)
├── MVersionInternal — Built-in version, always available, ID = "internal"
├── MVersionDb — Downloaded/user-added versions stored in database
└── MVersionPreset — Metadata for versions available to download (not yet installed)
App.services.versions.getAvailableVersions() merges internal + DB versions, filtering for active ones. Version instances (VersionImpl) are cached in a ConcurrentHashMap with SoftReference for memory-efficient GC.
"internal"— the built-in version"preset/[name]"— downloaded from the preset catalog"file/[path]"— user-imported from a file
version_config.json (44KB, bundled in assets) contains metadata for all downloadable versions: locale, short/long names, modify times, group ordering. This config is periodically updated from the server and cached locally at files/version_config.json.
For downloads from the preset catalog:
- User picks a preset in
VersionListFragment DownloadMapper.enqueue(...)builds aOneTimeWorkRequestforVersionDownloadWorkerand starts aMainScopeobserver onWorkManager.getWorkInfoByIdFlow(uuid)- The worker streams the file via OkHttp (
Accept-Encoding: identity,Range: bytes=N-on resume) into a temp file undercacheDir/DownloadMapper-tmp/, reporting progress viasetProgress(Data) - On
SUCCEEDED,VersionDownloadCompleteReceiver.onReceive(id)finalizes the file (decompresses gzip viaOptionalGzipInputStreamif needed), moves it into app storage, and inserts a row into theversiontable
For local imports (.yes / .pdb):
- User selects a
.yesor.pdbfile (via file manager or intent) VersionFileImporterdetects format and handles gzip decompression- PDB files are converted to YES2 via the
BiblePlusmodule, saved aspdb-{name}.yes - YES2 files are copied to app storage
- A row is inserted into the
versiontable - Import size limit: 100MB
See Binary Formats for the complete YES2 specification.
PerVersion table stores per-version settings like font size multiplier, allowing different text sizes for different Bible versions.