From 697db8d8ce5f0e892ef106326246eef496b76f16 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 26 May 2023 00:05:52 -0700 Subject: [PATCH] Update AGP --- build.gradle.kts | 23 +++++++++++------- example/build.gradle.kts | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- jitpack.yml | 2 +- nio/build.gradle.kts | 3 +++ service/build.gradle.kts | 5 +++- service/src/main/assets/main.jar | Bin 3581 -> 3634 bytes .../superuser/internal/RootServerMain.java | 10 +++++--- 8 files changed, 31 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c4c7423..91cd69a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.android.build.gradle.BaseExtension +import com.android.build.gradle.LibraryExtension import java.io.ByteArrayOutputStream import java.net.URL @@ -15,7 +16,7 @@ buildscript { } dependencies { - classpath("com.android.tools.build:gradle:7.4.2") + classpath("com.android.tools.build:gradle:8.0.1") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -78,6 +79,9 @@ publishing { fun Project.android(configuration: BaseExtension.() -> Unit) = extensions.getByName("android").configuration() +fun Project.androidLibrary(configuration: LibraryExtension.() -> Unit) = + extensions.getByName("android").configuration() + subprojects { buildscript { repositories { @@ -96,7 +100,7 @@ subprojects { afterEvaluate { android { compileSdkVersion(33) - buildToolsVersion = "33.0.1" + buildToolsVersion = "33.0.2" defaultConfig { if (minSdkVersion == null) @@ -113,8 +117,8 @@ subprojects { if (plugins.hasPlugin("com.android.library")) { apply(plugin = "maven-publish") - android { - buildFeatures.apply { + androidLibrary { + buildFeatures { buildConfig = false } @@ -126,19 +130,20 @@ subprojects { classpath += configurations.getByName("javadocDeps") } - val sourcesJar = tasks.register("sourcesJar", Jar::class) { - archiveClassifier.set("sources") - from(sources) + publishing { + singleVariant("release") { + withSourcesJar() + withJavadocJar() + } } afterEvaluate { publishing { publications { - create("maven") { + register("maven") { from(components["release"]) groupId = "com.github.topjohnwu" artifactId = project.name - artifact(sourcesJar) } } } diff --git a/example/build.gradle.kts b/example/build.gradle.kts index a650094..19d9f9e 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -13,7 +13,9 @@ android { } buildFeatures { + buildConfig = true viewBinding = true + aidl = true } buildTypes { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8fad3f5..3a02907 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jitpack.yml b/jitpack.yml index adb3fe1..efde7bf 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,2 @@ jdk: - - openjdk11 + - openjdk17 diff --git a/nio/build.gradle.kts b/nio/build.gradle.kts index 64dc02e..5d7636f 100644 --- a/nio/build.gradle.kts +++ b/nio/build.gradle.kts @@ -9,6 +9,9 @@ android { defaultConfig { minSdk = 21 } + buildFeatures { + aidl = true + } } dependencies { diff --git a/service/build.gradle.kts b/service/build.gradle.kts index f50d897..b825623 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -1,7 +1,7 @@ +import com.android.tools.r8.R8 import java.io.PrintStream import java.nio.file.Files import java.nio.file.Paths -import com.android.tools.r8.R8 import java.util.stream.Collectors plugins { @@ -12,6 +12,9 @@ group="com.github.topjohnwu.libsu" android { namespace = "com.topjohnwu.superuser.ipc" + buildFeatures { + aidl = true + } } android.libraryVariants.all { diff --git a/service/src/main/assets/main.jar b/service/src/main/assets/main.jar index 33609b4ba9c19c4f2b61ddc997fd2b699a263051..ec00d01346059795e1370779b2026526716151fb 100644 GIT binary patch delta 3565 zcmVP+qO^OqzC6C6`^saRs z$E8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zCk=j6Y<%x3MP%c*6PZ?jKZ()mZz$}J+4vnrq1E3~614hzie!ZMX7-y(%n19l?@6R| z_}wl0UP(5>cd_4G*u|OIW#2Ky(xD&6+5e1)GW$*EKTt~t2qyWTk@sT_000ac002-+ m0Rj{N6aWYa2mk;8AprTGk@sT_000aclk^QZ2Bi%E0001*JLy^g diff --git a/service/src/main/java/com/topjohnwu/superuser/internal/RootServerMain.java b/service/src/main/java/com/topjohnwu/superuser/internal/RootServerMain.java index f7a2de5..d7aaec6 100644 --- a/service/src/main/java/com/topjohnwu/superuser/internal/RootServerMain.java +++ b/service/src/main/java/com/topjohnwu/superuser/internal/RootServerMain.java @@ -181,10 +181,12 @@ class RootServerMain extends ContextWrapper implements Callable { int userId = uid / 100000; // UserHandler.getUserId int flags = Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY; try { - UserHandle userHandle = (UserHandle) UserHandle.class.getDeclaredMethod("of", int.class).invoke(null, userId); - Method createPackageContextAsUser = systemContext.getClass().getDeclaredMethod("createPackageContextAsUser", - String.class, int.class, UserHandle.class); - context = (Context) createPackageContextAsUser.invoke(systemContext, name.getPackageName(), flags, userHandle); + UserHandle userHandle = (UserHandle) UserHandle.class + .getDeclaredMethod("of", int.class).invoke(null, userId); + context = (Context) systemContext.getClass() + .getDeclaredMethod("createPackageContextAsUser", + String.class, int.class, UserHandle.class) + .invoke(systemContext, name.getPackageName(), flags, userHandle); } catch (Throwable e) { Log.w("IPC", "Failed to create package context as user: " + userId, e); context = systemContext.createPackageContext(name.getPackageName(), flags);