Merge tag 'v0.19.7'
This commit is contained in:
@@ -26,8 +26,8 @@ android {
|
||||
defaultConfig {
|
||||
applicationId = "app.mihon"
|
||||
|
||||
versionCode = 19
|
||||
versionName = "0.19.5"
|
||||
versionCode = 20
|
||||
versionName = "0.19.7"
|
||||
|
||||
buildConfigField("String", "COMMIT_COUNT", "\"${getLatestCommitCount()}\"")
|
||||
buildConfigField("String", "COMMIT_SHA", "\"${getLatestCommitSha()}\"")
|
||||
|
||||
@@ -43,21 +43,31 @@ import uy.kohesive.injekt.api.InjektRegistrar
|
||||
import uy.kohesive.injekt.api.addSingleton
|
||||
import uy.kohesive.injekt.api.addSingletonFactory
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
private val lock = Any()
|
||||
|
||||
class AppModule(val app: Application) : InjektModule {
|
||||
|
||||
private var sqlDriverRef: WeakReference<SqlDriver>? = null
|
||||
|
||||
override fun InjektRegistrar.registerInjectables() {
|
||||
addSingleton(app)
|
||||
|
||||
addSingletonFactory<SqlDriver> {
|
||||
AndroidxSqliteDriver(
|
||||
driver = BundledSQLiteDriver(),
|
||||
databaseType = AndroidxSqliteDatabaseType.FileProvider(app, "tachiyomi.db"),
|
||||
schema = Database.Schema,
|
||||
configuration = AndroidxSqliteConfiguration(
|
||||
isForeignKeyConstraintsEnabled = true,
|
||||
),
|
||||
)
|
||||
synchronized(lock) {
|
||||
sqlDriverRef?.get()?.let { return@synchronized it }
|
||||
|
||||
AndroidxSqliteDriver(
|
||||
driver = BundledSQLiteDriver(),
|
||||
databaseType = AndroidxSqliteDatabaseType.FileProvider(app, "tachiyomi.db"),
|
||||
schema = Database.Schema,
|
||||
configuration = AndroidxSqliteConfiguration(
|
||||
isForeignKeyConstraintsEnabled = true,
|
||||
),
|
||||
)
|
||||
.also { sqlDriverRef = WeakReference(it) }
|
||||
}
|
||||
}
|
||||
addSingletonFactory {
|
||||
Database(
|
||||
|
||||
+7
-2
@@ -106,8 +106,13 @@ class PackageInstallerInstaller(private val service: Service) : Installer(servic
|
||||
override fun cancelEntry(entry: Entry): Boolean {
|
||||
activeSession?.let { (activeEntry, sessionId) ->
|
||||
if (activeEntry == entry) {
|
||||
packageInstaller.abandonSession(sessionId)
|
||||
return false
|
||||
return try {
|
||||
packageInstaller.abandonSession(sessionId)
|
||||
false
|
||||
} catch (_: SecurityException) {
|
||||
// Highly likely the session has succeeded
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user