Commit Graph

160 Commits

Author SHA1 Message Date
oSumAtrIX bef4bc1a80
chore: merge upstream
# Conflicts:
#	brut.apktool/apktool-lib/build.gradle
#	build.gradle
2023-01-17 23:39:46 +01:00
Connor Tumbleson 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
Connor Tumbleson b32be8ca2a
refactor: rename attributes for storing obfuscated filepath 2022-11-08 06:24:41 -05:00
Kirlif c4e8f88499
Fix « doNotCompress » in case of obfuscated resources. 2022-11-07 14:08:49 +01:00
oSumAtrIX 9443f6fefb
feat: merge iBotPeaches/Apktool 2022-09-23 04:22:53 +02:00
Connor Tumbleson dceff41a57
feat: lodge helpful information of built apk location
fixes: #2843
2022-07-10 07:32:40 -04:00
Lucaskyy e115848dbc
refactor: get rid of all that logging 2022-06-11 19:24:41 +02:00
erev0s 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
auermich93 e105768592
fixes issue #2473 (#2783) 2022-03-21 06:51:15 -04:00
Connor Tumbleson 797fc3e332
fix: prevent file hold on tmpDir during build (#2745) 2022-01-18 07:32:41 -05:00
Connor Tumbleson 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
Connor Tumbleson 6cfe2987e5
fix: support for signature scheme v4 (#2705) 2021-11-27 07:41:15 -05:00
Connor Tumbleson 3b179f8750 refactor: rename ApkOptions -> Options/BuildOptions 2021-09-06 06:59:30 -04: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
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 88d3d0038c style: organize some using statements for consistency 2021-07-03 23:24:42 +03:00
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