Commit Graph

931 Commits

Author SHA1 Message Date
232e801e4d build: update to smali/baksmali 2.3.4 2019-10-18 04:03:53 +03:00
197d468727 Merge pull request #2175 from danielmalmq/master
Fixes issue with decoding apk containing a zero byte 9patch
2019-10-06 05:24:04 -04:00
9e39755750 bugfix, fix get wrong package ResPackage for multi-pkg resources.arsc. 2019-09-23 18:39:18 +08:00
dc312a5336 Fixes issue with decoding apk containing a zero byte 9patch 2019-09-19 13:34:06 +02:00
fefc5e226a refactor: use MultiDexContainer instead of DexBackedDexFile 2019-08-17 07:00:15 -04:00
c2065995ed feat: update internal framework to API 29 (Q Beta 4)
- fixes: #2131
2019-07-20 12:32:14 -04:00
4aa933b31a test: ensure we don't allow path traversal with win 2019-07-18 07:42:34 -04:00
342661cbaa fix: correct license header on "DuplicateDexTest" 2019-07-14 07:30:41 -04:00
9edcc78ee5 style: clean test file 2019-07-14 07:29:32 -04:00
d79724549c Added new option to skip non classes[0-9]*.dex files 2019-07-14 07:17:20 -04:00
5a51c5f96d style: add comment for explanation of 9patch minimization 2019-07-14 07:09:39 -04:00
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
103aa978df refactor: remove outdated ALLOWED_PACKAGES constant 2019-07-14 06:56:37 -04:00
8084762274 Fix recompile of miui.apk by allowing package renaming
This old issue prevented the package to be renamed from com.miui.core to miui, making it impossible to recompile, as all attributes are refefred to as miui:*/*. This fixes it permanently.
2019-07-14 06:54:32 -04:00
3990598373 fix: restore licenses wiped by 2017 license change 2019-07-13 12:23:22 -04:00
25a1cb02ef fix: License 2019 update 2019-07-13 12:19:41 -04:00
2bc8feb549 Add attr resource type handling 2019-07-02 19:23:33 -04:00
5f43a1fbca style: cleanup formatting 2019-06-01 09:27:41 -04:00
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
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
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
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
25a65186a9 test: add "android:appCategory=game" into AndroidManifest.xml
- refs: #2055
2019-05-07 18:12:53 -04:00
6c17e1a14f fix: prevent NPE when key-element is null 2019-04-26 15:17:03 -04:00
f1357109aa style: reorganize MXSerializer 2019-04-26 14:26:20 -04:00
3037024022 test: add 32,767 byte string for aapt2
- https://issuetracker.google.com/issues/73456167
2019-04-26 14:11:41 -04:00
4030e94cb3 test: aapt2 test for raw qmg file 2019-04-26 11:14:51 -04:00
adbde1745f fix: "qpm" can exist without 9patch, and use new "copyToDir" 2019-04-26 11:14:31 -04:00
73ac0d96fb Merge pull request #2066 from iBotPeaches/issue-2045
Support for SDK_Q shorthand
2019-04-24 19:56:15 -04:00
95fe0f3f02 test: assert SDK_Q works with insane test value (10,000) 2019-04-24 18:46:48 -04:00
f3f634f010 fix: add SDK_Q (test) value of 10,000 2019-04-24 18:46:48 -04:00
2e75f7b799 fix: create directory if doesn't exist, before error 2019-04-24 18:45:57 -04:00
8e00de38a0 Merge branch 'master' into patch-1 2019-02-27 18:26:02 -05:00
400a463286 Fix APKs with SDK versions being reference values
This non-standard behavior is rare, but quite annoying.
The solution is simple - replacing the reference value with the actual value from integers.xml, just like Apktool already does for versionName.
2019-02-20 08:26:17 -05:00
49e55f522f Fix APKs with SDK versions being reference values
This non-standard behavior is rare, but quite annoying.
The solution is simple - replacing the reference value with the actual value from integers.xml, just like Apktool already does for versionName.
2019-02-20 08:26:14 -05:00
be1aea76fe Fix reference values not being resolved against frameworks
This Apktool issue has existed for a long time and is especially prevalent with ROMs with multiple frameworks.
The issue happens because Apktool treats reference values inside XMLs (like layouts) as raw text values, and doesn't resolve them during decompile time. This causes some values to be misformed, but more importantly, this causes values referencing to secondary frameworks to not be resolved with their source frameworks, which also means the framework ID won't be added to usesFramework.ids in apktool.yml, and that breaks recompiling.
The interesting thing is that reference values are actually being resolved when they are located in value resources, like styles, thus presenting an inconsistent behavior.
This simple mod eliminates the "rawValue" for reference values, and that forces the "value" (resource ID) to resolve against the respective frameworks, fixing misformed values in the process.

BEFORE:
I: Using Apktool 2.4.0-896569-SNAPSHOT on Notes.apk
I: Loading resource table...
I: Decoding Shared Library (miui), pkgId: 16
I: Decoding Shared Library (miui.system), pkgId: 18
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: bin\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Loading resource table from file: bin\framework\16.apk
I: Decoding Shared Library (androidhwext), pkgId: 15
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

Some comparisons before and after the fix:
https://i.imgur.com/2gTllT0.png
https://i.imgur.com/KzJUeQt.png

AFTER:
I: Using Apktool 2.4.0-896569-SNAPSHOT on Notes.apk
I: Loading resource table...
I: Decoding Shared Library (miui), pkgId: 16
I: Decoding Shared Library (miui.system), pkgId: 18
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: bin\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Loading resource table from file: bin\framework\16.apk
I: Decoding Shared Library (androidhwext), pkgId: 15
I: Loading resource table from file: bin\framework\18.apk
I: Decoding Shared Library (miui), pkgId: 16
I: Decoding Shared Library (android.miui), pkgId: 17
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
2019-02-18 06:47:09 -05:00
bc7302a52b test: assert that vertical/horizontal divs are added if missing 2019-02-17 13:07:32 -05:00
1e68bb0ede feat: Fill missing 9patch lines to fix recompile
Somehow Google manages to compile MiuiSystemUI.apk (and a few other APKs I encountered) with a misformed pip_dismiss_scrim.9.png.
Either way, every time I encountered such 9.patch images, the missing lines always indicated a single full div or padding.
Apktool already fills missing padding lines, now it can also fill missing divs.
2019-02-16 18:52:34 -05:00
0efccc2d93 feat: allow configurable api-level for smali 2019-02-16 18:43:25 -05:00
91f6c80cc6 fix: add new aapt builds for mac 2019-02-16 18:01:38 -05:00
a9b5f7b41d fix: add new unix builds for master aosp aapt 2019-02-16 18:01:38 -05:00
b0f22918cc fix: win builds off master branch of AOSP 2019-02-16 18:01:38 -05:00
2253b66e50 fix: rebuild windows binaries to fix linking issue 2019-02-16 18:01:38 -05:00
13e356f2ef fix: use the res type spec name to create res bag value
Starting with the version 28.0.3 of the Android SDK build tools,
the internal ids of the items of an array bag seems to have changed.

Because of those changes, array resources were no longer decoded correctly.
They were decoded as style resources.

Instead of using the id of the first item within a resource bag,
the name of the res type spec is now used to choose the correct
resource bag value to create.

Note: a list of "legal names" for resource types  can be found in the source code of aapt2.
2019-01-29 10:07:40 +01:00
72368fc0d4 bug: reproduce the bug were array resources are decoded as style bag 2019-01-29 10:06:32 +01:00
cfea3e0831 build: initial attempt at getting travis windows support
build: force windows onto the bash environment

build: update permission (+x) of clean-test file

build: "bat" instead of "exe" extension

build: attempt to support long-path names on windows

build: another attempt at long filepaths on windows

build: force +x on scripts prior to execution

build: exit with return code of last command

build: dump out current path

build: dump out current path - part 2

fix: remove 5 chars from path to drop down from 260 windows max path

build: correct gradlew.bat path and remove unneeded lines

fix: remove long path global configuration

fix: restore PATH setting for windows env

build: PATH resets between scripts, fix for windows
2019-01-09 17:43:40 -05:00
016dc25fa9 Merge branch 'master' into master 2019-01-09 17:18:19 -05:00
45152c269a refactor: use specific exceptions when decoding raw xml 2019-01-09 17:11:51 -05:00
c1f50a2810 style: remove unused LOGGER for PullStreamDecoder 2019-01-09 17:11:32 -05:00
6bb73b509d fix: throw specific errors during XMLPullParser error 2019-01-09 17:10:56 -05:00