Commit Graph

846 Commits

Author SHA1 Message Date
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
Comnir
ecbcfb437e match test apk name with the relevant issue. 2020-06-09 07:08:22 -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
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
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
ee54853718
feat: update internal framework to API 29 (10 Release) 2019-11-29 11:43:31 -05:00
Connor Tumbleson
b05f19b80d fix: patch aapt2 to not run custom commands on passed aapt2 binary 2019-11-20 06:46:06 -05:00
Peter Retzlaff
d6f38e38cd Only attempt to use -e option when the packaged aapt binary is used. 2019-11-20 06:46:06 -05:00
Peter Retzlaff
5d488e5f22 Create file containing the do-not-compress extensions and pass it to aapt. 2019-11-20 06:46:06 -05:00
Connor Tumbleson
b02b265ae2
style: cleanup syntax 2019-11-19 06:55:27 -05:00
Connor Tumbleson
7910802648
Merge branch 'fix/uncompressed_files_bug' of https://github.com/realityJie/Apktool into realityJie-fix/uncompressed_files_bug 2019-11-19 06:53:00 -05:00
Connor Tumbleson
37505ff509 build: update aapt/aapt2 binaries to 71b16b59 (mac) 2019-11-18 19:48:33 -05:00
Connor Tumbleson
9e75e593a6 build: update aapt/aapt2 binaries to 71b16b59 (windows) 2019-11-18 19:48:33 -05:00
Connor Tumbleson
557b763c1c build: update aapt/aapt2 binaries to 71b16b59 (unix) 2019-11-18 19:48:33 -05:00
huangweijie
17ad91da61 fix bug of Unrecognized option: --only-main-classes 2019-11-15 08:47:22 -05:00
Brian Pak
31a23ba493 Fix AXML parser to handle obfuscated attribute names
This adds an additional check if the attribute namespace belongs to
Android namespace, and if so we try to decode using attribute decoder.

Fixes #1576.
2019-11-14 18:37:25 -05:00
huangweijie
5197e21d75 there files should not be compressed:
1.base on AOSP's frameworks/base/tools/aapt/Package.cpp: NO_COMPRESS_PATTERN = Pattern.compile("(jpg|jpeg|png|gif|wav|mp2|mp3|ogg|aac|mpg|mpeg|mid|midi|smf|jet|rtttl|imy|xmf|mp4|" +
            "m4a|m4v|3gp|3gpp|3g2|3gpp2|amr|awb|wma|wmv|webm|mkv)$"); specifically this rule include 9patch files.
2.file has not ext
3.the compressive type is store

warning:
even if there are the same type of files, they are compressive type may different, just like this example:
-rw----     1.0 fat     8343 b-  0% stor 80-Jan-01 08:00 assets/resources/assets/effect/common/ctp_trail15_1_tex.unity3d
-rw----     1.0 fat    11526 b-  0% stor 80-Jan-01 08:00 assets/resources/assets/effect/common/ctp_trail15_tex.unity3d
-rw----     2.0 fat     2483 bl 19% defN 80-Jan-01 08:00 assets/resources/assets/effect/common/cw_310300_cylq_ql01_mat.unity3d
-rw----     2.0 fat     9467 bl 17% defN 80-Jan-01 08:00 assets/resources/assets/effect/common/cw_310300_cylq_ql03_fbx.unity3d
ctp_trail15_1_tex.unity3d and ctp_trail15_tex.unity3d are uncompressed, but cw_310300_cylq_ql01_mat.unity3d and cw_310300_cylq_ql03_fbx.unity3d are compressed.

That is why I modified recordUncompressedFiles Method.
2019-11-14 12:02:49 +08:00
IgorEisberg
a33141646b Fix JDK 11 build 2019-10-20 21:23:30 +03:00
IgorEisberg
232e801e4d build: update to smali/baksmali 2.3.4 2019-10-18 04:03:53 +03:00
Connor Tumbleson
197d468727
Merge pull request #2175 from danielmalmq/master
Fixes issue with decoding apk containing a zero byte 9patch
2019-10-06 05:24:04 -04:00
yangjing.yeoh
9e39755750 bugfix, fix get wrong package ResPackage for multi-pkg resources.arsc. 2019-09-23 18:39:18 +08:00
Daniel Malmqvist
dc312a5336 Fixes issue with decoding apk containing a zero byte 9patch 2019-09-19 13:34:06 +02:00
Connor Tumbleson
fefc5e226a
refactor: use MultiDexContainer instead of DexBackedDexFile 2019-08-17 07:00:15 -04:00
Connor Tumbleson
c2065995ed
feat: update internal framework to API 29 (Q Beta 4)
- fixes: #2131
2019-07-20 12:32:14 -04:00
Connor Tumbleson
4aa933b31a
test: ensure we don't allow path traversal with win 2019-07-18 07:42:34 -04:00
Connor Tumbleson
9fcd7e4d36
style: grammar for "decompile" vs "disassemble" 2019-07-14 07:35:09 -04:00
Connor Tumbleson
342661cbaa
fix: correct license header on "DuplicateDexTest" 2019-07-14 07:30:41 -04:00
Connor Tumbleson
bae5aab78a
fix: use only long builder for "--only-main-classes" 2019-07-14 07:29:47 -04:00
Connor Tumbleson
9edcc78ee5
style: clean test file 2019-07-14 07:29:32 -04:00
Connor Tumbleson
4d1e6ccbe4
refactor: remove pollution of global command and move to advanced
- removes "-onlymainclasses" for long "--only-main-classes"
2019-07-14 07:23:18 -04:00
Daniel Malmqvist
d79724549c
Added new option to skip non classes[0-9]*.dex files 2019-07-14 07:17:20 -04:00
Connor Tumbleson
5a51c5f96d
style: add comment for explanation of 9patch minimization 2019-07-14 07:09:39 -04:00
Igor Eisberg
bc9f465f3e
Fix the massive list of uncompressed 9.png that prevents recompile on Windows
Windows has its limits, even Windows 10, at least on older versions before the max path length restriction was removed.
Because apktool failed to recognize the .9.png extension as a variety of the .png extension, those .9.png files were piling up in apktool.yml and then passed to aapt, which would fail to run on Windows because of an immense command length.
This fix makes a special exception for the .png exception and will allow the .9.png one to pass as another .png extension.

