Skip to content

Commit

Permalink
Merge pull request #79 from tapsellorg/release/2.2.4
Browse files Browse the repository at this point in the history
chore: update tapsellplus to `2.2.4`
  • Loading branch information
MortezaNedaei authored Jan 8, 2024
2 parents 9c1ca03 + 7f6d56f commit 2659548
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 260 deletions.
13 changes: 7 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ android {
packagingOptions {
resources.excludes.add("META-INF/*")
}
buildFeatures {
buildConfig = true
}
}

dependencies {
Expand All @@ -63,7 +66,7 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.3.0'

// for TapsellPlus
implementation 'ir.tapsell.plus:tapsell-plus-sdk-android:2.2.0'
implementation 'ir.tapsell.plus:tapsell-plus-sdk-android:2.2.4'

//for adMob
implementation 'com.google.android.gms:play-services-ads:21.5.0'
Expand Down Expand Up @@ -97,12 +100,10 @@ dependencies {
implementation "com.mbridge.msdk.oversea:same:16.3.91"
implementation "com.mbridge.msdk.oversea:interstitialvideo:16.3.91"

implementation 'com.google.android.material:material:1.9.0'

// for Vast (PreRoll)
implementation("com.google.ads.interactivemedia.v3:interactivemedia:3.30.1")
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.7'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.7'
implementation("androidx.media3:media3-ui:1.1.1")
implementation("androidx.media3:media3-exoplayer:1.1.1")
implementation("com.google.ads.interactivemedia.v3:interactivemedia:3.31.0")

testImplementation 'junit:junit:4.13.2'

Expand Down
226 changes: 0 additions & 226 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,226 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

##---------------End: proguard configuration for Gson ----------


##---------------Begin: proguard configuration for Retrofit ----------
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}

# Ignore annotation used for build tooling.
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**

# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit

# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.-KotlinExtensions
##---------------End: proguard configuration for Retrofit ----------


##---------------Begin: proguard configuration for okhttp3 ----------
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# 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
##---------------End: proguard configuration for okhttp3 ----------


##---------------Begin: proguard configuration for okio ----------
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
##---------------End: proguard configuration for okio ----------



##---------------Begin: proguard configuration for admob ----------
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}

# The following rules are used to strip any non essential Google Play Services classes and method.

# For Google Play Services
-keep public class com.google.android.gms.ads.**{
public *;
}

# For old ads classes
-keep public class com.google.ads.**{
public *;
}

# For mediation
-keepattributes *Annotation*

# Other required classes for Google Play Services
# Read more at http://developer.android.com/google/play-services/setup.html
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
##---------------End: proguard configuration for admob ----------


##---------------Begin: proguard configuration for chartboost ----------
-keep class com.chartboost.** { *; }
##---------------End: proguard configuration for chartboost ----------


##---------------Begin: proguard configuration for tapsell ----------
-keepclassmembers enum * { *; }
-keep class **.R$* { *; }
-keep interface ir.tapsell.sdk.NoProguard
-keep interface ir.tapsell.sdk.NoNameProguard
-keep class * implements ir.tapsell.sdk.NoProguard { *; }
-keep interface * extends ir.tapsell.sdk.NoProguard { *; }
-keep enum * implements ir.tapsell.sdk.NoProguard { *; }
-keepnames class * implements ir.tapsell.sdk.NoNameProguard { *; }
-keepnames class * extends android.app.Activity
-keep class ir.tapsell.plus.model.** { *; }
-keep class ir.tapsell.sdk.models.** { *; }

-keep class ir.tapsell.sdk.nativeads.TapsellNativeVideoAdLoader$Builder {*;}
-keep class ir.tapsell.sdk.nativeads.TapsellNativeBannerAdLoader$Builder {*;}

