Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'has invalid entry name' error for $ in a resource name #2271

Closed
p01arbear opened this issue Jan 3, 2020 · 10 comments
Closed

'has invalid entry name' error for $ in a resource name #2271

p01arbear opened this issue Jan 3, 2020 · 10 comments
Labels

Comments

@p01arbear
Copy link

p01arbear commented Jan 3, 2020

Information

  1. Apktool Version (apktool -version) - 2.4.1
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Playstore

Stacktrace/Logcat

Without --no-res build failed on <=2.4.1 with:

brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_11539218468336209270.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 28, --version-code, 11060065, --version-name, 11.6.0, --no-version-vectors, -F, /tmp/APKTOOL9525969781244891391.tmp, -e, /tmp/APKTOOL302453863322533635.tmp, -0, arsc, -I, /home/user/.local/share/apktool/framework/1.apk, -S, /home/user/src-dir/res, -M, /home/user/src-dir/AndroidManifest.xml]

Also there is strange difference between classes3.dex which uses this resourse:
original || rebuilded

Header Magic: dex\n035									Header Magic: dex\n035
Checksum: 63f7d3db (correct)							   |	Checksum: 3dd18ccd (correct)
File Size:    0x6dbd94 7191956							   |	File Size:    0x704c94 7359636
Header Size:  0x70       112								Header Size:  0x70       112
Endian:       0x12345678								Endian:       0x12345678
Map:                    @0x6dbcb8 with 18 items					   |	Map:                    @0x704bb8 with 18 items
 Item  0: type: Header                 0x0    size:     1 offset: 0x  0			 Item  0: type: Header                 0x0    size:     1 offset: 0x  0
 Item  1: type: String IDs             0x1    size: 49738 offset: 0x 70			 Item  1: type: String IDs             0x1    size: 49738 offset: 0x 70
 Item  2: type: Type IDs               0x2    size:  8989 offset: 0x30998		 Item  2: type: Type IDs               0x2    size:  8989 offset: 0x30998
 Item  3: type: Proto IDs              0x3    size: 13848 offset: 0x3960c		 Item  3: type: Proto IDs              0x3    size: 13848 offset: 0x3960c
 Item  4: type: Field IDs              0x4    size: 65369 offset: 0x61f2c		 Item  4: type: Field IDs              0x4    size: 65369 offset: 0x61f2c
 Item  5: type: Method IDs             0x5    size: 47752 offset: 0xe19f4		 Item  5: type: Method IDs             0x5    size: 47752 offset: 0xe19f4
 Item  6: type: Class Defs             0x6    size:  6099 offset: 0x13ee34		 Item  6: type: Class Defs             0x6    size:  6099 offset: 0x13ee34
 Item  7: type: Code                   0x2001 size: 39249 offset: 0x16e894	   |	 Item 15: type: Code                   0x2001 size: 39249 offset: 0x437444
 Item  8: type: Debug Info             0x2003 size:  7476 offset: 0x3cdec0	   |	 Item 14: type: Debug Info             0x2003 size: 36074 offset: 0x3f8858
 Item  9: type: Type List              0x1001 size:  6645 offset: 0x3e63f0	   |	 Item  8: type: Type List              0x1001 size:  6645 offset: 0x310120
 Item 10: type: String Data            0x2002 size: 49738 offset: 0x3f67b2	   |	 Item  7: type: String Data            0x2002 size: 49738 offset: 0x16e894
 Item 11: type: Annotation             0x2004 size: 11619 offset: 0x59803e	   |	 Item 10: type: Annotation             0x2004 size: 11619 offset: 0x35060b
 Item 12: type: Map                    0x2000 size:  5902 offset: 0x5e88c5	   |	 Item 16: type: Map                    0x2000 size:  5902 offset: 0x696a6e
 Item 13: type: Encoded Array          0x2005 size:   417 offset: 0x6541c0	   |	 Item  9: type: Encoded Array          0x2005 size:   414 offset: 0x3204e4
 Item 14: type: Annotations Set Item   0x1003 size: 10381 offset: 0x684300	   |	 Item 11: type: Annotations Set Item   0x1003 size: 10382 offset: 0x3a0e94
 Item 15: type: Annotations Ref Ref List 0x1002 size:   230 offset: 0x6a0578	   |	 Item 12: type: Annotations Ref Ref List 0x1002 size:   230 offset: 0x3bd110
 Item 16: type: Annotations Directory  0x2006 size:  5448 offset: 0x6a1ac0	   |	 Item 13: type: Annotations Directory  0x2006 size:  5448 offset: 0x3be660
 Item 17: type: Map List               0x1000 size:     1 offset: 0x6dbcb8	   |	 Item 17: type: Map List               0x1000 size:     1 offset: 0x704bb8
