Deobfuscation

Explained here is how to deobfuscate your crashes to get more details from stack traces.

Uploading Manually via the Dashboard

Go to Upload Mapping Files in the Settings menu of your Instabug dashboard and upload your Mapping.txt file. Multiple mapping files can be uploaded to correspond with each version of your application.

2901

Uploading via Script

Through automation, you can make it so that mapping files are generated and uploaded from environment with ease. First, you'll need the below script, which can be used to upload your mapping files directly without needing to visit the dashboard. You only need to add the location of your mapping file, as well as your application token.

#!/bin/bash
echo "Instabug mapping files uploader"

# Constants for app token and mapping files
APP_TOKEN="APPTOKEN"
PATH_TO_MAPPING_FILE="PATH/TO/FILE.txt"
VERSION_CODE="1"
VERSION_NAME="1.1"
VERSION='{"code":"'"$VERSION_CODE"'","name":"'"$VERSION_NAME"'"}'

if [ ! -f $PATH_TO_MAPPING_FILE ]; then
    echo "File not found!"
    exit 0
fi

echo "Mapping file found! Uploading..."

ENDPOINT="https://api.instabug.com/api/sdk/v3/symbols_files"
STATUS=$(curl "${ENDPOINT}" --write-out %{http_code} --silent --output /dev/null -F os=android -F app_version="${VERSION}" -F symbols_file=@"${PATH_TO_MAPPING_FILE}" -F application_token="${APP_TOKEN}")
if [ $STATUS -ne 200 ]; then
  echo "Error while uploading mapping files"
  exit 0
fi


echo "Success! Your mapping files got uploaded successfully"

Afterwards, add the following gradle task to your app's build.gradle while replacing "TOKEN" with your own token.

task uploadMappingFiles(type: Exec) {
    android.applicationVariants.all {
        if (it.variantData.variantConfiguration.buildType.name == "release" && it.mappingFile != null && it.mappingFile.exists()) {
            commandLine 'sh', '../upload_mapping.sh', "TOKEN", it.versionCode, it.versionName, it.mappingFile
        }
    }
}

Lastly, once you're done with the release task, simply run the following command:
./gradlew :app:uploadMappingFiles

Uploading via API

We have an API end point that you can use to upload your mapping files directly from the console. Mapping files must be uploaded as a .txt file.

URL:
https://api.instabug.com/api/sdk/v3/symbols_files
METHOD:
POST
PARAMS:
symbols_file
os (android, ios,,,)
application_token

What’s Next

After a crash has been deobfuscated and the fix is done, reach out to your affected users and let them know to update.