Commit Graph

334 Commits

Author SHA1 Message Date
Connor Tumbleson
fb67c0cd15 update internal aapt to API 21 2014-11-21 11:26:17 -06:00
Connor Tumbleson
e1a0b9eb8f [tests] add test for watch (api 20) 2014-11-21 11:26:16 -06:00
Connor Tumbleson
50de34bbf1 add anydpi qualifier 2014-11-21 11:26:16 -06:00
Connor Tumbleson
e08e76152c update internal framework to API 21 (lollipop) 2014-11-21 11:26:16 -06:00
Connor Tumbleson
daafeb284e fixes regression introduced in 40fdfc50a1
- tagged framework support fixed
2014-11-21 11:25:07 -06:00
Connor Tumbleson
e8dae927d4 Merge pull request #95 from iBotPeaches/cleanup_options
Options Cleanup
2014-11-02 07:48:36 -06:00
Connor Tumbleson
9b1c7d22ef JEB - Fix decompressor when string arrays aren't 4-byte aligned 2014-11-01 21:21:35 -05:00
Connor Tumbleson
40fdfc50a1 Options Cleanup
- remove ugly Hashmap passing
 - create ApkOptions
 - refactor based on ApkOptions
2014-11-01 21:07:02 -05:00
Connor Tumbleson
a7d8ca9086 cs fixes, remove unused imports 2014-10-29 16:18:47 -05:00
Connor Tumbleson
d821717253 java7 try-with-resources and multi catch 2014-10-29 16:18:25 -05:00
Connor Tumbleson
9031c22365 [skip] update all copyrights to 2014 2014-10-23 18:14:48 -05:00
Connor Tumbleson
869d287aaa Cleanup
- switch to java7 try-with-resources
 - add check in unit-tests for checking control
2014-10-22 22:03:59 -05:00
Connor Tumbleson
3e6fc8c5ef QMG are not 9patches
- skip these by copying raw
2014-10-22 21:56:54 -05:00
Connor Tumbleson
986b585f26 Removes hardcoded extension of PNG to allow OEM versions (qmg)
- adds unit-tests via two qmg files (one 9 patch, one regular)
2014-10-22 16:32:05 -05:00
Connor Tumbleson
1489869344 added unit-test and changelog note 2014-10-20 06:51:06 -05:00
Jeff Smith
db2478a71f Handle ResStringValue when ResAttr expected in ResStyleValue 2014-10-18 23:40:04 -05:00
Connor Tumbleson
5bc76f197f update internal framework to API 21 (lollipop) 2014-10-17 13:37:19 -05:00
Connor Tumbleson
99c1ab96da add api 21 qualifiers
- watch
 - tiny cs fixes
 - tag MIUI related changes
2014-10-17 13:35:02 -05:00
Connor Tumbleson
06bcff5b6f [skip] update changelog, code style fixes 2014-10-05 12:35:03 -05:00
Connor Tumbleson
62db52fe7b Handle APKs with NULL padding on StringPools
- issue 664
2014-10-05 12:34:38 -05:00
Connor Tumbleson
76bf5ead25 Handle renamed manifests with "yi"
- issue 682
2014-10-05 12:33:47 -05:00
Connor Tumbleson
ce3c37c6ab Handle ARSC files with multiple ResPackages
- superseeds - 68c1809a48
2014-10-03 11:31:43 -05:00
Connor Tumbleson
6138d26335 prevent execution if file is named same as apktool framework folder 2014-09-23 08:32:04 -05:00
Connor Tumbleson
7b0ba28a43 [skip] code style 2014-09-23 08:24:45 -05:00
Connor Tumbleson
49b6bf70e4 [skip] check result of .setExecutable() 2014-09-23 07:56:28 -05:00
Connor Tumbleson
ce15b50c1c handles <string-array> / <array> that require formatted="false" attributes 2014-09-22 18:27:25 -05:00
Connor Tumbleson
3d2e935f08 [skip] cs fixes 2014-08-16 10:17:15 -05:00
Connor Tumbleson
56c953cd16 don't break BC, store classes.dex in /smali 2014-08-16 09:54:34 -05:00
Connor Tumbleson
b2b5eb5f01 [skip] cs fixes, added changes to changelog 2014-08-16 09:48:02 -05:00
Connor Tumbleson
18b94d5974 Multiple Dex Support - part 4
- add unit tests
 - minor cs fixes
