Skip to content

Commit

Permalink
添加混淆规则
Browse files Browse the repository at this point in the history
  • Loading branch information
zhcode-fun committed Sep 13, 2024
1 parent 8ec279f commit 052df78
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ android {
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}

signingConfigs {
create("release") {
storeFile = file("buildsign.jks")
storePassword = ""
keyAlias = "wireguard"
keyPassword = ""
}
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles("proguard-android-optimize.txt")
signingConfig = signingConfigs.getByName("release")
packaging {
resources {
excludes += "DebugProbesKt.bin"
Expand Down
29 changes: 29 additions & 0 deletions ui/proguard-android-optimize.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
-dontwarn android.os.SystemProperties
-dontwarn com.sun.jna.Library
-dontwarn com.sun.jna.Memory
-dontwarn com.sun.jna.Native
-dontwarn com.sun.jna.Pointer
-dontwarn com.sun.jna.Structure$ByReference
-dontwarn com.sun.jna.Structure$FieldOrder
-dontwarn com.sun.jna.Structure
-dontwarn com.sun.jna.WString
-dontwarn com.sun.jna.platform.win32.Guid$GUID
-dontwarn com.sun.jna.platform.win32.Win32Exception
-dontwarn com.sun.jna.ptr.IntByReference
-dontwarn com.sun.jna.win32.W32APIOptions
-dontwarn javax.naming.NamingException
-dontwarn javax.naming.directory.DirContext
-dontwarn javax.naming.directory.InitialDirContext
-dontwarn org.bouncycastle.asn1.ASN1ObjectIdentifier
-dontwarn org.bouncycastle.asn1.edec.EdECObjectIdentifiers
-dontwarn org.bouncycastle.asn1.x509.AlgorithmIdentifier
-dontwarn org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
-dontwarn org.bouncycastle.jcajce.provider.asymmetric.edec.BCEdDSAPublicKey
-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn sun.net.spi.nameservice.NameService
-dontwarn sun.net.spi.nameservice.NameServiceDescriptor

-dontwarn lombok.Generated
-dontwarn org.xbill.DNS.spi.DnsjavaInetAddressResolverProvider

-allowaccessmodification
-dontusemixedcaseclassnames
-dontobfuscate
Expand Down Expand Up @@ -33,3 +61,4 @@
-keepclasseswithmembers class * {
@androidx.annotation.Keep <init>(...);
}

0 comments on commit 052df78

Please sign in to comment.