Commit Graph

904 Commits

Author SHA1 Message Date
Connor Tumbleson
2e3f22af7c
refactor: log first package if 2 2021-08-30 20:59:38 -04:00
Goooler
5c6d091f39 Merge branch 'master' into refine 2021-08-30 18:48:04 +08:00
Connor Tumbleson
a0c2fef83b feat: new aapt1/aap2 binaries for mac (static) 2021-08-29 11:50:36 -04:00
Connor Tumbleson
caee50b35b test: adjust test for SDK S/T 2021-08-29 07:22:05 -04:00
Connor Tumbleson
f4a75fe761 refactor: remove SDK name from development sdk version 2021-08-29 07:22:05 -04:00
Connor Tumbleson
b80d13b56a fix: add support for proper API 31/S (12) + API 32/T (13) 2021-08-29 07:22:05 -04:00
Connor
fc2f12363d feat: new windows/linux aapt/aapt2 binaries 2021-08-28 14:27:30 -04:00
Connor Tumbleson
394394c3b5 feat: add new aapt/aapt2 binaries 2021-08-28 14:27:30 -04:00
Goooler
c3e8be3e8a Reformat & Rearrange 2021-08-27 01:32:40 +08: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
Cody Lund
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
Connor Tumbleson
eaab729be5
build: remove deprecated jcenter repo location 2021-07-05 19:44:30 -04:00
Connor Tumbleson
e4654e0b5f
fix: write dummy resources as items 2021-07-04 09:49:59 -04:00
IgorEisberg
fad2f99541 style: return DexFile interface from SmaliDecoder 2021-07-04 14:12:38 +03:00
IgorEisberg
6cfa79e456 Determine minSdkVersion with baksmali for JARs + don't compress webp
We take advantage of the fact that baksmali can determine the minimum API version needed for a given collection of opcodes and extract it, then save to mMinSdkVersion, which is only used by smali via buildSourcesSmali.
This change, in addition to my previous change, allows to decompile and recompile JARs without worrying about specifying an API version via -api/--api-level.

