3

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?

Jonas
  • 43
  • 6

1 Answers1

10

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

Zerender
  • 131
  • 1
  • 3
  • Hey, concerning iOS do we have to do something similar to hide our bundle code ? I don't know if we can access the Javascript code in an iOS app. Also I try your answer, but I still can see my constant variable name with his value ... Or is the obfuscation not so strong ? – Julien Pepe Aug 27 '22 at 10:08
  • 1
    @Zerender, magnificent! – Joshua Kusaasira Sep 06 '22 at 14:18