Commit Graph

541 Commits

Author SHA1 Message Date
IgorEisberg
204b742cf0 Avoid abuse of getResTable calls and unneeded checks 2021-07-03 22:46:11 +03:00
IgorEisberg
1fd3f52b9d clean: setTargetSdkVersion used before manifest was decoded 2021-07-03 22:35:59 +03:00
IgorEisberg
992de66bac Handle setAnalysisMode properly 2021-07-03 22:17:00 +03:00
IgorEisberg
bb42159880 style: rename vars for consistency 2021-07-03 21:26:16 +03:00
Connor Tumbleson
a6138f3be4
feat: add helpful message if CantFindFrameworkResException is thrown 2021-06-26 07:02:46 -04:00
Comnir
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
Connor Tumbleson
0a7b843786
fix: cleanup StringBlock from unused methods 2021-03-28 17:26:35 -04:00
Connor Tumbleson
d2288ef921
fix: remove unused smali builder methods 2021-03-28 17:26:19 -04:00
Connor Tumbleson
bddf575318
fix: remove no longer used resources on ResPackage 2021-03-28 17:26:08 -04:00
Connor Tumbleson
618d9b23e5
fix: remove unused methods from Res* data classes 2021-03-28 17:25:37 -04:00
Connor Tumbleson
edb4fc86cc
fix: remove unused methods/properties from AXmlParser 2021-03-28 17:25:16 -04:00
Connor Tumbleson
8a23d0dbc1
refactor: correct spelling mistake of aapt 2021-03-28 10:54:31 -04:00
Connor Tumbleson
f4c2f9bc50
fix: remove declared exceptions that aren't thrown 2021-03-12 07:47:19 -05:00
Connor Tumbleson
4d11c13e44
refactor: remove duplicated code 2021-03-12 07:37:47 -05:00
Connor Tumbleson
447ba50332
refactor: drop author tags and support javadocs 2021-03-07 15:06:45 -05:00
wangyilei
e0e6cfd03f only log string decode warning when failed 2021-03-06 22:00:54 +08:00
wangyilei
5a66b2c42d support lib/specType chunk out-of-order reading 2021-03-06 21:58:23 +08:00
Connor Tumbleson
98aa7acb22 fix: skip files that violate safe filepath 2020-12-11 07:10:05 -05:00
Comnir
f1321c8437 fix issue 2299: Unicode code points higher than 0x10000 decoding fails.
- Use CESU8 decoder instead of UTF-8 in StringBlock.
- DEX uses Modified UTF-8 which is close to CESU-8 (https://source.android.com/devices/tech/dalvik/dex-format#mutf-8)
2020-12-10 12:38:55 +02:00
Comnir
201b5976bb Add tests for StringBlock#decodeString with failing tests for code points above 0x10FFFF (issue 2299). 2020-12-10 12:29:34 +02:00
Connor Tumbleson
6d4e503b16 fix: rename duplicate attributes to not start with numeric 2020-12-04 06:14:27 -05:00
Connor Tumbleson
d63088db9f feat: method to list frameworks 2020-11-30 07:11:08 -05:00
Connor Tumbleson
734793c4bb fix: survive if referent is null (flags) 2020-11-29 09:34:43 -05:00
Connor Tumbleson
5f7630e325 fix: survive if referent is null (enum) 2020-11-29 09:34:43 -05:00
Connor Tumbleson
3ab1a1a5e4 fix: fallback to res-auto namespace if non-android pkg 2020-11-28 16:58:31 -05:00
Connor Tumbleson
150ffc4fdc style: remove weird indented code 2020-11-28 16:58:31 -05:00
Connor Tumbleson
f1393c3ca6 refactor: return null, if always null 2020-11-28 16:58:31 -05:00
Connor Tumbleson
2eac0339b4 refactor: use easier to read string decode 2020-11-28 16:58:31 -05:00
Connor Tumbleson
db70927699 style: remove unused imports 2020-11-28 16:58:31 -05:00
Connor Tumbleson
45ae71204e chore: remove StringBlock unused m_stringOwns 2020-11-28 16:58:31 -05:00
Connor Tumbleson
7cf9a95710 fix: add better error message when can't write framework file 2020-11-28 16:19:29 -05:00
Connor Tumbleson
5a54b472d1 fix: set dummy attributes to same type (@null) 2020-11-28 08:59:18 -05:00
Connor Tumbleson
43010de4e8 style: remove unused import 2020-11-28 06:59:48 -05:00
Connor Tumbleson
b896b4491a fix: prevent NPE during decode app with no matching resId for resource 2020-11-28 06:59:48 -05:00
Connor Tumbleson
3101a05ef6
fix: add development next version (S) - API 31 2020-09-13 08:52:15 -04:00
Connor Tumbleson
6427a28beb
refactor: prevent casting by setting proper types 2020-09-13 08:45:30 -04:00
Connor Tumbleson
943b424172
fix: use proper array syntax 2020-09-13 08:45:05 -04:00
Connor Tumbleson
120c63df75
refactor: remove unused methods/variables 2020-09-13 08:44:40 -04:00
Connor Tumbleson
65eeb2fb4a
refactor: make constant values final 2020-09-13 08:44:08 -04:00
Connor Tumbleson
2720cf93a3
refactor: put same path switch on same line 2020-09-13 08:41:55 -04:00
Connor Tumbleson
35a4bd6718
style: re-org exceptions to have suffix (#2400)
* style: re-org exceptions to have suffix

* fix: add missing exception for ResResSpec
2020-09-13 08:40:03 -04:00
Ankit Pati
8009a10a5d remove executable bit set on .java file 2020-08-09 07:54:51 -04:00
Connor Tumbleson
de5d0e41cf fix: prevent nullying out sdk info when compileSdkVersion is found 2020-06-27 15:21:05 -04:00
Comnir
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
Peter Retzlaff
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
Peter Retzlaff
5db19b3329 Put empty, uncompressed files on doNotCompress list (fixes #2333).
We do not want one empty file to cause all files with that extension to
not be compressed, so we always put the full filename on the doNotCompress
list in this case.
2020-06-09 07:05:43 -04:00
Connor Tumbleson
83a45921ea fix: put the resources.arsc file under STORED compression into framework 2020-04-12 07:27:28 -04: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
b05f19b80d fix: patch aapt2 to not run custom commands on passed aapt2 binary 2019-11-20 06:46:06 -05:00