2014-08-16 08:55:10 -05:00
Connor Tumbleson
7ef993cc75 Multiple Dex Support - part 3
- dexlib2 handles non classes.dex
 - cleaned up functions
 - cs fixes
2014-08-16 08:45:43 -05:00
Connor Tumbleson
c476ce16be Multiple Dex Support - part 2
- CS fixes
 - adds support for building multiple dex
 - prevents extra dex from being unknown and extra dex
 - adds unit-test
2014-08-16 08:29:57 -05:00
Connor Tumbleson
70eaab9971 Multiple Dex Support
- CS fixes
 - added decode support for multiple dexes
 - decoded to smali_[dex name]
2014-08-15 20:24:12 -05:00
Connor Tumbleson
04d3d1a03a [skip] remove newline at EOF 2014-06-18 11:06:05 -05:00
Connor Tumbleson
2ca606c04d Merge branch 'master' of github.com:teprrr/Apktool into teprrr-master 2014-06-18 11:01:20 -05:00
Connor Tumbleson
e126a51b4b handles manifests with missing named attributes.
- fixes #512
2014-06-18 10:59:54 -05:00
Teemu Rytilahti
5eabf19157 Allow using the library externally by catching the exceptions while loading properties from unavailable classes. 2014-06-18 00:53:53 +02:00
Connor Tumbleson
848f0d6b5f fixed regression introduced in: b149d7bd49 2014-05-30 06:33:17 -05:00
Connor Tumbleson
c29dffe554 fix array type values being misrepresented due to incorrect index 2014-05-25 12:37:14 -05:00
Connor Tumbleson
0ece6cf1b3 update internal aapts for "unknown error -19" 2014-05-25 11:26:29 -05:00
Connor Tumbleson
584d1cda18 ignore "com.lge.internal" 2014-05-18 06:48:01 -05:00
Connor Tumbleson
8ad817441f suppress warnings when coming back from Yaml 2014-05-12 17:12:04 -05:00
Connor Tumbleson
a3897bfe0d [spelling] Nul -> Null 2014-05-12 17:11:28 -05:00
Connor Tumbleson
fc0b584af1 [skip] adjusted spacing to match new standard 2014-05-12 17:01:08 -05:00
Connor Tumbleson
0bb217ac88 [skip] code spacing 2014-05-12 17:00:49 -05:00
Connor Tumbleson
b149d7bd49 cleaned up XmlPullStreamDecoder
-- removed optimize for manifest bool
 -- take attr value once, then re-use
 -- used passed ResTable, instead of re-init
2014-05-12 17:00:31 -05:00
Connor Tumbleson
f5fc88e463 add travis-ci builds
[travis] skip test on travis

[travis] install 32bit libs
2014-05-09 17:52:29 -05:00
Connor Tumbleson
b53101f69e adds support for ignoring "com.lge"
-- fixes issue 630
2014-05-08 15:08:40 -05:00
Connor Tumbleson
dbda71d2af [skip] fix output to match a jar 2014-05-03 07:38:49 -05:00
Connor Tumbleson
a031787ece switch from URI to Paths 2014-05-03 07:37:52 -05:00
Connor Tumbleson
251a6bbb11 add unit-test for font tags in <array> item 2014-03-19 16:52:07 -05:00
Connor Tumbleson
25e9ed7281 add more modular support for renamed packages
-- There is no "set" rules for renaming a manifest, so we must adapt to patterns. There are some apks that have original package names as "android", "miui", "com.htc", etc. These are not meant for renaming, but exist to align that apk to a specific OEM framework system. (EX HTC system apks have a package id of com.htc). However, this pattern isn't true when framework apks are involved, as the intended behavior is to rename the package from xxx to com.htc (as an example).

