app: target api 35

This commit is contained in:
vvb2060 2024-08-24 02:46:47 +08:00 committed by John Wu
parent a82f17c594
commit dcd3bc58a3
6 changed files with 17 additions and 17 deletions

View File

@ -78,8 +78,8 @@ class SuperuserViewModel(
this@SuperuserViewModel, policy,
info.packageName,
info.sharedUserId != null,
info.applicationInfo.loadIcon(pm),
info.applicationInfo.getLabel(pm)
info.applicationInfo?.loadIcon(pm) ?: pm.defaultActivityIcon,
info.applicationInfo?.getLabel(pm) ?: info.packageName
)
} catch (e: PackageManager.NameNotFoundException) {
null

View File

@ -111,7 +111,7 @@ class SuRequestViewModel(
// shared UID. We have no way to know where this request comes from.
icon = pm.defaultActivityIcon
title = "[SharedUID] ${info.sharedUserId}"
packageName = info.sharedUserId
packageName = info.sharedUserId.toString()
} else {
val prefix = if (info.sharedUserId == null) "" else "[SharedUID] "
icon = app.loadIcon(pm)

View File

@ -1,6 +1,6 @@
package com.topjohnwu.magisk.core.model.su
import android.content.pm.PackageInfo
import android.content.pm.ApplicationInfo
import android.content.pm.PackageManager
import androidx.room.Entity
import androidx.room.PrimaryKey
@ -24,7 +24,7 @@ class SuLog(
}
fun PackageManager.createSuLog(
info: PackageInfo,
info: ApplicationInfo,
toUid: Int,
fromPid: Int,
command: String,
@ -33,13 +33,12 @@ fun PackageManager.createSuLog(
context: String,
gids: String,
): SuLog {
val appInfo = info.applicationInfo
return SuLog(
fromUid = appInfo.uid,
fromUid = info.uid,
toUid = toUid,
fromPid = fromPid,
packageName = getNameForUid(appInfo.uid)!!,
appName = appInfo.getLabel(this),
packageName = getNameForUid(info.uid)!!,
appName = info.getLabel(this),
command = command,
action = policy,
target = target,

View File

@ -64,7 +64,7 @@ object SuCallbackHandler {
val pm = context.packageManager
val log = runCatching {
pm.getPackageInfo(fromUid, pid)?.let {
pm.getPackageInfo(fromUid, pid)?.applicationInfo?.let {
pm.createSuLog(it, toUid, pid, command, policy, target, seContext, gids)
}
}.getOrNull() ?: createSuLog(fromUid, toUid, pid, command, policy, target, seContext, gids)

View File

@ -125,8 +125,9 @@ object AppMigration {
apk: File, out: OutputStream,
pkg: String, label: CharSequence
): Boolean {
val info = context.packageManager.getPackageArchiveInfo(apk.path, 0) ?: return false
val origLabel = info.applicationInfo.nonLocalizedLabel.toString()
val pm = context.packageManager
val info = pm.getPackageArchiveInfo(apk.path, 0)?.applicationInfo ?: return false
val origLabel = info.nonLocalizedLabel.toString()
try {
JarMap.open(apk, true).use { jar ->
val je = jar.getJarEntry(ANDROID_MANIFEST)

View File

@ -69,7 +69,7 @@ private val Project.androidComponents
fun Project.setupCommon() {
androidBase {
compileSdkVersion(34)
compileSdkVersion(35)
buildToolsVersion = "34.0.0"
ndkPath = "$sdkDirectory/ndk/magisk"
ndkVersion = "27.0.12077973"
@ -79,8 +79,8 @@ fun Project.setupCommon() {
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
packagingOptions {
@ -108,7 +108,7 @@ fun Project.setupCommon() {
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
jvmTarget = JvmTarget.JVM_21
}
}
}
@ -296,7 +296,7 @@ fun Project.setupAppCommon() {
}
defaultConfig {
targetSdk = 34
targetSdk = 35
}
buildTypes {