Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Proguard example #61

Closed
XIII-th opened this issue Nov 16, 2017 · 5 comments
Closed

Proguard example #61

XIII-th opened this issue Nov 16, 2017 · 5 comments

Comments

@XIII-th
Copy link
Contributor

XIII-th commented Nov 16, 2017

Around four weeks ago I found Autumn MVC and now I totally rewrite my game to this.
All work fine but after obfuscation with optimisation (proguard-android-optimize.txt settings file) game is not running.

I found solution which working in my case. It is:

# required to keep constructors for auto component creation
-keepclassmembers class com.xiii.lab.g_racing.** {
    public <init>(...);
}

# keep all members with autumn annotations
-keepclassmembers,allowobfuscation class * {
    @com.github.czyzby.** *;
}

and also:

-keepclassmembers enum com.badlogic.gdx.*$* { <fields>; }

last required additional for gdx proguard configuration. Why it required? I don't know, but without it game crashed.

I suggest to write complete example (as wiki page). I can miss some important points.

P.S. Framework is awesome!🌈 I can focus on gameplay with it. I'm looking forward to updates 😉

@czyzby
Copy link
Owner

czyzby commented Nov 16, 2017

Thank you for this, Proguard config example definitely deserves a wiki page. By the way, I'm pretty sure that only autumn and lml packages should be kept by Proguard - by including everything from com.github.czyzby, you're also keeping all of the Kiwi utilities which do not rely on reflection.

I'm glad that Autumn still has some users, but to be honest, I barely have any time to maintain all of my open source projects, and - if anything - I'm more focused on KTX. If you enjoy Kotlin or want to try it out, I suggest giving KTX a chance as well.

@XIII-th
Copy link
Contributor Author

XIII-th commented Nov 16, 2017

KTX - it's like an Autumn but it written for kotlin, right? @czyzby can you explain which benifits I can take if I migrate to KTX from Autumn?
Kotlin is novelty for me. I have not work with it yet

@czyzby
Copy link
Owner

czyzby commented Nov 16, 2017

I'd say Autumn MVC is more complex and feature packed. It implements common LibGDX boilerplate code, while forcing a specific way to structure your application. Autumn is basically a substitute for Spring for game devs with a Java backend background. People built some cool stuff with Autumn, but ultimately I believe the whole "framework on top of a framework" thing might be a bit too much for most hobby games devs, hence the lack of a bigger user base. It could also use more examples.

KTX, on the other hand, is less of a framework and more of a set of some lightweight libraries that bring Kotlin support for various parts of the LibGDX framework. I'd say there is some overlap between these sets of libraries, but they have a completely different approach.

  • Some utilities from the Kiwi library are handled by various KTX models like actors, app, collections or math.
  • LML is replaced by scene2d and vis modules which provide a Kotlin type-safe DSL to build Scene2D/VisUI views. LML is more flexible - since LML files are basically assets, they can be changed and reloaded at runtime (as shown by the LML examples project). KTX Scene2D DSL is safer and faster, since it does not rely on reflection and most widgets are validated in the compile time rather than runtime. Both have their issues and advantages.
  • Autumn is a rough equivalent of the inject module. Inject does not rely on reflection, so it should be slightly faster, but it lacks automatic component scan and requires more setup work.
  • There is no direct equivalent of Autumn MVC, since KTX does not aim to force any specific project structure.

Kiwi/LML/Autumn were one of my first programming projects and lack unit tests, while KTX is (almost) fully tested. That's partially the reason why updating KTX is very simple from a maintainer point of view, while LML updates usually lag some time behind, since I have to run a few example projects manually.

My honest opinion? If you're satisfied with the way Autumn MVC handles stuff, you can stick to that. If you prefer to use more or less pure LibGDX with some serious syntax sugar, try Kotlin + KTX.

By the way - if you haven't used Kotlin yet, I suggest giving it a try. It's a huge step forward comparing to the Java 6 that legacy Android devices require. Still, currently it will not work with the HTML LibGDX backend due to how GWT works. I'm pretty sure Autumn MVC could work even with Kotlin, although there might be some stuff you need to address to make it work.

@XIII-th
Copy link
Contributor Author

XIII-th commented Nov 17, 2017

Thanks for the expanded answer, @czyzby 🙂

@czyzby
Copy link
Owner

czyzby commented Dec 17, 2017

I added Autumn and Proguard wiki page. Thanks.

@czyzby czyzby closed this as completed Dec 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants