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

Unterminated character literal - no viable alt; token #805

Closed
iBotPeaches opened this issue Mar 3, 2021 · 4 comments
Closed

Unterminated character literal - no viable alt; token #805

iBotPeaches opened this issue Mar 3, 2021 · 4 comments

Comments

@iBotPeaches
Copy link
Contributor

I had a test that started failing on 2.5.0, and I thought it was related to some other issues, but now I'm stumped.

brut.androlib.decode.DecodeKotlinCoroutinesTest > kotlinCoroutinesEncodeAfterDecodeTest FAILED
    brut.androlib.AndrolibException: Could not smali file: kotlin/text/Typography.smali

As far as I can tell, it looks like a regular kotlin dex to me. Working directly through baksmali/smali I get.

➜  Desktop smali a out --verbose 
out/kotlin/text/Typography.smali[76,35] Error for input ''&': Unterminated character literal
out/kotlin/text/Typography.smali[78,0] [smali_file, field, literal]  no viable alt; token=[@259,4361:4366='.field',<FIELD_DIRECTIVE>,78:0] (decision=22 state 0) decision=<<>>
out/kotlin/text/Typography.smali[88,38] Error for input ''$': Unterminated character literal
out/kotlin/text/Typography.smali[90,0] [smali_file, field, literal]  no viable alt; token=[@355,4644:4649='.field',<FIELD_DIRECTIVE>,90:0] (decision=22 state 0) decision=<<>>
out/kotlin/text/Typography.smali[98,39] Error for input ''>': Unterminated character literal
out/kotlin/text/Typography.smali[100,0] [smali_file, field, literal]  no viable alt; token=[@435,4890:4895='.field',<FIELD_DIRECTIVE>,100:0] (decision=22 state 0) decision=<<>>
out/kotlin/text/Typography.smali[110,36] Error for input ''<': Unterminated character literal
out/kotlin/text/Typography.smali[112,0] [smali_file, field, literal]  no viable alt; token=[@531,5202:5207='.field',<FIELD_DIRECTIVE>,112:0] (decision=22 state 0) decision=<<>>
out/kotlin/text/Typography.smali[136,37] Error for input ''"': Unterminated character literal
out/kotlin/text/Typography.smali[138,0] [smali_file, field, literal]  no viable alt; token=[@739,5846:5851='.field',<FIELD_DIRECTIVE>,138:0] (decision=22 state 0) decision=<<>>

I thought it was related to the writer changes, but even using bare smali/baksmali.

classes.dex.zip

@JesusFreke
Copy link
Owner

Found the problem. Fix incoming. I'll let you test it out before I make a new version, haha :)

@JesusFreke
Copy link
Owner

Fixed in 5842cee.

I actually did a disassemble/assemble roundtrip on all the apps/framework jars from my android device, I'm a bit surprised that didn't flush this problem out.

But anyway, added a test at least. :)

If you can give it a try and report back, I'll go ahead and do another release if it looks good.

@iBotPeaches
Copy link
Contributor Author

➜  Desktop baksmali d classes.dex
➜  Desktop smali a out
➜  Desktop smali --version
smali 2.5.1-5842cee8-dirty (http://smali.org)
Copyright (C) 2010 Ben Gruver (JesusFreke@JesusFreke.com)
BSD license (http://www.opensource.org/licenses/bsd-license.php)
➜  Desktop
➜  duplicatedex git:(smali-2.5.0) baksmali d duplicatedex.apk 
➜  duplicatedex git:(smali-2.5.0) smali a out            
➜  duplicatedex git:(smali-2.5.0)  
➜  testkotlin git:(smali-2.5.0) baksmali d testkotlin.apk 
➜  testkotlin git:(smali-2.5.0) smali a out 
➜  testkotlin git:(smali-2.5.0)

We are good. I'll admit I'm not the best talented at overriding maven dependencies with a locally built archive to run the entire suite at once, so I just ran through the few dex tests we have and those all passed. Thanks again

@JesusFreke
Copy link
Owner

Thanks. The fix is in v2.5.2

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

2 participants