Link:         0 bytes   @0x0								Link:         0 bytes   @0x0
String IDs: 49738 strings @0x70								String IDs: 49738 strings @0x70
Type   IDs: 8989 types   @0x30998							Type   IDs: 8989 types   @0x30998
Field  IDs: 65369 fields  @0x61f2c							Field  IDs: 65369 fields  @0x61f2c
Proto  IDs: 13848 protos  @0x3960c							Proto  IDs: 13848 protos  @0x3960c
Method IDs: 47752 methods @0xe19f4							Method IDs: 47752 methods @0xe19f4
Class Defs: 6099 classes @0x13ee34							Class Defs: 6099 classes @0x13ee34
Data: 5690624 bytes @0x16e894							   |	Data: 5858304 bytes @0x16e894

Is it expected that rebuilder may change sizes of dex sections?

Steps to Reproduce

  1. apktool decode
  2. apktool build

Frameworks

APK is NOT from an OEM ROM

APK

Latest Tinder official base apk from Playstore.

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes.
  2. If you are trying to install a modified apk, did you resign it? Yes.
  3. Are you using the latest apktool version? Yes.
@Ticklefish
Copy link

I tried your file, installing AOSP framework-res.apk first, and it doesn't recompile because of this:

(java -jar user_files\APKTOOL\apktool_2.4.1.jar b --copy-original --force-all --use-aapt2 -p _WorkArea1\Frameworks _WorkArea1_working\tnd.apk -o _WorkArea1_out\tnd.apk)

