mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Bump compile sdk to 35
Co-authored-by: p
This commit is contained in:
parent
481cfedf08
commit
37419cdc26
5 changed files with 8 additions and 8 deletions
|
@ -127,7 +127,7 @@ private fun Extension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT): St
|
||||||
return produceState<Result<ImageBitmap>>(initialValue = Result.Loading, this) {
|
return produceState<Result<ImageBitmap>>(initialValue = Result.Loading, this) {
|
||||||
withIOContext {
|
withIOContext {
|
||||||
value = try {
|
value = try {
|
||||||
val appInfo = ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo
|
val appInfo = ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo!!
|
||||||
val appResources = context.packageManager.getResourcesForApplication(appInfo)
|
val appResources = context.packageManager.getResourcesForApplication(appInfo)
|
||||||
Result.Success(
|
Result.Success(
|
||||||
appResources.getDrawableForDensity(appInfo.icon, density, null)!!
|
appResources.getDrawableForDensity(appInfo.icon, density, null)!!
|
||||||
|
|
|
@ -87,7 +87,7 @@ class ExtensionManager(
|
||||||
?: return null
|
?: return null
|
||||||
|
|
||||||
return iconMap[pkgName] ?: iconMap.getOrPut(pkgName) {
|
return iconMap[pkgName] ?: iconMap.getOrPut(pkgName) {
|
||||||
ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo
|
ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo!!
|
||||||
.loadIcon(context.packageManager)
|
.loadIcon(context.packageManager)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ internal object ExtensionLoader {
|
||||||
|
|
||||||
val path = it.absolutePath
|
val path = it.absolutePath
|
||||||
pkgManager.getPackageArchiveInfo(path, PACKAGE_FLAGS)
|
pkgManager.getPackageArchiveInfo(path, PACKAGE_FLAGS)
|
||||||
?.apply { applicationInfo.fixBasePaths(path) }
|
?.apply { applicationInfo!!.fixBasePaths(path) }
|
||||||
}
|
}
|
||||||
?.filter { isPackageAnExtension(it) }
|
?.filter { isPackageAnExtension(it) }
|
||||||
?.map { ExtensionInfo(packageInfo = it, isShared = false) }
|
?.map { ExtensionInfo(packageInfo = it, isShared = false) }
|
||||||
|
@ -191,7 +191,7 @@ internal object ExtensionLoader {
|
||||||
context.packageManager.getPackageArchiveInfo(privateExtensionFile.absolutePath, PACKAGE_FLAGS)
|
context.packageManager.getPackageArchiveInfo(privateExtensionFile.absolutePath, PACKAGE_FLAGS)
|
||||||
?.takeIf { isPackageAnExtension(it) }
|
?.takeIf { isPackageAnExtension(it) }
|
||||||
?.let {
|
?.let {
|
||||||
it.applicationInfo.fixBasePaths(privateExtensionFile.absolutePath)
|
it.applicationInfo!!.fixBasePaths(privateExtensionFile.absolutePath)
|
||||||
ExtensionInfo(
|
ExtensionInfo(
|
||||||
packageInfo = it,
|
packageInfo = it,
|
||||||
isShared = false,
|
isShared = false,
|
||||||
|
@ -226,7 +226,7 @@ internal object ExtensionLoader {
|
||||||
private suspend fun loadExtension(context: Context, extensionInfo: ExtensionInfo): LoadResult {
|
private suspend fun loadExtension(context: Context, extensionInfo: ExtensionInfo): LoadResult {
|
||||||
val pkgManager = context.packageManager
|
val pkgManager = context.packageManager
|
||||||
val pkgInfo = extensionInfo.packageInfo
|
val pkgInfo = extensionInfo.packageInfo
|
||||||
val appInfo = pkgInfo.applicationInfo
|
val appInfo = pkgInfo.applicationInfo!!
|
||||||
val pkgName = pkgInfo.packageName
|
val pkgName = pkgInfo.packageName
|
||||||
|
|
||||||
val extName = pkgManager.getApplicationLabel(appInfo).toString().substringAfter("Tachiyomi: ")
|
val extName = pkgManager.getApplicationLabel(appInfo).toString().substringAfter("Tachiyomi: ")
|
||||||
|
@ -365,7 +365,7 @@ internal object ExtensionLoader {
|
||||||
*/
|
*/
|
||||||
private fun getSignatures(pkgInfo: PackageInfo): List<String>? {
|
private fun getSignatures(pkgInfo: PackageInfo): List<String>? {
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
val signingInfo = pkgInfo.signingInfo
|
val signingInfo = pkgInfo.signingInfo!!
|
||||||
if (signingInfo.hasMultipleSigners()) {
|
if (signingInfo.hasMultipleSigners()) {
|
||||||
signingInfo.apkContentsSigners
|
signingInfo.apkContentsSigners
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.gradle.api.JavaVersion as GradleJavaVersion
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget as KotlinJvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget as KotlinJvmTarget
|
||||||
|
|
||||||
object AndroidConfig {
|
object AndroidConfig {
|
||||||
const val COMPILE_SDK = 34
|
const val COMPILE_SDK = 35
|
||||||
const val TARGET_SDK = 34
|
const val TARGET_SDK = 34
|
||||||
const val MIN_SDK = 26
|
const val MIN_SDK = 26
|
||||||
const val NDK = "27.1.12297006"
|
const val NDK = "27.1.12297006"
|
||||||
|
|
|
@ -36,7 +36,7 @@ object WebViewUtil {
|
||||||
fun getVersion(context: Context): String {
|
fun getVersion(context: Context): String {
|
||||||
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
|
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
|
||||||
val pm = context.packageManager
|
val pm = context.packageManager
|
||||||
val label = webView.applicationInfo.loadLabel(pm)
|
val label = webView.applicationInfo!!.loadLabel(pm)
|
||||||
val version = webView.versionName
|
val version = webView.versionName
|
||||||
return "$label $version"
|
return "$label $version"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue