fix warnings, enable proguard

This commit is contained in:
Felix 2019-04-25 22:57:19 +02:00
parent 7ed31285ce
commit f42f2542ed
10 changed files with 28 additions and 14 deletions

View file

@ -11,10 +11,7 @@ class DatabaseFactory private constructor() {
ChaosflixDatabase::class.java, "mediaccc.de")
.addMigrations(
ChaosflixDatabase.migration_5_6)
.fallbackToDestructiveMigrationFrom(4)
.fallbackToDestructiveMigrationFrom(3)
.fallbackToDestructiveMigrationFrom(2)
.fallbackToDestructiveMigrationFrom(1)
.fallbackToDestructiveMigrationFrom(1,2,3,4)
.build()
})
}

View file

@ -1,9 +1,10 @@
package de.nicidienase.chaosflix.common.mediadata.entities.recording
import android.support.annotation.Keep
import java.util.*
import kotlin.collections.HashMap
@Keep
data class ConferencesWrapper(var conferences: List<ConferenceDto>) {

View file

@ -97,4 +97,3 @@ data class EventDto(@SerializedName("conference_id")
}
}
class EventsResponse (var events: List<EventDto>)

View file

@ -0,0 +1,6 @@
package de.nicidienase.chaosflix.common.mediadata.entities.recording
import android.support.annotation.Keep
@Keep
class EventsResponse (var events: List<EventDto>)

View file

@ -12,7 +12,7 @@ data class StreamUrl(var display: String = "",
var url: String = "") : Parcelable {
protected constructor(`in`: Parcel) : this(
private constructor(`in`: Parcel) : this(
display = `in`.readString() ?: "",
tech = `in`.readString() ?: "",
url = `in`.readString() ?: "")

1
gradle.properties Normal file
View file

@ -0,0 +1 @@
android.enableR8=false

View file

@ -40,9 +40,9 @@ android {
useProguard false
}
release {
useProguard false
minifyEnabled false
shrinkResources false
useProguard true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
@ -117,7 +117,7 @@ dependencies {
implementation "com.android.support:design:${rootProject.ext.supportLibraryVersion}"
implementation "com.android.support:preference-v14:${rootProject.ext.supportLibraryVersion}"
implementation "com.android.support:mediarouter-v7:${rootProject.ext.supportLibraryVersion}"
noFreeImplementation 'com.google.android.gms:play-services-cast-framework:16.1.0'
noFreeImplementation 'com.google.android.gms:play-services-cast-framework:16.2.0'
noFreeImplementation('pl.droidsonroids:casty:1.0.8') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}

View file

@ -22,6 +22,8 @@
-ignorewarnings
-dontwarn com.squareup.okhttp.**
-keep class pl.droidsonroids.casty.** { *; }
# Proguard configuration for Jackson 2.x (fasterxml package instead of codehaus package)
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
@ -72,4 +74,12 @@
-keep class .R
-keep class **.R$* {
<fields>;
}
# MediaRouter/Casty
-keep class android.support.v7.app.MediaRouteActionProvider{
*;
}
-keep class androidx.mediarouter.app.MediaRouteActionProvider{
*;
}

View file

@ -164,7 +164,7 @@ class BrowseActivity : AppCompatActivity(),
val keys = stream.urls.keys.toTypedArray()
val dialog = AlertDialog.Builder(this)
.setTitle(this.getString(R.string.select_stream))
.setItems(keys) { dialog: DialogInterface?, which: Int ->
.setItems(keys) { _: DialogInterface?, which: Int ->
val streamUrl = stream.urls[keys[which]]
if (streamUrl != null) {
castService.castStream(streamingItem, streamUrl, keys[which])

View file

@ -104,8 +104,8 @@
android:layout_gravity="bottom"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:max="@{downloadStatus.totalBytes}"
android:progress="@{downloadStatus.currentBytes}"/>
android:max="@{safeUnbox(downloadStatus.totalBytes)}"
android:progress="@{safeUnbox(downloadStatus.currentBytes)}"/>
</LinearLayout>