本文介绍了Proguard的keepclasseswithmembers:会员心不是保存在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要保持的2个文件类会员:等级和情节。我proguard.cfg文件:

I have to keep class and members of 2 files: Level and Episode. My proguard.cfg files:

-keepclasseswithmembers class games.levels.Episode {
public java.util.ArrayList<java.lang.String> levelLinks;
public java.util.ArrayList<Level> levels;
public java.util.ArrayList<java.lang.String> skin;
public int id;
}
-keepclasseswithmembers class games.levels.Level {
public int id;
public int episode;
public int numEnemies;
}

和我proguards的mapping.txt文件:

And my proguards mapping.txt file:

games.levels.Level -> games.levels.Level:
    int id -> id
    int episode -> episode
    int numEnemies -> numEnemies
games.levels.Episode -> games.levels.a:
    java.util.ArrayList levelLinks -> a
    java.util.ArrayList levels -> b
    java.util.ArrayList skin -> c
    int id -> d

我只是不明白这里发生了什么。任何人都可以请帮我一些痕迹,为什么层面的工作,但与情节?预先感谢。

I just can't understand what happens here. Could anyone please help me some traces why Level work, but not with Episode? Thank in advance.

推荐答案

解决了!
如果你想保持一个类的所有成员的名字,只是使用通配符=>这意味着任何匹配字段:

SOLVED AT LAST!If you wanna keep names of all members of a class, just use wildcard=> it means matching any fields:

-keep class X.Y.Z {
    <fields>;
}

这篇关于Proguard的keepclasseswithmembers:会员心不是保存在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 11:14