mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 07:57:39 +00:00
app: target api 35
This commit is contained in:
parent
a82f17c594
commit
dcd3bc58a3
@ -78,8 +78,8 @@ class SuperuserViewModel(
|
|||||||
this@SuperuserViewModel, policy,
|
this@SuperuserViewModel, policy,
|
||||||
info.packageName,
|
info.packageName,
|
||||||
info.sharedUserId != null,
|
info.sharedUserId != null,
|
||||||
info.applicationInfo.loadIcon(pm),
|
info.applicationInfo?.loadIcon(pm) ?: pm.defaultActivityIcon,
|
||||||
info.applicationInfo.getLabel(pm)
|
info.applicationInfo?.getLabel(pm) ?: info.packageName
|
||||||
)
|
)
|
||||||
} catch (e: PackageManager.NameNotFoundException) {
|
} catch (e: PackageManager.NameNotFoundException) {
|
||||||
null
|
null
|
||||||
|
@ -111,7 +111,7 @@ class SuRequestViewModel(
|
|||||||
// shared UID. We have no way to know where this request comes from.
|
// shared UID. We have no way to know where this request comes from.
|
||||||
icon = pm.defaultActivityIcon
|
icon = pm.defaultActivityIcon
|
||||||
title = "[SharedUID] ${info.sharedUserId}"
|
title = "[SharedUID] ${info.sharedUserId}"
|
||||||
packageName = info.sharedUserId
|
packageName = info.sharedUserId.toString()
|
||||||
} else {
|
} else {
|
||||||
val prefix = if (info.sharedUserId == null) "" else "[SharedUID] "
|
val prefix = if (info.sharedUserId == null) "" else "[SharedUID] "
|
||||||
icon = app.loadIcon(pm)
|
icon = app.loadIcon(pm)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.core.model.su
|
package com.topjohnwu.magisk.core.model.su
|
||||||
|
|
||||||
import android.content.pm.PackageInfo
|
import android.content.pm.ApplicationInfo
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
import androidx.room.PrimaryKey
|
import androidx.room.PrimaryKey
|
||||||
@ -24,7 +24,7 @@ class SuLog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun PackageManager.createSuLog(
|
fun PackageManager.createSuLog(
|
||||||
info: PackageInfo,
|
info: ApplicationInfo,
|
||||||
toUid: Int,
|
toUid: Int,
|
||||||
fromPid: Int,
|
fromPid: Int,
|
||||||
command: String,
|
command: String,
|
||||||
@ -33,13 +33,12 @@ fun PackageManager.createSuLog(
|
|||||||
context: String,
|
context: String,
|
||||||
gids: String,
|
gids: String,
|
||||||
): SuLog {
|
): SuLog {
|
||||||
val appInfo = info.applicationInfo
|
|
||||||
return SuLog(
|
return SuLog(
|
||||||
fromUid = appInfo.uid,
|
fromUid = info.uid,
|
||||||
toUid = toUid,
|
toUid = toUid,
|
||||||
fromPid = fromPid,
|
fromPid = fromPid,
|
||||||
packageName = getNameForUid(appInfo.uid)!!,
|
packageName = getNameForUid(info.uid)!!,
|
||||||
appName = appInfo.getLabel(this),
|
appName = info.getLabel(this),
|
||||||
command = command,
|
command = command,
|
||||||
action = policy,
|
action = policy,
|
||||||
target = target,
|
target = target,
|
||||||
|
@ -64,7 +64,7 @@ object SuCallbackHandler {
|
|||||||
val pm = context.packageManager
|
val pm = context.packageManager
|
||||||
|
|
||||||
val log = runCatching {
|
val log = runCatching {
|
||||||
pm.getPackageInfo(fromUid, pid)?.let {
|
pm.getPackageInfo(fromUid, pid)?.applicationInfo?.let {
|
||||||
pm.createSuLog(it, toUid, pid, command, policy, target, seContext, gids)
|
pm.createSuLog(it, toUid, pid, command, policy, target, seContext, gids)
|
||||||
}
|
}
|
||||||
}.getOrNull() ?: createSuLog(fromUid, toUid, pid, command, policy, target, seContext, gids)
|
}.getOrNull() ?: createSuLog(fromUid, toUid, pid, command, policy, target, seContext, gids)
|
||||||
|
@ -125,8 +125,9 @@ object AppMigration {
|
|||||||
apk: File, out: OutputStream,
|
apk: File, out: OutputStream,
|
||||||
pkg: String, label: CharSequence
|
pkg: String, label: CharSequence
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val info = context.packageManager.getPackageArchiveInfo(apk.path, 0) ?: return false
|
val pm = context.packageManager
|
||||||
val origLabel = info.applicationInfo.nonLocalizedLabel.toString()
|
val info = pm.getPackageArchiveInfo(apk.path, 0)?.applicationInfo ?: return false
|
||||||
|
val origLabel = info.nonLocalizedLabel.toString()
|
||||||
try {
|
try {
|
||||||
JarMap.open(apk, true).use { jar ->
|
JarMap.open(apk, true).use { jar ->
|
||||||
val je = jar.getJarEntry(ANDROID_MANIFEST)
|
val je = jar.getJarEntry(ANDROID_MANIFEST)
|
||||||
|
@ -69,7 +69,7 @@ private val Project.androidComponents
|
|||||||
|
|
||||||
fun Project.setupCommon() {
|
fun Project.setupCommon() {
|
||||||
androidBase {
|
androidBase {
|
||||||
compileSdkVersion(34)
|
compileSdkVersion(35)
|
||||||
buildToolsVersion = "34.0.0"
|
buildToolsVersion = "34.0.0"
|
||||||
ndkPath = "$sdkDirectory/ndk/magisk"
|
ndkPath = "$sdkDirectory/ndk/magisk"
|
||||||
ndkVersion = "27.0.12077973"
|
ndkVersion = "27.0.12077973"
|
||||||
@ -79,8 +79,8 @@ fun Project.setupCommon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
@ -108,7 +108,7 @@ fun Project.setupCommon() {
|
|||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
compilerOptions {
|
compilerOptions {
|
||||||
jvmTarget = JvmTarget.JVM_17
|
jvmTarget = JvmTarget.JVM_21
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ fun Project.setupAppCommon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
targetSdk = 34
|
targetSdk = 35
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user