Commit Graph

312 Commits

Author SHA1 Message Date
Connor Tumbleson
0d53923e24 Merge branch 'fix-flag-ref' of https://github.com/phhusson/Apktool into phhusson-fix-flag-ref 2015-09-12 15:07:49 -05:00
Connor Tumbleson
52dc52c2d3 add failing unit-test for reference in attribute 2015-09-12 15:07:32 -05:00
Pierre-Hugues Husson
e7b294a3ea Fix flags being defined as references 2015-09-10 18:07:00 +02:00
Connor Tumbleson
e8ad159438 Some APKs are reporting wrong pkgId
- fallback to renamed package to find that pkgId
2015-08-21 11:01:43 -05:00
Connor Tumbleson
579d7c561e fixes #1021
- adds support for godzillaui
2015-08-15 10:29:24 -05:00
Connor Tumbleson
4219997470 update internal aapt to include various patches
- miui support for godzillaui
 - miui support for 4 digit mnc/mcc
 - no-op the compat functions
2015-08-15 10:20:05 -05:00
Andrew Grieve
392420c909 Adds doNotCompress list to apktool.yml
This is the list of files (resources, assets, etc) that are stored in
the .apk uncompressed.

For apps that use AssetFileDescriptor.openFd(), the adding compression
will break the call.

Maintains support for the resourcesAreCompressed key, but no longer
records it when decompiling (it instead records resources.arsc in the
doNotCompress list).
2015-08-14 11:52:33 -04:00
Connor Tumbleson
2033e305af Prevent reading resources when -r / --no-res is used 2015-08-11 13:47:10 -05:00
Connor Tumbleson
099cc0fcb3 fixes #1005
- handles apks that have .9.xml files
2015-08-03 08:45:30 -05:00
Matt Mastracci
4249dde7cc Propagate the raw int values to callers 2015-07-07 15:39:22 -06:00
Connor Tumbleson
d5f3b3fd5a [skip] its com.miui.core now 2015-06-29 11:33:13 -05:00
Connor Tumbleson
b878cbd776 [miui] add a new ignored package 2015-06-06 10:43:48 -05:00
Connor Tumbleson
6ee029dd30 Read extra data if over known bytes
If the ResConfig had a size over KNOWN_CONFIG_BYTES
then the remaining bytes would be read twice, thus breaking
the next config. Fixes #924
2015-05-22 09:07:15 -05:00
Connor Tumbleson
2c1226fab8 [skip] use append instead of concat 2015-05-22 08:47:51 -05:00
Connor Tumbleson
8254764c6c More robust ResFileValue detection
Previously in 4882396163, strings that
resembled a filepath (ie res/foo/file), would be assigned to a
ResFileValue, which when attempted to be casted to ResScalarValue would
error out.

Attempting to check the filesystem for such files, slowed apktool's
execution majorly. In order to prevent this, the ClassCastException
and other checks related to checking ResFileValue when type is string
was added.

This allows bogus strings such as (res/foo/file) to be added, but the
exception is caught and allows decoding to continues. Fixes #921.
2015-05-14 13:27:22 -05:00
Connor Tumbleson
9cb3df85d8 Catch attr lookup on internal attributes
Internal attributes will fail the AttrDecoder. Catch the errors
and simply return the undecoded value which will be correct. Fixes #913
2015-05-10 07:36:44 -05:00
Connor Tumbleson
48285bde03 Prevent frameworks from modifying sharedLibrary
Since all frameworks are decoded the same via readPackage(), reading
a framework that was a sharedLibrary would throw the sharedLibrary
flag for the apk. Since packageName isn't set until after the first
decode, we check the values to make sure we only set this variable on
the first apk decoded. Refs #936
2015-05-05 07:43:48 -05:00
Connor Tumbleson
1fb87e3e4c Post smali 2.0.6 cleanup
- fix smaliDecoder/AccessorTest to use new DexFileFactory params
 - remove unneeded ds/tree files
 - cleanup unmerged lines
