Hangar Open the console

Play's automatic protection and test builds outside Play

Why testers who install a Play build outside the Play Store are asked to get the app from Google Play, and the ways Google documents to get unprotected builds.

You download an APK of your test build from Google Play, send it to a tester, and they see a screen asking them to get the app from Google Play instead. That screen can come from Play's automatic protection. This guide explains what automatic protection does, why it affects test builds installed outside the Play Store, and the ways around it that Google documents.

What automatic protection does

Automatic protection is a Google Play feature. To apply it, Google modifies your app's APKs and signs them, so it needs Play App Signing and an Android App Bundle.1 In Play Console it now sits under Protected with Play, which replaces the old App integrity page.2

The protected app runs an installer check when it opens. If the check fails, the user is asked to get the app from Google Play.1 Google's developer documentation puts it the same way: people who get a protected app from an unknown distribution channel are prompted to get the official app from Google Play.3 Some selected Play partners also get anti-tamper checks and obfuscation.1

Why test builds are affected

Google delivers protected builds on every track: internal, closed, open and production.1 So a build on your internal testing track is protected too, unless you turned protection off for that release. A tester who installs the same build some other way, for example from an APK you downloaded and sent them, may be asked to get the app from Google Play.

Uploads to internal app sharing are the exception. Google does not apply protection to builds uploaded there.1

What you can do about it

Google documents two ways to get a Play-signed build without protection:1

  1. Turn protection off before you upload. While preparing the release, turn off protection for it in the app bundle enhancements section, then download its APKs from the Downloads tab. The next release you upload is protected again.
  2. Use the Google Play Developer API to get unprotected builds.

Google also recommends sharing unprotected builds only with trusted members of your team, not distributing them more widely.1

The second option is the one that works without changing your releases. The generatedapks.list method returns the APKs Google Play generated from an app bundle. For apps that use automatic protection, it returns protected split APKs in generatedSplitApks and signed, unprotected split APKs in unprotectedGeneratedSplitApks. There is also unprotectedGeneratedStandaloneApks for standalone APKs.4 You then download each APK with generatedapks.download.5

Installing the right split APKs

An app bundle is a publishing format, not something a phone installs. From it, Google Play builds a base APK with the app's main code and resources, and configuration APKs for a particular CPU architecture, screen density or language. Each device installs only the configuration APKs that match it.6

So if a phone needs configuration splits, the base APK alone is not enough. Installing outside the Play Store without the split APKs a device needs fails on Google-certified devices and on devices running Android 10 or later.7 The installer has to pick the right splits for the phone and install them together. Android's PackageInstaller supports this: an installer can stream several APKs into one install session, as long as they share a package name, version code and signing certificates, each split has its own name, and there is one base APK.8

How Hangar does it

When a tester installs a build that Hangar read from your Play testing tracks, the Hangar app sends the phone's CPU architectures, screen density and languages. If Google Play has unprotected split APKs for that build, Hangar picks the base APK and the matching configuration APKs and installs them in one session. The tester doesn't see the prompt to get the app from Google Play, and you don't have to turn protection off for your releases.

Checklist

  • Check Protected with Play in Play Console to see whether automatic protection is on for your app.
  • Test the protected build too. Google asks you to check protected builds for problems such as the app failing to launch.1
  • If testers install outside the Play Store, they need unprotected builds: from the API, from a release with protection turned off, or from internal app sharing. Google recommends keeping unprotected builds to trusted team members.1
  • If you install split APKs yourself, install the base and the matching configuration splits in one session.

Sources

  1. Prevent unauthorized redistribution with automatic protection and prompt users to get your app on Google Play, Play Console Help
  2. Use Protected with Play to protect your app and your users, Play Console Help
  3. Play Integrity and signing services, Android Developers
  4. Method: generatedapks.list, Google Play Developer API
  5. Method: generatedapks.download, Google Play Developer API
  6. The Android App Bundle format, Android Developers
  7. About Android App Bundles, Android Developers
  8. PackageInstaller, Android Developers

Give your Android testers one app.

Open the console to add your app and its builds. Your testers install the Hangar app on an Android phone.

HGR-BLOG