移除Max 1.0.5(6)
This commit is contained in:
parent
321a27f6d5
commit
698ad1202a
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("applovin-quality-service")
|
// id("applovin-quality-service")
|
||||||
id("com.google.gms.google-services")
|
// id("com.google.gms.google-services")
|
||||||
id("com.google.firebase.crashlytics")
|
// id("com.google.firebase.crashlytics")
|
||||||
}
|
|
||||||
applovin{
|
|
||||||
apiKey = "BAorLOnK5J2flG9XoJ_9GHUnqETtkiGRooRrcLMv6NTkcN1TGQblSvTkB4kdKPmVomCyvusXDiNfVk0_eegmSt"
|
|
||||||
}
|
}
|
||||||
|
//applovin{
|
||||||
|
// apiKey = "BAorLOnK5J2flG9XoJ_9GHUnqETtkiGRooRrcLMv6NTkcN1TGQblSvTkB4kdKPmVomCyvusXDiNfVk0_eegmSt"
|
||||||
|
//}
|
||||||
android {
|
android {
|
||||||
namespace = "emoticon.wasticker.app"
|
namespace = "emoticon.wasticker.app"
|
||||||
compileSdk = 34
|
compileSdk = 34
|
||||||
@ -63,11 +63,11 @@ dependencies {
|
|||||||
implementation ("com.google.code.gson:gson:2.10.1")
|
implementation ("com.google.code.gson:gson:2.10.1")
|
||||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||||
|
|
||||||
implementation("com.applovin:applovin-sdk:+")
|
// implementation("com.applovin:applovin-sdk:+")
|
||||||
implementation("com.applovin.mediation:vungle-adapter:+")
|
// implementation("com.applovin.mediation:vungle-adapter:+")
|
||||||
implementation("com.applovin.mediation:bytedance-adapter:+")
|
// implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||||
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
// implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
// implementation("com.google.firebase:firebase-analytics-ktx")
|
||||||
implementation ("com.google.firebase:firebase-crashlytics-ktx")
|
// implementation ("com.google.firebase:firebase-crashlytics-ktx")
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "584182945186",
|
|
||||||
"project_id": "emoticon-stickers",
|
|
||||||
"storage_bucket": "emoticon-stickers.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:584182945186:android:5014a63b7148356a2d0efb",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "emoticon.wasticker.app"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyDNdFQpDcAAo4iSbZyt7KPKTcd3YjC1SzA"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
||||||
@ -3,8 +3,6 @@ package emoticon.wasticker.app;
|
|||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.applovin.sdk.AppLovinSdk;
|
|
||||||
import com.applovin.sdk.AppLovinSdkConfiguration;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
package emoticon.wasticker.app.listener;
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
import com.applovin.mediation.MaxError;
|
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
|
|
||||||
public interface AdListener {
|
public interface AdListener {
|
||||||
void onShowFail(MaxAd ad);
|
// void onShowFail(MaxAd ad);
|
||||||
void onShowSuccess(MaxAd ad);
|
// void onShowSuccess(MaxAd ad);
|
||||||
void onHidden( );
|
// void onHidden( );
|
||||||
|
//
|
||||||
void onLoadFail(String string, MaxError maxError);
|
// void onLoadFail(String string, MaxError maxError);
|
||||||
void onLoadSuccess(MaxAd ad);
|
// void onLoadSuccess(MaxAd ad);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,10 +4,6 @@ import android.app.Activity;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
import com.applovin.mediation.MaxAdListener;
|
|
||||||
import com.applovin.mediation.MaxError;
|
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -23,108 +19,108 @@ public class AdLoad {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static MaxInterstitialAd showMyAd(List<MaxInterstitialAd> ads)
|
// public static MaxInterstitialAd showMyAd(List<MaxInterstitialAd> ads)
|
||||||
{
|
// {
|
||||||
Collections.shuffle(ads);
|
// Collections.shuffle(ads);
|
||||||
for(int g=0;g<ads.size()-1;g++){
|
// for(int g=0;g<ads.size()-1;g++){
|
||||||
MaxInterstitialAd maxInterstitialAd = ads.get(g);
|
// MaxInterstitialAd maxInterstitialAd = ads.get(g);
|
||||||
if(maxInterstitialAd.isReady()){
|
// if(maxInterstitialAd.isReady()){
|
||||||
return maxInterstitialAd;
|
// return maxInterstitialAd;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// public static void setAdShowListener(MaxInterstitialAd ad, AdListener adListener){
|
||||||
|
// ad.setListener(new MaxAdListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||||
|
// if(adListener != null){
|
||||||
|
// adListener.onLoadSuccess(maxAd);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||||
|
//
|
||||||
|
// if(adListener != null){
|
||||||
|
// adListener.onShowSuccess(maxAd);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||||
|
// if(adListener != null){
|
||||||
|
// adListener.onHidden();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||||
|
// if(adListener != null){
|
||||||
|
// adListener.onLoadFail(s,maxError);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||||
|
// if(adListener != null){
|
||||||
|
// adListener.onShowFail(maxAd);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
public static void setAdShowListener(MaxInterstitialAd ad, AdListener adListener){
|
// public static List<MaxInterstitialAd> createAd(Activity mActivity) {
|
||||||
ad.setListener(new MaxAdListener() {
|
// MaxInterstitialAd ad1 = new MaxInterstitialAd(ad_1, mActivity);
|
||||||
@Override
|
// MaxInterstitialAd ad2 = new MaxInterstitialAd(ad_2, mActivity);
|
||||||
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
// MaxInterstitialAd ad3 = new MaxInterstitialAd(ad_3, mActivity);
|
||||||
if(adListener != null){
|
// ArrayList<MaxInterstitialAd> ads = new ArrayList<>();
|
||||||
adListener.onLoadSuccess(maxAd);
|
// ads.add(ad1);
|
||||||
}
|
// ads.add(ad2);
|
||||||
}
|
// ads.add(ad3);
|
||||||
|
// return ads;
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
// private void setAdLoadListener(MaxInterstitialAd ad){
|
||||||
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
// ad.setListener(new MaxAdListener() {
|
||||||
|
// @Override
|
||||||
if(adListener != null){
|
// public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||||
adListener.onShowSuccess(maxAd);
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||||
@Override
|
//
|
||||||
public void onAdHidden(@NonNull MaxAd maxAd) {
|
// }
|
||||||
if(adListener != null){
|
//
|
||||||
adListener.onHidden();
|
// @Override
|
||||||
}
|
// public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onAdClicked(@NonNull MaxAd maxAd) {
|
// @Override
|
||||||
|
// public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
// @Override
|
||||||
if(adListener != null){
|
// public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||||
adListener.onLoadFail(s,maxError);
|
//
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||||
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
//
|
||||||
if(adListener != null){
|
// }
|
||||||
adListener.onShowFail(maxAd);
|
// });
|
||||||
}
|
//
|
||||||
}
|
// }
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<MaxInterstitialAd> createAd(Activity mActivity) {
|
|
||||||
MaxInterstitialAd ad1 = new MaxInterstitialAd(ad_1, mActivity);
|
|
||||||
MaxInterstitialAd ad2 = new MaxInterstitialAd(ad_2, mActivity);
|
|
||||||
MaxInterstitialAd ad3 = new MaxInterstitialAd(ad_3, mActivity);
|
|
||||||
ArrayList<MaxInterstitialAd> ads = new ArrayList<>();
|
|
||||||
ads.add(ad1);
|
|
||||||
ads.add(ad2);
|
|
||||||
ads.add(ad3);
|
|
||||||
return ads;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAdLoadListener(MaxInterstitialAd ad){
|
|
||||||
ad.setListener(new MaxAdListener() {
|
|
||||||
@Override
|
|
||||||
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdHidden(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdClicked(@NonNull MaxAd maxAd) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,9 +13,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
import com.applovin.mediation.MaxError;
|
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -33,7 +31,7 @@ import emoticon.wasticker.app.manager.SPManager;
|
|||||||
import emoticon.wasticker.app.manager.Values;
|
import emoticon.wasticker.app.manager.Values;
|
||||||
import emoticon.wasticker.app.R;
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
public class AddActivity extends AppCompatActivity implements DownloadListener, View.OnClickListener, AdListener {
|
public class AddActivity extends AppCompatActivity implements DownloadListener, View.OnClickListener {
|
||||||
|
|
||||||
private String zipUrl;
|
private String zipUrl;
|
||||||
private String identifierName;
|
private String identifierName;
|
||||||
@ -52,7 +50,7 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
|||||||
|
|
||||||
private TextView addTV;
|
private TextView addTV;
|
||||||
|
|
||||||
private List<MaxInterstitialAd> ads;
|
// private List<MaxInterstitialAd> ads;
|
||||||
|
|
||||||
private int type = 0;
|
private int type = 0;
|
||||||
|
|
||||||
@ -60,8 +58,8 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_add);
|
setContentView(R.layout.activity_add);
|
||||||
ads = AdLoad.createAd(AddActivity.this);
|
// ads = AdLoad.createAd(AddActivity.this);
|
||||||
loadAd();
|
// loadAd();
|
||||||
progressBar = findViewById(R.id.progressbar);
|
progressBar = findViewById(R.id.progressbar);
|
||||||
backImage = findViewById(R.id.back_im);
|
backImage = findViewById(R.id.back_im);
|
||||||
trayImage = findViewById(R.id.tray_im);
|
trayImage = findViewById(R.id.tray_im);
|
||||||
@ -93,14 +91,14 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadAd() {
|
// private void loadAd() {
|
||||||
for (int i = 0; i < ads.size() ; i++) {
|
// for (int i = 0; i < ads.size() ; i++) {
|
||||||
MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
// MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||||
AdLoad.setAdShowListener(maxInterstitialAd, AddActivity.this);
|
// AdLoad.setAdShowListener(maxInterstitialAd, AddActivity.this);
|
||||||
maxInterstitialAd.loadAd();
|
// maxInterstitialAd.loadAd();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
private void initStickerShow() {
|
private void initStickerShow() {
|
||||||
@ -151,7 +149,8 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
|||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
type = 0;
|
type = 0;
|
||||||
showAd();
|
// TODO: 2024/7/18 action2
|
||||||
|
// showAd();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,60 +159,64 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
|||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
if (id == R.id.back_im) {
|
if (id == R.id.back_im) {
|
||||||
type = 0;
|
type = 0;
|
||||||
boolean b = showAd();
|
// TODO: 2024/7/18 action2
|
||||||
|
// boolean b = showAd();
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
} else if (id == R.id.add_whatsapp_tv) {
|
} else if (id == R.id.add_whatsapp_tv) {
|
||||||
type = 1;
|
type = 1;
|
||||||
boolean b = showAd();
|
// TODO: 2024/7/18 action3
|
||||||
if (!b) {
|
// boolean b = showAd();
|
||||||
addWhatsApp();
|
// if (!b) {
|
||||||
}
|
// addWhatsApp();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private boolean showAd() {
|
|
||||||
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
|
||||||
if (maxInterstitialAd != null) {
|
|
||||||
maxInterstitialAd.showAd();
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onShowFail(MaxAd ad) {
|
|
||||||
if(type == 1) {
|
|
||||||
addWhatsApp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onShowSuccess(MaxAd ad) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onHidden() {
|
|
||||||
if(type == 1){
|
|
||||||
loadAd();
|
|
||||||
addWhatsApp();
|
addWhatsApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadFail(String string, MaxError maxError) {
|
|
||||||
|
|
||||||
}
|
// private boolean showAd() {
|
||||||
|
// MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
|
// if (maxInterstitialAd != null) {
|
||||||
|
// maxInterstitialAd.showAd();
|
||||||
|
// return true;
|
||||||
|
// } else {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void onLoadSuccess(MaxAd ad) {
|
// public void onShowFail(MaxAd ad) {
|
||||||
|
// if(type == 1) {
|
||||||
}
|
// addWhatsApp();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onShowSuccess(MaxAd ad) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onHidden() {
|
||||||
|
// if(type == 1){
|
||||||
|
// loadAd();
|
||||||
|
// addWhatsApp();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onLoadFail(String string, MaxError maxError) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onLoadSuccess(MaxAd ad) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
private void addWhatsApp() {
|
private void addWhatsApp() {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
|
|||||||
@ -7,11 +7,6 @@ import android.os.Bundle;
|
|||||||
import android.os.CountDownTimer;
|
import android.os.CountDownTimer;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.applovin.mediation.MaxAd;
|
|
||||||
import com.applovin.mediation.MaxError;
|
|
||||||
import com.applovin.mediation.ads.MaxInterstitialAd;
|
|
||||||
import com.applovin.sdk.AppLovinSdk;
|
|
||||||
import com.applovin.sdk.AppLovinSdkConfiguration;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -21,31 +16,31 @@ import emoticon.wasticker.app.listener.AdListener;
|
|||||||
import emoticon.wasticker.app.manager.AdLoad;
|
import emoticon.wasticker.app.manager.AdLoad;
|
||||||
|
|
||||||
|
|
||||||
public class FirstOpenActivity extends AppCompatActivity implements AdListener {
|
public class FirstOpenActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
|
|
||||||
private List<MaxInterstitialAd> ads;
|
// private List<MaxInterstitialAd> ads;
|
||||||
|
|
||||||
private boolean hasShow = false;
|
private boolean hasShow = false;
|
||||||
|
|
||||||
private void initSDK() {
|
// private void initSDK() {
|
||||||
AppLovinSdk instance = AppLovinSdk.getInstance(this);
|
// AppLovinSdk instance = AppLovinSdk.getInstance(this);
|
||||||
instance.setMediationProvider("max");
|
// instance.setMediationProvider("max");
|
||||||
instance.initializeSdk(new AppLovinSdk.SdkInitializationListener() {
|
// instance.initializeSdk(new AppLovinSdk.SdkInitializationListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onSdkInitialized(AppLovinSdkConfiguration appLovinSdkConfiguration) {
|
// public void onSdkInitialized(AppLovinSdkConfiguration appLovinSdkConfiguration) {
|
||||||
countDownTimer.start();
|
// countDownTimer.start();
|
||||||
ads = AdLoad.createAd(FirstOpenActivity.this);
|
// ads = AdLoad.createAd(FirstOpenActivity.this);
|
||||||
for (int i = 0; i < ads.size() ; i++) {
|
// for (int i = 0; i < ads.size() ; i++) {
|
||||||
MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
// MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||||
maxInterstitialAd.loadAd();
|
// maxInterstitialAd.loadAd();
|
||||||
AdLoad.setAdShowListener(maxInterstitialAd, FirstOpenActivity.this);
|
// AdLoad.setAdShowListener(maxInterstitialAd, FirstOpenActivity.this);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -55,62 +50,67 @@ public class FirstOpenActivity extends AppCompatActivity implements AdListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onTick(long millisUntilFinished) {
|
public void onTick(long millisUntilFinished) {
|
||||||
if (!hasShow) {
|
if (!hasShow) {
|
||||||
startShow();
|
// TODO: 2024/7/18 action1
|
||||||
|
// startShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
if (!hasShow) {
|
|
||||||
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
|
||||||
if (maxInterstitialAd != null) {
|
|
||||||
hasShow = true;
|
|
||||||
AdLoad.setAdShowListener(maxInterstitialAd, new AdListener() {
|
|
||||||
@Override
|
|
||||||
public void onShowFail(MaxAd ad) {
|
|
||||||
goMain();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
goMain();
|
||||||
public void onShowSuccess(MaxAd ad) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// if (!hasShow) {
|
||||||
public void onHidden() {
|
// MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
goMain();
|
// if (maxInterstitialAd != null) {
|
||||||
}
|
// hasShow = true;
|
||||||
|
// AdLoad.setAdShowListener(maxInterstitialAd, new AdListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onLoadFail(String string, MaxError maxError) {
|
// public void onShowFail(MaxAd ad) {
|
||||||
|
// goMain();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onLoadSuccess(MaxAd ad) {
|
// public void onShowSuccess(MaxAd ad) {
|
||||||
|
// }
|
||||||
}
|
//
|
||||||
});
|
// @Override
|
||||||
maxInterstitialAd.showAd();
|
// public void onHidden() {
|
||||||
}else {
|
// goMain();
|
||||||
goMain();
|
// }
|
||||||
|
//
|
||||||
}
|
// @Override
|
||||||
}
|
// public void onLoadFail(String string, MaxError maxError) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onLoadSuccess(MaxAd ad) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// maxInterstitialAd.showAd();
|
||||||
|
// }else {
|
||||||
|
// goMain();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
initSDK();
|
countDownTimer.start();
|
||||||
}
|
// initSDK();
|
||||||
|
|
||||||
private void startShow() {
|
|
||||||
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
|
||||||
if (maxInterstitialAd != null) {
|
|
||||||
hasShow = true;
|
|
||||||
maxInterstitialAd.showAd();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// private void startShow() {
|
||||||
|
// MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
|
// if (maxInterstitialAd != null) {
|
||||||
|
// hasShow = true;
|
||||||
|
// maxInterstitialAd.showAd();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
@ -122,38 +122,36 @@ public class FirstOpenActivity extends AppCompatActivity implements AdListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onShowFail(MaxAd ad) {
|
||||||
@Override
|
// hasShow = false;
|
||||||
public void onShowFail(MaxAd ad) {
|
// }
|
||||||
hasShow = false;
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public void onShowSuccess(MaxAd ad) {
|
||||||
@Override
|
// hasShow = true;
|
||||||
public void onShowSuccess(MaxAd ad) {
|
//
|
||||||
hasShow = true;
|
// }
|
||||||
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public void onHidden() {
|
||||||
@Override
|
// goMain();
|
||||||
public void onHidden() {
|
// }
|
||||||
goMain();
|
//
|
||||||
}
|
//
|
||||||
|
|
||||||
|
|
||||||
private void goMain(){
|
private void goMain(){
|
||||||
Intent intent = new Intent(FirstOpenActivity.this, MainActivity.class);
|
Intent intent = new Intent(FirstOpenActivity.this, MainActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@Override
|
// @Override
|
||||||
public void onLoadFail(String str, MaxError maxError) {
|
// public void onLoadFail(String str, MaxError maxError) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onLoadSuccess(MaxAd ad) {
|
// public void onLoadSuccess(MaxAd ad) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
@ -1,11 +1,11 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.1.3" apply false
|
id("com.android.application") version "8.1.3" apply false
|
||||||
id("com.google.gms.google-services") version "4.3.15" apply false
|
// id("com.google.gms.google-services") version "4.3.15" apply false
|
||||||
id ("com.google.firebase.crashlytics") version "2.9.2" apply false
|
// id ("com.google.firebase.crashlytics") version "2.9.2" apply false
|
||||||
}
|
|
||||||
buildscript{
|
|
||||||
dependencies{
|
|
||||||
classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//buildscript{
|
||||||
|
// dependencies{
|
||||||
|
// classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@ -3,7 +3,7 @@ pluginManagement {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven{url = uri("https://artifacts.applovin.com/android")}
|
// maven{url = uri("https://artifacts.applovin.com/android")}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
@ -11,7 +11,7 @@ dependencyResolutionManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven ("https://artifact.bytedance.com/repository/pangle")
|
// maven ("https://artifact.bytedance.com/repository/pangle")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user