LibGDX proguard [英] LibGDX proguard

查看:169
本文介绍了LibGDX proguard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图缩小我的libGDX游戏的大小.jar。我一直试图让proguard工作。 Proguard一直在抱怨缺少类,或者输出.jar不会运行。

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.

我已经尝试了我为libGDX找到的所有现有配置文件。

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

有没有人有设置proguard的经验?

Does anyone have experience with setting up proguard?

推荐答案

您可以使用以下配置对于libGDX:

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);
}

这篇关于LibGDX proguard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