-c/--copy-original has been deprecated. Removal planned for v2.5.0 (#2129)
I: Using Apktool 2.4.1
I: Smaling smali folder into classes.dex...
I: Smaling smali_classes10 folder into classes10.dex...
I: Smaling smali_classes11 folder into classes11.dex...
I: Smaling smali_classes12 folder into classes12.dex...
I: Smaling smali_classes13 folder into classes13.dex...
I: Smaling smali_classes14 folder into classes14.dex...
I: Smaling smali_classes15 folder into classes15.dex...
I: Smaling smali_classes16 folder into classes16.dex...
I: Smaling smali_classes17 folder into classes17.dex...
I: Smaling smali_classes18 folder into classes18.dex...
I: Smaling smali_classes19 folder into classes19.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Smaling smali_classes3 folder into classes3.dex...
I: Smaling smali_classes4 folder into classes4.dex...
I: Smaling smali_classes5 folder into classes5.dex...
I: Smaling smali_classes6 folder into classes6.dex...
I: Smaling smali_classes7 folder into classes7.dex...
I: Smaling smali_classes8 folder into classes8.dex...
I: Smaling smali_classes9 folder into classes9.dex...
I: Building resources...
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\plurals.xml:324: error: invalid value for type 'plurals'. Expected a reference.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\plurals.xml: error: file failed to compile.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4259: error: resource 'drawable/$$animated_circular_progress_indicator__1__0' has invalid entry name '$$animated_circular_progress_indicator__1__0'. Invalid character '$$animated_circular_progress_indicator__1__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4260: error: resource 'drawable/$$animated_circular_progress_indicator__1__1' has invalid entry name '$$animated_circular_progress_indicator__1__1'. Invalid character '$$animated_circular_progress_indicator__1__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4261: error: resource 'drawable/$animated_checkmark_progress_indicator__0' has invalid entry name '$animated_checkmark_progress_indicator__0'. Invalid character '$animated_checkmark_progress_indicator__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4262: error: resource 'drawable/$animated_checkmark_progress_indicator__1' has invalid entry name '$animated_checkmark_progress_indicator__1'. Invalid character '$animated_checkmark_progress_indicator__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4263: error: resource 'drawable/$animated_circular_progress_indicator__0' has invalid entry name '$animated_circular_progress_indicator__0'. Invalid character '$animated_circular_progress_indicator__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4264: error: resource 'drawable/$animated_circular_progress_indicator__1' has invalid entry name '$animated_circular_progress_indicator__1'. Invalid character '$animated_circular_progress_indicator__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4265: error: resource 'drawable/$animated_circular_progress_indicator__2' has invalid entry name '$animated_circular_progress_indicator__2'. Invalid character '$animated_circular_progress_indicator__2'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4266: error: resource 'drawable/$avd_friend_match_selector_indicator__0' has invalid entry name '$avd_friend_match_selector_indicator__0'. Invalid character '$avd_friend_match_selector_indicator__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4267: error: resource 'drawable/$avd_friend_match_selector_indicator__1' has invalid entry name '$avd_friend_match_selector_indicator__1'. Invalid character '$avd_friend_match_selector_indicator__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4268: error: resource 'drawable/$avd_friend_match_selector_indicator__2' has invalid entry name '$avd_friend_match_selector_indicator__2'. Invalid character '$avd_friend_match_selector_indicator__2'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4269: error: resource 'drawable/$avd_friend_match_selector_indicator__3' has invalid entry name '$avd_friend_match_selector_indicator__3'. Invalid character '$avd_friend_match_selector_indicator__3'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4270: error: resource 'drawable/$avd_hide_password__0' has invalid entry name '$avd_hide_password__0'. Invalid character '$avd_hide_password__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4271: error: resource 'drawable/$avd_hide_password__1' has invalid entry name '$avd_hide_password__1'. Invalid character '$avd_hide_password__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4272: error: resource 'drawable/$avd_hide_password__2' has invalid entry name '$avd_hide_password__2'. Invalid character '$avd_hide_password__2'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4273: error: resource 'drawable/$avd_show_password__0' has invalid entry name '$avd_show_password__0'. Invalid character '$avd_show_password__0'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4274: error: resource 'drawable/$avd_show_password__1' has invalid entry name '$avd_show_password__1'. Invalid character '$avd_show_password__1'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4275: error: resource 'drawable/$avd_show_password__2' has invalid entry name '$avd_show_password__2'. Invalid character '$avd_show_password__2'.
W: C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res\values\public.xml:4276: error: resource 'drawable/$dollar_boost_bolt__0' has invalid entry name '$dollar_boost_bolt__0'. Invalid character '$dollar_boost_bolt__0'.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Me\AppData\Local\Temp\brut_util_Jar_5643842098940535297.tmp, compile, --dir, C:\TickleMyAndroid_WorkArea1_working\tnd.apk\res, --legacy, -o, C:\TickleMyAndroid_WorkArea1_working\tnd.apk\build\resources.zip]

That dollar sign isn't a valid character which is why the file won't recompile. You'll need to change these filenames to get your file to recompile. You'll also need to fix the line in plurals.xml.

Decompiling and recompiling without processing resources.arsc works without any errors.

Oh, and the resource you mentioned at the top of your post? It's in the drawable-sw600dp folder so should be in the recompiled APK.

@p01arbear
Copy link
Author

p01arbear commented Jan 6, 2020

Thank you. Indeed, usage of --use-aapt2 is the key to avoid --no-res.

And I don't understand why

That dollar sign isn't a valid character
$$animated_circular_progress_indicator__1__0' has invalid entry name

resource name, which is either: the filename, excluding the extension; or the value in the XML
So $ is a valid character due to spec.

You'll also need to fix the line in plurals.xml.

plurals.xml:234    <item type="plurals" name="APKTOOL_DUMMY_4">false</item>

I guess it's dummy values bug.