-- We solve this by first identifying the active package via the packageId instead of package with most ResSpecs (we fall back on that though)
-- then with two hardcoded arrays of UNKNOWN_PACKAGES and ALLOWED_PACKAGES
2014-03-19 16:23:45 -05:00
Connor Tumbleson
74153661df add unit-test for jpg image 2014-03-18 10:31:07 -05:00
Connor Tumbleson
1e3b66f9be adds "miui", "android" and "com.htc" to list of ignored renamed packages. 2014-03-09 17:47:43 -05:00
Connor Tumbleson
d1eb0b01e1 [skip] fixed bad logger name 2014-03-06 09:40:49 -06:00
Connor Tumbleson
119f9d9680 Added jar decode unit-test 2014-03-02 08:46:51 -06:00
Connor Tumbleson
b5dcce3738 abstracted unknown files out of resources, to remove dependencies on ResTable 2014-03-02 08:46:35 -06:00
Connor Tumbleson
0736aac013 fixes unknown files being ignored when -r is used 2014-02-22 13:59:36 -06:00
Connor Tumbleson
65b188ae96 fixes unknown files being ignored if prefixed with known file 2014-02-16 11:20:06 -06:00
Connor Tumbleson
f130c995fb added failing unit-test for bug 603 2014-02-16 11:16:59 -06:00
Connor Tumbleson
f85dc478b2 Github pr #81 - correctly handle non-URI characters in filename 2014-02-10 07:17:56 -06:00
Connor Tumbleson
19a1a260a0 refactor aapt test into own test class, move helper function into TestUtils 2014-02-10 07:15:32 -06:00
Connor Tumbleson
d90bea10ce malformed styles
if styles are malformed html, then recreation fails with OutOfBounds,
end tag if error occurs to prevent crash
2014-02-09 20:45:16 -06:00
Connor Tumbleson
94b90a6dd2 add code style doc rules, adjusting stringblock to 120 margin 2014-02-09 19:23:25 -06:00
Connor Tumbleson
086139a037 code cleanup of 2014 2014-02-09 19:01:57 -06:00
Connor Tumbleson
c5a8f0c8a5 don't write a trailing /u0000 if its the last char of the string 2014-02-09 18:49:32 -06:00
Connor Tumbleson
541301278b add unit-tests (very long strings - greater than 32768 chars) 2014-02-09 18:49:05 -06:00
Connor Tumbleson
ca314b9aae fix abused lengths (strings over 32768) for UTF-16 strings 2014-02-09 18:48:40 -06:00
Connor Tumbleson
cc5ae0f1d1 update unit-tests to handle a simple resource in smali 2014-02-08 17:17:02 -06:00
Connor Tumbleson
e48ab8b9b9 threadsafe StringBlock 2014-02-07 07:35:03 -06:00
Connor Tumbleson
dc2b2fecb8 cleanup new lines and fixup revision properties 2014-02-04 09:52:09 -06:00
Connor Tumbleson
2af523d5d4 correctly handles apk's with one package named "android" 2014-01-13 17:43:09 -06:00
Connor Tumbleson
501a6df677 only store renamed-manifest-package if the apk requires the change 2014-01-07 15:06:45 -06:00
Connor Tumbleson
f6a61ba1b4 rename variables to help user understand, remove unneeded ones 2014-01-07 13:08:48 -06:00
Connor Tumbleson
e254cec648 rework manifest renaming
Issue #526, correctly handles apks where a renamed package is required, by comparing the package name present
in AndroidManifest.xml and resources.arsc. If different, we take the package name present
in resources.arsc (original) and replace it in the <manifest> tag of AndroidManifest.xml. The previous value in
AndroidManifest.xml (renamed) becomes the value to be passed to aapt on rebuild via --rename-manifest-package

