This happens on apktool 2.1.1 running on Linux, APK coming from a Mediatek 6.0 ROM, but is most probably not MTK specific.
For instance this line:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles_material.xml#846
This contains a @empty
Current apktool decodes it to @null which is wrong, the behaviour is different.
For instance https://android.googlesource.com/platform/frameworks/base.git/+/master/core/java/android/widget/PopupWindow.java#231
The hasValueOrEmpty will return false for @null, but true for @empty, so apktool d/b will change the behaviour of the matching firmware.
Namely, the CTS android.widget.cts.ListPopupWindowTest#testAccessAnimationStyle fails without this change.
Very nice catch. This seems to be the underlying issue (I think) affecting #1116
My check for empty vs null must be wrong - https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/value/ResValueFactory.java#L36
Here is the fix I currently am using:
https://github.com/phhusson/Apktool/commit/a210eafa28a952e0b08dc439092bbc8b9edfad39
Thanks! Looks good. I'll whip up some tests when I get a chance and get this merged in.
@phhusson could you post your built apktool with that fix?
Most helpful comment
Here you go:
https://drive.google.com/file/d/0B5fQwPNvh3h0YVR5WjlPbVJFUkU/view?usp=sharing