diff --git a/.travis.yml b/.travis.yml index 3ed3b7a7..3e3f7435 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: android -jdk: oraclejdk7 +jdk: oraclejdk8 android: components: - # Workaround to get build tools 23.0.3 + # Workaround to get build tools 26.0.2 # https://github.com/travis-ci/travis-ci/issues/5036 - tools - platform-tools - - build-tools-23.0.3 - - android-23 + - build-tools-26.0.2 + - android-26 - extra-android-m2repository script: diff --git a/dependencies.gradle b/dependencies.gradle index e8ea5982..1a1db7d2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -34,7 +34,7 @@ ext { dexmakerMockito : 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0', // Other - picasso : 'com.squareup.picasso:picasso:2.5.2', + picasso : 'com.squareup.picasso:picasso:2.71828', supportCompatV4 : 'com.android.support:support-compat:26.1.0', supportCoreV4 : 'com.android.support:support-core-ui:26.1.0', retrofit : 'com.squareup.retrofit2:retrofit:2.3.0', diff --git a/tweet-composer/src/main/java/com/twitter/sdk/android/tweetcomposer/ComposerView.java b/tweet-composer/src/main/java/com/twitter/sdk/android/tweetcomposer/ComposerView.java index b3491b9b..e4cfd295 100644 --- a/tweet-composer/src/main/java/com/twitter/sdk/android/tweetcomposer/ComposerView.java +++ b/tweet-composer/src/main/java/com/twitter/sdk/android/tweetcomposer/ComposerView.java @@ -68,7 +68,7 @@ public ComposerView(Context context, AttributeSet attrs, int defStyle) { } private void init(Context context) { - imageLoader = Picasso.with(getContext()); + imageLoader = Picasso.get(); // TODO: make color vary depending on the style mediaBg = new ColorDrawable(context.getResources() .getColor(R.color.tw__composer_light_gray)); diff --git a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/GalleryAdapter.java b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/GalleryAdapter.java index 8dbcb965..e96731ca 100644 --- a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/GalleryAdapter.java +++ b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/GalleryAdapter.java @@ -63,7 +63,7 @@ public Object instantiateItem(ViewGroup container, int position) { container.addView(root); final MediaEntity entity = items.get(position); - Picasso.with(context).load(entity.mediaUrlHttps).into(root); + Picasso.get().load(entity.mediaUrlHttps).into(root); return root; } diff --git a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/TweetUi.java b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/TweetUi.java index e7b129b7..f55d3508 100644 --- a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/TweetUi.java +++ b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/TweetUi.java @@ -63,7 +63,7 @@ public static TweetUi getInstance() { guestSessionProvider = twitterCore.getGuestSessionProvider(); tweetRepository = new TweetRepository(new Handler(Looper.getMainLooper()), twitterCore.getSessionManager()); - imageLoader = Picasso.with(Twitter.getInstance().getContext(getIdentifier())); + imageLoader = Picasso.get(); } public String getIdentifier() { diff --git a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/GalleryImageView.java b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/GalleryImageView.java index 38e4e2da..bf345148 100644 --- a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/GalleryImageView.java +++ b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/GalleryImageView.java @@ -20,6 +20,8 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; @@ -66,7 +68,7 @@ public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { } @Override - public void onBitmapFailed(Drawable errorDrawable) { + public void onBitmapFailed(@NonNull Exception e, @Nullable Drawable errorDrawable) { } diff --git a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/TweetMediaView.java b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/TweetMediaView.java index 861f0356..bcb55c3f 100644 --- a/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/TweetMediaView.java +++ b/tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/internal/TweetMediaView.java @@ -429,7 +429,7 @@ public void onSuccess() { } @Override - public void onError() { /* intentionally blank */ } + public void onError(Exception e) { /* intentionally blank */ } } static class Size { diff --git a/twitter-core/proguard.txt b/twitter-core/proguard.txt index a40d86b1..1779fd3e 100644 --- a/twitter-core/proguard.txt +++ b/twitter-core/proguard.txt @@ -23,4 +23,33 @@ # Retain class members for annotations -keepclasseswithmembers class * { @retrofit2.http.* ; -} \ No newline at end of file +} + +#okhttp (partially from https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro) +-dontwarn com.squareup.okhttp.* + +# A resource is loaded with a relative path so the package of this class must be preserved. +-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase + +# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java. +-dontwarn org.codehaus.mojo.animal_sniffer.* + +# OkHttp platform used only on JVM and when Conscrypt dependency is available. +-dontwarn okhttp3.internal.platform.ConscryptPlatform + +#mopub (https://raw.githubusercontent.com/mopub/mopub-android-sdk/master/mopub-sample/proguard.cfg0 +# Keep public classes and methods. +-keepclassmembers class com.mopub.** { public *; } +-keep public class com.mopub.** +-keep public class android.webkit.JavascriptInterface {} + +# Explicitly keep any custom event classes in any package. +-keep class * extends com.mopub.mobileads.CustomEventBanner {} +-keep class * extends com.mopub.mobileads.CustomEventInterstitial {} +-keep class * extends com.mopub.mobileads.CustomEventRewardedAd {} +-keep class * extends com.mopub.nativeads.CustomEventNative {} + +# Keep methods that are accessed via reflection +-keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; } + +-dontwarn com.twitter.*