Open sealinglip opened 9 years ago
yes, seams dex2jar is buggy on the 'constructor' var.
the different between dex2jar and smali is that the token sequence is different
.field
private
final
constructor
:
Lcom/google/mygson/internal/ObjectConstructor;
.field
private
final
constructor:Lcom/google/mygson/internal/ObjectConstructor;
the constructor
token is greedy eat by sAccList
The problem I'm seeing is referenced [here] (https://github.com/JesusFreke/smali/issues/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!