> For the complete documentation index, see [llms.txt](https://ftcoders.first-tech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/utilitarios/arquivo-proguard-rules.pro.md).

# Arquivo proguard-rules.pro

Abaixo segue o **EXEMPLO** de um arquivo proguard-rules.pro.\
\
obs: É importante notar que essas regras são totalmente exclusivas para cada projeto, pois dependem diretamente das bibliotecas que estão sendo importadas. Portanto, o arquivo disponibilizado abaixo serve apenas como exemplo, já que cada aplicativo terá suas próprias regras geradas de maneira personalizada.\ <br>

```
# ==============================================================================
# 1. IGNORAR AVISOS DE BIBLIOTECAS DE TERCEIROS (-dontwarn)
# ==============================================================================
-dontwarn com.fasterxml.jackson.**
-dontwarn com.google.auto.value.**
-dontwarn io.opentelemetry.**
-dontwarn javax.annotation.**
-dontwarn javax.inject.**
-dontwarn sun.misc.**
-dontwarn org.codehaus.mojo.**
-dontwarn org.junit.**
-dontwarn org.mockito.**
-dontwarn android.test.**
-dontwarn android.support.test.**

# Ignora avisos gerais do SDK da FirstTech
-dontwarn com.firsttech.**

# Ignora avisos das bibliotecas de requisição HTTP
-dontwarn okhttp3.**
-dontwarn retrofit2.**
-dontwarn okio.**


# ==============================================================================
# 2. PROTEGER CLASSES DE INTERFACE E ADAPTERS (-keep)
# ==============================================================================
-keep class com.firsttech.taponphone.app.adapter.** { *; }
-keepclassmembers class **.ViewHolder {
    <init>(...);
}

# Protege o DataBinding e ViewBinding para evitar crash ao inflar layouts
-keep class com.firsttech.taponphone.app.databinding.** { *; }
-keep class androidx.databinding.** { *; }
-keepclassmembers class * extends androidx.viewbinding.ViewBinding {
    public static ** inflate(...);
    public static ** bind(...);
    public ** getRoot();
}


# ==============================================================================
# 3. PROTEGER MODELOS E CLASSES DO SDK DA FIRSTTECH
# ==============================================================================
-keep class com.firsttech.taponphone.sdk.v2.models.** { *; }
-keep class com.firsttech.taponphone.sdk.v2.model.** { *; }

# Mantém os construtores e métodos públicos do pacote raiz da FirstTech
-keep class com.firsttech.** {
    public <init>(...);
    <methods>;
}


# ==============================================================================
# 4. MANTER METADADOS IMPORTANTES PARA DEBUG E ANOTAÇÕES
# ==============================================================================
-keepattributes SourceFile,LineNumberTable,Signature,*Annotation*


# ==============================================================================
# 5. REGRAS PARA GSON E RETROFIT (REDE E SERIALIZAÇÃO JSON)
# ==============================================================================
-keep class com.google.gson.** { *; }
-keepclassmembers class * {
    @com.google.gson.annotations.SerializedName <fields>;
}

-keep interface retrofit2.** { *; }
-keep interface **.api.** { *; }
-keepattributes RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations


# ==============================================================================
# 6. REGRAS DE SISTEMA (MÉTODOS NATIVOS E ENUMS)
# ==============================================================================
-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}


# ==============================================================================
# 7. SILENCIAR OS ERROS ESPECÍFICOS DO R8 (GERADOS NO SEU BUILD FAILED)
# ==============================================================================
-dontwarn com.fasterxml.jackson.core.JsonFactory
-dontwarn com.fasterxml.jackson.core.JsonGenerator
-dontwarn com.google.auto.value.AutoValue$Builder
-dontwarn com.google.auto.value.AutoValue$CopyAnnotations
-dontwarn com.google.auto.value.AutoValue
-dontwarn io.opentelemetry.api.common.AttributeKey
-dontwarn io.opentelemetry.api.common.Attributes
-dontwarn io.opentelemetry.api.incubator.common.ExtendedAttributeKey
-dontwarn io.opentelemetry.api.incubator.common.ExtendedAttributeType
-dontwarn io.opentelemetry.api.incubator.common.ExtendedAttributes
-dontwarn io.opentelemetry.api.incubator.common.ExtendedAttributesBuilder
-dontwarn io.opentelemetry.api.incubator.internal.InternalExtendedAttributeKeyImpl
-dontwarn io.opentelemetry.api.incubator.logs.ExtendedLogRecordBuilder
-dontwarn io.opentelemetry.api.incubator.logs.ExtendedLogger
-dontwarn io.opentelemetry.api.incubator.metrics.ExtendedLongGaugeBuilder
-dontwarn io.opentelemetry.api.incubator.trace.ExtendedSpanBuilder
-dontwarn io.opentelemetry.api.incubator.trace.ExtendedTracer
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleLogRecordExporterComponentProvider
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleLogRecordExporterProvider
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleMetricExporterComponentProvider
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleMetricExporterProvider
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleSpanExporterComponentProvider
-dontwarn io.opentelemetry.exporter.logging.internal.ConsoleSpanExporterProvider
-dontwarn io.opentelemetry.exporter.logging.internal.LoggingLogRecordExporterProvider
-dontwarn io.opentelemetry.exporter.logging.internal.LoggingMetricExporterProvider
-dontwarn io.opentelemetry.exporter.logging.internal.LoggingSpanExporterProvider
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ftcoders.first-tech.com/first-tech-ttp-sdk-pt/utilitarios/arquivo-proguard-rules.pro.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
