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

[BUG] #2900

Closed
MaSven opened this issue Oct 10, 2022 · 0 comments
Closed

[BUG] #2900

MaSven opened this issue Oct 10, 2022 · 0 comments

Comments

@MaSven
Copy link
Contributor

MaSven commented Oct 10, 2022

Information

  1. commit 87223d3 -
  2. Linux -
  3. apkmirror -

Stacktrace/Logcat

Exception in thread "main" java.lang.IllegalArgumentException: Chunk [] 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.StyledString$Span.getAttributes(StyledString.java:84)
	at brut.androlib.res.decoder.StyledString$Decoder.decodeIterate(StyledString.java:129)
	at brut.androlib.res.decoder.StyledString$Decoder.decode(StyledString.java:116)
	at brut.androlib.res.decoder.StyledString.toString(StyledString.java:48)
	at brut.androlib.res.decoder.StringBlock.getHTML(StringBlock.java:131)
	at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:393)
	at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:312)
	at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:297)
	at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:212)
	at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:133)
	at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:85)
	at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:51)
	at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:790)
	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:74)
	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 -f dhl.apk

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)

APK

https://www.apkmirror.com/apk/deutsche-post-dhl/dhl-paket/dhl-paket-8-3-32-1250-release/post-dhl-8-3-32-1250-android-apk-download/download/?key=ed33303c8ff8a9ef6b4cf27bdd027e38b45c8a1f&forcebaseapk=true

Questions to ask before submission

I think the issue is, that this apk includes this string

a;style=color:#D40511;;href=https://www.dhl.de/de/toolbar/footer/app/datenschutz.data.html

In this line at brut.androlib.res.decoder.StyledString$Span.getAttributes(StyledString.java:84).

So, this evaluates to a not valid map entry. This is also a documented behavious of the used Splitter. At the throws section.

Splits sequence into substrings, splits each substring into an entry, and returns an unmodifiable map with each of the entries. For example, Splitter.on(';').trimResults().withKeyValueSeparator("=>").split("a=>b ; c=>b") will return a mapping from "a" to "b" and "c" to "b".
The returned map preserves the order of the entries from sequence.
Throws:
IllegalArgumentException – if the specified sequence does not split into valid map entries, or if there are duplicate keys

MaSven added a commit to MaSven/Apktool that referenced this issue Oct 10, 2022
Fastst way to fix empty key value splitting for styled strings.

Signed-off-by: Sven Marquardt <dev@mail.smarquardt.space>
MaSven added a commit to MaSven/Apktool that referenced this issue Oct 10, 2022
Fastst way to fix empty key value splitting for styled strings.

Signed-off-by: Sven Marquardt <dev@mail.smarquardt.space>
MaSven added a commit to MaSven/Apktool that referenced this issue Oct 10, 2022
Fastst way to fix empty key value splitting for styled strings.

Signed-off-by: Sven Marquardt <dev@mail.smarquardt.space>
iBotPeaches added a commit that referenced this issue Oct 12, 2022
iBotPeaches added a commit that referenced this issue Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant