react-nativeexpoandroid-obfuscation

Obfuscate an EXPO file


First time I use Expo (react native app) to deploy an app into Googgle play store. Expo Generates an aab -file that I can upload to the store. But it seems like it is not obfuscated. Reading through the Expo documents I don't get my head around how to define this in my build process.

If I understand documentation correctly it is in my eas.json file I should define this, or have I misunderstood?

But I don't know how the code should look like. Any suggestions for how?


Solution

  • Follow this steps

    1. Make sure expo-build-properties is installed, or install it if needed: expo install expo-build-properties
    2. In your app.json / app.config.js change this dependency:
    "plugins": [
          "expo-build-properties"
        ]
    

    to

    "plugins": [
          [
            "expo-build-properties",
            {
              "android": {
                "enableProguardInReleaseBuilds": true
              }
            }
          ]
        ]
    

    After these steps, it should be obfuscated. Source: https://docs.expo.dev/versions/latest/sdk/build-properties/#example-appjson-with-config-plugin