При запуске R8 обнаружены отсутствующие классы. Добавьте недостающие классы или примените дополнительные правила хранениAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 При запуске R8 обнаружены отсутствующие классы. Добавьте недостающие классы или примените дополнительные правила хранени

Сообщение Anonymous »

Привет, ребята, в настоящее время я занимаюсь разработкой приложения для Android. У меня есть намерение использовать proguard для защиты моего приложения от обратного проектирования
однако после того, как я применил proguard к своему приложению, возникла ошибка типа это :

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in mypath\app\build\outputs\mapping\debug\missing_rules.txt.


Missing class sun.security.x509.X509CertInfo (referenced from: java.lang.String org.openjsse.sun.security.ssl.SSLLogger$SSLSimpleFormatter.formatCertificate(java.security.cert.Certificate))


Missing class sun.util.logging.PlatformLogger$Level (referenced from: void org.openjsse.sun.net.www.protocol.https.HttpsClient.(javax.net.ssl.SSLSocketFactory, java.net.URL, java.net.Proxy, int) and 1 other context)


Missing class sun.util.logging.PlatformLogger (referenced from: void org.openjsse.sun.net.www.protocol.https.HttpsClient.(javax.net.ssl.SSLSocketFactory, java.net.URL, java.net.Proxy, int) and 1 other context)

Я пытался настроить Missing_rules, чтобы решить эту проблему, но это вообще не сработало
Можете ли вы ребята, помогите мне найти решение этой проблемы?
вот мой код:
// Proguard-rule (модуль приложения)

# Keep file R and Manifest
-keep class **.R
-keep class **.R$* {*;}
-keep class **.BuildConfig {*;}
-keep class **.Manifest {*;}

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }

# Keep Model and Repository Classes
-keep class com.example.core.data.model.** { *; }
-keep class com.example.core.data.repo.** { *; }

# Keep ViewModels
-keep class * extends androidx.lifecycle.ViewModel

# Keep Parcelable Classes
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Keep UI-related classes
-keep class com.example.ui.activity.** { *; }
-keep class com.example.ui.fragment.** { *; }
-keep class com.example.service.** { *; }

# Keeping all classes in a particular package
-keep class com.example.package.** { *; }

# Maintains all classes mentioned in a particular file
#-keep @com.example.rules.txt

# Maintain parcelable classes
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Maintain model classes
-keep class com.example.model.** { *; }

# Maintain class of service
-keep class com.example.service.** { *; }

# Maintain classes required for SSL/TLS handling
-keep class okhttp3.internal.platform.ConscryptPlatform {*;}
-keep class okhttp3.internal.platform.OpenJSSEPlatform {*;}
-keep class org.bouncycastle.** {*;}
-keep class org.conscrypt.** {*;}
-keep class org.openjsse.** {*;}

# Maintain parcelable classes
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Keep classes required by OpenJSSE
-keep class sun.security.x509.** { *; }
-keep class sun.util.logging.** { *; }


// потребительские правила (основной модуль)
##---------------Begin: proguard configuration for SQLCipher ----------
-keep,includedescriptorclasses class net.sqlcipher.** { *; }
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }

##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { ; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName ;
}

##---------------Begin: proguard configuration for Retrofit ----------
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod

# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* ;
}

# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**

# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit

# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*

# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
-if interface * { @retrofit2.http.* ; }
-keep,allowobfuscation interface

-dontwarn kotlinx.**

##---------------Begin: proguard configuration for Glide ----------
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}

# Uncomment for DexGuard only
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule

##---------------Begin: proguard configuration for RxJava ----------
# Uncomment if you use RxJava
#-dontwarn java.util.concurrent.Flow*

# Keep file R and Manifest
-keep class **.R
-keep class **.R$* {*;}
-keep class **.BuildConfig {*;}
-keep class **.Manifest {*;}

# Keep Dependency Injection Framework related classes and methods
-keep class dagger.hilt.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }

# Keep Model and Repository Classes
-keep class com.example.core.data.model.** { *; }
-keep class com.example.core.data.repo.** { *; }

# Keep ViewModels
-keep class * extends androidx.lifecycle.ViewModel

# Keep Parcelable Classes
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Keep UI-related classes
-keep class com.example.core.ui.activity.** { *; }
-keep class com.example.core.ui.fragment.** { *; }
-keep class com.example.core.service.** { *; }

# Keeping all classes in a particular package
-keep class com.example.package.** { *; }

# Maintains all classes mentioned in a particular file
#-keep @com.example.rules.txt

# keep model class
-keep class com.example.model.** { *; }

# Menjaga kelas service
-keep class com.example.service.** { *; }