@p01arbear p01arbear changed the title Resources$NotFoundException after decompile & rebuild $ in resource name break build with 'has invalid entry name' error Jan 11, 2020
@p01arbear p01arbear changed the title $ in resource name break build with 'has invalid entry name' error 'has invalid entry name' error for $ in resource name Jan 11, 2020
@p01arbear p01arbear changed the title 'has invalid entry name' error for $ in resource name 'has invalid entry name' error for $ in a resource name Jan 11, 2020
@iBotPeaches
Copy link
Owner

iBotPeaches commented Apr 12, 2020

Is it expected that rebuilder may change sizes of dex sections?

I see it looks like the debug info section got smaller, probably that.

The spec allows $ and I thought I patched it for sure. I'll hold this open and double check. With both aapt1/aapt2 and win/mac/osx to build I must have missed something.

@sergentum
Copy link

sergentum commented May 3, 2020

I have the same issue.

I: Using Apktool 2.4.1_0303
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\arrays.xml:962: error: invalid value for type 'array'. Expected a reference.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\plurals.xml:463: error: invalid value for type 'plurals'. Expected a reference.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\plurals.xml:464: error: invalid value for type 'plurals'. Expected a reference.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3755: error: resource 'drawable/$avd_hide_password__0' has invalid entry name '$avd_hide_password__0'. Invalid character '$avd_hide_password__0'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3756: error: resource 'drawable/$avd_hide_password__1' has invalid entry name '$avd_hide_password__1'. Invalid character '$avd_hide_password__1'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3757: error: resource 'drawable/$avd_hide_password__2' has invalid entry name '$avd_hide_password__2'. Invalid character '$avd_hide_password__2'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3758: resource 'drawable/$avd_show_password__0' has invalid entry name '$avd_show_password__0'. Invalid character '$avd_show_password__0'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3759: error: resource 'drawable/$avd_show_password__1' has invalid entry name '$avd_show_password__1'. Invalid character '$avd_show_password__1'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:3760: error: resource 'drawable/$avd_show_password__2' has invalid entry name '$avd_show_password__2'. Invalid character '$avd_show_password__2'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:7370: error: resource 'drawable/$ft_ic_no_media_holder__0' has invalid entry name '$ft_ic_no_media_holder__0'. Invalid character '$ft_ic_no_media_holder__0'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:7371: error: resource 'drawable/$ft_ic_no_media_holder__1' has invalid entry name '$ft_ic_no_media_holder__1'. Invalid character '$ft_ic_no_media_holder__1'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:7372: error: resource 'drawable/$ft_ic_no_media_holder__2' has invalid entry name '$ft_ic_no_media_holder__2'. Invalid character '$ft_ic_no_media_holder__2'.
W: D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res\values\public.xml:7373: error: resource 'drawable/$ft_ic_no_media_holder__3' has invalid entry name '$ft_ic_no_media_holder__3'. Invalid character '$ft_ic_no_media_holder__3'.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\username\AppData\Local\Temp\BAT_temp\brut_util_Jar_4113801838252819575.tmp, compile, --dir, D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\res, --legacy, -o, D:\projects\BatchApkTool_INPUT_APK\AeX-4.2.0-AMSUser\build\resources.zip]

Windows 10. apktool also tried to build by myself and also tried to launch in IDE to debug, but still have the same result.

@muslemomar
Copy link

same issue I guess. (aapt2 enabled):

