app-info 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,60 +13,52 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
-
17
16
  syntax = "proto3";
18
-
19
17
  import "Configuration.proto";
20
-
21
18
  package aapt.pb;
22
-
23
19
  option java_package = "com.android.aapt";
24
-
25
20
  // A string pool that wraps the binary form of the C++ class android::ResStringPool.
26
21
  message StringPool {
27
22
  bytes data = 1;
28
23
  }
29
-
30
24
  // The position of a declared entity within a file.
31
25
  message SourcePosition {
32
26
  uint32 line_number = 1;
33
27
  uint32 column_number = 2;
34
28
  }
35
-
36
29
  // Developer friendly source file information for an entity in the resource table.
37
30
  message Source {
38
31
  // The index of the string path within the source string pool of a ResourceTable.
39
32
  uint32 path_idx = 1;
40
33
  SourcePosition position = 2;
41
34
  }
42
-
43
35
  // The name and version fingerprint of a build tool.
44
36
  message ToolFingerprint {
45
37
  string tool = 1;
46
38
  string version = 2;
47
39
  }
48
-
40
+ // References to non local resources
41
+ message DynamicRefTable {
42
+ PackageId package_id = 1;
43
+ string package_name = 2;
44
+ }
49
45
  // Top level message representing a resource table.
50
46
  message ResourceTable {
51
47
  // The string pool containing source paths referenced throughout the resource table. This does
52
48
  // not end up in the final binary ARSC file.
53
49
  StringPool source_pool = 1;
54
-
55
50
  // Resource definitions corresponding to an Android package.
56
51
  repeated Package package = 2;
57
-
58
52
  // The <overlayable> declarations within the resource table.
59
53
  repeated Overlayable overlayable = 3;
60
-
61
54
  // The version fingerprints of the tools that built the resource table.
62
55
  repeated ToolFingerprint tool_fingerprint = 4;
56
+ repeated DynamicRefTable dynamic_ref_table = 5;
63
57
  }
64
-
65
58
  // A package ID in the range [0x00, 0xff].
66
59
  message PackageId {
67
60
  uint32 id = 1;
68
61
  }
69
-
70
62
  // Defines resources for an Android package.