As an extra, added webp file extension to NO_COMPRESS_PATTERN, according to AAPT2 standards, and since it's factually never compresses as it's an already compressed format.
https://cs.android.com/android/platform/superproject/+/master:frameworks/base/tools/aapt2/cmd/Link.cpp;l=2328
2021-07-04 02:14:56 +03:00
IgorEisberg
1ed1076a84 correction: don't clear resource table if it was already loaded 2021-07-04 00:16:22 +03:00
IgorEisberg
88d3d0038c style: organize some using statements for consistency 2021-07-03 23:24:42 +03:00
IgorEisberg
83f9693633 clean: get rid of useless throws 2021-07-03 23:15:10 +03:00
IgorEisberg
1472b50541 fix: pass opcodes=null for baksmali to auto-determine by dex version
When DexBackedDexFile gets opcodes==null, it calls getDefaultOpcodes(dexVersion) which returns the appropriate opcodes for the given dex version. No hints are required for baksmali, but only needed for smali.
https://github.com/JesusFreke/smali/blob/master/dexlib2/src/main/java/org/jf/dexlib2/dexbacked/DexBackedDexFile.java#L83
2021-07-03 23:05:04 +03:00
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
Goooler
d65c88a447 Merge branch 'master' into gradle7
# Conflicts:
#	build.gradle
2021-07-01 11:12:17 +08:00
Connor Tumbleson
a6138f3be4
feat: add helpful message if CantFindFrameworkResException is thrown 2021-06-26 07:02:46 -04:00
Connor Tumbleson
9f8ddb1bb0
feat: update internal framework to API 31 (S Beta 4) 2021-06-02 06:21:30 -04:00
Connor Tumbleson
66b1c30fa0
style: use new form of junit assertions 2021-05-31 06:43:40 -04:00
Goooler
076ade6a51 TestImplementation jUnit in depends 2021-04-25 22:40:46 +08:00
Goooler
8a8cd6eb89 Bump versions 2021-04-22 18:14:18 -04:00
pashamcr
c57a731d17 Update gradle to 7.0
Signed-off-by: pashamcr <36408873+pashamcr@users.noreply.github.com>
2021-04-16 11:22:17 +03:00
Goooler
3352088d00 Add proguard rule 2021-04-14 06:33:21 -04:00
Comnir
491d18058a test: fix incorrect 3-byte encoding. 2021-04-03 13:47:13 +03: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
468ead8f10
test: add testcase for static field values 2021-03-28 07:44:16 -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
e9a897febe
build: syntax updates for gradle files 2021-03-04 07:21:22 -05:00
Connor Tumbleson
98aa7acb22 fix: skip files that violate safe filepath 2020-12-11 07:10:05 -05:00
Connor Tumbleson
b17832f0e1
style: add missing license headers 2020-12-11 07:07:54 -05:00
Connor Tumbleson
785cb4f89d
test: add High Brightness Symbol into tests for feature test against #2299 2020-12-11 07:06:14 -05:00
Comnir
961f1f94f6 Rename variables in tests. 2020-12-10 14:44:01 +02: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
d1c006b260
build: add latest linux/windows/mac aapt|aapt2 binaries (#2450)
* build: add latest linux/windows aapt|aapt2 binaries

* build: add latest mac aapt|aapt2 binaries
2020-12-03 06:18:01 -05:00
Connor Tumbleson
d63088db9f feat: method to list frameworks 2020-11-30 07:11:08 -05:00
Connor Tumbleson
db1fe98524 feat: usage output for 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
2d41305998
fix: v2.6.0 not v1.6.0 2020-11-28 21:15:30 -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
4f13bcad48 fix: add message explaining deprecation of 32bit 2020-11-28 16:26:00 -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
a91aad461e
fix: secure links in usage output 2020-11-28 16:18:54 -05:00
Connor Tumbleson
693d8d1fbf
style: copyright year to start of project 2020-11-28 16:18:40 -05:00
Connor Tumbleson
590f9c1392
fix: remove warning about smali-debugging 2020-11-28 09:10:37 -05:00
Connor Tumbleson
94e224ee3f
fix: delay -c removal till 2.6 2020-11-28 08:59:48 -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
cd7405d31b build: update add latest mac aapt|aapt2 binaries 2020-11-27 15:55:36 -05:00
Connor Tumbleson
3043266ee5 build: update add latest linux/windows aapt|aapt2 binaries 2020-11-27 15:55:36 -05:00
Connor Tumbleson
6bd1ab603b test: add triple dex test to aapt1 2020-11-27 10:51:54 -05:00
Connor Tumbleson
5658c959b4 test: add triple dex test on aapt2 2020-11-27 10:51:54 -05:00
Connor Tumbleson
9170c5a04b build: fix chmod on mac binaries 2020-11-27 09:22:41 -05:00
Connor Tumbleson
1dfac6d8bf build: add latest linux/windows aapt|aapt2 binaries 2020-11-27 09:22:41 -05:00
Connor Tumbleson
d7e27ffc69 build: add latest mac aapt|aapt2 binaries (API 30) 2020-11-27 09:22:41 -05:00
Connor Tumbleson
231ce72483 test: add more tests for #2386 2020-11-27 09:22:41 -05:00
Connor Tumbleson
c501952c69 build: add latest linux/windows aapt|aapt2 binaries (API 30) 2020-11-27 09:22:41 -05:00
Connor Tumbleson
d6f84df00b fix: leading 0s not supported in aapt anymore 2020-11-27 09:22:41 -05:00
Connor Tumbleson
efeb09e037 build: add latest linux/windows aapt|aapt2 binaries 2020-11-27 09:22:41 -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
Connor Tumbleson
22fdee4d2e
feat: update internal framework to API 30 (11 Release) 2020-09-12 11:54:15 -04:00
Giacomo Ferretti
d3f9d5acd2 build: update 'proguard' from 6.1.1 to 7.0.0
`jcenter()` it's needed because they didn't upload to Maven Central yet. https://github.com/Guardsquare/proguard/issues/54

There are some minor issues with proguard still.
It produces a lot of warnings since Gradle 6.0, but it's fixable on their side. https://github.com/Guardsquare/proguard/issues/14
2020-08-14 07:56:52 -04:00
Giacomo Ferretti
4c3f1f335a refactor: 'compile' it's deprecated
`compile` it's deprecated since Gradle 6.0 and been discouraged since Gradle 3.4.

We should use `implementation` and `api` instead because `compile` will be removed in Gradle 7.0.

https://docs.gradle.org/6.5.1/userguide/upgrading_version_5.html#deprecations
2020-08-14 07:56:52 -04:00
Ankit Pati
87a9c659f5 convert CRLF line endings to LF in .java file 2020-08-09 07:57:00 -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
Leo Wandersleb
546577df6a exit code 1 if parameters are wrong
for use in scripts, it's not convenient to get an exit code 0 on
failure.
2020-06-16 06:18:57 -04:00