Both these values along with the package id of the original are stored in apktool.yml, for use during the
rebuild
2014-01-07 10:59:37 -06:00
Connor Tumbleson
559a3024cc Ignore multiple types 2014-01-06 06:39:51 -06:00
Connor Tumbleson
7a162fb80f add long-string unit-tests 2013-12-18 08:41:30 -06:00
Connor Tumbleson
1d745ac0ad correctly handles abused length strings - jtmuhone 2013-12-18 08:41:18 -06:00
Connor Tumbleson
52767a2a94 add unicode string unit-test and json string test 2013-12-17 16:50:48 -06:00
Connor Tumbleson
d5d03fe1e4 cleanup confusing logic - ntop001 2013-12-09 06:23:21 -06:00
Connor Tumbleson
259ff5ef01 fix nio2 windows problem - funorpain 2013-12-08 16:48:59 -06:00
Connor Tumbleson
f887709823 unused import removal 2013-11-23 08:37:20 -06:00
Connor Tumbleson
a1ca5019d8 fix spacing in ResArrayValue 2013-11-23 08:35:08 -06:00
Connor Tumbleson
e91790e676 correctly handle incorrect type labeled <array>'s 2013-11-23 08:34:33 -06:00
Connor Tumbleson
4b180bd13c handle MNC_ZERO correctly 2013-11-22 16:22:53 -06:00
Connor Tumbleson
6d5d889c27 adjust spacing in test files, removed unused imports 2013-11-15 13:08:27 -06:00
Connor Tumbleson
d2fc74d984 remove jre7 code from testing class, added comments for manifest changing 2013-11-15 13:07:07 -06:00
Connor Tumbleson
8d0801e6db cleanup document related functions 2013-11-15 12:08:21 -06:00
Connor Tumbleson
feb71b2aa0 code cleanup (spacing) 2013-11-05 15:38:49 -06:00
Connor Tumbleson
f6623d8a12 add newer release api versions 2013-11-03 19:08:39 -06:00
Connor Tumbleson
acd0fcd9e3 update internal aapt's to API 19 2013-11-02 11:28:59 -05:00
Connor Tumbleson
9a31c135ac update internal framework to API 19 2013-11-01 20:11:52 -05:00
Connor Tumbleson
bdb718f8a9 added xxxhdpi, added DENSITY_400, added MNC_ZERO 2013-11-01 20:10:39 -05:00
Connor Tumbleson
2ef25fe5e2 fix jar disassembling 2013-10-16 19:48:43 -05:00
Connor Tumbleson
87e39c4bb9 add todo 2013-10-12 15:44:47 -05:00
Connor Tumbleson
68c1809a48 Handles multiple package framework files correctly. 2013-10-12 15:40:06 -05:00
Connor Tumbleson
64bcb32d81 add method to return size of resPackage, (count of ResSpecs) 2013-10-12 15:39:43 -05:00
Connor Tumbleson
02ac674551 Add apktool version to output during decode/rebuild 2013-09-17 21:52:09 -05:00
Connor Tumbleson
27922bdb81 remove hardcoded seperator char 2013-09-17 21:48:31 -05:00
Connor Tumbleson
bd9dce78b4 add warning for unknown operating system and fix getFrameworkDir to use non hardcode seperator char 2013-09-17 21:44:57 -05:00
Connor Tumbleson
0e33e2d477 update to use FileDataStore 2013-09-15 10:35:00 -05:00
Connor Tumbleson
d4b86475ca fix for NPE w/ null version numbers 2013-09-12 17:46:14 -05:00
Connor Tumbleson
be4ae922de stderr for error messages 2013-09-07 08:54:07 -05:00
Connor Tumbleson
054ddb1388 Fix for window builds due to java.nio 2013-09-07 08:53:07 -05:00
Connor Tumbleson
c27d514a16 update internal aapts to API 18 2013-08-15 10:04:07 -05:00
Connor Tumbleson
d12468a2f7 remove "Done"/"Loaded" messages, as output is becoming clogged. 2013-08-14 08:33:09 -05:00
Connor Tumbleson
6d5fb63ee4 [skip] fix spacing 2013-08-13 15:52:03 -05:00
Connor Tumbleson
dd5723cafa remove useless check and fix SmaliBuilder to actually build debug files 2013-08-13 15:45:51 -05:00
Connor Tumbleson
f95f9b2f4b debuginjector - adapt for dexlib2 2013-08-13 15:45:15 -05:00
Connor Tumbleson
5aa18eee2d [SmaliMod] adjust handling for stream, files and dexlib2 2013-08-13 15:43:35 -05:00
Connor Tumbleson
3acff3ef34 remove DexFileBuilder, due to dexlib2 2013-08-13 08:42:27 -05:00
Connor Tumbleson
a4ac131479 [SmaliDecoder] force 1 job if debug mode 2013-08-13 08:42:04 -05:00
Connor Tumbleson
d07f52bd6a fix prop location of smali/baksmali, add more checks 2013-08-12 12:28:28 -05:00
Connor Tumbleson
a8f6e40c02 update SmaliDecoder to handle jobs / odex files 2013-08-12 12:28:01 -05:00
Connor Tumbleson
1de4525534 add HelloWorld test smali file into unit-test 2013-08-12 12:27:25 -05:00
Connor Tumbleson
ca67c00f83 wip 2013-08-12 09:16:51 -05:00
Connor Tumbleson
b0cee3c500 remove duplicate import 2013-08-12 09:16:51 -05:00
Connor Tumbleson
fb7fbf0805 pass api to DexFileFactory 2013-08-12 09:16:51 -05:00
Connor Tumbleson
af32d4da3e decode sources after resources 2013-08-12 09:16:51 -05:00
Connor Tumbleson
570eaa7023 adapt SmaliDecoder to dexlib2 2013-08-12 09:16:51 -05:00
Connor Tumbleson
007a6d45a2 Update to smali 2b5 2013-08-12 09:16:50 -05:00
Connor Tumbleson
115db91fab fixes space in filepath on windows 2013-07-26 16:36:26 -05:00
Connor Tumbleson
fbf8d8fbdf update internal framework to API 18 2013-07-25 07:52:39 -05:00
Connor Tumbleson
102cc0443d fixed unit-test to properly detect if decode worked 2013-07-15 12:24:07 -05:00
Connor Tumbleson
6a87c9ffd4 remove un-needed done. 2013-07-08 13:58:46 -05:00
Connor Tumbleson
0919fe5322 move unit test to @beforeClass and test its output as a separate test, due to parallel test running 2013-07-08 13:24:33 -05:00
Connor Tumbleson
6b173146ac fix invalid casting 2013-07-08 12:27:55 -05:00
Connor Tumbleson
63b0dd1edb fixes JDK bug: 5051418 2013-07-08 12:27:33 -05:00
Connor Tumbleson
6fdf7b37e1 b3: added fixed windows aapt 2013-06-24 14:23:39 -05:00
Connor Tumbleson
65be443e05 regression: fix decoding a jar file. 2013-06-14 13:44:48 -05:00
Connor Tumbleson
6475ef8a77 ignore errors during Manifest alterations, to prevent crashing of apktool 2013-06-12 10:29:16 -05:00
Connor Tumbleson
832978a549 fixes issue 469, added -m / --match-original
fixes xml output not having newline after xml declaration
2013-06-12 10:04:28 -05:00
Connor Tumbleson
9f03d7d35c removes hacky @*android fix
Updates unit-tests to actually use AOSP drawables/layouts/anims, instead of using 3rd party ones.
2013-06-05 12:36:24 -05:00
Connor Tumbleson
a4a22a2961 revert commit: 7d5d633b97 2013-06-05 11:58:17 -05:00
Ryszard Wiśniewski
38de56697a Properly handle style with dot in its name and without a parent style. 2013-06-05 18:45:17 +02:00
Connor Tumbleson
09a978e015 fix for root unknown file on windows 2013-05-24 08:11:10 -05:00
Connor Tumbleson
cfac52a744 fix for Windows Env using FileSystem, thanks @BurgerZ 2013-05-24 07:55:33 -05:00
Connor Tumbleson
c6861e1241 move multi catches to multi-catch (java 7), fixed pkg id not being correctly read from apktool.yml 2013-05-12 10:15:36 -05:00
Connor Tumbleson
ed67a3d94d updated unit testing
-- styles.xml
-- layouts.xml
-- anims.xml
-- drawables.xml
-- attrs.xml
-- raw/blank_test.png
2013-05-12 07:21:13 -05:00
Connor Tumbleson
aa20036307 fixed problem with <items> showing up in colors.xml 2013-05-12 07:20:35 -05:00
Connor Tumbleson
ac745599ed close, unclosed ZipFile 2013-05-12 07:20:07 -05:00
Ryszard Wiśniewski
d9cac893f9 Now one non positional substitution and one positional is detected as "multiple non positional". 2013-05-11 20:04:12 +02:00
Ryszard Wiśniewski
14f26474e6 Cleaned up the code related to multiple substitutions in xml strings. 2013-05-11 20:04:12 +02:00
Ryszard Wiśniewski
e7ee8cb178 Decode "%d %" with formatted="false". It's not necessary for current aapt, but it's more consistent with "%d % ". 2013-05-11 20:04:12 +02:00
Ryszard Wiśniewski
68f97980eb ResXmlEncoders: replaced findNonPositionedSubstitutions() by more flexible findSubstitutions().
Also rewritten some bits.
2013-05-11 20:04:12 +02:00
Connor Tumbleson
997df5cfc5 added more plurals/color unit tests 2013-05-11 12:50:59 -05:00
Connor Tumbleson
9186858f33 added lib support for "/libs" folder. 2013-05-10 08:24:24 -05:00
Connor Tumbleson
acc83919d0 add "/libs" unit testing, adjusted naming on previous unit tests 2013-05-09 22:13:00 -05:00
Connor Tumbleson
3a6d548756 fixed problem with nodpi, added drawable unit testing 2013-05-09 21:54:03 -05:00
Connor Tumbleson
f93a312308 Prevents double escaping of special chars in arrays.xml/<item> tags 2013-05-05 08:13:32 -05:00