Commit Graph

77 Commits

Author SHA1 Message Date
oSumAtrIX 9443f6fefb
feat: merge iBotPeaches/Apktool 2022-09-23 04:22:53 +02:00
Connor Tumbleson dc3667dbd0
Support Spare Flags (#2887)
* support sparse flag

* style: cs changes

Co-authored-by: R0S <41138521+iamr0s@users.noreply.github.com>
2022-09-19 17:18:35 -04:00
Connor Tumbleson f94cdc5cf3
refactor: mark skips as "fine" to not clog output 2022-07-10 07:38:05 -04:00
Lucaskyy e115848dbc
refactor: get rid of all that logging 2022-06-11 19:24:41 +02:00
Connor Tumbleson fc28ac56ef
Merge pull request #2785 from iBotPeaches/revert-2650-fix-private-reference
Revert "fix: decoding references to private resources"
2022-03-21 07:44:22 -04:00
Connor Tumbleson c300184780
fix: add support for overlay spec skipping 2022-03-21 07:03:14 -04:00
Connor Tumbleson df3b9f7c56
fix: introduce basic staged alias support 2022-03-13 08:34:45 -04:00
Connor Tumbleson e9a3993da8
refactor: rename enums for new overlays/stagedAliases 2022-03-13 08:34:31 -04:00
Yaroslav d29411117e
fix: decoding references to private resources (#2650)
* fix: decoding references to private resources

* style: fix naming in constructor parameter

* test: add test to check build/decode private references
2021-10-17 12:01:54 -04:00
Goooler 94ed86db28 Code cleanups 2021-08-27 01:16:46 +08:00
Goooler e25c3636ff Update docs & licenses to use https 2021-08-26 07:40:32 -04:00
Connor Tumbleson bddf575318
fix: remove no longer used resources on ResPackage 2021-03-28 17:26:08 -04:00
Connor Tumbleson f4c2f9bc50
fix: remove declared exceptions that aren't thrown 2021-03-12 07:47:19 -05:00
Connor Tumbleson 447ba50332
refactor: drop author tags and support javadocs 2021-03-07 15:06:45 -05:00
wangyilei 5a66b2c42d support lib/specType chunk out-of-order reading 2021-03-06 21:58:23 +08:00
Connor Tumbleson 5a54b472d1 fix: set dummy attributes to same type (@null) 2020-11-28 08:59:18 -05:00
Connor Tumbleson 3f831c8221
refactor: copyright year should be year started, not current year 2020-04-11 06:33:05 -04:00
Frieder Bluemle 81ca785e02
Fix file header comment format 2020-02-29 17:37:46 -08:00
Connor Tumbleson 25a1cb02ef
fix: License 2019 update 2019-07-13 12:19:41 -04:00
Vincent Barthelemy 13e356f2ef fix: use the res type spec name to create res bag value
Starting with the version 28.0.3 of the Android SDK build tools,
the internal ids of the items of an array bag seems to have changed.

Because of those changes, array resources were no longer decoded correctly.
They were decoded as style resources.

Instead of using the id of the first item within a resource bag,
the name of the res type spec is now used to choose the correct
resource bag value to create.

Note: a list of "legal names" for resource types  can be found in the source code of aapt2.
2019-01-29 10:07:40 +01:00
Connor Tumbleson 3f8d9fa835 aapt2: patch system for decoding pkgId between 0x7f - 0xff 2018-03-05 10:28:50 -05:00
Connor Tumbleson 0827b2b7a2 aapt2: read the type spec and infer if sparsely packed 2018-02-22 11:22:40 -05:00
Connor Tumbleson b7b449eaaf
We are ignoring typeIdOffset
- missing sample that experiences this
 - needs tests
 - samples requested: https://github.com/iBotPeaches/Apktool/issues/1728
 - refs: f90f2f8dc3
2018-02-16 08:38:07 -05:00
Connor Tumbleson 9fc1ede991
License 2018 update 2018-02-16 08:26:53 -05:00
Connor Tumbleson b525f235f8 code style cleanup 2017-12-08 16:38:31 -05:00
Nic Allen 88eed24625 Patch APKTool to allow repeated entry offsets to appear 2017-12-07 15:38:25 -08:00
Connor Tumbleson 0f4cfcb892 Tweak colorimetry to colorMode 2017-08-23 17:03:51 -04:00
Connor Tumbleson 68a7eb7a74 example applications (sparse & not) tests
- update ARSCDecoder to detail sparse applications
2017-08-23 14:43:57 -04:00
Connor Tumbleson 6473611d47 Initial work for Sparsed Resource Types
- die out if encountered
2017-08-23 14:14:48 -04:00
Connor Tumbleson bf44f9b809 Support for Color HDR & Gamut 2017-08-23 13:53:30 -04:00
Connor Tumbleson eda95b3da2 Don't read more data than entryChunk has
- fixes #1534
2017-07-26 16:21:59 -04:00
Connor Tumbleson 1597c12472 changed all license files 2017-07-05 12:05:52 -04:00
Connor Tumbleson 81b22df13c Merge pull request #1324 from jamestut/arscfix2
Skip additional payload data of TYPE chunk
2016-09-18 16:56:23 -04:00
jamestut 52a44776df Skip additional payload data of TYPE chunk
Some APKs' arsc has additional payload data (like TYPE 8 chunks and/or padding) in the TYPE chunk. After the ARSCDecoder read such kind of chunk, it acts erratically. Most of the time, it just stops parsing the ARSC, therefore, some resources are not decoded because they are not in the apktool's resources' spec table.
2016-09-18 00:13:19 +07:00
Connor Tumbleson 67d80a133f
Ignore the unknown 4 bytes in Android N 2016-08-24 07:56:09 -04:00
Anthony Morris e23eb9cf6b Use Guava's LittleEndianDataInputStream.
This replaces the custom LittleEndianDataInputStream with
guava's implementation. To do this, I had to fix ExtDataInput
to better handle the case where skipBytes doesn't skip all the
bytes (the tests failed without this, and succeed with it). This
appears to be the main difference between the two implementations.
Guava's implementation is preferred because it is already a
dependency and because its license is clearer (the previous
implementation had a vague "public domain" comment in the thread
which may not be legally sufficient).

Fixes #1166
2016-08-05 14:36:34 +01:00
Connor Tumbleson e6faa56c96
Correctly handle ResTable_typeSpec by using unsigned bytes to prevent overflow
- fixes #1185
 - allows applications that have large typeSpec indexes to work
2016-08-01 23:26:00 -04:00
Connor Tumbleson 475178605c
dump header size during failure 2016-07-21 08:29:06 -04:00
Connor Tumbleson ba62238843 Skips unknown bytes if mismatch occurs after reading Configurations
- fixes #1131
2016-04-30 09:02:23 -04:00
Chirayu Desai 26b60364fb Replace little endian data input stream implementation
* Drop LEDataInputStream (which had a restrictive license)
  with LittleEndianDataInputStream, which is public domain.

A minor change has been made to the new class, removing
the interitance of InputStream.
This makes it's behaviour indentical to the previous implementation,
and unit tests pass.

Fixes #1166
Source: http://www.peterfranza.com/2008/09/26/little-endian-input-stream/
2016-03-23 19:58:16 +05:30
Dave Nault 2f1326c6ca #1186 Performance: usage of String.format in ARSCDecoder.addMissingResSpecs
Reduces the time it takes to parse the Android framework by ~50%.

The synthesized name now has no leading zeroes, but this doesn't appear to matter since the numeric part of the name isn't used anywhere.
2016-03-07 11:33:07 -08:00
Connor Tumbleson 52e9e8a4d7 fix spacing & change warning message to use LOGGER 2016-02-16 08:18:26 -05:00
Christopher R. Palmer 4a02f5321c decoder: Extend "keep-broken-res" to also ignore duplicate resources 2016-02-15 11:13:49 -05:00
Connor Tumbleson b2d50bec5f [skip] code style cleanup 2015-12-14 07:10:14 -06:00
Connor Tumbleson eabb7d819b Correctly read sparse ResourceTables.
Prior to this change, APKs usually went Package -> TypeSpec -> Config (all) -> Entries.
Reading all configs under that TypeSpec. Now we have packages that go
Package -> TypeSpec -> Config (single) -> Entries.

So we have to read this correctly to make sure we can correctly decode sparse and packed
Resource tables.
2015-12-14 07:03:09 -06:00
Connor Tumbleson 6c4167fba4 Fixes #1099
- Moves Config --> Type
 - Moves Type -> TypeSpec
 - ResType -> ResTypeSpec
 - ResConfig -> ResType

 This is to match AOSP and ease the transitions/updates of new AOSP drops
2015-12-07 20:48:57 -06:00
Connor Tumbleson 1e5dc3006e Add headerSize & chunkSize to Header class 2015-12-07 07:34:56 -06:00
Connor Tumbleson 8374839427 MNC, noticed recently in API 23, is no longer 0 padded. So mnc001 is now mnc1
- Frameworks between froyo and honeycomb have mnc001, etc
 - A size check of ResConfig header for less than 32 (honeycomb) uses old decode method
 - Greater than 32 bytes moves to new decode method of mnc# vs mnc###
2015-12-01 08:48:31 -06:00
Rover12421 6f617db53f set readConfigFlags read default value to 28
fix if size == 28, remainingSize error.
2015-11-17 14:31:17 +08:00
Connor Tumbleson a29839bab2 Added API 23 qualifier "roundness" 2015-10-08 06:58:11 -05:00