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

遇到param有annotation的时候,dcc.py中的处理逻辑造成Multiple annotations blahblah, Could not smali file错误 #36

Closed
eggfly opened this issue Aug 9, 2020 · 2 comments

Comments

@eggfly
Copy link

eggfly commented Aug 9, 2020

类似这样的smali,在kotlin里面出现的比较多,每个参数都有表示非空的那个annotation:

69 # virtual methods
70 .method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
71 .locals 4
72 .param p1, "context" # Landroid/content/Context;
73 .annotation build Lorg/jetbrains/annotations/Nullable;
74 .end annotation
75 .end param
76 .param p2, "intent" # Landroid/content/Intent;
77 .annotation build Lorg/jetbrains/annotations/Nullable;
78 .end annotation
79 .end param

dcc会处理成:
.annotation build Lorg/jetbrains/annotations/Nullable;
.end annotation
.annotation build Lorg/jetbrains/annotations/Nullable;
.end annotation

然后apktool重新smali时报错:
xxxx.smali[73,26] Multiple annotations of type Lorg/jetbrains/annotations/Nullable;
xxxx.smali[73,26] mismatched tree node: UP expecting I_FIELDS
Could not smali file: xxxx.smali

@amimo
Copy link
Owner

amimo commented Aug 9, 2020

试下copy-runtime-annotation这个分支。

@eggfly
Copy link
Author

eggfly commented Aug 13, 2020

试下copy-runtime-annotation这个分支。

看到修复方法了~多谢。但是有个疑问哈,把非runtime的annotations去掉了,万一apk里有反射获取annotation的逻辑,少数情况就跪了,我自己改了一个版本,保留所有的annotation算了

@eggfly eggfly closed this as completed Aug 13, 2020
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