Commit Graph

246 Commits

Author SHA1 Message Date
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
f10060fe8f fix: when decoding with UTF-8 fails, create a new buffer for the retry with CESU-8.
If the decoding fails and there are UTF-8 decodable bytes before the bytes that couldn't be decoded, then the read index of the original buffer is incremented and those bytes will be missing from the decode result.
Now we create a new buffer and the decoding will start at the original start offset.

issue #2546
2021-04-03 13:28:22 +03:00
468ead8f10 test: add testcase for static field values 2021-03-28 07:44:16 -04:00
447ba50332 refactor: drop author tags and support javadocs 2021-03-07 15:06:45 -05:00
b17832f0e1 style: add missing license headers 2020-12-11 07:07:54 -05:00
785cb4f89d test: add High Brightness Symbol into tests for feature test against #2299 2020-12-11 07:06:14 -05:00
961f1f94f6 Rename variables in tests. 2020-12-10 14:44:01 +02:00
201b5976bb Add tests for StringBlock#decodeString with failing tests for code points above 0x10FFFF (issue 2299). 2020-12-10 12:29:34 +02:00
6bd1ab603b test: add triple dex test to aapt1 2020-11-27 10:51:54 -05:00
5658c959b4 test: add triple dex test on aapt2 2020-11-27 10:51:54 -05:00
231ce72483 test: add more tests for #2386 2020-11-27 09:22:41 -05:00
d6f84df00b fix: leading 0s not supported in aapt anymore 2020-11-27 09:22:41 -05:00
3101a05ef6 fix: add development next version (S) - API 31 2020-09-13 08:52:15 -04:00
ecbcfb437e match test apk name with the relevant issue. 2020-06-09 07:08:22 -04:00
306959a6fb fix the usage of debug flag (-d) when using aapt2
- when using aapt and debug flag, we remove the 'debuggable' attribute from AndroidManifest and aapt adds it back. (see issue 1621)
- when using aapt2 and debug flag, we add and set the value of 'debuggable' attribute ourselves.
2020-06-09 07:08:22 -04:00
408050ffde Add tests to ensure empty, uncompressed files are put on the doNotCompress list.
Also, fix a bug where ext would retain its value from a previous
iteration of the loop, since we don't always overwrite it now.
2020-06-09 07:05:43 -04:00
05f81f9dd0 Change zero-byte-file tests so they test the correct behavior.
* The empty test file needs to be STORED in the testapp, so put it on
  the initial doNotCompress list.
* It needs to have a file extension that matches the NO_COMPRESS_PATTERN.
* assertNotSame tests for object equality, which doesn't work for String
  comparisons.
2020-06-09 07:05:43 -04:00
3f831c8221 refactor: copyright year should be year started, not current year 2020-04-11 06:33:05 -04:00
81ca785e02 Fix file header comment format 2020-02-29 17:37:46 -08:00
dc312a5336 Fixes issue with decoding apk containing a zero byte 9patch 2019-09-19 13:34:06 +02:00