Commit Graph

62 Commits

Author SHA1 Message Date
Connor Tumbleson
342ff67a4c
Migrate to Gradle Kotlin DSL (#3249)
* feat: initial migration to kotlin

* feat: initial migration to kotlin

* fix: wire up dependencies

* fix: Deprecated tag for kotlin detection

* refactor: put all modules into sub-projects

* fix: include jar file (android framework)

* fix: add version message/info

* fix: wire up version/gitrev to properties

* fix: wire up proguard on cli

* fix: wire up proguard

* fix: wire up output cleaning command

* fix: drop license header on gradle files

 - fully rewritten from scratch by myself
 - no longer including license header on build files

* fix: add compile utf8/flags for java8

* refactor: remove unneeded curly braces

* feat: progress towards maven-publish

* build: publish to maven

* docs: update documentation

* refactor: prevent implicit order by removal of afterEvaluate

* build: remove unused license plugin
2023-08-05 06:28:31 -04:00
Connor Tumbleson
7c2cb5b30a
Hardened String Block Parser (#3239)
* fix: add headerSize to stringBlock to detect larger headers

* fix: handle app with style offset, but 0 styles

* refactor: split counting stream into CountingDataInput

* fix: read strings till end of string pool chunk

* fix: support out of bound string reading

* fix: don't read string/style offset out of bounds

* refactor: cleanup comments for string parser

* style: comment on 4 byte alignment

* fix: only warn if utf16 string
2023-08-01 06:23:14 -04:00
Igor Eisberg
33ca2929c9
refactor: clean up style and redundancy (#3232)
* refactor: clean up redundancy

* refactor: no need for both setApkFile and setApkFileName
2023-07-29 18:56:27 -04:00
Igor Eisberg
79b2173b85
style: normalize command descs and redundancy (#3188) 2023-07-21 06:08:30 -04:00
Connor Tumbleson
bdbe1384bf
ARSC/AXML Parser Rework (#3131)
* Supports ASRC with null renamed package.
* Rework ASRC Chunk parser to a loop to break assumption of order of chunks
* Break out unknown skips for alignment to ResourceTypes.h
* Add verbose information for file skips
* Add test for protected apk sample
* Rework chunk parsing for StringBlock
* Refactor AXML Parser to support proper header reading
* Fix parsing if attribute size reported does not align to actual size
2023-07-12 05:33:28 -04:00
sv99
b83b58e8e8
Correct aapt/aapt2 waiting too long on execution output (#3071)
Co-authored-by: Connor Tumbleson <iBotPeaches@users.noreply.github.com>
2023-05-20 14:01:03 -04:00
sv99
48b71b34b1
refactor: Replace to nio & apply CS inspection skips (#3055) 2023-05-13 06:12:22 -04:00
Connor Tumbleson
67a936f1c7
build: include bleeding edge smali from source via jitpack (#2941)
* build: include smali from source

* refactor: adjust build.gradle for repositories
2022-11-24 06:15:41 -05: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
Matteo Baccan
b3741409f5
Code smell reduction (#2554)
* Correct use of <> diamond operator

* Correct modifiers order

* Private constructor for utility class

* Correct use of diamond operator

* Corrected naming convention

* Correct modifier order

* Use not synchronized class

* Introduced try/resource in stream copy

* Removed unused private field

* Code reformat

Reformat of IOUtils.copy from to stream

* Add a space

Improved code formatting

* Code reformat

Only a new space

* Code reformat

Removed extra spaces
2021-04-14 06:31:32 -04:00
Connor Tumbleson
64eda064eb
fix: remove unused util methods/exceptions 2021-03-28 17:10:52 -04:00
Connor Tumbleson
8a23d0dbc1
refactor: correct spelling mistake of aapt 2021-03-28 10:54:31 -04:00
Connor Tumbleson
447ba50332
refactor: drop author tags and support javadocs 2021-03-07 15:06:45 -05:00
Connor Tumbleson
49a167540f fix: cut down length of zipslip exceptions 2020-12-11 07:10:05 -05:00
Connor Tumbleson
1452014992 fix: early return if no files + enhanced for loop 2020-12-03 06:35:47 -05: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
Connor Tumbleson
44a2e87f81
refactor: support more random suffix to prevent multi-thread crash 2020-04-11 06:50:09 -04:00
Connor Tumbleson
d4b2314e26
Merge branch 'issue-2251' of https://github.com/chris-sharl/Apktool into chris-sharl-issue-2251 2020-04-11 06:43:54 -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
chris-sharl
5272ae24b3 fix issue-2251 2019-12-19 18:39:04 +08:00
Connor Tumbleson
c1f9afe33c fix: enhance bitness detection on windows 2019-11-19 06:45:07 -05:00
Connor Tumbleson
25a1cb02ef
fix: License 2019 update 2019-07-13 12:19:41 -04:00
Sebastian Rasmussen
b01dce7f3a Adapt AXMLResourceParser to handle broken headers.
Fixes #1976.
2019-01-08 21:20:50 +01:00
Connor Tumbleson
61848cfa06 fix: allow AaptManager to find new naming of aapt binaries 2019-01-04 11:24:49 -05:00
Connor Tumbleson
618de55bd3 fix: update AaptManager to handle flattened aapt structure 2018-12-18 17:37:04 -05:00
Connor Tumbleson
b7d33cb623 style: update license headers that are missing 2018 2018-08-23 16:14:24 -04:00
Connor Tumbleson
6231edfcfd fix: make sure we wait on executor for output
- fixes: #1809
 - thanks to sunshouxiang
2018-07-23 13:22:27 -04:00
Connor Tumbleson
3a33bfc48f fix: allow detection of aapt2 from old SDK builds 2018-04-19 17:09:44 -04:00
Connor Tumbleson
cabf1d5cad fix: prevent cluttering temp files, delete BRUT temp files on close 2018-04-06 11:12:09 -04:00
Connor Tumbleson
07afbdb52b fix: normalize path to fix building .apk on Windows
- fixes #1741
2018-04-05 16:24:58 -04:00
Connor Tumbleson
d2c808dd7d aapt2: refactor loading of aapt/aapt2 binaries
- change: die out if invalid aapt path is provided
2018-02-28 11:25:56 -05:00
Connor Tumbleson
367d33e314 aapt2: remove util outputting to console 2018-02-28 10:54:35 -05:00
Connor Tumbleson
bd0ce9aea3 aapt2: aapt1 is "aapt" 2018-02-22 11:41:31 -05:00
Connor Tumbleson
574de8db71 aapt2: new method to execAndReturn to collect stdout from a process 2018-02-22 11:22:40 -05:00
Connor Tumbleson
e02c5f2b2f aapt2: Add AaptManager
- capable of determining version of an aapt binary (2 or 1)
 - can return a v2/v1 aapt binary
2018-02-22 11:22:40 -05:00
Connor Tumbleson
9fc1ede991
License 2018 update 2018-02-16 08:26:53 -05: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
f8fe98d9a6 code style 2017-06-29 11:30:00 -04:00
Bing Qiao
28883538a7 Class.class.getResourceAsStream tries to load resource from root directory. This fails when apktool is built into a fat jar like Spring boot executable so that the classloader tries to load the resource from the root directory of the Spring boot jar instead of that of the bundled appktool jar. 2017-06-29 12:36:05 +01:00
Connor Tumbleson
b9736d97e3
Add is64Bit() check 2016-12-22 09:06:03 -05:00
Connor Tumbleson
894da2033b
If obtained value is smaller than expected, retry
- fixes #1332
 - thanks xpirt
2016-10-13 09:00:08 -04:00
Anthony Morris
e23eb9cf6b Use Guava's LittleEndianDataInputStream.
This replaces the custom LittleEndianDataInputStream with
guava's implementation. To do this, I had to fix ExtDataInput
to better handle the case where skipBytes doesn't skip all the
bytes (the tests failed without this, and succeed with it). This
appears to be the main difference between the two implementations.
Guava's implementation is preferred because it is already a
dependency and because its license is clearer (the previous
implementation had a vague "public domain" comment in the thread
which may not be legally sufficient).

Fixes #1166
2016-08-05 14:36:34 +01:00
Andrei Zhukouski
74e0aa0bd2 Write output to separate streams (error and output)
This will allow to write errors and output to the console handler as usual, but will help to handle errors from external binaries (such as aapt, executed by exec method) in all initialized logger handlers, not only console, but text handler, for ex.
2016-01-05 10:39:07 +03:00
Connor Tumbleson
7326867b09 re-add copy() method using try-with-resources 2015-04-16 08:12:20 -05:00
Rover12421
407ffdc5fe remove BrutIO copy method
`copy` method already in IOUtils
2015-03-30 13:30:52 +08:00
Greg Leach
39a2848340 Moving a couple utility functions into BrutIO. Also, formatting change to match spec. 2015-03-25 09:56:55 -07:00
Connor Tumbleson
2f7ae8c001 [meta] Repo Cleanup
- Moved all license files to root
 - Moved NOTICE to CONTRIBUTORS.md
 - cleaned up .gitignore
 - removed redundant gitignores
2015-03-14 08:02:57 -05:00