Commit Graph

265 Commits

Author SHA1 Message Date
7fe58ca0c2 Android 14 - Support for Grammatical Inflection (#3374)
* build: update aapt/aapt2 with win/linux binaries

* docs: add note for specific aapt tag

* test: test for grammatical inflection

* build: update aapt/aapt2 with mac binaries

* build: update aapt/aapt2 with mac binaries (static libstl)
2023-10-08 06:38:10 -04:00
959b6de063 fix: support COMPACT/OFFSET16 packed resources. (#3372)
* fix: support COMPACT/OFFSET16

* fix: properly read specNamesId from compact resources

* fix: properly read OFFSET16 in entries

* test: add assertions for compact/offset16 sample

* refactor: extract flags out of private functions
2023-10-06 07:22:02 -04:00
679c133d21 feat: make aapt2 default (#3370) 2023-10-04 20:52:28 -04:00
515af4faf8 Reworks Attr/Array Handler (#3326)
* test: add example pkcs key

* fix: rework towards ResScalarValue instead of ResIntValue

* fix: prefer res name instead of "guessing" based on ids
2023-09-11 19:01:09 -04:00
a117132e39 Feat: Introduce "res-mode" options. (#3318)
* Revert "Remove Apktool Dummys. (#3258)"

This reverts commit 0e226928ce.

* feat: properly add dummys

* refactor: shorten ResTypeSpec

* style: remove extra space

* refactor: extract FlagItem into own class

* refactor: notate which type is null

* fix: only add dummys if enabled

* feat: skip unknown (if enabled)

* feat: introduce "res-mode"

* feat: expose config on res table

* feat: add method to base attr for res skips

* fix: ensure autobuild doesn't choke

* refactor: remove java17 enhanced switch

* refactor: rename methods

* refactor: cleanup res-mode param

* test: introduction of test/sample apk

* refactor: make ResXmlPatcher public for loading XML

* test: assertions for dummy|leave|retain

* fix: prevent using `@null` as a name

* refactor: shorten long param for 'resm'

* refactor: leave for preserve
2023-09-09 07:29:39 -04:00
81a7e1e434 fix: only mark as sparse if intended application (#3299) 2023-08-27 15:06:58 -04:00
225c9089d9 refactor: remove deprecations from test suite (#3269) 2023-08-13 14:25:32 -04:00
9d7d58016e ApkDecoder use apkFile and unknownFiles from ApkInfo (#3242) 2023-08-01 06:57:22 -04:00
445da0e658 Move to XMLUnit Legacy (#3235)
* build: migrate to xmlunit 2.9.1

* feat: opt into xxe protection for test suite
2023-07-30 13:48:26 -04:00
e19c44b1b1 refactor: drop unused method 2023-07-30 13:16:34 -04:00
33ca2929c9 refactor: clean up style and redundancy (#3232)
* refactor: clean up redundancy

* refactor: no need for both setApkFile and setApkFileName
2023-07-29 18:56:27 -04:00
486fb20084 Support empty resource table. (#3230)
* test: assertions for empty arsc table

* fix: don't crash if no pkgs found
2023-07-29 06:49:13 -04:00
fe93fd21d1 refactor: manual YAML Cleanup (#3229)
* refactor: add missing license headers

* fix: remove unused exceptions

* refactor: remove unused single quote / slash param
2023-07-29 06:14:40 -04:00
62b9eedb9e Remove SnakeYAML for manual YAML Parser (#3191)
* Simple straitforward yaml serialization with minimal needed functionality

* Consolidate ApkInfo tests in the package brut.androlib.apk, unify interface YamlReader and add ApkInfoSerializationTest read -> write -> read test

* remove dependencies from snakeyaml

* remove unused methods

* correct indent test value

* correct style with curly braces

* add test item with hieroglyph
2023-07-29 05:59:15 -04:00
ab7998439e "--no-compile-sdk-metadata" tests. (#3220)
* refactor: move loadDocument() to base

* test: confirm manifest properties are removed/left-alone

* chore: remove unused imports
2023-07-25 07:29:53 -04:00
7f0d94ede9 feat: Introduce --no-compile-sdk-metadata (#3208)
* feat: ignore sdk metadata during aapt2

* test: adjust test suite for aapt2 change
2023-07-25 06:43:15 -04:00
7a4a20ba34 Support explicit operation for when to load full resource table (#3217) 2023-07-25 06:18:13 -04:00
d1a0c941ab Fix LocaleNumberSystem + ConfigFlag reading (#3205)
* fix: prevent over-reading config flags

* fix: properly read localeNumberingSystem

* test: adjust test for bcp47 aapt2 test

* fix: properly add 8 to 'read' on parser

* test: add test for aapt2 bcp47 tag

* test: add additional bcp47 test

* fix: handle numbering system parsing

* fix: add comment about localeNumber usage
2023-07-23 17:25:25 -04:00
54836509ed fix: correct detection of sparse/not-sparse applications (#3201)
* test: add failing/passing sparse/not-sparse test

* fix: replace sparse/not applications w/ official sample

 -ref: c8f71aa67e

* fix: properly detect sparse applications during disassembly

* refactor: remove check on bool set for sparse resources
2023-07-23 11:20:12 -04:00
ca07a0a56c Fix regressions towards apktool.yml generation (#3172)
* fix: prevent blowing out minSdkVersion

* fix: correct naming regression with apk name and sdk info

* chore: comment for why we double up minSdkVersion

* fix: deprecate compressionType

* test: assert apktool format isn't regressed
2023-07-20 05:37:46 -04:00
bdbe1384bf ARSC/AXML Parser Rework (#3131)
* Supports ASRC with null renamed package.
* Rework ASRC Chunk parser to a loop to break assumption of order of chunks
* Break out unknown skips for alignment to ResourceTypes.h
* Add verbose information for file skips
* Add test for protected apk sample
* Rework chunk parsing for StringBlock
* Refactor AXML Parser to support proper header reading
* Fix parsing if attribute size reported does not align to actual size
2023-07-12 05:33:28 -04:00
2b81215846 test: add assertions for unknown files / assets (#3074) 2023-07-04 12:47:26 -04:00
a7e2e3e5e1 Extract into ApkInvoker and split into data classes. (#3124)
* extract AaptInvoker and rename MetaFile to ApkInfo, all decode methods from AndrolibResources moved to the ApkDecoder

* extract ARSCData and FlagsOffset from ARSCDecoder and remove unused imports

* rebase to master

* move decodeManifest and decodeResources to the ResourceDecoder

* remove commented old code
2023-07-03 18:38:52 -04:00
70d941d18d feat: support upside-down-cake/vanilla-ice-cream sdk shorthand (#3113) 2023-07-02 05:35:45 -04:00
40d427e5bd Extract class Framework from AndrolibResources (#3105) 2023-06-27 10:51:26 -04:00
9c495cae29 Move build functions from Androlib to the ApkBuilder (#3103) 2023-06-27 08:25:27 -04:00
10495cbe96 Refactor into common config object. (#3100)
* extract Config

* extract Config

* style: linting

---------

Co-authored-by: Slava Volkov <sv99@inbox.ru>
2023-06-25 15:07:23 -04:00
168aa1abc0 move AndrolidExceptions to the package brut.androlib.exceptions (renamed from brut.androlib.err) (#3088) 2023-06-10 13:16:31 -04:00
fb4889f432 feat: update internal framework to API 34 (Upside Down Cake Preview) (#3063)
* feat: update internal framework to API 34 (Upside Down Cake Preview)

* test: add assertion for API34 property
2023-05-13 06:43:31 -04:00
48b71b34b1 refactor: Replace to nio & apply CS inspection skips (#3055) 2023-05-13 06:12:22 -04:00
35ce8fc061 Issue 2943 - Support raw disassembly w/ AndResGuard (#2944)
* fix: allow copying r/R if in raw mode

* test: assert raw files disassembled from AndResGuard
2022-11-20 08:08:45 -05:00
b7c56c8928 Tests / Style for #2815 (#2817)
* style: reorg getAttributes (StyledString)

* test: assertion for aapt2 string (#2815)
2022-05-23 07:09:27 -04:00
8fab4bfb3d added option to include generic/permissive network security config file durin… (#2791)
* added option to include permissive network security config file during build

* added tests for app with existing network config and for app without

* minor fixes for pull 2791

* refactor: slim down test app for network config

* style: remove extra newlines

* refactor: moved network tests to aapt2

* refactor: remove unused exceptions

* test (aapt2): ensure aapt2 is used for net-sec-conf

* fix (cli): block use of net-sec-conf on aapt1

* fix conflict

Co-authored-by: Connor Tumbleson <connor@sourcetoad.com>
Co-authored-by: Connor Tumbleson <connor.tumbleson@gmail.com>
2022-05-07 06:52:07 -04:00
d38eceedae test (aapt/aapt2): ensure ampersand is escaped on android:label (#2802)
* test (aapt/aapt2): ensure ampersand is escaped on android:label

* build (workflow): ensure test changes force ci rebuild
2022-04-24 17:33:11 -04:00
420406b553 test (aapt2): add assertion for "usesPermissionFlags" (#2790) 2022-03-28 07:07:20 -04:00
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
4065717b45 Preventing instantiation of untrusted classes. (#2760 - CVE-2022-0476)
* fix: enforce allowable classes during yaml parsing

* fix: rename class to reference escaping nature of strings

* test: assertion for parsing malicious yaml
2022-02-19 09:12:04 -05:00
ddc4bb360a Cleanup trailing temp files/folders (#2742)
* test: add missing afterClass to cleanup BRUT* directory

* fix: properly cleanup apkFile temp after buildManifest
2022-01-17 07:19:22 -05:00
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
3b179f8750 refactor: rename ApkOptions -> Options/BuildOptions 2021-09-06 06:59:30 -04:00
99166e3609 refactor: change test name of aapt2 issue 2632 2021-08-30 21:38:01 -04:00
851309dde0 Merge branch 'master' into refine 2021-08-30 21:17:49 -04:00
087142d4cf fix wrong HTML start/end tags in strings.xml (#2631)
* fix wrong HTML start/end tags in strings.xml
2021-08-30 21:15:23 -04:00
5c6d091f39 Merge branch 'master' into refine 2021-08-30 18:48:04 +08:00
caee50b35b test: adjust test for SDK S/T 2021-08-29 07:22:05 -04:00
94ed86db28 Code cleanups 2021-08-27 01:16:46 +08:00
e25c3636ff Update docs & licenses to use https 2021-08-26 07:40:32 -04:00
8d59882e5f Fix: numeric string meta-data value corruption (#2612)
* Fix: handle numeric strings in manifest meta-data value
* fix regex
* scoped solution
* improve comment

Co-authored-by: Cody Lund <colund@microsoft.com>
2021-08-17 07:01:08 -04:00
66b1c30fa0 style: use new form of junit assertions 2021-05-31 06:43:40 -04:00
491d18058a test: fix incorrect 3-byte encoding. 2021-04-03 13:47:13 +03:00