Commit Graph

275 Commits

Author SHA1 Message Date
Connor Tumbleson
13b39903d2 empty or null values should not be matched 2015-12-26 06:59:57 -05:00
Connor Tumbleson
f9323943db Handle Dexguard key names
- Temporarily replace with dummy value names till research is completed
 - allows decode
2015-12-26 06:59:43 -05:00
Connor Tumbleson
a8a9c40a7b add ResBoolValue to Style check 2015-12-26 06:58:39 -05:00
Connor Tumbleson
ba7393d705 Fixes #767
Handles large int values in AndroidManifest.xml, by prefixing
with `\ ` which aapt treats a string. This prevents truncation
from overflow.

Superseeds PR#1007 - thanks to gio73 for initial research &
MarchMil for continued investigation.
2015-12-18 11:30:28 -06:00
Connor Tumbleson
e5ac340cab [ci skip] minor spacing change 2015-12-18 09:46:28 -06:00
Connor Tumbleson
831765665f Handling empty (null) values again 2015-12-14 11:35:15 -06:00
Connor Tumbleson
b2d50bec5f [skip] code style cleanup 2015-12-14 07:10:14 -06:00
Connor Tumbleson
eabb7d819b Correctly read sparse ResourceTables.
Prior to this change, APKs usually went Package -> TypeSpec -> Config (all) -> Entries.
Reading all configs under that TypeSpec. Now we have packages that go
Package -> TypeSpec -> Config (single) -> Entries.

So we have to read this correctly to make sure we can correctly decode sparse and packed
Resource tables.
2015-12-14 07:03:09 -06:00
Connor Tumbleson
7e803aeac9 Gracefully handle null values 2015-12-14 07:00:46 -06:00
Connor Tumbleson
be4bdf1d75 Adds support for DATA_NULL_EMPTY 2015-12-14 07:00:12 -06:00
Connor Tumbleson
6c4167fba4 Fixes #1099
- Moves Config --> Type
 - Moves Type -> TypeSpec
 - ResType -> ResTypeSpec
 - ResConfig -> ResType

 This is to match AOSP and ease the transitions/updates of new AOSP drops
2015-12-07 20:48:57 -06:00
Connor Tumbleson
1e5dc3006e Add headerSize & chunkSize to Header class 2015-12-07 07:34:56 -06:00
Connor Tumbleson
af2f54245b [skip] remove confusing logic 2015-12-03 07:57:12 -06:00
Connor Tumbleson
8374839427 MNC, noticed recently in API 23, is no longer 0 padded. So mnc001 is now mnc1
- Frameworks between froyo and honeycomb have mnc001, etc
 - A size check of ResConfig header for less than 32 (honeycomb) uses old decode method
 - Greater than 32 bytes moves to new decode method of mnc# vs mnc###
2015-12-01 08:48:31 -06:00
Rover12421
6f617db53f set readConfigFlags read default value to 28
fix if size == 28, remainingSize error.
2015-11-17 14:31:17 +08:00
Connor Tumbleson
5f5f50f6fd Fixes edge case where mnc = 1, with no mcc field. Fixes #1072 2015-11-01 06:17:29 -06:00
Connor Tumbleson
83f3273a48 Merge branch 'master' of github.com:iBotPeaches/Apktool 2015-10-20 06:27:09 -05:00
Connor Tumbleson
3cc141025f Add deprecation notice for SmaliDebugging - #1061 2015-10-20 06:19:50 -05:00
zoujunhua
c30261bd15 add "flyme" to list of ignored renamed packages 2015-10-16 16:02:02 +08:00
Connor Tumbleson
3dea579f66 Prevent casting Strings/Styles to Attrs
- refs #957, #1060
2015-10-15 08:58:19 -05:00
Connor Tumbleson
76a940628f greedy .dex finder is finding dex files in unknown folders
- which android can't load unless its in /root of apk
2015-10-15 08:57:20 -05:00
Connor Tumbleson
5e4bae0526 Only stores extension(s) of uncompressed files
- fixes #1053
2015-10-13 07:28:43 -05:00
Connor Tumbleson
a29839bab2 Added API 23 qualifier "roundness" 2015-10-08 06:58:11 -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
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
14589e3593 If passed string isn't a reference, don't look for it. 2015-04-19 07:44:57 -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