Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] Chunk [ text-decoration: none] is not a valid entry

Open hazcod opened this issue 3 years ago • 5 comments

Information

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

Stacktrace/Logcat

I: Using Apktool 2.6.1 on foo.apk
I: Loading resource table...
Exception in thread "main" java.lang.IllegalArgumentException: Chunk [ text-decoration: none] is not a valid entry
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:220)
	at com.google.common.base.Splitter$MapSplitter.split(Splitter.java:528)
	at brut.androlib.res.decoder.StringBlock$Tag.toString(StringBlock.java:167)
	at java.base/java.lang.String.valueOf(String.java:4213)
	at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
	at brut.androlib.res.decoder.StringBlock.processStyledString(StringBlock.java:260)
	at brut.androlib.res.decoder.StringBlock.getHTML(StringBlock.java:288)
	at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:366)
	at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:285)
	at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:261)
	at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:184)
	at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:135)
	at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:84)
	at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:50)
	at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:783)
	at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:64)
	at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:56)
	at brut.androlib.Androlib.getResTable(Androlib.java:70)
	at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:247)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:109)
	at brut.apktool.Main.cmdDecode(Main.java:175)
	at brut.apktool.Main.main(Main.java:79)

Steps to Reproduce

  1. apktool d foo.apk

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.

hazcod avatar Aug 09 '22 05:08 hazcod

Happen to have the full string of that resource? Could even grep for it with aapt d resources --values name.apk

iBotPeaches avatar Aug 09 '22 10:08 iBotPeaches

This is the full string of the resource. Note that when I tried the --values flag it gave me an error: aapt d resources --values foobar.apk W/asset (299236): Asset path --values is neither a directory nor file (type=1). ERROR: dump failed because assets could not be loaded

Below is the output without the --values flag. dump.txt .

Doomed5G avatar Aug 09 '22 13:08 Doomed5G

Sorry I believe it was then

aapt d resources foobar.apk --values | grep 'decoration'

That will include the values with the affected string

iBotPeaches avatar Aug 09 '22 13:08 iBotPeaches

Ok, this is the given output if I grep for 'decoration'.

spec resource 0x7f070473 com.foobar.kabinet:dimen/home_track_item_decoration_height: flags=0x00000000 spec resource 0x7f070474 com.foobar.kabinet:dimen/home_track_item_decoration_vertical_padding: flags=0x00000000 spec resource 0x7f070475 com.foobar.kabinet:dimen/home_track_item_decoration_width: flags=0x00000000 resource 0x7f070473 com.foobar.kabinet:dimen/home_track_item_decoration_height: t=0x05 d=0x00002001 (s=0x0008 r=0x00) resource 0x7f070474 com.foobar.kabinet:dimen/home_track_item_decoration_vertical_padding: t=0x05 d=0x00000401 (s=0x0008 r=0x00) resource 0x7f070475 com.foobar.kabinet:dimen/home_track_item_decoration_width: t=0x05 d=0x00000201 (s=0x0008 r=0x00)

Thanks.

Doomed5G avatar Aug 09 '22 13:08 Doomed5G

Apologies for passing wrong commands. Was doing this from memory. You'd want:

aapt d --values resources foobar.apk | grep 'decoration'

iBotPeaches avatar Aug 21 '22 17:08 iBotPeaches

Closing this one as duplicate (even though it was first) because the other one has an attached APK and I could triage it immediately.

I believe its same root issue.

https://github.com/iBotPeaches/Apktool/issues/2890

iBotPeaches avatar Sep 21 '22 10:09 iBotPeaches