Fix usage of deprecated functions (#1192)

* Fix usage of deprecated functions

* lint

* Lint

* Another
This commit is contained in:
Mitchell Syer
2024-12-07 23:56:42 -05:00
committed by GitHub
parent 1d541a30ae
commit 2e3af25dd4
10 changed files with 37 additions and 36 deletions

View File

@@ -54,7 +54,7 @@ object Extension {
private val applicationDirs: ApplicationDirs by injectLazy()
suspend fun installExtension(pkgName: String): Int {
logger.debug("Installing $pkgName")
logger.debug { "Installing $pkgName" }
val extensionRecord = extensionTableAsDataClass().first { it.pkgName == pkgName }
return installAPK {
@@ -144,7 +144,7 @@ object Extension {
val className =
packageInfo.packageName + packageInfo.applicationInfo.metaData.getString(METADATA_SOURCE_CLASS)
logger.debug("Main class for extension is $className")
logger.debug { "Main class for extension is $className" }
dex2jar(apkFilePath, jarFilePath, fileNameWithoutType)
extractAssetsFromApk(apkFilePath, jarFilePath)
@@ -295,7 +295,7 @@ object Extension {
}
fun uninstallExtension(pkgName: String) {
logger.debug("Uninstalling $pkgName")
logger.debug { "Uninstalling $pkgName" }
val extensionRecord = transaction { ExtensionTable.selectAll().where { ExtensionTable.pkgName eq pkgName }.first() }
val fileNameWithoutType = extensionRecord[ExtensionTable.apkName].substringBefore(".apk")

View File

@@ -55,12 +55,12 @@ object ExtensionsList {
suspend fun fetchExtensionsCached() {
// update if 60 seconds has passed or requested offline and database is empty
if (lastUpdateCheck + 60.seconds.inWholeMilliseconds < System.currentTimeMillis()) {
logger.debug("Getting extensions list from the internet")
logger.debug { "Getting extensions list from the internet" }
lastUpdateCheck = System.currentTimeMillis()
fetchExtensions()
} else {
logger.debug("used cached extension list")
logger.debug { "used cached extension list" }
}
}