71
63
  message Package {
72
64
  // The package ID of this package, in the range [0x00, 0xff].
@@ -77,33 +69,26 @@ message Package {
77
69
  // - IDs > 0x7f are reserved for the application as well and are treated as feature splits.
78
70
  // This may not be set if no ID was assigned.
79
71
  PackageId package_id = 1;
80
-
81
72
  // The Java compatible Android package name of the app.
82
73
  string package_name = 2;
83
-
84
74
  // The series of types defined by the package.
85
75
  repeated Type type = 3;
86
76
  }
87
-
88
77
  // A type ID in the range [0x01, 0xff].
89
78
  message TypeId {
90
79
  uint32 id = 1;
91
80
  }
92
-
93
81
  // A set of resources grouped under a common type. Such types include string, layout, xml, dimen,
94
82
  // attr, etc. This maps to the second part of a resource identifier in Java (R.type.entry).
95
83
  message Type {
96
84
  // The ID of the type. This may not be set if no ID was assigned.
97
85
  TypeId type_id = 1;
98
-
99
86
  // The name of the type. This corresponds to the 'type' part of a full resource name of the form
100
87
  // package:type/entry. The set of legal type names is listed in Resource.cpp.
101
88
  string name = 2;
102
-
103
89
  // The entries defined for this type.
104
90
  repeated Entry entry = 3;
105
91
  }
106
-
107
92
  // The Visibility of a symbol/entry (public, private, undefined).
108
93
  message Visibility {
109
94
  // The visibility of the resource outside of its package.
@@ -113,54 +98,42 @@ message Visibility {
113
98
  // private one. An unknown visibility, in this case, would cause the resource to be omitted
114
99
  // from either R.java.
115
100
  UNKNOWN = 0;
116
-
117
101
  // A resource was explicitly marked as private. This means the resource can not be accessed
118
102
  // outside of its package unless the @*package:type/entry notation is used (the asterisk being
119
103
  // the private accessor). If two R.java files are generated (private + public), the resource
120
104
  // will only be emitted to the private R.java file.
121
105
  PRIVATE = 1;
122
-
123
106
  // A resource was explicitly marked as public. This means the resource can be accessed
124
107
  // from any package, and is emitted into all R.java files, public and private.
125
108
  PUBLIC = 2;
126
109
  }
127
-
128
110
  Level level = 1;
129
-
130
111
  // The path at which this entry's visibility was defined (eg. public.xml).
131
112
  Source source = 2;
132
-
133
113
  // The comment associated with the <public> tag.
134
114
  string comment = 3;
135
-
136
115
  // Indicates that the resource id may change across builds and that the public R.java identifier
137
116
  // for this resource should not be final. This is set to `true` for resources in `staging-group`
138
117
  // tags.
139
118
  bool staged_api = 4;
140
119
  }
141
-
142
120
  // Whether a resource comes from a compile-time overlay and is explicitly allowed to not overlay an
143
121
  // existing resource.
144
122
  message AllowNew {
145
123
  // Where this was defined in source.
146
124
  Source source = 1;
147
-
148
125
  // Any comment associated with the declaration.
149
126
  string comment = 2;
150
127
  }
151
-
152
128
  // Represents a set of overlayable resources.
153
129
  message Overlayable {
154
130
  // The name of the <overlayable>.
155
131
  string name = 1;
156
-
157
132
  // The location of the <overlayable> declaration in the source.
158
133
  Source source = 2;
159
-
160
134
  // The component responsible for enabling and disabling overlays targeting this <overlayable>.
161
135
  string actor = 3;
162
136
  }
163
-
164
137
  // Represents an overlayable <item> declaration within an <overlayable> tag.
165
138
  message OverlayableItem {
166
139
  enum Policy {
@@ -175,32 +148,25 @@ message OverlayableItem {
175
148
  ACTOR = 8;
176
149
  CONFIG_SIGNATURE = 9;
177
150
  }
178
-
179
151
  // The location of the <item> declaration in source.
180
152
  Source source = 1;
181
-
182
153
  // Any comment associated with the declaration.
183
154
  string comment = 2;
184
-
185
155
  // The policy defined by the enclosing <policy> tag of this <item>.
186
156
  repeated Policy policy = 3;
187
-
188
157
  // The index into overlayable list that points to the <overlayable> tag that contains
189
158
  // this <item>.
190
159
  uint32 overlayable_idx = 4;
191
160
  }
192
-
193
161
  // The staged resource ID definition of a finalized resource.
194
162
  message StagedId {
195
163
  Source source = 1;
196
164
  uint32 staged_id = 2;
197
165
  }
198
-
199
166
  // An entry ID in the range [0x0000, 0xffff].
200
167
  message EntryId {
201
168
  uint32 id = 1;
202
169
  }
203
-
204
170
  // An entry declaration. An entry has a full resource ID that is the combination of package ID,
205
171
  // type ID, and its own entry ID. An entry on its own has no value, but values are defined for
206
172
  // various configurations/variants.
@@ -210,53 +176,41 @@ message Entry {
210
176
  // ID.
211
177
  // This may not be set if no ID was assigned.
212
178
  EntryId entry_id = 1;
213
-
214
179
  // The name of this entry. This corresponds to the 'entry' part of a full resource name of the
215
180
  // form package:type/entry.
216
181
  string name = 2;
217
-
218
182
  // The visibility of this entry (public, private, undefined).
219
183
  Visibility visibility = 3;
220
-
221
184
  // Whether this resource, when originating from a compile-time overlay, is allowed to NOT overlay
222
185
  // any existing resources.
223
186
  AllowNew allow_new = 4;
224
-
225
187
  // Whether this resource can be overlaid by a runtime resource overlay (RRO).
226
188
  OverlayableItem overlayable_item = 5;
227
-
228
189
  // The set of values defined for this entry, each corresponding to a different
229
190
  // configuration/variant.
230
191
  repeated ConfigValue config_value = 6;
231
-
232
192
  // The staged resource ID of this finalized resource.
233
193
  StagedId staged_id = 7;
234
194
  }
235
-
236
195
  // A Configuration/Value pair.
237
196
  message ConfigValue {
238
197
  Configuration config = 1;
239
198
  Value value = 2;
240
199
  }
241
-
242
200
  // The generic meta-data for every value in a resource table.
243
201
  message Value {
244
202
  // Where the value was defined.
245
203
  Source source = 1;
246
-
247
204
  // Any comment associated with the value.
248
205
  string comment = 2;
249
-
250
206
  // Whether the value can be overridden.
251
207
  bool weak = 3;
252
-
253
208
  // The value is either an Item or a CompoundValue.
254
209
  oneof value {
255
210
  Item item = 4;
256
211
  CompoundValue compound_value = 5;
257
212
  }
258
213
  }
259
-
260
214
  // An Item is an abstract type. It represents a value that can appear inline in many places, such
261
215
  // as XML attribute values or on the right hand side of style attribute definitions. The concrete
262
216
  // type is one of the types below. Only one can be set.
@@ -271,7 +225,6 @@ message Item {
271
225
  Primitive prim = 7;
272
226
  }
273
227
  }
274
-
275
228
  // A CompoundValue is an abstract type. It represents a value that is a made of other values.
276
229
  // These can only usually appear as top-level resources. The concrete type is one of the types
277
230
  // below. Only one can be set.
@@ -285,82 +238,63 @@ message CompoundValue {
285
238
  MacroBody macro = 6;
286
239
  }
287
240
  }
