Commit Graph

142 Commits

Author SHA1 Message Date
IgorEisberg
204b742cf0 Avoid abuse of getResTable calls and unneeded checks 2021-07-03 22:46:11 +03:00
IgorEisberg
bb42159880 style: rename vars for consistency 2021-07-03 21:26:16 +03:00
Connor Tumbleson
447ba50332
refactor: drop author tags and support javadocs 2021-03-07 15:06:45 -05:00
Connor Tumbleson
98aa7acb22 fix: skip files that violate safe filepath 2020-12-11 07:10:05 -05:00
Connor Tumbleson
d63088db9f feat: method to list frameworks 2020-11-30 07:11:08 -05: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
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
b02b265ae2
style: cleanup syntax 2019-11-19 06:55:27 -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
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
25a1cb02ef
fix: License 2019 update 2019-07-13 12:19:41 -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
IgorEisberg
0efccc2d93
feat: allow configurable api-level for smali 2019-02-16 18:43:25 -05:00
Alexei Khlebnikov
564b285126 fix: add file extension to doNotCompress only if the file size is not 0 2018-07-19 18:14:48 +02:00
Connor Tumbleson
061ddb8ee6 fix: remove hardcoded list of no-compressed assets
- We no longer use aapt for building assets, so this code is never ran
 in aapt1/2. So we can no longer skip these assets.
2018-04-12 11:45:29 -04:00
Connor Tumbleson
d755724ed8 Revert "decode: only store full relative path to uncompressed assets"
This reverts commit bd9c9c7cec.
2018-04-06 14:59:03 -04:00
Connor Tumbleson
0700c684b6 Revert "build: introduce "buildUnknownAndUncompressedAssets""
This reverts commit e35f66b0e0.
2018-04-06 14:58:35 -04:00
Connor Tumbleson
72196f3544 Revert "fix: normalize paths for uncompressed assets & unknown files"
This reverts commit ca25a26944.
2018-04-06 14:58:11 -04:00
Connor Tumbleson
bb42ef068e Revert "fix: Applications with implicit sdk versioning lose that information"
This reverts commit 25a164dd10.
2018-04-06 14:57:09 -04:00
Connor Tumbleson
041659c43f style: output "built apk" when task is completed 2018-04-06 14:03:42 -04:00
Connor Tumbleson
25a164dd10 fix: Applications with implicit sdk versioning lose that information
- This is a temporary hack to keep application building, but will not
 work due to missing nearly all resources.
 - refs: #1761
2018-04-06 14:02:41 -04:00
Connor Tumbleson
ca25a26944 fix: normalize paths for uncompressed assets & unknown files 2018-04-06 10:31:28 -04:00
Connor Tumbleson
e35f66b0e0 build: introduce "buildUnknownAndUncompressedAssets"
- processes assets that are stored (uncompressed)
 - additionally process unknown files
 - modifies application after build process
 - prevents "too long" execution command
 - fixes #1272
2018-04-05 17:07:55 -04:00
Connor Tumbleson
bd9c9c7cec decode: only store full relative path to uncompressed assets 2018-04-05 17:07:55 -04:00
Connor Tumbleson
448d14592f aapt2: don't rebuild compile stage unless needed 2018-02-28 18:40:13 -05:00
Connor Tumbleson
f05bd31e59 aapt2: sparse resource pulling from yaml 2018-02-28 11:05:07 -05:00
Connor Tumbleson
5a8bc45653 aapt2: aapt2 is a staged build (compile and link).
- we destroy the "compile" stage item after a link, but keep the pending directory
 - apktool then cannot complete link stage
 - if aapt2 is used, lie to system and re-process
 - todo: rethink this
2018-02-22 11:22:40 -05:00
Connor Tumbleson
a8bdad628a aapt2: wire up zipPackage() instead of using aapt1 for final apk package 2018-02-22 11:22:40 -05:00
Connor Tumbleson
34a2d03b31
Support for applications with an empty resources.arsc file
- fixes #1730
2018-02-19 06:45:48 -05:00
Connor Tumbleson
9fc1ede991
License 2018 update 2018-02-16 08:26:53 -05:00
Connor Tumbleson
e7d511adf8 Remove unused line
- refs: no issue
2018-02-08 15:17:51 -05:00
Connor Tumbleson
d1857102dd Add spaces where missing to make logic easier to read
- refs: no issue
2018-02-08 15:14:19 -05:00
Connor Tumbleson
bca474272e Support for rebuilding root depth kotlin folder
- refs: #1703
2018-02-07 09:42:56 -05:00
Connor Tumbleson
2b9728e9f3 Prevent ugly "Content is not allowed in prolog" warning
- fixes: #1634
2017-12-01 15:21:47 -05:00
Connor Tumbleson
3ec4f360ab
Add support for shorthand SDK for bounding check
- fixes #1630
2017-09-28 08:23:02 -04:00
Connor Tumbleson
f0f87c844e Adds ability to skip asset files
- fixes #1605
 - prevents rebuild
2017-09-19 15:51:04 -04:00
Connor Tumbleson
eee73b945d Support for VRHeadset Qualifier 2017-08-23 13:05:08 -04:00
Connor Tumbleson
f9c091f54b refactor sdk codename to sdk level into function 2017-08-15 15:35:26 -04:00
Connor Tumbleson
02c8b62b00 Prevent malicious directory/file work with unknown files 2017-07-05 12:45:17 -04:00
Connor Tumbleson
1597c12472 changed all license files 2017-07-05 12:05:52 -04:00
Connor Tumbleson
93d61cc07a kotlin folder should not be treated as unknown - #1520 2017-07-04 09:55:50 -04:00
Connor Tumbleson
e1f7ac355e
add support for preview builds (N, O) 2017-05-08 09:03:13 -04:00