# Troubleshooting

## Code Obfuscation

{% hint style="warning" %}
The obfuscation material is intended to assist the developer in overcoming obfuscation issues in their application.

The client's obfuscator can affect the functionality of the SDK, so it is necessary that it does not obfuscate the SDK code.

Unico is not responsible for any obfuscation conflicts with the SDK.
{% endhint %}

Obfuscation is a process of transforming the bytecode into a form that is less readable by humans, thereby making reverse engineering more difficult.

This process involves removing debugging-related information such as variable tables, line numbers, and renaming packages, classes, and methods.

When embedding the **Android SDK** in the application, issues may occur.

### Obfuscation via DexGuard <a href="#ofuscacao-via-dexguard" id="ofuscacao-via-dexguard"></a>

When obfuscation is performed via **DexGuard**, in case of failure, use the following rules:

```kotlin
-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }
```

### Obfuscation via ProGuard <a href="#ofuscacao-via-proguard" id="ofuscacao-via-proguard"></a>

When obfuscation is performed via **ProGuard**, in case of failure, use the following rules:

```kotlin
-keep class kotlin.coroutines.**
-keep class kotlinx.coroutines.**

-keep class com.acesso.acessobio_android.** { *; }
-keep class io.unico.** { *; }

-keep class br.com.makrosystems.haven.** { *; }
-keep class HavenSDK.**{ *; }
-keep class HavenSDK** { *; }
```

## SDK Update - Version 4.3.x <a href="#do-sdk-versao-43x" id="do-sdk-versao-43x"></a>

Starting from version 4.4.x of the SDK, Unico began using its own Maven repository to distribute the Android SDK and changed the name of the SDK dependency, along with adjustments to ProGuard and DexGuard rules for clients using the GuardSquare library, as described in the Code Obfuscation section above.

### Update the Maven Repositor&#x79;**:**

Change the Maven repository to the new repository in the project's **`build.gradle`** file.

The implementation was done as follows:

{% code title="build.gradle" overflow="wrap" %}

```
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io'}
    }
}
```

{% endcode %}

It should now be updated to the new repository:

{% code title="build.gradle" overflow="wrap" %}

```
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
    repositories {
        google()
        jcenter()
        maven { 
            url "https://maven-sdk.unico.run/sdk-mobile" 
        }
    }
}
```

{% endcode %}

### Change the SDK Dependency

Change the SDK dependency to the new dependency in the **`app/build.gradle`** file of the project.

The implementation was done as follows:

{% code title="app/build.gradle" overflow="wrap" %}

```
/* unico */
dependencies {
    implementation 'com.github.acesso-io:acessobio-android:$version'
}
```

{% endcode %}

It should now be updated to the new dependency:

{% code title="app/build.gradle" overflow="wrap" %}

```
/* unico */
dependencies {
    implementation "io.unico:capture:$version"
}
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://devcenter.unico.io/unico-idcloud/by-client-integration/sdk/available-sdks/android-sdk/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