2015-05-02 06:59:36 -05:00
Connor Tumbleson
c659df9dce Correctly add version qualifier when decoding
- fixes #928
2015-04-29 07:49:02 -05:00
Connor Tumbleson
e407fe839b Correctly rebuild /libs & /lib folder on [b]uild 2015-04-22 07:21:02 -05:00
Connor Tumbleson
960d111a1e cleanup unit-tests to remove hacky renaming of control 2015-04-22 07:20:29 -05:00
Connor Tumbleson
14589e3593 If passed string isn't a reference, don't look for it. 2015-04-19 07:44:57 -05:00
Connor Tumbleson
5d405fa842 add a unit-test for provider attr changing 2015-04-18 08:44:25 -05:00
Connor Tumbleson
3208624bf6 Moves all XML parsing related functions to new class: ResXmlPatcher 2015-04-16 08:24:30 -05:00
Connor Tumbleson
addbf8336d [WIP] Wires up rewriter of @string references in provider attrs
- finds all <providers> in manifest
 - finds corresponding @string in res/values/strings.xml
 - does reference replacement w/ literal value
 - fixes #636
2015-04-16 08:24:30 -05:00
Connor Tumbleson
becaf754a9 [skip] use IOUtils.closeQuietly() 2015-04-16 08:20:18 -05:00
Connor Tumbleson
3cdd8243c7 Read res header completely 2015-04-16 08:14:57 -05:00
Connor Tumbleson
7326867b09 re-add copy() method using try-with-resources 2015-04-16 08:12:20 -05:00
Connor Tumbleson
10afb3cd56 Merge branch 'del_BrutIO_copy' of https://github.com/rover12421/Apktool into rover12421-del_BrutIO_copy 2015-04-16 08:03:44 -05:00
Connor Tumbleson
bb6cd98dfa fix regression of lang qualifiers
- values-xx was improperly decoded as values-b+xx
 - added unit test
2015-04-11 12:39:38 -05:00
Connor Tumbleson
da3b8c710d cleanup messy logic for bcp qualifiers 2015-04-11 11:36:31 -05:00
Connor Tumbleson
a561a95542 Don't ignore multiple dex files when -s is used
- fixes #904
2015-04-04 08:09:07 -05:00
Connor Tumbleson
aee0792e00 Suppress overwriting platformBuildVersion[Code/Name]
- fixes #890
 - introduces unit-test comparing manifest
2015-04-04 07:40:38 -05:00
Connor Tumbleson
ae15b2a7f7 fixes #900
- removes aapt test (no longer needed)
2015-04-02 08:15:39 -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
Greg Leach
472a02db41 Formatting for right-hand margin 2015-03-24 20:22:05 -07:00
Greg Leach
628286c022 Java NIO doesn't allow the preservation of the compression method (STORED vs DEFLATED), so unfortunately we need to fall back to ZipEntry-based output for unknown files. 2015-03-24 20:14:05 -07:00
Rover12421
f3582b60db buildUnknownFiles optimization
newFileSystem will file replication overhead
2015-03-18 09:15:26 +08:00
Connor Tumbleson
39fea5fa2c [tests] add test for shared library rebuild 2015-03-14 08:20:18 -05:00
Connor Tumbleson
fac43a62b8 remove dependency on sharedLibrary in apktool.yml 2015-03-14 08:20:00 -05:00
Connor Tumbleson
0a74de4ab0 Shared Library Rebuilding Support
- handles references with shared resources
 - adds support for --shared-lib
 - update unit-tests
2015-03-14 08:04:33 -05:00
Connor Tumbleson
a766db9d50 update internal aapt to API 22 2015-03-12 17:44:22 -05:00
Connor Tumbleson
697de20454 update internal framework to API 22 (lollipop mr1) 2015-03-12 17:44:07 -05:00
Connor Tumbleson
40e75a0a39 [skip] sdk version (lollipop mr1) 2015-03-12 17:43:47 -05:00
Connor Tumbleson
2db8828efb add support for TYPE_NULL 2015-03-12 17:43:17 -05:00
Connor Tumbleson
bbc6023068 gracefully handle apks that have strings that resemble filepaths
- ex string res/foo tries to map to resource res/foo
 - looks for dot now, ie res/foo.xml
2015-03-06 17:04:43 -06:00
Connor Tumbleson
d9fda1feda added additional unit-test, cleaned up spacing 2015-03-03 15:38:36 -06:00
Jeremy Hornberger
5076612c87 Ampersand in "&lt;" gets replaced with "&amp;" in plural strings 2015-03-03 15:38:35 -06:00
thuxnder
07b43d687c use BufferedInputStream for APK
faster xml escape function
2015-03-01 10:29:34 -06:00