288
-
289
241
  // Message holding a boolean, so it can be optionally encoded.
290
242
  message Boolean {
291
243
  bool value = 1;
292
244
  }
293
-
294
245
  // A value that is a reference to another resource. This reference can be by name or resource ID.
295
246
  message Reference {
296
247
  enum Type {
297
248
  // A plain reference (@package:type/entry).
298
249
  REFERENCE = 0;
299
-
300
250
  // A reference to a theme attribute (?package:type/entry).
301
251
  ATTRIBUTE = 1;
302
252
  }
303
-
304
253
  Type type = 1;
305
-
306
254
  // The resource ID (0xPPTTEEEE) of the resource being referred. This is optional.
307
255
  uint32 id = 2;
308
-
309
256
  // The name of the resource being referred. This is optional if the resource ID is set.
310
257
  string name = 3;
311
-
312
258
  // Whether this reference is referencing a private resource (@*package:type/entry).
313
259
  bool private = 4;
314
-
315
260
  // Whether this reference is dynamic.
316
261
  Boolean is_dynamic = 5;
317
-
318
262
  // The type flags used when compiling the reference. Used for substituting the contents of macros.
319
263
  uint32 type_flags = 6;
320
-
321
264
  // Whether raw string values would have been accepted in place of this reference definition. Used
322
265
  // for substituting the contents of macros.
323
266
  bool allow_raw = 7;
324
267
  }
325
-
326
268
  // A value that represents an ID. This is just a placeholder, as ID values are used to occupy a
327
269
  // resource ID (0xPPTTEEEE) as a unique identifier. Their value is unimportant.
328
270
  message Id {
329
271
  }
330
-
331
272
  // A value that is a string.
332
273
  message String {
333
274
  string value = 1;
334
275
  }
335
-
336
276
  // A value that is a raw string, which is unescaped/uninterpreted. This is typically used to
337
277
  // represent the value of a style attribute before the attribute is compiled and the set of
338
278
  // allowed values is known.
339
279
  message RawString {
340
280
  string value = 1;
341
281
  }
342
-
343
282
  // A string with styling information, like html tags that specify boldness, italics, etc.
344
283
  message StyledString {
345
284
  // The raw text of the string.
346
285
  string value = 1;
347
-
348
286
  // A Span marks a region of the string text that is styled.
349
287
  message Span {
350
288
  // The name of the tag, and its attributes, encoded as follows:
351
289
  // tag_name;attr1=value1;attr2=value2;[...]
352
290
  string tag = 1;
353
-
354
291
  // The first character position this span applies to, in UTF-16 offset.
355
292
  uint32 first_char = 2;
356
-
357
293
  // The last character position this span applies to, in UTF-16 offset.
358
294
  uint32 last_char = 3;
359
295
  }
360
-
361
296
  repeated Span span = 2;
362
297
  }
363
-
364
298
  // A value that is a reference to an external entity, like an XML file or a PNG.
