mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-20 13:01:27 +00:00
Upgrade gradle
This commit is contained in:
parent
ae34659b26
commit
4ba365565f
@ -57,6 +57,10 @@ android {
|
|||||||
keepDebugSymbols += "**/*.so"
|
keepDebugSymbols += "**/*.so"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(17)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setupApp()
|
setupApp()
|
||||||
|
@ -7,7 +7,3 @@ setupCommon()
|
|||||||
android {
|
android {
|
||||||
namespace = "com.topjohnwu.shared"
|
namespace = "com.topjohnwu.shared"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
api("io.michaelrocks:paranoid-core:0.3.7")
|
|
||||||
}
|
|
||||||
|
@ -2,9 +2,6 @@ package com.topjohnwu.magisk;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class ProviderInstaller {
|
public class ProviderInstaller {
|
||||||
|
|
||||||
public static boolean install(Context context) {
|
public static boolean install(Context context) {
|
||||||
|
@ -20,9 +20,6 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class StubApk {
|
public class StubApk {
|
||||||
private static File dynDir;
|
private static File dynDir;
|
||||||
private static Method addAssetPath;
|
private static Method addAssetPath;
|
||||||
|
@ -25,9 +25,6 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public final class APKInstall {
|
public final class APKInstall {
|
||||||
|
|
||||||
public static void transfer(InputStream in, OutputStream out) throws IOException {
|
public static void transfer(InputStream in, OutputStream out) throws IOException {
|
||||||
|
@ -17,16 +17,10 @@ gradlePlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("gradle-plugin", "1.8.0"))
|
implementation(kotlin("gradle-plugin", "1.8.0"))
|
||||||
implementation("com.android.tools.build:gradle:7.4.1")
|
implementation("com.android.tools.build:gradle:7.4.1")
|
||||||
implementation("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3")
|
implementation("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3")
|
||||||
implementation("io.michaelrocks:paranoid-gradle-plugin:0.3.7")
|
implementation("org.lsposed.lsparanoid:gradle-plugin:0.5.0")
|
||||||
implementation("org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r")
|
implementation("org.eclipse.jgit:org.eclipse.jgit:6.4.0.202211300538-r")
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ fun genStubManifest(srcDir: File, outDir: File): String {
|
|||||||
fun List<String>.process() = asSequence()
|
fun List<String>.process() = asSequence()
|
||||||
.filter(::notJavaKeyword)
|
.filter(::notJavaKeyword)
|
||||||
// Distinct by lower case to support case insensitive file systems
|
// Distinct by lower case to support case insensitive file systems
|
||||||
.distinctBy { it.toLowerCase(Locale.ROOT) }
|
.distinctBy { it.lowercase() }
|
||||||
|
|
||||||
val names = mutableListOf<String>()
|
val names = mutableListOf<String>()
|
||||||
names.addAll(c1)
|
names.addAll(c1)
|
||||||
@ -174,8 +174,7 @@ fun genStubManifest(srcDir: File, outDir: File): String {
|
|||||||
cls.append(names.random(kRANDOM))
|
cls.append(names.random(kRANDOM))
|
||||||
// Old Android does not support capitalized package names
|
// Old Android does not support capitalized package names
|
||||||
// Check Android 7.0.0 PackageParser#buildClassName
|
// Check Android 7.0.0 PackageParser#buildClassName
|
||||||
cls[0] = cls[0].toLowerCase()
|
yield(cls.toString().replaceFirstChar { it.lowercase() })
|
||||||
yield(cls.toString())
|
|
||||||
}
|
}
|
||||||
}.distinct().iterator()
|
}.distinct().iterator()
|
||||||
|
|
||||||
|
@ -53,12 +53,12 @@ fun Project.setupCommon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "11"
|
jvmTarget = "17"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,8 +133,8 @@ private fun Project.setupAppCommon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all {
|
android.applicationVariants.all {
|
||||||
val projectName = project.name.toLowerCase(Locale.ROOT)
|
val projectName = project.name.lowercase()
|
||||||
val variantCapped = name.capitalize(Locale.ROOT)
|
val variantCapped = name.replaceFirstChar { it.uppercase() }
|
||||||
tasks.getByPath(":$projectName:package$variantCapped").doLast {
|
tasks.getByPath(":$projectName:package$variantCapped").doLast {
|
||||||
val apk = outputs.files.asFileTree.filter { it.name.endsWith(".apk") }.singleFile
|
val apk = outputs.files.asFileTree.filter { it.name.endsWith(".apk") }.singleFile
|
||||||
val comment = "version=${Config.version}\nversionCode=${Config.versionCode}"
|
val comment = "version=${Config.version}\nversionCode=${Config.versionCode}"
|
||||||
@ -191,7 +191,7 @@ fun Project.setupApp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all {
|
android.applicationVariants.all {
|
||||||
val variantCapped = name.capitalize(Locale.ROOT)
|
val variantCapped = name.replaceFirstChar { it.uppercase() }
|
||||||
|
|
||||||
val stubTask = tasks.getByPath(":stub:package$variantCapped")
|
val stubTask = tasks.getByPath(":stub:package$variantCapped")
|
||||||
val stubApk = stubTask.outputs.files.asFileTree.filter {
|
val stubApk = stubTask.outputs.files.asFileTree.filter {
|
||||||
@ -249,8 +249,8 @@ fun Project.setupStub() {
|
|||||||
setupAppCommon()
|
setupAppCommon()
|
||||||
|
|
||||||
android.applicationVariants.all {
|
android.applicationVariants.all {
|
||||||
val variantCapped = name.capitalize(Locale.ROOT)
|
val variantCapped = name.replaceFirstChar { it.uppercase() }
|
||||||
val variantLowered = name.toLowerCase(Locale.ROOT)
|
val variantLowered = name.lowercase()
|
||||||
val manifest = file("src/${variantLowered}/AndroidManifest.xml")
|
val manifest = file("src/${variantLowered}/AndroidManifest.xml")
|
||||||
val outSrcDir = File(buildDir, "generated/source/obfuscate/${variantLowered}")
|
val outSrcDir = File(buildDir, "generated/source/obfuscate/${variantLowered}")
|
||||||
val templateDir = file("template")
|
val templateDir = file("template")
|
||||||
@ -299,11 +299,12 @@ fun Project.setupStub() {
|
|||||||
}
|
}
|
||||||
// Override optimizeReleaseResources task
|
// Override optimizeReleaseResources task
|
||||||
tasks.whenTaskAdded {
|
tasks.whenTaskAdded {
|
||||||
val apk = File(buildDir, "intermediates/processed_res/" +
|
|
||||||
"release/out/resources-release.ap_")
|
|
||||||
val optRes = File(buildDir, "intermediates/optimized_processed_res/" +
|
|
||||||
"release/resources-release-optimize.ap_")
|
|
||||||
if (name == "optimizeReleaseResources") {
|
if (name == "optimizeReleaseResources") {
|
||||||
|
dependsOn("generateReleaseObfuscatedSources")
|
||||||
|
val apk = File(buildDir, "intermediates/processed_res/" +
|
||||||
|
"release/out/resources-release.ap_")
|
||||||
|
val optRes = File(buildDir, "intermediates/optimized_processed_res/" +
|
||||||
|
"release/resources-release-optimize.ap_")
|
||||||
doLast { apk.copyTo(optRes, true) }
|
doLast { apk.copyTo(optRes, true) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("io.michaelrocks.paranoid")
|
id("org.lsposed.lsparanoid")
|
||||||
}
|
}
|
||||||
|
|
||||||
paranoid {
|
lsparanoid {
|
||||||
obfuscationSeed = if (RAND_SEED != 0) RAND_SEED else null
|
seed = if (RAND_SEED != 0) RAND_SEED else null
|
||||||
includeSubprojects = true
|
includeDependencies = true
|
||||||
|
global = true
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -14,13 +14,9 @@ import java.io.File;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
// Wrap the actual classloader as we only want to resolve classname
|
// Wrap the actual classloader as we only want to resolve classname
|
||||||
// mapping when loading from platform (via LoadedApk.mClassLoader)
|
// mapping when loading from platform (via LoadedApk.mClassLoader)
|
||||||
@Obfuscate
|
|
||||||
class AppClassLoader extends ClassLoader {
|
class AppClassLoader extends ClassLoader {
|
||||||
|
|
||||||
final Map<String, String> mapping = new HashMap<>();
|
final Map<String, String> mapping = new HashMap<>();
|
||||||
|
|
||||||
AppClassLoader(File apk) {
|
AppClassLoader(File apk) {
|
||||||
|
@ -4,9 +4,6 @@ import android.app.Application;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class DelegateApplication extends Application {
|
public class DelegateApplication extends Application {
|
||||||
|
|
||||||
private Application receiver;
|
private Application receiver;
|
||||||
|
@ -9,9 +9,6 @@ import android.util.Log;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class DelegateRootService extends ContextWrapper {
|
public class DelegateRootService extends ContextWrapper {
|
||||||
|
|
||||||
public DelegateRootService() {
|
public DelegateRootService() {
|
||||||
|
@ -43,9 +43,6 @@ import javax.crypto.SecretKey;
|
|||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class DownloadActivity extends Activity {
|
public class DownloadActivity extends Activity {
|
||||||
|
|
||||||
private static final String APP_NAME = "Magisk";
|
private static final String APP_NAME = "Magisk";
|
||||||
|
@ -21,9 +21,6 @@ import java.lang.reflect.Field;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||||
public class DynLoad {
|
public class DynLoad {
|
||||||
|
|
||||||
|
@ -10,9 +10,6 @@ import java.io.IOException;
|
|||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class Networking {
|
public class Networking {
|
||||||
|
|
||||||
private static final int READ_TIMEOUT = 15000;
|
private static final int READ_TIMEOUT = 15000;
|
||||||
|
@ -22,9 +22,6 @@ import java.net.HttpURLConnection;
|
|||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import io.michaelrocks.paranoid.Obfuscate;
|
|
||||||
|
|
||||||
@Obfuscate
|
|
||||||
public class Request implements Closeable {
|
public class Request implements Closeable {
|
||||||
private final HttpURLConnection conn;
|
private final HttpURLConnection conn;
|
||||||
private Executor executor = null;
|
private Executor executor = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user