summaryrefslogtreecommitdiff
path: root/tools/aapt2/ApkInfo.proto
blob: 80bdccbc4dd23410098958daf107b9597c3ce45e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

import "frameworks/base/tools/aapt2/Resources.proto";

package aapt.pb;

option java_package = "com.android.aapt";

// Top level message representing data extracted from the APK for 'apkinfo'
// command.
message ApkInfo {
  message XmlFile {
    string path = 1;
    XmlNode root = 2;
  }

  Badging badging = 1;
  ResourceTable resource_table = 2;
  repeated XmlFile xml_files = 3;
}

// Data extracted from the manifest of the APK.
message Badging {
  PackageInfo package = 1;
  Application application = 2;
  UsesSdk uses_sdk = 3;
  UsesConfiguration uses_configuration = 4;
  SupportsScreen supports_screen = 5;
  SupportsInput supports_input = 6;
  LaunchableActivity launchable_activity = 7;
  LeanbackLaunchableActivity leanback_launchable_activity = 8;
  StaticLibrary static_library = 9;
  SdkLibrary sdk_library = 10;
  Overlay overlay = 11;
  PackageVerifier package_verifier = 12;
  CompatibleScreens compatible_screens = 13;
  Architectures architectures = 14;
  SupportsGlTexture supports_gl_texture = 15;
  Components components = 16;

  repeated string locales = 17;
  repeated int32 densities = 18;

  repeated FeatureGroup feature_groups = 53;
  repeated UsesPermission uses_permissions = 54;
  repeated Permission permissions = 55;
  repeated UsesLibrary uses_libraries = 56;
  repeated UsesStaticLibrary uses_static_libraries = 57;
  repeated UsesSdkLibrary uses_sdk_libraries = 58;
  repeated UsesNativeLibrary uses_native_libraries = 59;
  repeated UsesPackage uses_packages = 51;

  repeated Metadata metadata = 62;
  repeated Property properties = 63;
}

// Information extracted about package from <manifest> and
// <original-package> tags.
message PackageInfo {
  enum InstallLocation {
    DEFAULT_INSTALL_LOCATION = 0;
    AUTO = 1;
    INTERNAL_ONLY = 2;
    PREFER_EXTERNAL = 3;
  }

  string package = 1;
  int32 version_code = 2;
  string version_name = 3;

  string split = 4;

  string platform_version_name = 5;
  string platform_version_code = 6;

  int32 compile_sdk_version = 7;
  string compile_sdk_version_codename = 8;

  InstallLocation install_location = 9;

  string original_package = 10;
}

// Information extracted from <application> element.
message Application {
  string label = 1;
  string icon = 2;
  string banner = 3;

  bool test_only = 4;
  bool game = 5;
  bool debuggable = 6;

  map<string, string> locale_labels = 8;
  map<int32, string> density_icons = 9;
}

// Components defined in the APK.
message Components {
  bool main = 1;
  bool other_activities = 2;
  bool other_receivers = 3;
  bool other_services = 4;

  repeated string provided_components = 5;
}

// Application's min and target SDKs.
message UsesSdk {
  oneof min_sdk {
    int32 min_sdk_version = 2;
    string min_sdk_version_name = 3;
  }
  int32 max_sdk_version = 4;
  oneof target_sdk {
    int32 target_sdk_version = 5;
    string target_sdk_version_name = 6;
  }
}

message UsesConfiguration {
  int32 req_touch_screen = 1;
  int32 req_keyboard_type = 2;
  int32 req_hard_keyboard = 3;
  int32 req_navigation = 4;
  int32 req_five_way_nav = 5;
}

// Screens supported by this application.
message SupportsScreen {
  enum ScreenType {
    UNSPECIFIED_SCREEN_TYPE = 0;
    SMALL = 1;
    NORMAL = 2;
    LARGE = 3;
    XLARGE = 4;
  }
  repeated ScreenType screens = 1;
  bool supports_any_densities = 2;
  int32 requires_smallest_width_dp = 3;
  int32 compatible_width_limit_dp = 4;
  int32 largest_width_limit_dp = 5;
}

