Skip to content

Commit

Permalink
Revert GMA and IMA changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaunt committed Sep 9, 2024
1 parent ee1b41c commit 7c10857
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 329 deletions.
3 changes: 0 additions & 3 deletions securesignals-gma-dev-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>

<!-- Metadata for toggling UID2 and EUID environments. If true, EUID is used. -->
<meta-data android:name="uid2_environment_euid" android:value="false"/>

<activity
android:exported="true"
android:name="com.uid2.dev.BannerActivity">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.uid2.dev;

import static com.uid2.dev.utils.BundleExKt.isEnvironmentEUID;
import static com.uid2.dev.utils.ContextExKt.getMetadata;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
Expand All @@ -14,9 +11,9 @@
import com.google.android.gms.ads.RequestConfiguration;
import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.uid2.EUIDManager;
import com.uid2.UID2Manager;
import com.uid2.data.UID2Identity;

import org.json.JSONObject;

import java.io.BufferedReader;
Expand Down Expand Up @@ -104,11 +101,7 @@ private void loadUID2Identity() {
refreshFrom,
refreshExpires,
fromJsonIdentity.getRefreshResponseKey());
if (isEnvironmentEUID(getMetadata(this))) {
EUIDManager.getInstance().setIdentity(identity);
} else {
UID2Manager.getInstance().setIdentity(identity);
}
UID2Manager.getInstance().setIdentity(identity);
} catch (Exception e) {
Log.e(TAG, "Error loading Identity: " + e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ package com.uid2.dev

import android.app.Application
import android.util.Log
import com.uid2.EUIDManager
import com.uid2.UID2Manager
import com.uid2.UID2Manager.Environment.Production
import com.uid2.dev.utils.getMetadata
import com.uid2.dev.utils.isEnvironmentEUID

class GMADevApplication : Application() {

Expand All @@ -16,20 +12,12 @@ class GMADevApplication : Application() {
// Initialise the UID2Manager class. We will use it's DefaultNetworkSession rather than providing our own
// custom implementation. This can be done to allow wrapping something like OkHttp.
try {
if (getMetadata().isEnvironmentEUID()) {
EUIDManager.init(
context = this,
isLoggingEnabled = true,
)
} else {
UID2Manager.init(
context = this,
environment = Production,
isLoggingEnabled = true,
)
}
UID2Manager.init(
context = this,
isLoggingEnabled = true,
)
} catch (ex: Exception) {
Log.e("GMADevApplication", "Error initialising UID2Manager", ex)
Log.e("IMADevApplication", "Error initialising UID2Manager", ex)
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 2 additions & 9 deletions securesignals-ima-dev-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -10,13 +9,7 @@
android:name=".IMADevApplication"
android:label="@string/app_name"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="UnusedAttribute">

<!-- Metadata for toggling UID2 and EUID environments. If true, EUID is used. -->
<meta-data android:name="uid2_environment_euid" android:value="false"/>

android:icon="@drawable/ic_launcher">
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ package com.uid2.dev

import android.app.Application
import android.util.Log
import com.uid2.EUIDManager
import com.uid2.UID2Manager
import com.uid2.UID2Manager.Environment.Production
import com.uid2.dev.utils.getMetadata
import com.uid2.dev.utils.isEnvironmentEUID

class IMADevApplication : Application() {

Expand All @@ -16,18 +12,10 @@ class IMADevApplication : Application() {
// Initialise the UID2Manager class. We will use it's DefaultNetworkSession rather than providing our own
// custom implementation. This can be done to allow wrapping something like OkHttp.
try {
if (baseContext.getMetadata().isEnvironmentEUID()) {
EUIDManager.init(
context = this,
isLoggingEnabled = true,
)
} else {
UID2Manager.init(
context = this,
environment = Production,
isLoggingEnabled = true,
)
}
UID2Manager.init(
context = this,
isLoggingEnabled = true,
)
} catch (ex: Exception) {
Log.e("IMADevApplication", "Error initialising UID2Manager", ex)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.uid2.dev;

import static com.uid2.dev.utils.BundleExKt.isEnvironmentEUID;
import static com.uid2.dev.utils.ContextExKt.getMetadata;

import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;
Expand All @@ -25,7 +22,6 @@
import com.google.ads.interactivemedia.v3.api.ImaSdkFactory;
import com.google.ads.interactivemedia.v3.api.ImaSdkSettings;
import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate;
import com.uid2.EUIDManager;
import com.uid2.UID2Manager;
import com.uid2.data.UID2Identity;

Expand Down Expand Up @@ -231,11 +227,7 @@ private void loadUID2Identity() {
refreshExpires,
fromJsonIdentity.getRefreshResponseKey());

if (isEnvironmentEUID(getMetadata(getBaseContext()))) {
EUIDManager.getInstance().setIdentity(identity);
} else {
UID2Manager.getInstance().setIdentity(identity);
}
UID2Manager.getInstance().setIdentity(identity);
} catch (Exception e) {
Log.e(LOGTAG, "Error loading Identity: " + e);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7c10857

Please sign in to comment.