From 34b2f525a33f9b40715463b209a38be04cf36044 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Sun, 5 Jun 2022 11:40:13 +0800 Subject: [PATCH] Update proguard-rules.pro --- app/proguard-rules.pro | 26 ++++++------------- .../topjohnwu/magisk/signing/SignBoot.java | 2 -- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8586743ec..d63c78377 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,21 +1,3 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/topjohnwu/Library/Android/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - # Parcelable -keepclassmembers class * implements android.os.Parcelable { public static final ** CREATOR; @@ -26,6 +8,9 @@ public static void check*(...); public static void throw*(...); } +-assumenosideeffects class java.util.Objects { + public static ** requireNonNull(...); +} # Stub -keep class com.topjohnwu.magisk.core.App { (java.lang.Object); } @@ -34,6 +19,11 @@ boolean mActivityHandlesUiMode; } +# main +-keep,allowoptimization public class com.topjohnwu.magisk.signing.SignBoot { + public static void main(java.lang.String[]); +} + # Strip Timber verbose and debug logging -assumenosideeffects class timber.log.Timber$Tree { public void v(**); diff --git a/app/src/main/java/com/topjohnwu/magisk/signing/SignBoot.java b/app/src/main/java/com/topjohnwu/magisk/signing/SignBoot.java index 1073c4d46..ee4c2dceb 100644 --- a/app/src/main/java/com/topjohnwu/magisk/signing/SignBoot.java +++ b/app/src/main/java/com/topjohnwu/magisk/signing/SignBoot.java @@ -1,6 +1,5 @@ package com.topjohnwu.magisk.signing; -import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -33,7 +32,6 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.Arrays; -@Keep public class SignBoot { private static final int BOOT_IMAGE_HEADER_V1_RECOVERY_DTBO_SIZE_OFFSET = 1632;