# Menjaga kelas-kelas yang diperlukan untuk penanganan SSL/TLS
-keep class okhttp3.internal.platform.ConscryptPlatform {*;}
-keep class okhttp3.internal.platform.OpenJSSEPlatform {*;}
-keep class org.bouncycastle.** {*;}
-keep class org.conscrypt.** {*;}
-keep class org.openjsse.** {*;}

# Keep classes required by OpenJSSE
-keep class sun.security.x509.** { *; }
-keep class sun.util.logging.** { *; }

// Missing_rules.txt
# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.android.org.conscrypt.SSLParametersImpl
-dontwarn javax.naming.Binding
-dontwarn javax.naming.NamingEnumeration
-dontwarn javax.naming.NamingException
-dontwarn javax.naming.directory.Attribute
-dontwarn javax.naming.directory.Attributes
-dontwarn javax.naming.directory.DirContext
-dontwarn javax.naming.directory.InitialDirContext
-dontwarn javax.naming.directory.SearchControls
-dontwarn javax.naming.directory.SearchResult
-dontwarn org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn sun.net.util.IPAddressUtil
-dontwarn sun.net.www.http.HttpClient
-dontwarn sun.net.www.http.KeepAliveCache
-dontwarn sun.net.www.protocol.http.Handler
-dontwarn sun.net.www.protocol.http.HttpURLConnection$TunnelState
-dontwarn sun.net.www.protocol.http.HttpURLConnection
-dontwarn sun.net.www.protocol.https.Handler
-dontwarn sun.security.action.GetBooleanAction
-dontwarn sun.security.action.GetIntegerAction
-dontwarn sun.security.action.GetLongAction
-dontwarn sun.security.action.GetPropertyAction
-dontwarn sun.security.action.OpenFileInputStreamAction
-dontwarn sun.security.internal.interfaces.TlsMasterSecret
-dontwarn sun.security.internal.spec.TlsKeyMaterialParameterSpec
-dontwarn sun.security.internal.spec.TlsKeyMaterialSpec
-dontwarn sun.security.internal.spec.TlsPrfParameterSpec
-dontwarn sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec
-dontwarn sun.security.jca.ProviderList
-dontwarn sun.security.jca.Providers
-dontwarn sun.security.provider.certpath.AlgorithmChecker
-dontwarn sun.security.provider.certpath.CertId
-dontwarn sun.security.provider.certpath.OCSP
-dontwarn sun.security.provider.certpath.OCSPResponse$ResponseStatus
-dontwarn sun.security.provider.certpath.OCSPResponse$SingleResponse
-dontwarn sun.security.provider.certpath.OCSPResponse
-dontwarn sun.security.provider.certpath.PKIXExtendedParameters
-dontwarn sun.security.provider.certpath.ResponderId
-dontwarn sun.security.provider.certpath.UntrustedChecker
-dontwarn sun.security.util.AlgorithmDecomposer
-dontwarn sun.security.util.AnchorCertificates
-dontwarn sun.security.util.BitArray
-dontwarn sun.security.util.Debug
-dontwarn sun.security.util.DerInputStream
-dontwarn sun.security.util.DerOutputStream
-dontwarn sun.security.util.DerValue
-dontwarn sun.security.util.DisabledAlgorithmConstraints
-dontwarn sun.security.util.ECUtil
-dontwarn sun.security.util.HostnameChecker
-dontwarn sun.security.util.KeyUtil
-dontwarn sun.security.util.LegacyAlgorithmConstraints
-dontwarn sun.security.util.ObjectIdentifier
-dontwarn sun.security.util.SafeDHParameterSpec
-dontwarn sun.security.util.SignatureUtil
-dontwarn sun.security.util.math.ImmutableIntegerModuloP
-dontwarn sun.security.util.math.IntegerFieldModuloP
-dontwarn sun.security.util.math.IntegerModuloP
-dontwarn sun.security.util.math.MutableIntegerModuloP
-dontwarn sun.security.util.math.intpoly.IntegerPolynomial1305
-dontwarn sun.security.validator.ValidatorException
-dontwarn sun.security.x509.CertificateExtensions
-dontwarn sun.security.x509.Extension
-dontwarn sun.security.x509.KeyIdentifier
-dontwarn sun.security.x509.NetscapeCertTypeExtension
-dontwarn sun.security.x509.PKIXExtensions
-dontwarn sun.security.x509.SerialNumber
-dontwarn sun.security.x509.X500Name
-dontwarn sun.security.x509.X509CertImpl
-dontwarn sun.security.x509.X509CertInfo
-dontwarn sun.util.logging.PlatformLogger$Level
-dontwarn sun.util.logging.PlatformLogger


Подробнее здесь: https://stackoverflow.com/questions/781 ... ses-or-app
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»