Commit Graph

1550 Commits

Author SHA1 Message Date
Connor Tumbleson
5f43a1fbca
style: cleanup formatting 2019-06-01 09:27:41 -04:00
Connor Tumbleson
4a856b46c4
Merge branch 'feature/keep-meta-inf-services-folder' of https://github.com/adibfara/Apktool into adibfara-feature/keep-meta-inf-services-folder 2019-06-01 09:08:04 -04:00
Connor Tumbleson
ed7633fbe8
build: update smali/baksmali to 2.2.7 2019-06-01 09:00:54 -04:00
Adib Faramarzi
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
Adib Faramarzi
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
Adib Faramarzi
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
Adib Faramarzi
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
Connor Tumbleson
25a65186a9 test: add "android:appCategory=game" into AndroidManifest.xml
- refs: #2055
2019-05-07 18:12:53 -04:00
Connor Tumbleson
d3ec0b8508
Merge pull request #2069 from iBotPeaches/mx-cleanup
Prevent NPE with missing attributes
2019-04-26 17:38:57 -04:00
Connor Tumbleson
6c17e1a14f fix: prevent NPE when key-element is null 2019-04-26 15:17:03 -04:00
Connor Tumbleson
f1357109aa style: reorganize MXSerializer 2019-04-26 14:26:20 -04:00
Connor Tumbleson
3037024022 test: add 32,767 byte string for aapt2
- https://issuetracker.google.com/issues/73456167
2019-04-26 14:11:41 -04:00
Connor Tumbleson
5199c98a71
Merge pull request #2068 from iBotPeaches/issue-2064
Fix: Support decoding raw "qmg" files
2019-04-26 11:35:58 -04:00
Connor Tumbleson
4030e94cb3 test: aapt2 test for raw qmg file 2019-04-26 11:14:51 -04:00
Connor Tumbleson
adbde1745f fix: "qpm" can exist without 9patch, and use new "copyToDir" 2019-04-26 11:14:31 -04:00
Connor Tumbleson
d068c3e481 feat: new "copyToDir" where inFilename/outFilename differs 2019-04-26 11:14:08 -04:00
Connor Tumbleson
73ac0d96fb
Merge pull request #2066 from iBotPeaches/issue-2045
Support for SDK_Q shorthand
2019-04-24 19:56:15 -04:00
Connor Tumbleson
422f964041
Merge pull request #2067 from iBotPeaches/issue-2048
fix: create directory if doesn't exist, before error
2019-04-24 19:55:38 -04:00
Connor Tumbleson
95fe0f3f02 test: assert SDK_Q works with insane test value (10,000) 2019-04-24 18:46:48 -04:00
Connor Tumbleson
f3f634f010 fix: add SDK_Q (test) value of 10,000 2019-04-24 18:46:48 -04:00
Connor Tumbleson
2e75f7b799 fix: create directory if doesn't exist, before error 2019-04-24 18:45:57 -04:00
Connor Tumbleson
d1b0025c4e fix: correct location of JAVA_HOME 2019-04-24 18:32:26 -04:00
Connor Tumbleson
cf9e8662b8 fix: jdk211 for clean/build 2019-04-24 18:29:26 -04:00
Connor Tumbleson
16c50d56e5 build: travis complaining about JAVA_HOME now 2019-04-24 18:25:41 -04:00
Connor Tumbleson
813cd911f2 build: update jdk path for windows
- need an automated solution for this
2019-04-24 18:12:43 -04:00
Connor Tumbleson
cc194daf83
fix: document 2.4.0 change on "api-level" for build
- fixes: #2027
2019-03-03 07:03:12 -05:00
Connor Tumbleson
ff407f80ce
docs: add information about generating author/commit count 2019-03-03 06:57:33 -05:00
Connor Tumbleson
f18e48c661
build: start new dev cycle (2.4.1-SNAPSHOT) 2019-03-02 21:55:54 -05:00
Connor Tumbleson
7ba7249ce3
build: version bump (2.4.0) 2019-03-01 19:37:47 -05:00
Connor Tumbleson
c8d2a6a853
Merge pull request #1959 from a-bahmani/patch-1
fix: prevent NPE when referencing a missing ResSpec
2019-02-28 06:29:40 -05:00
Connor Tumbleson
8e00de38a0
Merge branch 'master' into patch-1 2019-02-27 18:26:02 -05:00
Connor Tumbleson
53fdd9fc2f
build: update smali/baksmali to 2.2.6 2019-02-20 08:35:05 -05:00
Igor Eisberg
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
Igor Eisberg
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
Igor Eisberg
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
Connor Tumbleson
1a61e44632
Merge pull request #2015 from iBotPeaches/issue-1522
Add horizontal/vertical line support if missing for 9patch
2019-02-18 06:42:47 -05:00
Connor Tumbleson
bc7302a52b
test: assert that vertical/horizontal divs are added if missing 2019-02-17 13:07:32 -05:00
IgorEisberg
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
IgorEisberg
0efccc2d93
feat: allow configurable api-level for smali 2019-02-16 18:43:25 -05:00
Connor Tumbleson
438c4b9c59
build: windows is not an optional failure 2019-02-16 18:01:38 -05:00
Connor Tumbleson
91f6c80cc6
fix: add new aapt builds for mac 2019-02-16 18:01:38 -05:00
Connor Tumbleson
a9b5f7b41d
fix: add new unix builds for master aosp aapt 2019-02-16 18:01:38 -05:00
Connor Tumbleson
2c41ac1f7f
build: also patch the clean-tests for not completed win builds 2019-02-16 18:01:38 -05:00
Connor Tumbleson
443e5d3643
build: fix timeout in windows due to travis
- refs: https://travis-ci.community/t/windows-build-hangs-after-done-exit-0/1439
2019-02-16 18:01:38 -05:00
Connor Tumbleson
37e700424a
build: update jdk on windows from 191 to 201 2019-02-16 18:01:38 -05:00
Connor Tumbleson
b0f22918cc
fix: win builds off master branch of AOSP 2019-02-16 18:01:38 -05:00
Connor Tumbleson
2253b66e50
fix: rebuild windows binaries to fix linking issue 2019-02-16 18:01:38 -05:00
Connor Tumbleson
43c3b9644c
Merge pull request #2000 from vbarthel-fr/issue-1994
fix: issue 1994
2019-01-30 10:04:58 -05:00
Vincent Barthelemy
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
Vincent Barthelemy
72368fc0d4 bug: reproduce the bug were array resources are decoded as style bag 2019-01-29 10:06:32 +01:00