Commit 2b2efb1
authored
refactor: migrate tests to aapt2 + related fixes (#3865)
* refactor: migrate tests to aapt2 + related fixes
All tests have been migrated to aapt2, no tests left for aapt1,
as we phase out support.
Fixed shared library support using a custom option '-l' or '-lib',
that can be specified many times for multiple libs.
On decoding, the dynamic_ref_table is used to determine which
shared libraries were used, and when done they are stored in
ascending order in apktool.yml as a usesLibrary list.
The order within usesLibrary determines the package IDs that will
be dynamically assigned to shared resources on recompile.
Works perfectly with aapt2, doesn't seem to work with aapt1
since it's garbage and never worked properly.
SharedLibraryTest was updated accordingly.
"isFrameworkApk" and "sharedLibrary" flags are obsolete.
We decide aapt options to use by package ID.
values-godzilla dir omitted for now, currently aapt2 doesn't
support it properly (needs more binary patching).
drawableXhdpiTest commented out for now until we decide what
to do with those old Samsung and HTC 9patch drawables.
aapt2 stores them with ".9" or ".r" appended to resource name,
and the decoded files are named ".9.9.qmg" or ".r.r.9.png".
Some variable name tweaks for consistency.
* organize tests logically to minimize imports
* Use camelCase for test methods
* remove old proprietary drawables and restore drawableXhdpiTest1 parent d137d16 commit 2b2efb1
File tree
273 files changed
+813
-1190
lines changed- brut.apktool
- apktool-cli/src/main/java/brut/apktool
- apktool-lib/src
- main/java/brut/androlib
- apk
- res
- data
- value
- decoder
- test
- java/brut/androlib
- aapt1
- aapt2
- apk
- res
- decoder
- src
- xml
- resources
- aapt1
- testapp
- kotlin
- libs
- res
- drawable-xhdpi
- values-en
- values-godzillaui
- values-watch
- values
- aapt2
- pkgid8
- testapp
- assets
- res
- drawable-xhdpi
- values
- xml
- smali_classes2
- smali_classes3
- smali
- unknown/AssetBundle
- assets
- apk
- arbitrary-write
- decode/issue2543
- doctype
- duplicatedex
- empty9patch
- issue1157
- issue1170
- issue1234
- issue1235
- res/values
- issue1244
- issue1264
- issue1456
- issue1481
- smali/com/ibotpeaches/issue1481
- issue1498
- issue1589
- issue1594
- issue1605
- issue1680
- issue1730
- issue1994
- issue2328
- debuggable-false
- res/values
- debuggable-missing
- res/values
- debuggable-true
- res/values
- issue2543
- issue2701
- issue2836
- issue3366
- issue3705
- issue636
- issue767
- network_config
- res
- drawable-hdpi
- drawable-ldpi
- drawable-mdpi
- drawable-nodpi
- drawable-xhdpi
- values
- xml
- smali
- pkgid8
- res/values
- protected_chunks
- res/decoder/issue1522
- sparse
- testapp
- assets
- txt
- unicode-txt
- lib
- res
- drawable-534dpi
- drawable-anydpi
- drawable-hdpi
- drawable-ldpi
- drawable-mdpi
- drawable-nodpi
- drawable-tvdpi
- drawable-xhdpi
- drawable-xxhdpi-v4
- drawable-xxhdpi
- drawable-xxxhdpi
- drawable
- font
- layout
- raw
- values-ar-rXB
- values-ast-rES
- values-ast
- values-b+ast+Hant+IT+ARABEXT
- values-b+ast+Latn+IT+AREVELA
- values-b+de+CH+1901
- values-b+en+Latn+419
- values-b+en+Latn+US
- values-b+en+US+POSIX
- values-b+eng+419
- values-b+iw+660
- values-en-rUS
- values-en
- values-feminine
- values-fr
- values-ldrtl
- values-lowdr-v26
- values-mcc001-mnc00
- values-mcc001-mnc1
- values-mcc001
- values-mcc002
- values-mcc003
- values-mcc238-mnc6
- values-mcc238-mnc870
- values-mnc1
- values-neuter
- values-notround
- values-nowidecg-v26
- values-round
- values-vrheadset-v26
- values-watch
- values-widecg-v26
- values
- xml
- smali_classes2
- smali_classes3
- smali
- unknown
- AssetBundle
- assets
- lib_bug603
- unk_folder
- testjar
- original/META-INF
- smali/com/apktool/test
- unknown_compression
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
273 files changed
+813
-1190
lines changedLines changed: 30 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
365 | 368 | | |
366 | 369 | | |
367 | 370 | | |
| 371 | + | |
368 | 372 | | |
369 | 373 | | |
370 | | - | |
371 | 374 | | |
372 | 375 | | |
373 | 376 | | |
| |||
408 | 411 | | |
409 | 412 | | |
410 | 413 | | |
411 | | - | |
| 414 | + | |
412 | 415 | | |
413 | 416 | | |
414 | 417 | | |
| |||
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
438 | | - | |
| 441 | + | |
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
445 | | - | |
| 448 | + | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
452 | | - | |
| 455 | + | |
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
456 | 467 | | |
457 | 468 | | |
458 | 469 | | |
| |||
469 | 480 | | |
470 | 481 | | |
471 | 482 | | |
472 | | - | |
| 483 | + | |
473 | 484 | | |
474 | 485 | | |
475 | 486 | | |
476 | 487 | | |
477 | 488 | | |
478 | | - | |
479 | | - | |
480 | 489 | | |
| 490 | + | |
| 491 | + | |
481 | 492 | | |
482 | 493 | | |
483 | 494 | | |
| |||
508 | 519 | | |
509 | 520 | | |
510 | 521 | | |
511 | | - | |
| 522 | + | |
512 | 523 | | |
513 | 524 | | |
514 | 525 | | |
515 | 526 | | |
516 | 527 | | |
517 | 528 | | |
518 | | - | |
| 529 | + | |
519 | 530 | | |
520 | 531 | | |
521 | 532 | | |
522 | 533 | | |
523 | 534 | | |
524 | 535 | | |
525 | | - | |
| 536 | + | |
526 | 537 | | |
527 | 538 | | |
528 | 539 | | |
| |||
565 | 576 | | |
566 | 577 | | |
567 | 578 | | |
| 579 | + | |
568 | 580 | | |
569 | 581 | | |
570 | 582 | | |
571 | 583 | | |
572 | 584 | | |
573 | 585 | | |
574 | 586 | | |
| 587 | + | |
575 | 588 | | |
576 | 589 | | |
577 | 590 | | |
| |||
634 | 647 | | |
635 | 648 | | |
636 | 649 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
643 | 656 | | |
644 | 657 | | |
645 | 658 | | |
| |||
Lines changed: 24 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| |||
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
| |||
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
| |||
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
470 | 472 | | |
471 | | - | |
472 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
473 | 482 | | |
474 | 483 | | |
475 | | - | |
476 | | - | |
477 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
478 | 504 | | |
479 | 505 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 506 | + | |
488 | 507 | | |
489 | 508 | | |
490 | 509 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
348 | 358 | | |
349 | 359 | | |
350 | 360 | | |
| |||
Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
227 | 226 | | |
228 | 227 | | |
229 | 228 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | 229 | | |
235 | 230 | | |
236 | 231 | | |
237 | 232 | | |
238 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 259 | | |
264 | 260 | | |
265 | 261 | | |
| |||
280 | 276 | | |
281 | 277 | | |
282 | 278 | | |
283 | | - | |
284 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
285 | 283 | | |
286 | 284 | | |
287 | 285 | | |
288 | 286 | | |
289 | 287 | | |
290 | 288 | | |
291 | | - | |
292 | 289 | | |
293 | 290 | | |
294 | 291 | | |
| |||
0 commit comments