// Inputs supported by this application.
message SupportsInput {
  repeated string inputs = 1;
}

// Information about used features which is extracted from <uses-permission>
// elements or implied from permissions.
message Feature {
  message ImpliedData {
      bool from_sdk_23_permission = 1;
      repeated string reasons = 2;
  }

  string name = 1;
  bool required = 2;
  int32 version = 3;

  ImpliedData implied_data = 4;
}

message FeatureGroup {
  string label = 1;
  int32 open_gles_version = 2;
  repeated Feature features = 3;
}

// Information about permission requested by the application.
message UsesPermission {
  message PermissionFlags {
    bool never_for_location = 1;
  }

  string name = 1;
  int32 max_sdk_version = 2;
  bool required = 3;
  bool implied = 4;
  bool sdk23_and_above = 5;

  repeated string required_features = 6;
  repeated string required_not_features = 7;

  PermissionFlags permission_flags = 8;
}

// Permission defined by the application.
message Permission {
  string name = 1;
}

// Data extracted about launchable activity. Launchable activity is an entry
// point on phone and tablet devices.
message LaunchableActivity {
  string name = 1;
  string icon = 2;
  string label = 3;
}

// Data extracted about leanback launchable activity. Leanback launchable
// activity is an entry point on TV devices.
message LeanbackLaunchableActivity {
  string name = 1;
  string icon = 2;
  string label = 3;
  string banner = 4;
}

// Library used by the application.
message UsesLibrary {
  string name = 1;
  bool required = 2;
}

// Static library this APK declares.
message StaticLibrary {
  string name = 1;
  int32 version = 2;
  int32 version_major = 3;
}

// Static library used by the application.
message UsesStaticLibrary {
  string name = 1;
  int32 version = 2;
  int32 version_major = 3;
  repeated string certificates = 4;
}

// SDK library this APK declares.
message SdkLibrary {
  string name = 1;
  int32 version_major = 2;
}

// SDK library used by the application.
message UsesSdkLibrary {
  string name = 1;
  int32 version_major = 2;
  repeated string certificates = 3;
}

// Native library used by the application.
message UsesNativeLibrary {
  string name = 1;
  bool required = 2;
}

// Information extracted from <meta-data> elements defined across
// AndroidManifest.xml.
message Metadata {
  string name = 1;
  oneof value {
    string value_string = 2;
    int32 value_int = 3;
  }
  oneof resource {
    string resource_string = 4;
    int32 resource_int = 5;
  }
}

// Information about overlay that is declared in the APK.
message Overlay {
  string target_package = 1;
  int32 priority = 2;
  bool static = 3;
  string required_property_name = 4;
  string required_property_value = 5;
}

// Data extracted from <package-verifier> element.
message PackageVerifier {
  string name = 1;
  string public_key = 2;
}

// External packages used by the application
message UsesPackage {
  string name = 1;
  string package_type = 2;
  int32 version = 3;
  int32 version_major = 4;
  repeated string certificates = 5;
}

// Open GL textures format supported by the current application.
message SupportsGlTexture {
  repeated string name = 1;
}

// Screens compatible with the application.
message CompatibleScreens {
  message Screen {
    int32 size = 1;
    int32 density = 2;
  }

  repeated Screen screens = 1;
}

// Architectures supported by the application.
message Architectures {
  repeated string architectures = 1;
  repeated string alt_architectures = 2;
}

// Information extracted from <property> elements defined across
// AndroidManifest.xml.
message Property {
  string name = 1;
  oneof value {
    string value_string = 2;
    int32 value_int = 3;
  }
  oneof resource {
    string resource_string = 4;
    int32 resource_int = 5;
  }
}