diff --git a/CHANGELOG.md b/CHANGELOG.md index dd4db982f3e..7722cb3ffbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ 7.41 ----- +* New Features: + * Wear OS app + ([#1068](https://github.com/Automattic/pocket-casts-android/pull/1068)). 7.40 ----- diff --git a/base.gradle b/base.gradle index 28c6998affd..8ad1237b3bb 100644 --- a/base.gradle +++ b/base.gradle @@ -147,10 +147,8 @@ android { if (canSignRelease) { signingConfig signingConfigs.release } - } } - } dependencies { diff --git a/build.gradle b/build.gradle index 842d6941a9f..4685c7a16ec 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ plugins { id 'com.mikepenz.aboutlibraries.plugin' version '10.4.0' apply false id 'com.github.ben-manes.versions' version '0.42.0' id 'com.diffplug.spotless' version '6.2.2' - id 'io.sentry.android.gradle' version '3.1.5' apply false + id 'io.sentry.android.gradle' version '3.10.0' apply false } apply plugin: 'base' @@ -86,4 +86,3 @@ allprojects { } } } - diff --git a/wear/build.gradle b/wear/build.gradle index fc5c755b2b0..d166a7b3aa7 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -1,6 +1,9 @@ +import io.sentry.android.gradle.extensions.InstrumentationFeature + plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'io.sentry.android.gradle' } apply plugin: 'com.google.gms.google-services' @@ -14,17 +17,6 @@ android { applicationId project.applicationId } - if (canSignRelease) { - signingConfigs { - release { - storeFile = project.storeFile - storePassword = project.storePassword - keyAlias = project.keyAlias - keyPassword = project.keyPassword - } - } - } - buildTypes { debug { applicationIdSuffix '.debug' @@ -50,11 +42,15 @@ android { sentryDsn: project.pocketcastsSentryDsn ] - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + if (!project.pocketcastsSentryDsn) { + println "WARNING: Sentry DSN gradle property 'pocketcastsSentryDsn' not found. Crash reporting won't work without this." + } - if (canSignRelease) { - signingConfig signingConfigs.release + if (!file("${project.rootDir}/sentry.properties").exists()) { + println "WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files won't be uploaded." } + + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -70,6 +66,13 @@ android { } } +sentry { + includeProguardMapping = file("$rootDir/sentry.properties").exists() + tracingInstrumentation { + features = EnumSet.allOf(InstrumentationFeature) - InstrumentationFeature.FILE_IO + } +} + dependencies { implementation androidLibs.wearInput diff --git a/wear/proguard-rules.pro b/wear/proguard-rules.pro index 481bb434814..518f5223213 100644 --- a/wear/proguard-rules.pro +++ b/wear/proguard-rules.pro @@ -1,10 +1,14 @@ # Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# By default, the flags in this file are appended to flags specified +# in /Applications/android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html +# Add any project specific keep options here: + # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: @@ -12,10 +16,142 @@ # public *; #} -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +# Without this the playback notification doesn't show up on fresh launch +# https://github.com/shiftyjelly/pocketcasts-android/issues/1656 +-keep class au.com.shiftyjelly.pocketcasts.core.player.** { *; } + +-dontwarn android.test.** +-dontwarn org.junit.internal.runners.statements.** +-dontwarn org.junit.rules.** +# retrolambda +-dontwarn java.lang.invoke.* +# okhttp +-dontwarn com.squareup.okhttp.** +-dontwarn org.conscrypt.** +-dontwarn okio.** +# Platform calls Class.forName on types which do not exist on Android to determine platform. +-dontnote retrofit2.Platform +# Platform used when running on Java 8 VMs. Will not be used at runtime. +-dontwarn retrofit2.Platform$Java8 +# Retain generic type information for use by reflection by converters and adapters. +-keepattributes Signature +# Retain declared checked exceptions for use by a Proxy instance. +-keepattributes Exceptions +-keepattributes *Annotation* + +# kotlin +-keepclassmembernames class kotlinx.** { + volatile ; +} + +# appcompat +-keep public class android.support.v7.widget.** { *; } +-keep public class android.support.v7.internal.widget.** { *; } +-keep public class android.support.v7.internal.view.menu.** { *; } +-keep public class android.support.v4.media.session.** { *; } +-keep public class * extends android.support.v4.view.ActionProvider { + public (android.content.Context); +} + +# dagger 2 +-dontwarn com.google.errorprone.annotations.* + +-keepattributes *Annotation* +-keepattributes SourceFile,LineNumberTable +-keep public class * extends java.lang.Exception +-keep class com.google.android.gms.measurement.** { *; } +-dontwarn com.google.android.gms.measurement.** + +# chrome cast +-keep class androidx.media3.cast.DefaultCastOptionsProvider { *; } +-keep class androidx.mediarouter.app.MediaRouteActionProvider { *; } +-keep class au.com.shiftyjelly.pocketcasts.CastOptionsProvider { *; } + +# glide +-keep class com.bumptech.glide.integration.okhttp3.OkHttpGlideModule +-keep public class * implements com.bumptech.glide.module.GlideModule +-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { + **[] $VALUES; + public *; +} + +-keepclassmembers enum * { + ; + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# retrofit +-dontwarn retrofit2.** +-keep class retrofit2.** { *; } +-keepattributes Signature +-keepattributes Exceptions +-keepclasseswithmembers class * { + @retrofit2.http.* ; +} +-dontwarn okhttp3.** +-dontwarn retrofit2.Platform$Java8 +-dontwarn javax.annotation.** -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +# moshi +-dontwarn okio.** +-dontwarn javax.annotation.** +-keepclasseswithmembers class * { + @com.squareup.moshi.* ; +} +-keep @com.squareup.moshi.JsonQualifier interface * +-keep class **JsonAdapter { + (...); + ; +} +-keepnames @com.squareup.moshi.JsonClass class * + +# Enum field names are used by the integrated EnumJsonAdapter. +# Annotate enums with @JsonClass(generateAdapter = false) to use them with Moshi. +-keepclassmembers @com.squareup.moshi.JsonClass class * extends java.lang.Enum { + ; +} + +# Retain generated JsonAdapters if annotated type is retained. +-if @com.squareup.moshi.JsonClass class * +-keep class <1>JsonAdapter { + (...); + ; +} + +# Keep layout classes +-keep class * extends android.view.View + +# clean up notes +-dontnote io.reactivex.** +-dontnote com.facebook.stetho.** +-dontnote com.afollestad.materialdialogs.internal.** +-dontnote com.astuetz.** +-dontnote com.google.android.gms.** +-dontnote com.google.android.material.** +-dontnote io.fabric.sdk.** +-dontnote com.google.firebase.** +-dontnote okhttp3.** +-dontnote retrofit2.** +-dontwarn com.google.common.** + +# requested by Adam for MediaCompat and Android Auto +-keep class android.support.v4.media.** implements android.os.Parcelable { + public static final ** CREATOR; +} + +# corountines +-keepnames class kotlinx.coroutines.experimental.internal.MainDispatcherFactory {} +-dontwarn kotlinx.coroutines.** + +## remove our logs +#-assumenosideeffects class timber.log.Timber { +# public static *** e(...); +# public static *** d(...); +# public static *** w(...); +# public static *** i(...); +#} +# +#-assumenosideeffects class au.com.shiftyjelly.pocketcasts.core.helper.log.TimberHelper { +# public static *** sql(...); +#}