LibGDX proguard

 ̄綄美尐妖づ 提交于 2019-12-11 06:01:26

问题


I have been trying to shrink the size of my libGDX game .jar. I have been trying to get proguard to work. Proguard keeps complaining about missing classes, or the output .jar won't run.

I have tried all the existing configuration files I found for libGDX.

Does anyone have experience with setting up proguard?


回答1:


You can use the following configuration for libGDX:

-dontwarn com.badlogic.gdx.**
-dontnote com.badlogic.gdx.**

-keepclassmembers class com.badlogic.gdx.graphics.Cubemap* { *; }
-keepclassmembers class com.badlogic.gdx.graphics.GL* { *; }

# for Android backend
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
    <init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
}

# for box2d plugin
-keepclassmembers class com.badlogic.gdx.physics.box2d.World {
    boolean contactFilter(long, long);
    void    beginContact(long);
    void    endContact(long);
    void    preSolve(long, long);
    void    postSolve(long, long);
    boolean reportFixture(long);
    float   reportRayFixture(long, float, float, float, float, float);
}


来源:https://stackoverflow.com/questions/39249056/libgdx-proguard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!