yausername / youtubedl-android

youtube-dl for android
GNU General Public License v3.0
947 stars 172 forks source link

Make this library proguard friendly #222

Closed zunjae closed 1 year ago

zunjae commented 1 year ago

Hello

Just wanted to thank you for developing this library.

I have a suggestion

Since I heavily obfuscate my code - including those from third party libraries - json serialization breaks. The variable description inside VideoInfo gets changed to abcd, causing the deserialization to fail.

A workaround I don't really agree with is using

-keep class com.yausername.youtubedl_android.mapper.** { *; }

A solution to this problem is to annotate each variable in your Java class. I know this sounds like a pain, but it can be automated inside Android Studio using a json plugin.

so

private String fulltitle;

becomes

@JsonProperty("fulltitle")
private String fulltitle;
JunkFood02 commented 1 year ago

parse the json response by yourself is probably a better solution

JunkFood02 commented 1 year ago

Also, this library can be only used under the GPLv3 license. In other words, you're prohibited to use this library when you're using it in your closed source software

zunjae commented 1 year ago

Good to know. In that case I'll have to drop this library.