diff --git a/main.go b/main.go index 835eccab..bdf2ac32 100644 --- a/main.go +++ b/main.go @@ -39,6 +39,7 @@ type Config struct { AppSlug string `env:"BITRISE_APP_SLUG,required"` AddonAPIBaseURL string `env:"addon_api_base_url,required"` AddonAPIToken string `env:"addon_api_token"` + GenerateUniversalApkIfNone bool `env:"generate_universal_apk_if_none,opt[true,false]"` DebugMode bool `env:"debug_mode,opt[true,false]"` BundletoolVersion string `env:"bundletool_version,required"` } @@ -333,10 +334,17 @@ func findAPKsAndAABs(pths []string) (apks []string, aabs []string, others []stri func deploy(clearedFilesToDeploy []string, config Config) (ArtifactURLCollection, error) { apks, aabs, others := findAPKsAndAABs(clearedFilesToDeploy) - apks, _, err := ensureAABsHasUniversalAPKPair(aabs, apks, config.BundletoolVersion) - if err != nil { - return ArtifactURLCollection{}, err + + if config.GenerateUniversalApkIfNone { + var err error + apks, _, err = ensureAABsHasUniversalAPKPair(aabs, apks, config.BundletoolVersion) + if err != nil { + return ArtifactURLCollection{}, err + } + } else { + log.Printf("Does not have universal APK pair but ignoring generation.") } + androidArtifacts := append(apks, aabs...) // deploy the apks first, as the universal apk's public install page will be used for aabs. diff --git a/step.yml b/step.yml index 57e496de..9556e962 100644 --- a/step.yml +++ b/step.yml @@ -223,6 +223,13 @@ inputs: The token required to authenticate with the API. is_dont_change_value: true is_sensitive: true + - generate_universal_apk_if_none: "true" + opts: + title: "Force generate universal APK for AABs" + description: | + When building an AAB artifact, check for a corresponding universal APK. + If none is found, generate the corresponding locally (debug) signed + universal APK for ease of debugging. - debug_mode: "false" opts: category: Debug