From 473593db1b90b09a2fcf98d578c193241c80ffff Mon Sep 17 00:00:00 2001 From: Matin Zadeh Dolatabad <24797481+matinzd@users.noreply.github.com> Date: Wed, 22 May 2024 14:46:37 +0200 Subject: [PATCH 1/3] feat: add proguard-rules.pro --- android/proguard-rules.pro | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 android/proguard-rules.pro diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro new file mode 100644 index 00000000..876a8156 --- /dev/null +++ b/android/proguard-rules.pro @@ -0,0 +1,12 @@ +-keep class com.adjust.sdk.** { *; } +-keep class com.google.android.gms.common.ConnectionResult { + int SUCCESS; +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { + com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { + java.lang.String getId(); + boolean isLimitAdTrackingEnabled(); +} +-keep public class com.android.installreferrer.** { *; } From 48dbb19d8cf83eaf6a273cd9529cdf62a0e8c7d6 Mon Sep 17 00:00:00 2001 From: Matin Zadeh Dolatabad <24797481+matinzd@users.noreply.github.com> Date: Wed, 22 May 2024 14:48:56 +0200 Subject: [PATCH 2/3] chore: add proguard rules in build.gradle --- android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/android/build.gradle b/android/build.gradle index a1798fc6..a0f8f90a 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,6 +16,7 @@ android { targetSdkVersion _targetSdkVersion versionCode 1 versionName "1.0" + consumerProguardFiles "proguard-rules.pro" } buildTypes { release { From 767b88c2a199508b493fae2c2c71eac5b8825810 Mon Sep 17 00:00:00 2001 From: Matin Zadeh Dolatabad <24797481+matinzd@users.noreply.github.com> Date: Wed, 22 May 2024 14:51:31 +0200 Subject: [PATCH 3/3] chore: update docs --- README.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/README.md b/README.md index 9f2abec4..a16ac155 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ This is the React Native SDK of Adjust™. You can read more about Adjust™ at * [Adjust project settings](#adjust-project-settings) * [Android permissions](#android-permissions) * [Google Play Services](#android-gps) - * [Proguard settings](#android-proguard) * [Install referrer](#android-referrer) * [Google Play Referrer API](#android-referrer-gpr-api) * [Google Play Store intent](#android-referrer-gps-intent) @@ -187,25 +186,6 @@ To check whether the analytics part of the Google Play Services library has been In case you encounter any issue with attempts to read Google Advertising Identifier, feel free to open an issue in our Github repository or write an email to support@adjust.com. -### Proguard settings - -If you are using Proguard, add these lines to your Proguard file: - -``` --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - ### Install referrer In order to correctly attribute an install of your Android app to its source, Adjust needs information about the **install referrer**. This can be obtained by using the **Google Play Referrer API** or by catching the **Google Play Store intent** with a broadcast receiver. @@ -232,12 +212,6 @@ allprojects { } ``` -Also, make sure that you have paid attention to the [Proguard settings](#android-proguard) chapter and that you have added all the rules mentioned in it, especially the one needed for this feature: - -``` --keep public class com.android.installreferrer.** { *; } -``` - This feature is supported if you are using the **Adjust SDK v4.12.0 or above**. #### Google Play Store intent