|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package android.bundle; |
| 4 | + |
| 5 | +import "config.proto"; |
| 6 | +import "targeting.proto"; |
| 7 | + |
| 8 | +option java_package = "com.android.bundle"; |
| 9 | + |
| 10 | +// Describes the output of the "build-apks" command. |
| 11 | +message BuildApksResult { |
| 12 | + // The package name of this app. |
| 13 | + string package_name = 4; |
| 14 | + |
| 15 | + // List of the created variants. |
| 16 | + repeated Variant variant = 1; |
| 17 | + |
| 18 | + // Metadata about BundleTool used to build the APKs. |
| 19 | + Bundletool bundletool = 2; |
| 20 | + |
| 21 | + // List of the created asset slices. |
| 22 | + repeated AssetSliceSet asset_slice_set = 3; |
| 23 | + |
| 24 | + // Information about local testing mode. |
| 25 | + LocalTestingInfo local_testing_info = 5; |
| 26 | + |
| 27 | + // Asset modules metadata for asset only bundles. |
| 28 | + AssetModulesInfo asset_modules_info = 6; |
| 29 | + |
| 30 | + // Default values for targeting dimensions, as specified in the BundleConfig. |
| 31 | + // Only set for dimensions that have a default suffix specified. |
| 32 | + repeated DefaultTargetingValue default_targeting_value = 7; |
| 33 | + |
| 34 | + // Information about permanently fused install-time modules, which were |
| 35 | + // presented in original bundle but fused into base in all variants. |
| 36 | + repeated PermanentlyFusedModule permanently_fused_modules = 8; |
| 37 | +} |
| 38 | + |
| 39 | +message BuildSdkApksResult { |
| 40 | + // The package name of the SDK. |
| 41 | + // |
| 42 | + // For instance, for SDK “com.foo.bar” with major version “15”, |
| 43 | + // the package name stored here is simply “com.foo.bar”. |
| 44 | + // This is different from the package name that is installed in Android |
| 45 | + // PackageManager on sandbox-enabled devices (which is “com.foo.bar_15”). |
| 46 | + string package_name = 1; |
| 47 | + |
| 48 | + // Variants generated for the SDK. |
| 49 | + // At the moment, there is always a single variant. |
| 50 | + repeated Variant variant = 2; |
| 51 | + |
| 52 | + Bundletool bundletool = 3; |
| 53 | + |
| 54 | + SdkVersionInformation version = 4; |
| 55 | +} |
| 56 | + |
| 57 | +message SdkVersionInformation { |
| 58 | + // Major version of the SDK. |
| 59 | + int32 major = 1; |
| 60 | + |
| 61 | + // Minor version of the SDK. |
| 62 | + int32 minor = 2; |
| 63 | + |
| 64 | + // Patch version of the SDK. |
| 65 | + int32 patch = 3; |
| 66 | + |
| 67 | + // A unique version code assigned to the SDK by the caller of build-sdk-apks. |
| 68 | + int32 version_code = 4; |
| 69 | +} |
| 70 | + |
| 71 | +// Variant is a group of APKs that covers a part of the device configuration |
| 72 | +// space. APKs from multiple variants are never combined on one device. |
| 73 | +message Variant { |
| 74 | + // Variant-level targeting. |
| 75 | + // This targeting is fairly high-level and each APK has its own targeting as |
| 76 | + // well. |
| 77 | + VariantTargeting targeting = 1; |
| 78 | + |
| 79 | + // Set of APKs, one set per module. |
| 80 | + repeated ApkSet apk_set = 2; |
| 81 | + |
| 82 | + // Number of the variant, starting at 0 (unless overridden). |
| 83 | + // A device will receive APKs from the first variant that matches the device |
| 84 | + // configuration, with higher variant numbers having priority over lower |
| 85 | + // variant numbers. |
| 86 | + uint32 variant_number = 3; |
| 87 | + |
| 88 | + // Extra information about the variant e.g. has uncompressed dex files or |
| 89 | + // uncompressed native libraries |
| 90 | + VariantProperties variant_properties = 4; |
| 91 | +} |
| 92 | + |
| 93 | +// Describes properties of a variant |
| 94 | +message VariantProperties { |
| 95 | + // Variant has uncompressed dex files |
| 96 | + bool uncompressed_dex = 1; |
| 97 | + |
| 98 | + // Variant has uncompressed native libraries |
| 99 | + bool uncompressed_native_libraries = 2; |
| 100 | + |
| 101 | + // Variant has sparse encoded resource tables |
| 102 | + bool sparse_encoding = 3; |
| 103 | +} |
| 104 | + |
| 105 | +// Describes the output of the "extract-apks" command. |
| 106 | +message ExtractApksResult { |
| 107 | + // Set of extracted APKs. |
| 108 | + repeated ExtractedApk apks = 1; |
| 109 | + |
| 110 | + // Information about the APKs if built with local testing enabled. |
| 111 | + LocalTestingInfoForMetadata local_testing_info = 2; |
| 112 | +} |
| 113 | + |
| 114 | +message LocalTestingInfoForMetadata { |
| 115 | + // The absolute path on the device that files targeted by local testing |
| 116 | + // mode will be pushed to. |
| 117 | + string local_testing_dir = 1; |
| 118 | +} |
| 119 | + |
| 120 | +// Describes extracted APK. |
| 121 | +message ExtractedApk { |
| 122 | + // Module name. |
| 123 | + string module_name = 1; |
| 124 | + |
| 125 | + // Path |
| 126 | + string path = 2; |
| 127 | + |
| 128 | + // Indicates the delivery type (e.g. on-demand) of the APK. |
| 129 | + DeliveryType delivery_type = 3; |
| 130 | +} |
| 131 | + |
| 132 | +// Represents a module. |
| 133 | +// For pre-L devices multiple modules (possibly all) may be merged into one. |
| 134 | +message ApkSet { |
| 135 | + ModuleMetadata module_metadata = 1; |
| 136 | + |
| 137 | + // APKs. |
| 138 | + repeated ApkDescription apk_description = 2; |
| 139 | +} |
| 140 | + |
| 141 | +message ModuleMetadata { |
| 142 | + // Module name. |
| 143 | + string name = 1; |
| 144 | + |
| 145 | + // Indicates the type of this feature module. |
| 146 | + FeatureModuleType module_type = 7; |
| 147 | + |
| 148 | + // Indicates the delivery type (e.g. on-demand) of the module. |
| 149 | + DeliveryType delivery_type = 6; |
| 150 | + |
| 151 | + // Indicates whether this module is marked "instant". |
| 152 | + bool is_instant = 3; |
| 153 | + |
| 154 | + // Names of the modules that this module directly depends on. |
| 155 | + // Each module implicitly depends on the base module. |
| 156 | + repeated string dependencies = 4; |
| 157 | + |
| 158 | + // The targeting that makes a conditional module installed. |
| 159 | + // Relevant only for Split APKs. |
| 160 | + ModuleTargeting targeting = 5; |
| 161 | + |
| 162 | + // Deprecated. Please use delivery_type. |
| 163 | + bool on_demand_deprecated = 2 [deprecated = true]; |
| 164 | + |
| 165 | + // Runtime-enabled SDK dependencies of this module. |
| 166 | + repeated RuntimeEnabledSdkDependency runtime_enabled_sdk_dependencies = 8; |
| 167 | + |
| 168 | + // Information about the SDK that this module was generated from. |
| 169 | + // Only set for modules with module_type FeatureModuleType.SDK_MODULE. |
| 170 | + optional SdkModuleMetadata sdk_module_metadata = 9; |
| 171 | +} |
| 172 | + |
| 173 | +// Set of asset slices belonging to a single asset module. |
| 174 | +message AssetSliceSet { |
| 175 | + // Module level metadata. |
| 176 | + AssetModuleMetadata asset_module_metadata = 1; |
| 177 | + |
| 178 | + // Asset slices. |
| 179 | + repeated ApkDescription apk_description = 2; |
| 180 | +} |
| 181 | + |
| 182 | +message AssetModuleMetadata { |
| 183 | + // Module name. |
| 184 | + string name = 1; |
| 185 | + |
| 186 | + // Indicates the delivery type for persistent install. |
| 187 | + DeliveryType delivery_type = 4; |
| 188 | + |
| 189 | + // Metadata for instant installs. |
| 190 | + InstantMetadata instant_metadata = 3; |
| 191 | + |
| 192 | + // Deprecated. Use delivery_type. |
| 193 | + bool on_demand_deprecated = 2 [deprecated = true]; |
| 194 | + |
| 195 | + // Type of asset module. |
| 196 | + AssetModuleType asset_module_type = 5; |
| 197 | +} |
| 198 | + |
| 199 | +message InstantMetadata { |
| 200 | + // Indicates whether this module is marked "instant". |
| 201 | + bool is_instant = 1; |
| 202 | + |
| 203 | + // Indicates the delivery type for instant install. |
| 204 | + DeliveryType delivery_type = 3; |
| 205 | + |
| 206 | + // Deprecated. Use delivery_type. |
| 207 | + bool on_demand_deprecated = 2 [deprecated = true]; |
| 208 | +} |
| 209 | + |
| 210 | +enum DeliveryType { |
| 211 | + UNKNOWN_DELIVERY_TYPE = 0; |
| 212 | + INSTALL_TIME = 1; |
| 213 | + ON_DEMAND = 2; |
| 214 | + FAST_FOLLOW = 3; |
| 215 | +} |
| 216 | + |
| 217 | +enum FeatureModuleType { |
| 218 | + UNKNOWN_MODULE_TYPE = 0; |
| 219 | + FEATURE_MODULE = 1; |
| 220 | + ML_MODULE = 2; |
| 221 | + SDK_MODULE = 3; |
| 222 | +} |
| 223 | + |
| 224 | +enum AssetModuleType { |
| 225 | + UNKNOWN_ASSET_TYPE = 0; |
| 226 | + DEFAULT_ASSET_TYPE = 1; |
| 227 | + AI_PACK_TYPE = 2; |
| 228 | +} |
| 229 | + |
| 230 | +message ApkDescription { |
| 231 | + ApkTargeting targeting = 1; |
| 232 | + |
| 233 | + // Path to the APK file. |
| 234 | + string path = 2; |
| 235 | + |
| 236 | + oneof apk_metadata_oneof_value { |
| 237 | + // Set only for Split APKs. |
| 238 | + SplitApkMetadata split_apk_metadata = 3; |
| 239 | + // Set only for standalone APKs. |
| 240 | + StandaloneApkMetadata standalone_apk_metadata = 4; |
| 241 | + // Set only for Instant split APKs. |
| 242 | + SplitApkMetadata instant_apk_metadata = 5; |
| 243 | + // Set only for system APKs. |
| 244 | + SystemApkMetadata system_apk_metadata = 6; |
| 245 | + // Set only for asset slices. |
| 246 | + SplitApkMetadata asset_slice_metadata = 7; |
| 247 | + // Set only for APEX APKs. |
| 248 | + ApexApkMetadata apex_apk_metadata = 8; |
| 249 | + // Set only for archived APKs. |
| 250 | + ArchivedApkMetadata archived_apk_metadata = 9; |
| 251 | + } |
| 252 | + |
| 253 | + SigningDescription signing_description = 10; |
| 254 | +} |
| 255 | + |
| 256 | +// Holds data specific to signing configuration applied on the APKs. |
| 257 | +message SigningDescription { |
| 258 | + // Denotes if the generated APK to be signed with the rotated key. |
| 259 | + bool signed_with_rotated_key = 1; |
| 260 | +} |
| 261 | + |
| 262 | +// Holds data specific to Split APKs. |
| 263 | +message SplitApkMetadata { |
| 264 | + string split_id = 1; |
| 265 | + |
| 266 | + // Indicates whether this APK is the master split of the module. |
| 267 | + bool is_master_split = 2; |
| 268 | +} |
| 269 | + |
| 270 | +// Holds data specific to Standalone APKs. |
| 271 | +message StandaloneApkMetadata { |
| 272 | + // Names of the modules fused in this standalone APK. |
| 273 | + repeated string fused_module_name = 1; |
| 274 | + |
| 275 | + reserved 2; |
| 276 | +} |
| 277 | + |
| 278 | +// Holds data specific to system APKs. |
| 279 | +message SystemApkMetadata { |
| 280 | + // Names of the modules fused in this system APK. |
| 281 | + repeated string fused_module_name = 1; |
| 282 | + // Was "system_apk_type". |
| 283 | + reserved 2; |
| 284 | +} |
| 285 | + |
| 286 | +// Holds data specific to APEX APKs. |
| 287 | +message ApexApkMetadata { |
| 288 | + // Configuration for processing of APKs embedded in an APEX image. |
| 289 | + repeated ApexEmbeddedApkConfig apex_embedded_apk_config = 1; |
| 290 | +} |
| 291 | + |
| 292 | +// Holds data specific to Archived APKs. |
| 293 | +message ArchivedApkMetadata {} |
| 294 | + |
| 295 | +message LocalTestingInfo { |
| 296 | + // Indicates if the bundle is built in local testing mode. |
| 297 | + bool enabled = 1; |
| 298 | + // The local testing path, as specified in the base manifest. |
| 299 | + // This refers to the relative path on the external directory of the app where |
| 300 | + // APKs will be pushed for local testing. |
| 301 | + // Set only if local testing is enabled. |
| 302 | + string local_testing_path = 2; |
| 303 | +} |
| 304 | + |
| 305 | +// Holds metadata for asset only bundles. |
| 306 | +message AssetModulesInfo { |
| 307 | + // App versionCodes that will be updated with these asset modules. |
| 308 | + // Only relevant for asset-only bundles. |
| 309 | + repeated int64 app_version = 1; |
| 310 | + |
| 311 | + // Version tag for the asset upload. |
| 312 | + // Only relevant for asset-only bundles. |
| 313 | + string asset_version_tag = 2; |
| 314 | +} |
| 315 | + |
| 316 | +// Default value targeted by a particular dimension. |
| 317 | +message DefaultTargetingValue { |
| 318 | + // The dimension being targeted. |
| 319 | + SplitDimension.Value dimension = 1; |
| 320 | + |
| 321 | + // The default value being targeted. |
| 322 | + string default_value = 2; |
| 323 | +} |
| 324 | + |
| 325 | +message PermanentlyFusedModule { |
| 326 | + // Module name. |
| 327 | + string name = 1; |
| 328 | +} |
| 329 | + |
| 330 | +// Describes a runtime-enabled SDK that the app depends on. |
| 331 | +message RuntimeEnabledSdkDependency { |
| 332 | + // Package name of the runtime-enabled SDK. |
| 333 | + // Required. |
| 334 | + string package_name = 1; |
| 335 | + // Major version of the runtime-enabled SDK. |
| 336 | + // Required. |
| 337 | + int32 major_version = 2; |
| 338 | + // Minor version of the runtime-enabled SDK. |
| 339 | + // Required. |
| 340 | + int32 minor_version = 3; |
| 341 | +} |
| 342 | + |
| 343 | +// Metadata of the app module generated from a runtime-enabled SDK that the app |
| 344 | +// depends on. |
| 345 | +message SdkModuleMetadata { |
| 346 | + // Version of the Runtime-enabled SDK that this module was generated from. |
| 347 | + // Required. |
| 348 | + optional SdkModuleVersion sdk_module_version = 1; |
| 349 | + |
| 350 | + // Package name of the runtime-enabled SDK that this module was generated |
| 351 | + // from. |
| 352 | + // Required. |
| 353 | + optional string sdk_package_name = 2; |
| 354 | + |
| 355 | + // Package ID of the resources of this module. Can have values between 2-255. |
| 356 | + // Required. |
| 357 | + optional int32 resources_package_id = 3; |
| 358 | +} |
| 359 | + |
| 360 | +// Versioning information about the SDK that the app module was generated from. |
| 361 | +message SdkModuleVersion { |
| 362 | + // Major version of the SDK. |
| 363 | + // Required. |
| 364 | + optional int32 major = 1; |
| 365 | + // Minor version of the SDK. |
| 366 | + // Required. |
| 367 | + optional int32 minor = 2; |
| 368 | + // Patch version of the SDK. |
| 369 | + // Required. |
| 370 | + optional int32 patch = 3; |
| 371 | +} |
| 372 | + |
0 commit comments