365
299
  message FileReference {
366
300
  enum Type {
@@ -369,15 +303,12 @@ message FileReference {
369
303
  BINARY_XML = 2;
370
304
  PROTO_XML = 3;
371
305
  }
372
-
373
306
  // Path to a file within the APK (typically res/type-config/entry.ext).
374
307
  string path = 1;
375
-
376
308
  // The type of file this path points to. For UAM bundle, this cannot be
377
309
  // BINARY_XML.
378
310
  Type type = 2;
379
311
  }
380
-
381
312
  // A value that represents a primitive data type (float, int, boolean, etc.).
382
313
  // Refer to Res_value in ResourceTypes.h for info on types and formatting
383
314
  message Primitive {
@@ -402,28 +333,22 @@ message Primitive {
402
333
  float fraction_value_deprecated = 5 [deprecated=true];
403
334
  }
404
335
  }
405
-
406
336
  // A value that represents an XML attribute and what values it accepts.
407
337
  message Attribute {
408
338
  // A Symbol used to represent an enum or a flag.
409
339
  message Symbol {
410
340
  // Where the enum/flag item was defined.
411
341
  Source source = 1;
412
-
413
342
  // Any comments associated with the enum or flag.
414
343
  string comment = 2;
415
-
416
344
  // The name of the enum/flag as a reference. Enums/flag items are generated as ID resource
417
345
  // values.
418
346
  Reference name = 3;
419
-
420
347
  // The value of the enum/flag.
421
348
  uint32 value = 4;
422
-
423
349
  // The data type of the enum/flag as defined in android::Res_value.
424
350
  uint32 type = 5;
425
351
  }
426
-
427
352
  // Bitmask of formats allowed for an attribute.
428
353
  enum FormatFlags {
429
354
  NONE = 0x0; // Proto3 requires a default of 0.
@@ -441,51 +366,39 @@ message Attribute {
441
366
  FLAGS = 0x00020000; // Allows flags that are defined in the Attribute's symbols.
442
367
  // ENUM and FLAGS cannot BOTH be set.
443
368
  }
444
-
445
369
  // A bitmask of types that this XML attribute accepts. Corresponds to the flags in the
446
370
  // enum FormatFlags.
447
371
  uint32 format_flags = 1;
448
-
449
372
  // The smallest integer allowed for this XML attribute. Only makes sense if the format includes
450
373
  // FormatFlags::INTEGER.
451
374
  int32 min_int = 2;
452
-
453
375
  // The largest integer allowed for this XML attribute. Only makes sense if the format includes
454
376
  // FormatFlags::INTEGER.
455
377
  int32 max_int = 3;
456
-
457
378
  // The set of enums/flags defined in this attribute. Only makes sense if the format includes
458
379
  // either FormatFlags::ENUM or FormatFlags::FLAGS. Having both is an error.
459
380
  repeated Symbol symbol = 4;
460
381
  }
461
-
462
382
  // A value that represents a style.
463
383
  message Style {
464
384
  // An XML attribute/value pair defined in the style.
465
385
  message Entry {
466
386
  // Where the entry was defined.
467
387
  Source source = 1;
468
-
469
388
  // Any comments associated with the entry.
470
389
  string comment = 2;
471
-
472
390
  // A reference to the XML attribute.
473
391
  Reference key = 3;
474
-
475
392
  // The Item defined for this XML attribute.
476
393
  Item item = 4;
477
394
  }
478
-
479
395
  // The optinal style from which this style inherits attributes.
480
396
  Reference parent = 1;
481
-
482
397
  // The source file information of the parent inheritance declaration.
483
398
  Source parent_source = 2;
484
-
485
399
  // The set of XML attribute/value pairs for this style.
486
400
  repeated Entry entry = 3;
487
401
  }
488
-
489
402
  // A value that represents a <declare-styleable> XML resource. These are not real resources and
490
403
  // only end up as Java fields in the generated R.java. They do not end up in the binary ARSC file.
491
404
  message Styleable {
@@ -493,36 +406,28 @@ message Styleable {
493
406
  message Entry {
494
407
  // Where the attribute was defined within the <declare-styleable> block.
495
408
  Source source = 1;
496
-
497
409
  // Any comments associated with the declaration.
498
410
  string comment = 2;
499
-
500
411
  // The reference to the attribute.
501
412
  Reference attr = 3;
502
413
  }
503
-
504
414
  // The set of attribute declarations.
505
415
  repeated Entry entry = 1;
506
416
  }
507
-
508
417
  // A value that represents an array of resource values.
509
418
  message Array {
510
419
  // A single element of the array.
511
420
  message Element {
512
421
  // Where the element was defined.
513
422
  Source source = 1;
514
-
515
423
  // Any comments associated with the element.
516
424
  string comment = 2;
517
-
518
425
  // The value assigned to this element.
519
426
  Item item = 3;
520
427
  }
521
-
522
428
  // The list of array elements.
523
429
  repeated Element element = 1;
524
430
  }
525
-
526
431
  // A value that represents a string and its many variations based on plurality.
527
432
  message Plural {
528
433
  // The arity of the plural.
@@ -534,26 +439,20 @@ message Plural {
534
439
  MANY = 4;
535
440
  OTHER = 5;
536
441
  }
537
-
538
442
  // The plural value for a given arity.
539
443
  message Entry {
540
444
  // Where the plural was defined.
541
445
  Source source = 1;
542
-
543
446
  // Any comments associated with the plural.
544
447
  string comment = 2;
545
-
546
448
  // The arity of the plural.
547
449
  Arity arity = 3;
548
-
549
450
  // The value assigned to this plural.
550
451
  Item item = 4;
551
452
  }
552
-
553
453
  // The set of arity/plural mappings.
554
454
  repeated Entry entry = 1;
555
455
  }
556
-
557
456
  // Defines an abstract XmlNode that must be either an XmlElement, or
558
457
  // a text node represented by a string.
559
458
  message XmlNode {
@@ -561,54 +460,41 @@ message XmlNode {
561
460
  XmlElement element = 1;
562
461
  string text = 2;
563
462
  }
564
-
565
463
  // Source line and column info.
566
464
  SourcePosition source = 3;
567
465
  }
568
-
569
466
  // An <element> in an XML document.
570
467
  message XmlElement {
571
468
  // Namespaces defined on this element.
572
469
  repeated XmlNamespace namespace_declaration = 1;
573
-
574
470
  // The namespace URI of this element.
575
471
  string namespace_uri = 2;
576
-
577
472
  // The name of this element.
578
473
  string name = 3;
579
-
580
474
  // The attributes of this element.
581
475
  repeated XmlAttribute attribute = 4;
582
-
583
476
  // The children of this element.
584
477
  repeated XmlNode child = 5;
585
478
  }
586
-
587
479
  // A namespace declaration on an XmlElement (xmlns:android="http://...").
588
480
  message XmlNamespace {
589
481
  string prefix = 1;
590
482
  string uri = 2;
591
-
592
483
  // Source line and column info.
593
484
  SourcePosition source = 3;
594
485
  }
595
-
596
486
  // An attribute defined on an XmlElement (android:text="...").
597
487
  message XmlAttribute {
598
488
  string namespace_uri = 1;
599
489
  string name = 2;
600
490
  string value = 3;
601
-
602
491
  // Source line and column info.
603
492
  SourcePosition source = 4;
604
-
605
493
  // The optional resource ID (0xPPTTEEEE) of the attribute.
606
494
  uint32 resource_id = 5;
607
-
608
495
  // The optional interpreted/compiled version of the `value` string.
609
496
  Item compiled_item = 6;
610
497
  }
611
-
612
498
  message MacroBody {
613
499
  string raw_string = 1;
614
500
  StyleString style_string = 2;
@@ -616,13 +502,11 @@ message MacroBody {
616
502
  repeated NamespaceAlias namespace_stack = 4;
617
503
  SourcePosition source = 5;
618
504
  }
619
-
620
505
  message NamespaceAlias {
621
506
  string prefix = 1;
622
507
  string package_name = 2;
623
508
  bool is_private = 3;
624
509
  }
625
-
626
510
  message StyleString {
627
511
  message Span {
628
512
  string name = 1;
@@ -632,7 +516,6 @@ message StyleString {
632
516
  string str = 1;
633
517
  repeated Span spans = 2;
634
518
  }
635
-
636
519
  message UntranslatableSection {
637
520
  uint64 start_index = 1;
638
521
  uint64 end_index = 2;