Sasha Smundak | 7a894a6 | 2020-05-06 21:23:08 -0700 | [diff] [blame^] | 1 | // Messages describing APK Set's table of contents (toc.pb entry). |
| 2 | // Please be advised that the ultimate source is at |
| 3 | // https://github.com/google/bundletool/tree/master/src/main/proto |
| 4 | // so you have been warned. |
| 5 | syntax = "proto3"; |
| 6 | |
| 7 | package android.bundle; |
| 8 | |
| 9 | import "config.proto"; |
| 10 | import "targeting.proto"; |
| 11 | |
| 12 | option go_package = "android_bundle_proto"; |
| 13 | option java_package = "com.android.bundle"; |
| 14 | |
| 15 | // Describes the output of the "build-apks" command. |
| 16 | message BuildApksResult { |
| 17 | // The package name of this app. |
| 18 | string package_name = 4; |
| 19 | |
| 20 | // List of the created variants. |
| 21 | repeated Variant variant = 1; |
| 22 | |
| 23 | // Metadata about BundleTool used to build the APKs. |
| 24 | Bundletool bundletool = 2; |
| 25 | |
| 26 | // List of the created asset slices. |
| 27 | repeated AssetSliceSet asset_slice_set = 3; |
| 28 | |
| 29 | // Information about local testing mode. |
| 30 | LocalTestingInfo local_testing_info = 5; |
| 31 | } |
| 32 | |
| 33 | // Variant is a group of APKs that covers a part of the device configuration |
| 34 | // space. APKs from multiple variants are never combined on one device. |
| 35 | message Variant { |
| 36 | // Variant-level targeting. |
| 37 | // This targeting is fairly high-level and each APK has its own targeting as |
| 38 | // well. |
| 39 | VariantTargeting targeting = 1; |
| 40 | |
| 41 | // Set of APKs, one set per module. |
| 42 | repeated ApkSet apk_set = 2; |
| 43 | |
| 44 | // Number of the variant, starting at 0 (unless overridden). |
| 45 | // A device will receive APKs from the first variant that matches the device |
| 46 | // configuration, with higher variant numbers having priority over lower |
| 47 | // variant numbers. |
| 48 | uint32 variant_number = 3; |
| 49 | } |
| 50 | |
| 51 | // Represents a module. |
| 52 | // For pre-L devices multiple modules (possibly all) may be merged into one. |
| 53 | message ApkSet { |
| 54 | ModuleMetadata module_metadata = 1; |
| 55 | |
| 56 | // APKs. |
| 57 | repeated ApkDescription apk_description = 2; |
| 58 | } |
| 59 | |
| 60 | message ModuleMetadata { |
| 61 | // Module name. |
| 62 | string name = 1; |
| 63 | |
| 64 | // Indicates the delivery type (e.g. on-demand) of the module. |
| 65 | DeliveryType delivery_type = 6; |
| 66 | |
| 67 | // Indicates whether this module is marked "instant". |
| 68 | bool is_instant = 3; |
| 69 | |
| 70 | // Names of the modules that this module directly depends on. |
| 71 | // Each module implicitly depends on the base module. |
| 72 | repeated string dependencies = 4; |
| 73 | |
| 74 | // The targeting that makes a conditional module installed. |
| 75 | // Relevant only for Split APKs. |
| 76 | ModuleTargeting targeting = 5; |
| 77 | |
| 78 | // Deprecated. Please use delivery_type. |
| 79 | bool on_demand_deprecated = 2 [deprecated = true]; |
| 80 | } |
| 81 | |
| 82 | // Set of asset slices belonging to a single asset module. |
| 83 | message AssetSliceSet { |
| 84 | // Module level metadata. |
| 85 | AssetModuleMetadata asset_module_metadata = 1; |
| 86 | |
| 87 | // Asset slices. |
| 88 | repeated ApkDescription apk_description = 2; |
| 89 | } |
| 90 | |
| 91 | message AssetModuleMetadata { |
| 92 | // Module name. |
| 93 | string name = 1; |
| 94 | |
| 95 | // Indicates the delivery type for persistent install. |
| 96 | DeliveryType delivery_type = 4; |
| 97 | |
| 98 | // Metadata for instant installs. |
| 99 | InstantMetadata instant_metadata = 3; |
| 100 | |
| 101 | // Deprecated. Use delivery_type. |
| 102 | bool on_demand_deprecated = 2 [deprecated = true]; |
| 103 | } |
| 104 | |
| 105 | message InstantMetadata { |
| 106 | // Indicates whether this module is marked "instant". |
| 107 | bool is_instant = 1; |
| 108 | |
| 109 | // Indicates the delivery type for instant install. |
| 110 | DeliveryType delivery_type = 3; |
| 111 | |
| 112 | // Deprecated. Use delivery_type. |
| 113 | bool on_demand_deprecated = 2 [deprecated = true]; |
| 114 | } |
| 115 | |
| 116 | enum DeliveryType { |
| 117 | UNKNOWN_DELIVERY_TYPE = 0; |
| 118 | INSTALL_TIME = 1; |
| 119 | ON_DEMAND = 2; |
| 120 | FAST_FOLLOW = 3; |
| 121 | } |
| 122 | |
| 123 | message ApkDescription { |
| 124 | ApkTargeting targeting = 1; |
| 125 | |
| 126 | // Path to the APK file. |
| 127 | // BEGIN-INTERNAL |
| 128 | // The path may be a blobkey if the proto is not constructed by bundletool. |
| 129 | // END-INTERNAL |
| 130 | string path = 2; |
| 131 | |
| 132 | oneof apk_metadata_oneof_value { |
| 133 | // Set only for Split APKs. |
| 134 | SplitApkMetadata split_apk_metadata = 3; |
| 135 | // Set only for standalone APKs. |
| 136 | StandaloneApkMetadata standalone_apk_metadata = 4; |
| 137 | // Set only for Instant split APKs. |
| 138 | SplitApkMetadata instant_apk_metadata = 5; |
| 139 | // Set only for system APKs. |
| 140 | SystemApkMetadata system_apk_metadata = 6; |
| 141 | // Set only for asset slices. |
| 142 | SplitApkMetadata asset_slice_metadata = 7; |
| 143 | // Set only for APEX APKs. |
| 144 | ApexApkMetadata apex_apk_metadata = 8; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // Holds data specific to Split APKs. |
| 149 | message SplitApkMetadata { |
| 150 | string split_id = 1; |
| 151 | |
| 152 | // Indicates whether this APK is the master split of the module. |
| 153 | bool is_master_split = 2; |
| 154 | } |
| 155 | |
| 156 | // Holds data specific to Standalone APKs. |
| 157 | message StandaloneApkMetadata { |
| 158 | // Names of the modules fused in this standalone APK. |
| 159 | repeated string fused_module_name = 1; |
| 160 | |
| 161 | reserved 2; |
| 162 | } |
| 163 | |
| 164 | // Holds data specific to system APKs. |
| 165 | message SystemApkMetadata { |
| 166 | // Names of the modules fused in this system APK. |
| 167 | repeated string fused_module_name = 1; |
| 168 | enum SystemApkType { |
| 169 | UNSPECIFIED_VALUE = 0; |
| 170 | // Uncompressed APK for system image. |
| 171 | SYSTEM = 1; |
| 172 | // Stub APK for compressed APK in the system image |
| 173 | // (contains only android manifest). |
| 174 | SYSTEM_STUB = 2; |
| 175 | // Compressed APK for system image. |
| 176 | SYSTEM_COMPRESSED = 3; |
| 177 | } |
| 178 | // Indicates whether the APK is uncompressed system APK, stub APK or |
| 179 | // compressed system APK. |
| 180 | SystemApkType system_apk_type = 2; |
| 181 | } |
| 182 | |
| 183 | // Holds data specific to APEX APKs. |
| 184 | message ApexApkMetadata { |
| 185 | // Configuration for processing of APKs embedded in an APEX image. |
| 186 | repeated ApexEmbeddedApkConfig apex_embedded_apk_config = 1; |
| 187 | } |
| 188 | |
| 189 | message LocalTestingInfo { |
| 190 | // Indicates if the bundle is built in local testing mode. |
| 191 | bool enabled = 1; |
| 192 | // The local testing path, as specified in the base manifest. |
| 193 | // This refers to the relative path on the external directory of the app where |
| 194 | // APKs will be pushed for local testing. |
| 195 | // Set only if local testing is enabled. |
| 196 | string local_testing_path = 2; |
| 197 | } |