7

Android Instant Apps documentation states in the restricted features section that it can not:

Run unverified software, run arbitrary native code, or load code dynamically other than the code provided by the Instant Apps runtime.

I don't fully understand the above statement but it sounds to me like it may not accept any third party software or any native libraries other than libraries given in SDK/NDK.

Could someone help to elaborate?

Edric
  • 24,639
  • 13
  • 81
  • 91
Srini Edara
  • 101
  • 6

3 Answers3

6

This statement:

Prepare your app > Restricted features

Run unverified software, run arbitrary native code, or load code dynamically other than the code provided by the Instant Apps runtime.

Refers to APKs, libraries, or code that is sideloaded, not packaged within the original apk.

unverified software

  • In other words, only the signed apk and its contents are allowed.

arbitrary native code

  • Everything must run from your apk or be provided by the framework.

load code dynamically

  • Such as use of DexClassLoader to retrieve stuff that’s not already packaged with the apk.
Prags
  • 2,457
  • 2
  • 21
  • 38
Julia K
  • 561
  • 5
  • 11
  • I don't know how these requirements are different from the [Developer Policy](https://play.google.com/about/privacy-security-deception/malicious-behavior/) requirements *an app may not download executable code (e.g. dex, JAR, .so files) from a source other than Google Play*. – Alex Cohn Jan 09 '18 at 09:54
  • Statements like this are meant to be broad for flexible decisions. If you have a specific question/example and would like to know if its method is allowed or not for Instant Apps, you can post it to Google @ https://issuetracker.google.com/issues?q=componentid:316045 – TWL Jan 12 '18 at 22:17
4

You can use third-party libraries. What you can't do, for example, is download a binary from your server at runtime and run that.

philo
  • 3,580
  • 3
  • 29
  • 40
0

An unofficial answer from an official Google representative was that with Instant Apps, unlike normal apps, there is no technical way to run downloaded code, or load classes dynamically. For normal apps, the restriction is written in Play Store Developer Policy, and is enforced only on Play Store via standard security monitoring procedures.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307