- AppStoreJsBridge: JS bridge for native APK install, version check, update - InstalledAppDao, InstalledApp entity: Room DB for tracking installed apps - UpdateCheckerWorker: background update polling via WorkManager - InstallerService: APK download + SHA-256 verify + PackageInstaller session - Updated AndroidManifest: REQUEST_INSTALL_PACKAGES, FileProvider, receivers - Updated MainActivity: notification channel, WorkManager, JS bridge wiring - config.json: targetUrl = https://store.silverlabs.uk - file_paths.xml: FileProvider paths for APK installs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1.1 KiB
Kotlin
37 lines
1.1 KiB
Kotlin
package uk.silverlabs.silverdroid.data
|
|
|
|
import android.content.Context
|
|
import androidx.room.Database
|
|
import androidx.room.Room
|
|
import androidx.room.RoomDatabase
|
|
import uk.silverlabs.silverdroid.data.model.InstalledApp
|
|
import uk.silverlabs.silverdroid.data.model.PwaApp
|
|
|
|
@Database(
|
|
entities = [PwaApp::class, InstalledApp::class],
|
|
version = 2,
|
|
exportSchema = true
|
|
)
|
|
abstract class PwaDatabase : RoomDatabase() {
|
|
abstract fun pwaAppDao(): PwaAppDao
|
|
abstract fun installedAppDao(): InstalledAppDao
|
|
|
|
companion object {
|
|
@Volatile
|
|
private var INSTANCE: PwaDatabase? = null
|
|
|
|
fun getInstance(context: Context): PwaDatabase {
|
|
return INSTANCE ?: synchronized(this) {
|
|
val instance = Room.databaseBuilder(
|
|
context.applicationContext,
|
|
PwaDatabase::class.java,
|
|
"pwa_database"
|
|
)
|
|
.fallbackToDestructiveMigration()
|
|
.build()
|
|
INSTANCE = instance
|
|
instance
|
|
}
|
|
}
|
|
}
|
|
} |