Before: http://dpaste.com/2BC3RRB
After: http://dpaste.com/177CVZQ
2019-07-14 07:04:49 -04:00
Connor Tumbleson
103aa978df
refactor: remove outdated ALLOWED_PACKAGES constant 2019-07-14 06:56:37 -04:00
Igor Eisberg
8084762274
Fix recompile of miui.apk by allowing package renaming
This old issue prevented the package to be renamed from com.miui.core to miui, making it impossible to recompile, as all attributes are refefred to as miui:*/*. This fixes it permanently.
2019-07-14 06:54:32 -04:00
Connor Tumbleson
3990598373
fix: restore licenses wiped by 2017 license change 2019-07-13 12:23:22 -04:00
Connor Tumbleson
25a1cb02ef
fix: License 2019 update 2019-07-13 12:19:41 -04:00
Connor Tumbleson
81acde7613
fix: add deprecation notice into code for #2129 2019-07-13 12:08:59 -04:00
Connor Tumbleson
0aad85a0a0
fix: add more missing modules
- thanks http://cr.openjdk.java.net/~mr/jigsaw/ea/module-summary.html
2019-07-13 08:54:19 -04:00
Connor Tumbleson
4888a5a9f0
build: add desktop/sql jmod files 2019-07-13 08:47:16 -04:00
Connor Tumbleson
24c3c0dbc9
fix: properly determine greater than java8 2019-07-13 08:37:59 -04:00
Connor Tumbleson
6aeb7d39d7
fix: remove deprecated shadowJar features 2019-07-13 08:22:30 -04:00
Connor Tumbleson
e3bead4b5b
build: support for jdk9+ build 2019-07-13 07:54:41 -04:00
Shaheen Gandhi
2bc8feb549 Add attr resource type handling 2019-07-02 19:23:33 -04:00
Connor Tumbleson
1b4f8ec68c
fix: move outjars to end of proguard file 2019-06-01 10:57:19 -04:00
Connor Tumbleson
5f43a1fbca
style: cleanup formatting 2019-06-01 09:27:41 -04:00
Adib Faramarzi
61088302e3 Add unit tests
- add APK file containing a simple app that tries to use coroutines every 2 seconds, and would fail with earlier versions of APKTool
- add unit test for decoding the app
- add unit test for building a decoded app
2019-05-30 22:18:04 +04:30
Adib Faramarzi
cfd50acd1d Add unit tests
- add APK file containing a simple app that tries to use coroutines every 2 seconds, and would fail with earlier versions of APKTool
- add unit test for decoding the app
2019-05-30 22:12:57 +04:30
Adib Faramarzi
fa99bdd19d Fix removal of META-INF/services folder
- copy the META-INF/services folder to the destination APK folder so it does not get dropped
2019-05-30 19:08:21 +04:30
Adib Faramarzi
154da4c643 Fix removal of META-INF/services folder
- copy the META-INF/services folder to the destination APK folder so it does not get dropped
2019-05-30 18:46:59 +04:30
Connor Tumbleson
25a65186a9 test: add "android:appCategory=game" into AndroidManifest.xml
- refs: #2055
2019-05-07 18:12:53 -04:00
Connor Tumbleson
6c17e1a14f fix: prevent NPE when key-element is null 2019-04-26 15:17:03 -04:00
Connor Tumbleson
f1357109aa style: reorganize MXSerializer 2019-04-26 14:26:20 -04:00
Connor Tumbleson
3037024022 test: add 32,767 byte string for aapt2
- https://issuetracker.google.com/issues/73456167
2019-04-26 14:11:41 -04:00
Connor Tumbleson
4030e94cb3 test: aapt2 test for raw qmg file 2019-04-26 11:14:51 -04:00