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 | |
Dan Willemsen | 4591b64 | 2021-05-24 14:24:12 -0700 | [diff] [blame^] | 9 | option go_package = "android/soong/cmd/extract_apks/bundle_proto"; |
Sasha Smundak | 7a894a6 | 2020-05-06 21:23:08 -0700 | [diff] [blame] | 10 | option java_package = "com.android.bundle"; |
| 11 | |
| 12 | message BundleConfig { |
| 13 | Bundletool bundletool = 1; |
| 14 | Optimizations optimizations = 2; |
| 15 | Compression compression = 3; |
| 16 | // Resources to be always kept in the master split. |
| 17 | MasterResources master_resources = 4; |
| 18 | ApexConfig apex_config = 5; |
| 19 | // APKs to be signed with the same key as generated APKs. |
| 20 | repeated UnsignedEmbeddedApkConfig unsigned_embedded_apk_config = 6; |
| 21 | AssetModulesConfig asset_modules_config = 7; |
| 22 | |
| 23 | enum BundleType { |
| 24 | REGULAR = 0; |
| 25 | APEX = 1; |
| 26 | ASSET_ONLY = 2; |
| 27 | } |
| 28 | BundleType type = 8; |
| 29 | } |
| 30 | |
| 31 | message Bundletool { |
| 32 | reserved 1; |
| 33 | // Version of BundleTool used to build the Bundle. |
| 34 | string version = 2; |
| 35 | } |
| 36 | |
| 37 | message Compression { |
| 38 | // Glob matching the list of files to leave uncompressed in the APKs. |
| 39 | // The matching is done against the path of files in the APK, thus excluding |
| 40 | // the name of the modules, and using forward slash ("/") as a name separator. |
| 41 | // Examples: "res/raw/**", "assets/**/*.uncompressed", etc. |
| 42 | repeated string uncompressed_glob = 1; |
| 43 | } |
| 44 | |
| 45 | // Resources to keep in the master split. |
| 46 | message MasterResources { |
| 47 | // Resource IDs to be kept in master split. |
| 48 | repeated int32 resource_ids = 1; |
| 49 | // Resource names to be kept in master split. |
| 50 | repeated string resource_names = 2; |
| 51 | } |
| 52 | |
| 53 | message Optimizations { |
| 54 | SplitsConfig splits_config = 1; |
| 55 | // This is for uncompressing native libraries on M+ devices (L+ devices on |
| 56 | // instant apps). |
| 57 | UncompressNativeLibraries uncompress_native_libraries = 2; |
| 58 | // This is for uncompressing dex files on P+ devices. |
| 59 | UncompressDexFiles uncompress_dex_files = 3; |
| 60 | // Configuration for the generation of standalone APKs. |
| 61 | // If no StandaloneConfig is set, the configuration is inherited from |
| 62 | // splits_config. |
| 63 | StandaloneConfig standalone_config = 4; |
| 64 | } |
| 65 | |
| 66 | message UncompressNativeLibraries { |
| 67 | bool enabled = 1; |
| 68 | } |
| 69 | |
| 70 | message UncompressDexFiles { |
| 71 | bool enabled = 1; |
| 72 | } |
| 73 | |
| 74 | // Optimization configuration used to generate Split APKs. |
| 75 | message SplitsConfig { |
| 76 | repeated SplitDimension split_dimension = 1; |
| 77 | } |
| 78 | |
| 79 | // Optimization configuration used to generate Standalone APKs. |
| 80 | message StandaloneConfig { |
| 81 | // Device targeting dimensions to shard. |
| 82 | repeated SplitDimension split_dimension = 1; |
| 83 | // Whether 64 bit libraries should be stripped from Standalone APKs. |
| 84 | bool strip_64_bit_libraries = 2; |
| 85 | } |
| 86 | |
| 87 | message SplitDimension { |
| 88 | enum Value { |
| 89 | UNSPECIFIED_VALUE = 0; |
| 90 | ABI = 1; |
| 91 | SCREEN_DENSITY = 2; |
| 92 | LANGUAGE = 3; |
| 93 | TEXTURE_COMPRESSION_FORMAT = 4; |
| 94 | // BEGIN-INTERNAL |
| 95 | GRAPHICS_API = 5; |
| 96 | // END-INTERNAL |
| 97 | } |
| 98 | Value value = 1; |
| 99 | |
| 100 | // If set to 'true', indicates that APKs should *not* be split by this |
| 101 | // dimension. |
| 102 | bool negate = 2; |
| 103 | |
| 104 | // Optional transformation to be applied to asset directories where |
| 105 | // the targeting is encoded in the directory name (e.g: assets/foo#tcf_etc1) |
| 106 | SuffixStripping suffix_stripping = 3; |
| 107 | } |
| 108 | |
| 109 | message SuffixStripping { |
| 110 | // If set to 'true', indicates that the targeting suffix should be removed |
| 111 | // from assets paths for this dimension when splits (or asset slices) are |
| 112 | // generated. |
| 113 | // This only applies to assets. |
| 114 | // For example a folder with path "assets/level1_textures#tcf_etc1" |
| 115 | // would be outputted to "assets/level1_textures". File contents are |
| 116 | // unchanged. |
| 117 | bool enabled = 1; |
| 118 | |
| 119 | // The default suffix to be used for the cases where separate slices can't |
| 120 | // be generated for this dimension. In the case of standalone/universal APKs |
| 121 | // generation, stripping the suffix can lead to file name collisions. This |
| 122 | // default suffix defines the directories to retain. The others are |
| 123 | // discarded: standalone/universal APKs will contain only directories |
| 124 | // targeted at this value for the dimension. |
| 125 | // |
| 126 | // If not set or empty, the fallback directory in each directory group will be |
| 127 | // used (for example, if both "assets/level1_textures#tcf_etc1" and |
| 128 | // "assets/level1_textures" are present and the default suffix is empty, |
| 129 | // then only "assets/level1_textures" will be used). |
| 130 | string default_suffix = 2; |
| 131 | } |
| 132 | |
| 133 | // Configuration for processing APEX bundles. |
| 134 | // https://source.android.com/devices/tech/ota/apex |
| 135 | message ApexConfig { |
| 136 | // Configuration for processing of APKs embedded in an APEX image. |
| 137 | repeated ApexEmbeddedApkConfig apex_embedded_apk_config = 1; |
| 138 | } |
| 139 | |
| 140 | message ApexEmbeddedApkConfig { |
| 141 | // Android package name of the APK. |
| 142 | string package_name = 1; |
| 143 | |
| 144 | // Path to the APK within the APEX system image. |
| 145 | string path = 2; |
| 146 | } |
| 147 | |
| 148 | message UnsignedEmbeddedApkConfig { |
| 149 | // Path to the APK inside the module (e.g. if the path inside the bundle |
| 150 | // is split/assets/example.apk, this will be assets/example.apk). |
| 151 | string path = 1; |
| 152 | } |
| 153 | |
| 154 | message AssetModulesConfig { |
| 155 | // App versionCodes that will be updated with these asset modules. |
| 156 | // Only relevant for asset-only bundles. |
| 157 | repeated int64 app_version = 1; |
| 158 | |
| 159 | // Version tag for the asset upload. |
| 160 | // Only relevant for asset-only bundles. |
| 161 | string asset_version_tag = 2; |
| 162 | } |