-keepclasseswithmembers class * {
native <methods>;
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keep interface ir.tapsell.plus.NoProguard
-keep interface * extends ir.tapsell.plus.NoProguard { *; }
-keep class * implements ir.tapsell.plus.NoProguard { *; }

##---------------End: proguard configuration for tapsell ----------

##---------------Begin: proguard configuration for AppLovin ----------

-dontwarn com.applovin.**
-keep class com.applovin.** { *; }
-keep class com.google.android.gms.ads.identifier.** { *; }

##---------------End: proguard configuration for AppLovin ----------

-keep public class com.bumptech.glide.**

# For communication with AdColony's WebView
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

# TapsellPlus needs their formal names
-keepnames public class com.google.android.gms.ads.MobileAds
-keepnames public class com.unity3d.services.monetization.IUnityMonetizationListener
-keepnames public class com.adcolony.sdk.AdColony
-keepnames public class com.google.android.gms.ads.identifier.AdvertisingIdClient
-keepnames public class com.chartboost.sdk.Chartboost
-keepnames public class com.applovin.sdk.AppLovinSdkSettings

# Vunvle Rules
-keep class com.vungle.warren.AdConfig
-keep class com.vungle.warren.InitCallback
-keep class com.vungle.warren.LoadAdCallback
-keep class com.vungle.warren.PlayAdCallback
-keep class com.vungle.warren.Vungle$Consent
-keep class com.vungle.warren.Vungle
-dontwarn com.vungle.warren.AdConfig
-dontwarn com.vungle.warren.InitCallback
-dontwarn com.vungle.warren.LoadAdCallback
-dontwarn com.vungle.warren.PlayAdCallback
-dontwarn com.vungle.warren.Vungle$Consent
-dontwarn com.vungle.warren.Vungle

# FaceBook sdk Rules
-keep class com.facebook.FacebookSdk
-keep class com.facebook.ads.AudienceNetworkAds$InitListener
-keep class com.facebook.ads.AudienceNetworkAds$InitSettingsBuilder
-keep class com.facebook.ads.AudienceNetworkAds
-keep class com.facebook.ads.InterstitialAd
-keep class com.facebook.ads.InterstitialAdListener
-keep class com.facebook.ads.RewardedVideoAd
-keep class com.facebook.ads.RewardedVideoAdListener
-dontwarn com.facebook.FacebookSdk
-dontwarn com.facebook.ads.AudienceNetworkAds$InitListener
-dontwarn com.facebook.ads.AudienceNetworkAds$InitSettingsBuilder
-dontwarn com.facebook.ads.AudienceNetworkAds
-dontwarn com.facebook.ads.InterstitialAd
-dontwarn com.facebook.ads.InterstitialAdListener
-dontwarn com.facebook.ads.RewardedVideoAd
-dontwarn com.facebook.ads.RewardedVideoAdListener
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.media3.common.MediaItem;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory;
import androidx.media3.ui.PlayerView;

import com.google.ads.interactivemedia.v3.api.AdErrorEvent;
import com.google.ads.interactivemedia.v3.api.AdEvent;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.ui.StyledPlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSource;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.util.Util;

import ir.tapsell.plus.TapsellPlus;
import ir.tapsell.plus.VastRequestListener;
Expand All @@ -33,7 +28,7 @@ public class ExoPlayerVastActivity extends AppCompatActivity {
private static final String SAMPLE_VIDEO_URL = "https://storage.backtory.com/tapsell-server/sdk/VASTContentVideo.mp4";

private TextView tvLog;
private StyledPlayerView playerView;
private PlayerView playerView;
private ExoPlayer player;
private ViewGroup adUiContainer;
private ViewGroup companionContainer;
Expand Down Expand Up @@ -65,13 +60,8 @@ private void initializePlayer() {
return;
}
// Set up the factory for media sources, passing the ads loader and ad view providers.
DataSource.Factory dataSourceFactory =
new DefaultDataSource.Factory(this,
new DefaultHttpDataSource.Factory()
.setUserAgent(Util.getUserAgent(this, getString(R.string.app_name))));

MediaSource.Factory mediaSourceFactory =
new DefaultMediaSourceFactory(dataSourceFactory)
DefaultMediaSourceFactory mediaSourceFactory =
new DefaultMediaSourceFactory(this)
.setLocalAdInsertionComponents(unusedAdTagUri -> adsLoader, playerView);

// Create an ExoPlayer and set it as the player for content and ads.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void init() {
adContainer = findViewById(R.id.adContainer);

adHolder = TapsellPlus.createAdHolder(
this, adContainer, R.layout.native_banner);
this, adContainer, ir.tapsell.plus.R.layout.native_banner);

requestAd();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
Expand Down Expand Up @@ -76,7 +76,7 @@ public int getItemCount() {
}

public class ItemHolder extends RecyclerView.ViewHolder {
AppCompatTextView tvTitle;
TextView tvTitle;

ItemHolder(View itemView) {
super(itemView);
Expand All @@ -96,7 +96,7 @@ public class TapsellListItemAdHolder extends RecyclerView.ViewHolder {
super(itemView);
adContainer = itemView.findViewById(R.id.adContainer);
adHolder = TapsellPlus.createAdHolder(
activity, adContainer, R.layout.native_banner);
activity, adContainer, ir.tapsell.plus.R.layout.native_banner);
}

void bindView(int position) {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_vast_exo_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
android:layout_height="200dp">


<com.google.android.exoplayer2.ui.StyledPlayerView

<androidx.media3.ui.PlayerView
android:id="@+id/exo_player"
android:layout_width="match_parent"
android:layout_height="200dp"
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'

classpath 'com.android.tools.build:gradle:8.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
10 changes: 8 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.enableR8.fullMode=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip

0 comments on commit 2659548

Please sign in to comment.