I: Using Apktool 2.4.1 I: Copying C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c} classes.dex file... I: Copying C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c} classes2.dex file... I: Copying C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c} classes3.dex file... I: Copying C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c} classes4.dex file... I: Building resources... W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:540: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:541: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:542: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:543: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:544: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:545: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:546: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml:547: error: invalid value for type 'array'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\arrays.xml: error: file failed to compile. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml:15: error: invalid value for type 'plurals'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml:16: error: invalid value for type 'plurals'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml:17: error: invalid value for type 'plurals'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml:18: error: invalid value for type 'plurals'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml:19: error: invalid value for type 'plurals'. Expected a reference. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\plurals.xml: error: file failed to compile. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\public.xml:2418: error: resource 'drawable/$ic_backupsound_gradient_24_24__0' has invalid entry name '$ic_backupsound_gradient_24_24__0'. Invalid character '$ic_backupsound_gradient_24_24__0'. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\public.xml:2419: error: resource 'drawable/$ic_ico_purchase_newfeatures_gradient_24_24__0' has invalid entry name '$ic_ico_purchase_newfeatures_gradient_24_24__0'. Invalid character '$ic_ico_purchase_newfeatures_gradient_24_24__0'. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\public.xml:2420: error: resource 'drawable/$ic_ico_purchase_turnoffads_gradient_24_24__0' has invalid entry name '$ic_ico_purchase_turnoffads_gradient_24_24__0'. Invalid character '$ic_ico_purchase_turnoffads_gradient_24_24__0'. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\public.xml:2421: error: resource 'drawable/$ic_mission_typing_gradient_24_24__0' has invalid entry name '$ic_mission_typing_gradient_24_24__0'. Invalid character '$ic_mission_typing_gradient_24_24__0'. W: C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res\values\public.xml:2422: error: resource 'drawable/$ic_mission_walking_gradient_24_24__0' has invalid entry name '$ic_mission_walking_gradient_24_24__0'. Invalid character '$ic_mission_walking_gradient_24_24__0'. brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\muslim\AppData\Local\Temp\brut_util_Jar_8728328140509795327.tmp, compile, --dir, C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\res, --legacy, -o, C:\Users\muslim\AppData\Local\Temp\apk-editor-studio\apk\{c806ce54-f7b4-4ffb-bf36-8da97da1447c}\build\resources.zip]

@SamuelScheit
Copy link

I have the same issue

@iBotPeaches
Copy link
Owner

➜  2271 apktool d tnd.apk 
I: Using Apktool 2.4.2-f545c2-SNAPSHOT on tnd.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes10.dex...
I: Baksmaling classes11.dex...
I: Baksmaling classes12.dex...
I: Baksmaling classes13.dex...
I: Baksmaling classes14.dex...
I: Baksmaling classes15.dex...
I: Baksmaling classes16.dex...
I: Baksmaling classes17.dex...
I: Baksmaling classes18.dex...
I: Baksmaling classes19.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Baksmaling classes6.dex...
I: Baksmaling classes7.dex...
I: Baksmaling classes8.dex...
I: Baksmaling classes9.dex...
I: Baksmaling assets/audience_network.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
➜  2271

You get some errors on build, but not the original ones:

➜  2271 apktool b tnd --use-aapt2
I: Using Apktool 2.4.2-f545c2-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /home/ibotpeaches/Downloads/Apktool/2271/tnd/res/values/plurals.xml:324: error: invalid value for type 'plurals'. Expected a reference.
W: /home/ibotpeaches/Downloads/Apktool/2271/tnd/res/values/plurals.xml: error: file failed to compile.
W: /home/ibotpeaches/Downloads/Apktool/2271/tnd/res/values/styles.xml:6293: error: invalid value for type 'style'. Expected a reference.
W: /home/ibotpeaches/Downloads/Apktool/2271/tnd/res/values/styles.xml: error: file failed to compile.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_63118493868854920724276778402417756603.tmp, compile, --dir, /home/ibotpeaches/Downloads/Apktool/2271/tnd/res, --legacy, -o, /home/ibotpeaches/Downloads/Apktool/2271/tnd/build/resources.zip]
➜  2271 

Fix those two resources and:

➜  2271 apktool b tnd --use-aapt2
I: Using Apktool 2.4.2-f545c2-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/kotlin)
I: Copying libs... (/META-INF/services)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
➜  2271 

Closing as solved in upcoming release. Watch this space for the linked bug for those bad resources.

@iBotPeaches
Copy link
Owner

See #2438 - for the issue related to those dummy properties.

@wanstr
Copy link

wanstr commented Jan 21, 2022

I see the status of the issue is marked as closed but I still seem to have this issue with v2.6.0. So the fix is still pending?

@iBotPeaches
Copy link
Owner

I see the status of the issue is marked as closed but I still seem to have this issue with v2.6.0. So the fix is still pending?

Please open new issue with details if you are still experiencing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants