From 9a9301ed6165f77aadaaf93295a1a86551f6d0e0 Mon Sep 17 00:00:00 2001 From: Daniel Jih Date: Tue, 3 Jul 2018 15:25:39 -0700 Subject: [PATCH 1/2] catch security exceptions when fetching adid --- src/com/amplitude/api/DeviceInfo.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/amplitude/api/DeviceInfo.java b/src/com/amplitude/api/DeviceInfo.java index f9db52c5..2634d746 100644 --- a/src/com/amplitude/api/DeviceInfo.java +++ b/src/com/amplitude/api/DeviceInfo.java @@ -224,6 +224,8 @@ private String getAndCacheGoogleAdvertisingId() { AmplitudeLog.getLogger().w(TAG, "Google Play Services SDK not found!"); } catch (InvocationTargetException e) { AmplitudeLog.getLogger().w(TAG, "Google Play Services not available"); + } catch (SecurityException e) { + AmplitudeLog.getLogger().w(TAG, "Please update Google Play Services version"); } catch (Exception e) { AmplitudeLog.getLogger().e(TAG, "Encountered an error connecting to Google Play Services", e); } From df7befe2f9452b771c9c15c309615004d69db25c Mon Sep 17 00:00:00 2001 From: Daniel Jih Date: Tue, 3 Jul 2018 16:27:20 -0700 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a769027c..a0174dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased +* Catch SecurityExceptions thrown during fetching of Google Advertising ID. This is caused by older versions of Google Play Services using `MODE_WORLD_READABLE` when reading from SharedPreferences. If you see this warning you should update your version of Google Play Services. + ## 2.18.1 (May 07, 2018) * Updating to [OkHttp 3.10.0](https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-3100)