-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
d2j-smali : no viable alternative at input ':' #16
Comments
yes, seams dex2jar is buggy on the 'constructor' var. the different between dex2jar and smali is that the token sequence is different
the |
Fix issue #16 pxb1988/dex2jar#16
The problem I'm seeing is referenced [here] (JesusFreke/smali#251) and I get that its not relevant to this but this tool and the ApkTool seem to be in disagreement. I'm seeing this issue come up when using the ApkTool lib when attempting to re-build an APK. I'm using this tool to convert from dex to smali .The variable names in my source that are throwing the errors are: "views", "intent", "pending"... Will renaming my variables solve this issue? |
If a field is named as some special word, e.g. 'constructor', as the following shows
.field private final constructor:Lcom/google/mygson/internal/ObjectConstructor;
The small parser would complain as the title shows.
I think there should be some bug in the ANTLR rule 'sField', and perhaps other rules quote rule 'sAccList' are also the same.
sField : '.field' acc=sAccList (f=sFieldF|f=sFieldP) ('=' v=sFieldValue)?
(sAnnotation*
'.end field')?
;
As in the above-mentioned case, the token 'constructor' will be matched as a ACC because rule 'sAccList' is greedy and it will not go into the following rule to be matched as a field name.
I'm a newbie to ANTLR. It seems Apktool use the same rule to parse a field declaration, but it's surprising it works fine. And I also tried to change rule 'sAccList' into a nongreedy rule, but I failed.
I'm sorry I'm also a newbie to Github and I even don't know how to highlight the code snippet.
I hope the information above could help you!
The text was updated successfully, but these errors were encountered: