blob: 80bdccbc4dd23410098958daf107b9597c3ce45e [file] [log] [blame]
Iurii Makhno85875a82022-04-26 15:30:01 +00001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto3";
18
19import "frameworks/base/tools/aapt2/Resources.proto";
20
21package aapt.pb;
22
23option java_package = "com.android.aapt";
24
25// Top level message representing data extracted from the APK for 'apkinfo'
26// command.
27message ApkInfo {
28 message XmlFile {
29 string path = 1;
30 XmlNode root = 2;
31 }
32
33 Badging badging = 1;
34 ResourceTable resource_table = 2;
35 repeated XmlFile xml_files = 3;
36}
37
38// Data extracted from the manifest of the APK.
39message Badging {
40 PackageInfo package = 1;
41 Application application = 2;
42 UsesSdk uses_sdk = 3;
43 UsesConfiguration uses_configuration = 4;
44 SupportsScreen supports_screen = 5;
45 SupportsInput supports_input = 6;
46 LaunchableActivity launchable_activity = 7;
47 LeanbackLaunchableActivity leanback_launchable_activity = 8;
48 StaticLibrary static_library = 9;
49 SdkLibrary sdk_library = 10;
50 Overlay overlay = 11;
51 PackageVerifier package_verifier = 12;
52 CompatibleScreens compatible_screens = 13;
53 Architectures architectures = 14;
54 SupportsGlTexture supports_gl_texture = 15;
55 Components components = 16;
56
57 repeated string locales = 17;
58 repeated int32 densities = 18;
59
60 repeated FeatureGroup feature_groups = 53;
61 repeated UsesPermission uses_permissions = 54;
62 repeated Permission permissions = 55;
63 repeated UsesLibrary uses_libraries = 56;
64 repeated UsesStaticLibrary uses_static_libraries = 57;
65 repeated UsesSdkLibrary uses_sdk_libraries = 58;
66 repeated UsesNativeLibrary uses_native_libraries = 59;
67 repeated UsesPackage uses_packages = 51;
68
69 repeated Metadata metadata = 62;
70 repeated Property properties = 63;
71}
72
73// Information extracted about package from <manifest> and
74// <original-package> tags.
75message PackageInfo {
76 enum InstallLocation {
77 DEFAULT_INSTALL_LOCATION = 0;
78 AUTO = 1;
79 INTERNAL_ONLY = 2;
80 PREFER_EXTERNAL = 3;
81 }
82
83 string package = 1;
84 int32 version_code = 2;
85 string version_name = 3;
86
87 string split = 4;
88
89 string platform_version_name = 5;
90 string platform_version_code = 6;
91
92 int32 compile_sdk_version = 7;
93 string compile_sdk_version_codename = 8;
94
95 InstallLocation install_location = 9;
96
97 string original_package = 10;
98}
99
100// Information extracted from <application> element.
101message Application {
102 string label = 1;
103 string icon = 2;
104 string banner = 3;
105
106 bool test_only = 4;
107 bool game = 5;
108 bool debuggable = 6;
109
110 map<string, string> locale_labels = 8;
111 map<int32, string> density_icons = 9;
112}
113
114// Components defined in the APK.
115message Components {
116 bool main = 1;
117 bool other_activities = 2;
118 bool other_receivers = 3;
119 bool other_services = 4;
120
121 repeated string provided_components = 5;
122}
123
124// Application's min and target SDKs.
125message UsesSdk {
126 oneof min_sdk {
127 int32 min_sdk_version = 2;
128 string min_sdk_version_name = 3;
129 }
130 int32 max_sdk_version = 4;
131 oneof target_sdk {
132 int32 target_sdk_version = 5;
133 string target_sdk_version_name = 6;
134 }
135}
136
137message UsesConfiguration {
138 int32 req_touch_screen = 1;
139 int32 req_keyboard_type = 2;
140 int32 req_hard_keyboard = 3;
141 int32 req_navigation = 4;
142 int32 req_five_way_nav = 5;
143}
144
145// Screens supported by this application.
146message SupportsScreen {
147 enum ScreenType {
148 UNSPECIFIED_SCREEN_TYPE = 0;
149 SMALL = 1;
150 NORMAL = 2;
151 LARGE = 3;
152 XLARGE = 4;
153 }
154 repeated ScreenType screens = 1;
155 bool supports_any_densities = 2;
156 int32 requires_smallest_width_dp = 3;
157 int32 compatible_width_limit_dp = 4;
158 int32 largest_width_limit_dp = 5;
159}
160
161// Inputs supported by this application.
162message SupportsInput {
163 repeated string inputs = 1;
164}
165
166// Information about used features which is extracted from <uses-permission>
167// elements or implied from permissions.
168message Feature {
169 message ImpliedData {
170 bool from_sdk_23_permission = 1;
171 repeated string reasons = 2;
172 }
173
174 string name = 1;
175 bool required = 2;
176 int32 version = 3;
177
178 ImpliedData implied_data = 4;
179}
180
181message FeatureGroup {
182 string label = 1;
183 int32 open_gles_version = 2;
184 repeated Feature features = 3;
185}
186
187// Information about permission requested by the application.
188message UsesPermission {
189 message PermissionFlags {
190 bool never_for_location = 1;
191 }
192
193 string name = 1;
194 int32 max_sdk_version = 2;
195 bool required = 3;
196 bool implied = 4;
197 bool sdk23_and_above = 5;
198
199 repeated string required_features = 6;
200 repeated string required_not_features = 7;
201
202 PermissionFlags permission_flags = 8;
203}
204
205// Permission defined by the application.
206message Permission {
207 string name = 1;
208}
209
210// Data extracted about launchable activity. Launchable activity is an entry
211// point on phone and tablet devices.
212message LaunchableActivity {
213 string name = 1;
214 string icon = 2;
215 string label = 3;
216}
217
218// Data extracted about leanback launchable activity. Leanback launchable
219// activity is an entry point on TV devices.
220message LeanbackLaunchableActivity {
221 string name = 1;
222 string icon = 2;
223 string label = 3;
224 string banner = 4;
225}
226
227// Library used by the application.
228message UsesLibrary {
229 string name = 1;
230 bool required = 2;
231}
232
233// Static library this APK declares.
234message StaticLibrary {
235 string name = 1;
236 int32 version = 2;
237 int32 version_major = 3;
238}
239
240// Static library used by the application.
241message UsesStaticLibrary {
242 string name = 1;
243 int32 version = 2;
244 int32 version_major = 3;
245 repeated string certificates = 4;
246}
247
248// SDK library this APK declares.
249message SdkLibrary {
250 string name = 1;
251 int32 version_major = 2;
252}
253
254// SDK library used by the application.
255message UsesSdkLibrary {
256 string name = 1;
257 int32 version_major = 2;
258 repeated string certificates = 3;
259}
260
261// Native library used by the application.
262message UsesNativeLibrary {
263 string name = 1;
264 bool required = 2;
265}
266
267// Information extracted from <meta-data> elements defined across
268// AndroidManifest.xml.
269message Metadata {
270 string name = 1;
271 oneof value {
272 string value_string = 2;
273 int32 value_int = 3;
274 }
275 oneof resource {
276 string resource_string = 4;
277 int32 resource_int = 5;
278 }
279}
280
281// Information about overlay that is declared in the APK.
282message Overlay {
283 string target_package = 1;
284 int32 priority = 2;
285 bool static = 3;
286 string required_property_name = 4;
287 string required_property_value = 5;
288}
289
290// Data extracted from <package-verifier> element.
291message PackageVerifier {
292 string name = 1;
293 string public_key = 2;
294}
295
296// External packages used by the application
297message UsesPackage {
298 string name = 1;
299 string package_type = 2;
300 int32 version = 3;
301 int32 version_major = 4;
302 repeated string certificates = 5;
303}
304
305// Open GL textures format supported by the current application.
306message SupportsGlTexture {
307 repeated string name = 1;
308}
309
310// Screens compatible with the application.
311message CompatibleScreens {
312 message Screen {
313 int32 size = 1;
314 int32 density = 2;
315 }
316
317 repeated Screen screens = 1;
318}
319
320// Architectures supported by the application.
321message Architectures {
322 repeated string architectures = 1;
323 repeated string alt_architectures = 2;
324}
325
326// Information extracted from <property> elements defined across
327// AndroidManifest.xml.
328message Property {
329 string name = 1;
330 oneof value {
331 string value_string = 2;
332 int32 value_int = 3;
333 }
334 oneof resource {
335 string resource_string = 4;
336 int32 resource_int = 5;
337 }
338}