Skip to content

Commit

Permalink
Add proguard configuration for IMA/GMA plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Bird committed Jun 5, 2023
1 parent 60f66e3 commit 9297565
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
6 changes: 2 additions & 4 deletions sdk/src/test/java/com/uid2/network/RefreshResponseTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class RefreshResponseTest {
JSONObject(),
JSONObject(mapOf("key" to "value"))
).forEach {
val refresh = RefreshResponse.fromJson(it)
assertNull(refresh)
assertNull(RefreshResponse.fromJson(it))
}

// If we take a valid response but remove the "status" parameter, check that it's handled correctly.
Expand All @@ -45,8 +44,7 @@ class RefreshResponseTest {

body.remove(it)

val refresh = RefreshResponse.fromJson(success)
assertNull(refresh)
assertNull(RefreshResponse.fromJson(success))
}
}

Expand Down
5 changes: 3 additions & 2 deletions securesignals-gma-dev-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
apply from: rootProject.file("$rootDir/common.gradle")

android {
namespace 'com.uid2.devapp'
namespace 'com.uid2.dev'

defaultConfig {
applicationId "com.uid2.securesignals.gma.devapp"
Expand All @@ -17,7 +17,8 @@ android {

buildTypes {
release {
minifyEnabled false
shrinkResources true
minifyEnabled true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.uid2.UID2Manager;
import com.uid2.data.UID2Identity;
import com.uid2.devapp.R;

import org.json.JSONObject;

Expand Down
1 change: 1 addition & 0 deletions securesignals-gma/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {

buildTypes {
release {
consumerProguardFiles 'uid2-gma.pro'
minifyEnabled false
}
}
Expand Down
3 changes: 3 additions & 0 deletions securesignals-gma/uid2-gma.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Google's GMA uses reflection to identify available adapters. These are therefore not referenced by the consuming
# application and thus, require a rule to ensure that they are not stripped out during the build.
-keep public class com.uid2.securesignals.gma.*
1 change: 1 addition & 0 deletions securesignals-ima/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {

buildTypes {
release {
consumerProguardFiles 'uid2-ima.pro'
minifyEnabled false
}
}
Expand Down
3 changes: 3 additions & 0 deletions securesignals-ima/uid2-ima.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Google's IMA uses reflection to identify available adapters. These are therefore not referenced by the consuming
# application and thus, require a rule to ensure that they are not stripped out during the build.
-keep public class com.uid2.securesignals.ima.*

0 comments on commit 9297565

Please sign in to comment.