接Topon 1.0.6(7)
This commit is contained in:
parent
698ad1202a
commit
5ecc65a184
@ -1,13 +1,12 @@
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
// id("applovin-quality-service")
|
||||
// id("com.google.gms.google-services")
|
||||
// id("com.google.firebase.crashlytics")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
}
|
||||
//applovin{
|
||||
// apiKey = "BAorLOnK5J2flG9XoJ_9GHUnqETtkiGRooRrcLMv6NTkcN1TGQblSvTkB4kdKPmVomCyvusXDiNfVk0_eegmSt"
|
||||
//}
|
||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||
android {
|
||||
namespace = "emoticon.wasticker.app"
|
||||
compileSdk = 34
|
||||
@ -16,9 +15,12 @@ android {
|
||||
applicationId = "emoticon.wasticker.app"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 6
|
||||
versionName = "1.0.5"
|
||||
|
||||
versionCode = 7
|
||||
versionName = "1.0.6"
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"wasticker_V" + versionName + "(${versionCode})_$timestamp"
|
||||
)
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@ -60,14 +62,59 @@ dependencies {
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
|
||||
implementation ("com.google.code.gson:gson:2.10.1")
|
||||
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
implementation("com.github.bumptech.glide:glide:4.16.0")
|
||||
|
||||
// implementation("com.applovin:applovin-sdk:+")
|
||||
// implementation("com.applovin.mediation:vungle-adapter:+")
|
||||
// implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||
// implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||
// implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
// implementation ("com.google.firebase:firebase-crashlytics-ktx")
|
||||
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
//-----------------------------TopOn 聚合(mintegral、unityads、liftoff(vungle)、Bigo)
|
||||
//Anythink (Necessary)
|
||||
implementation("com.anythink.sdk:core-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:nativead-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:banner-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:interstitial-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:rewardedvideo-tpn:6.3.68")
|
||||
implementation("com.anythink.sdk:splash-tpn:6.3.68")
|
||||
|
||||
//Androidx (Necessary)
|
||||
implementation("androidx.appcompat:appcompat:1.1.0")
|
||||
implementation("androidx.browser:browser:1.4.0")
|
||||
|
||||
//Vungle
|
||||
implementation("com.anythink.sdk:adapter-tpn-vungle:6.3.68")
|
||||
implementation("com.vungle:vungle-ads:7.3.2")
|
||||
implementation("com.google.android.gms:play-services-basement:18.1.0")
|
||||
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
|
||||
|
||||
//UnityAds
|
||||
implementation("com.anythink.sdk:adapter-tpn-unityads:6.3.68")
|
||||
implementation("com.unity3d.ads:unity-ads:4.9.3")
|
||||
|
||||
//Bigo
|
||||
implementation("com.anythink.sdk:adapter-tpn-bigo:6.3.68")
|
||||
implementation("com.bigossp:bigo-ads:4.7.4")
|
||||
|
||||
//Mintegral
|
||||
implementation("com.anythink.sdk:adapter-tpn-mintegral-nonchina:6.3.68")
|
||||
implementation("com.mbridge.msdk.oversea:reward:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnative:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbnativeadvanced:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbsplash:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbanner:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
||||
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||
|
||||
//Tramini
|
||||
implementation("com.anythink.sdk:tramini-plugin-tpn:6.3.68")
|
||||
//-----------------------------TopOn 聚合
|
||||
|
||||
// Debugger UI Tools
|
||||
implementation("com.anythink.sdk:debugger-ui:1.0.7")
|
||||
|
||||
}
|
||||
29
app/google-services.json
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
55
app/proguard-rules.pro
vendored
55
app/proguard-rules.pro
vendored
@ -25,4 +25,57 @@
|
||||
-keepattributes Signature
|
||||
-keep class com.google.gson.reflect.TypeToken { *; }
|
||||
-keep class * extends com.google.gson.reflect.TypeToken
|
||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||
|
||||
#---------------------------------TopOn 聚合
|
||||
# Vungle
|
||||
-dontwarn com.vungle.ads.**
|
||||
-keepclassmembers class com.vungle.ads.** {
|
||||
*;
|
||||
}
|
||||
# Google
|
||||
-keep class com.google.android.gms.** { *; }
|
||||
-dontwarn com.google.android.gms.**
|
||||
# START OkHttp + Okio
|
||||
# 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.
|
||||
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
|
||||
# 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 and other security providers are available.
|
||||
-dontwarn okhttp3.internal.platform.**
|
||||
-dontwarn org.conscrypt.**
|
||||
-dontwarn org.bouncycastle.**
|
||||
-dontwarn org.openjsse.**
|
||||
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.*
|
||||
# END OkHttp + Okio
|
||||
# START Protobuf
|
||||
-dontwarn com.google.protobuf.**
|
||||
-keepclassmembers class com.google.protobuf.** {
|
||||
*;
|
||||
}
|
||||
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
|
||||
# END Protobuf
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class com.mbridge.** {*; }
|
||||
-keep interface com.mbridge.** {*; }
|
||||
-keep class android.support.v4.** { *; }
|
||||
-dontwarn com.mbridge.**
|
||||
-keep class **.R$* { public static final int mbridge*; }
|
||||
-keep public class com.mbridge.* extends androidx.** { *; }
|
||||
-keep public class androidx.viewpager.widget.PagerAdapter{ *; }
|
||||
-keep public class androidx.viewpager.widget.ViewPager.OnPageChangeListener{ *; }
|
||||
-keep interface androidx.annotation.IntDef{ *; }
|
||||
-keep interface androidx.annotation.Nullable{ *; }
|
||||
-keep interface androidx.annotation.CheckResult{ *; }
|
||||
-keep interface androidx.annotation.NonNull{ *; }
|
||||
-keep public class androidx.fragment.app.Fragment{ *; }
|
||||
-keep public class androidx.core.content.FileProvider{ *; }
|
||||
-keep public class androidx.core.app.NotificationCompat{ *; }
|
||||
-keep public class androidx.appcompat.widget.AppCompatImageView { *; }
|
||||
-keep public class androidx.recyclerview.*{ *; }
|
||||
|
||||
#---------------------------------TopOn 聚合
|
||||
@ -1,8 +1,16 @@
|
||||
package emoticon.wasticker.app;
|
||||
|
||||
import static android.content.ContentValues.TAG;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.anythink.core.api.ATSDK;
|
||||
import com.anythink.core.api.DeviceDataInfo;
|
||||
import com.anythink.core.api.NetTrafficeCallback;
|
||||
import com.anythink.debug.api.ATDebuggerUITest;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
@ -12,7 +20,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import emoticon.wasticker.app.data.Data;
|
||||
import emoticon.wasticker.app.manager.AdLoad;
|
||||
|
||||
import emoticon.wasticker.app.manager.SPManager;
|
||||
import emoticon.wasticker.app.manager.Unit;
|
||||
|
||||
@ -21,7 +29,7 @@ public class App extends Application {
|
||||
|
||||
private static List<Data> data;
|
||||
|
||||
private static App app;
|
||||
public static App app;
|
||||
|
||||
public static List<Data> getData() {
|
||||
return data;
|
||||
@ -31,17 +39,50 @@ public class App extends Application {
|
||||
return app;
|
||||
}
|
||||
|
||||
public static List<ATInterstitial> ads;
|
||||
|
||||
private static Context context;
|
||||
private static final String TOP_ID = "h66976f1c0c2c2";
|
||||
private static final String TOP_KEY = "9811f4f339fdae4673ae557aeb32e68c";
|
||||
private static final String TOP_DEBUG = "5a963ac260793c4ffdf9580cd63743d4ce258e51";
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
app = this;
|
||||
context = getApplicationContext();
|
||||
|
||||
|
||||
SPManager.init(this);
|
||||
|
||||
|
||||
ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {
|
||||
|
||||
@Override
|
||||
public void onResultCallback(boolean isEU) {
|
||||
Log.e(TAG, "onResultCallback:" + isEU);
|
||||
if (isEU && ATSDK.getGDPRDataLevel(context) == ATSDK.UNKNOWN) {
|
||||
ATSDK.showGdprAuth(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onErrorCallback(String errorMsg) {
|
||||
Log.e(TAG, "onErrorCallback:" + errorMsg);
|
||||
}
|
||||
});
|
||||
|
||||
initSdk();
|
||||
|
||||
try {
|
||||
InputStream open = getAssets().open("data.json");
|
||||
String s = Unit.fileToString(open);
|
||||
Gson gson = new Gson();
|
||||
TypeToken<List<Data>> typeToken = new TypeToken<List<Data>>() {};
|
||||
TypeToken<List<Data>> typeToken = new TypeToken<List<Data>>() {
|
||||
};
|
||||
List<Data> tempData = gson.fromJson(s, typeToken.getType());
|
||||
Collections.shuffle(tempData);
|
||||
data = tempData;
|
||||
@ -51,4 +92,22 @@ public class App extends Application {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static List<ATInterstitial> lodAd() {
|
||||
|
||||
return ads;
|
||||
}
|
||||
private void initSdk() {
|
||||
|
||||
|
||||
ATSDK.init(context, TOP_ID, TOP_KEY);
|
||||
|
||||
ads = Unit.getAllAd();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
package emoticon.wasticker.app.listener;
|
||||
|
||||
|
||||
|
||||
public interface AdListener {
|
||||
// void onShowFail(MaxAd ad);
|
||||
// void onShowSuccess(MaxAd ad);
|
||||
// void onHidden( );
|
||||
//
|
||||
// void onLoadFail(String string, MaxError maxError);
|
||||
// void onLoadSuccess(MaxAd ad);
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package emoticon.wasticker.app.listener;
|
||||
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
|
||||
public interface Adcallback {
|
||||
void onShowFail(AdError ad);
|
||||
void onAdHidden( );
|
||||
}
|
||||
@ -1,126 +0,0 @@
|
||||
package emoticon.wasticker.app.manager;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import emoticon.wasticker.app.listener.AdListener;
|
||||
|
||||
public class AdLoad {
|
||||
|
||||
public static final String ad_1 = "1ef06eb9fcfdf647";
|
||||
public static final String ad_2 = "0ab3b7bfcd6f2965";
|
||||
public static final String ad_3 = "353729c133f3fbff";
|
||||
|
||||
|
||||
|
||||
// public static MaxInterstitialAd showMyAd(List<MaxInterstitialAd> ads)
|
||||
// {
|
||||
// Collections.shuffle(ads);
|
||||
// for(int g=0;g<ads.size()-1;g++){
|
||||
// MaxInterstitialAd maxInterstitialAd = ads.get(g);
|
||||
// if(maxInterstitialAd.isReady()){
|
||||
// return maxInterstitialAd;
|
||||
// }
|
||||
// }
|
||||
// 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 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) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
}
|
||||
@ -1,15 +1,109 @@
|
||||
package emoticon.wasticker.app.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.anythink.core.api.ATAdInfo;
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.anythink.interstitial.api.ATInterstitialListener;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import emoticon.wasticker.app.App;
|
||||
import emoticon.wasticker.app.listener.Adcallback;
|
||||
|
||||
public class Unit {
|
||||
|
||||
private static final String one_AD = "n6697728eddd69";
|
||||
private static final String two_Ad = "n6697723242dcd";
|
||||
private static final String three_ad = "n66976f9be349f";
|
||||
private static ArrayList<ATInterstitial> adArrayList;
|
||||
|
||||
|
||||
public static void setCallback(ATInterstitial ad, Adcallback adcallback) {
|
||||
ad.setAdListener(new ATInterstitialListener() {
|
||||
@Override
|
||||
public void onInterstitialAdLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdLoadFail(AdError adError) {
|
||||
|
||||
adcallback.onShowFail(adError);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdShow(ATAdInfo atAdInfo) {
|
||||
|
||||
ad.load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdClose(ATAdInfo atAdInfo) {
|
||||
adcallback.onAdHidden();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdVideoStart(ATAdInfo atAdInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdVideoEnd(ATAdInfo atAdInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdVideoError(AdError adError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static ATInterstitial onCache(List<ATInterstitial> list) {
|
||||
Collections.shuffle(list);
|
||||
for (ATInterstitial ad : list) {
|
||||
if (ad.isAdReady()) {
|
||||
return ad;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ATInterstitial> getAllAd() {
|
||||
if (adArrayList == null) {
|
||||
adArrayList = new ArrayList<>();
|
||||
adArrayList.add(createAd(one_AD, App.app));
|
||||
adArrayList.add(createAd(two_Ad, App.app));
|
||||
adArrayList.add(createAd(three_ad, App.app));
|
||||
}
|
||||
for (ATInterstitial ad : adArrayList) {
|
||||
if (!ad.isAdReady()) {
|
||||
ad.load();
|
||||
}
|
||||
}
|
||||
return adArrayList;
|
||||
}
|
||||
|
||||
private static ATInterstitial createAd(String adUnitId, Context context) {
|
||||
ATInterstitial ad = new ATInterstitial(context, adUnitId);
|
||||
return ad;
|
||||
}
|
||||
|
||||
public static int dpToPx(Context context, int dp) {
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
return Math.round(dp * density);
|
||||
@ -20,9 +114,9 @@ public class Unit {
|
||||
char[] charArray = new char[fileInputStream.available()];
|
||||
int readCount = 0;
|
||||
InputStreamReader streamReader = new InputStreamReader(fileInputStream);
|
||||
BufferedReader bufferedReader =new BufferedReader(streamReader);
|
||||
StringWriter stringWriter =new StringWriter();
|
||||
while ((readCount = bufferedReader.read(charArray))!=-1){
|
||||
BufferedReader bufferedReader = new BufferedReader(streamReader);
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
while ((readCount = bufferedReader.read(charArray)) != -1) {
|
||||
stringWriter.write(charArray, 0, readCount);
|
||||
}
|
||||
return stringWriter.toString();
|
||||
|
||||
@ -14,6 +14,8 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.io.File;
|
||||
@ -22,12 +24,13 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
import emoticon.wasticker.app.App;
|
||||
import emoticon.wasticker.app.initadapter.sticker.StickerAdapter;
|
||||
import emoticon.wasticker.app.listener.AdListener;
|
||||
import emoticon.wasticker.app.listener.Adcallback;
|
||||
import emoticon.wasticker.app.listener.DownloadListener;
|
||||
import emoticon.wasticker.app.manager.AdLoad;
|
||||
import emoticon.wasticker.app.manager.Download;
|
||||
import emoticon.wasticker.app.manager.SPManager;
|
||||
import emoticon.wasticker.app.manager.Unit;
|
||||
import emoticon.wasticker.app.manager.Values;
|
||||
import emoticon.wasticker.app.R;
|
||||
|
||||
@ -50,16 +53,17 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
||||
|
||||
private TextView addTV;
|
||||
|
||||
// private List<MaxInterstitialAd> ads;
|
||||
|
||||
// private List<MaxInterstitialAd> ads;
|
||||
private List<ATInterstitial> ads;
|
||||
private int type = 0;
|
||||
private static boolean isAlreadyShow = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_add);
|
||||
// ads = AdLoad.createAd(AddActivity.this);
|
||||
// loadAd();
|
||||
|
||||
ads = App.lodAd();
|
||||
progressBar = findViewById(R.id.progressbar);
|
||||
backImage = findViewById(R.id.back_im);
|
||||
trayImage = findViewById(R.id.tray_im);
|
||||
@ -91,14 +95,6 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
||||
|
||||
}
|
||||
|
||||
// private void loadAd() {
|
||||
// for (int i = 0; i < ads.size() ; i++) {
|
||||
// MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||
// AdLoad.setAdShowListener(maxInterstitialAd, AddActivity.this);
|
||||
// maxInterstitialAd.loadAd();
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
private void initStickerShow() {
|
||||
@ -149,8 +145,32 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
type = 0;
|
||||
// TODO: 2024/7/18 action2
|
||||
// showAd();
|
||||
showAd();
|
||||
|
||||
}
|
||||
|
||||
private void showAd() {
|
||||
ATInterstitial mInterstitialAd = Unit.onCache(ads);
|
||||
if (mInterstitialAd == null) {
|
||||
isAlreadyShow = false;
|
||||
} else {
|
||||
if (mInterstitialAd.isAdReady()) {
|
||||
Unit.setCallback(mInterstitialAd, new Adcallback() {
|
||||
@Override
|
||||
public void onShowFail(AdError ad) {
|
||||
isAlreadyShow = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdHidden() {
|
||||
isAlreadyShow = true;
|
||||
}
|
||||
});
|
||||
mInterstitialAd.show(this);
|
||||
} else {
|
||||
mInterstitialAd.load();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -159,65 +179,27 @@ public class AddActivity extends AppCompatActivity implements DownloadListener,
|
||||
int id = v.getId();
|
||||
if (id == R.id.back_im) {
|
||||
type = 0;
|
||||
// TODO: 2024/7/18 action2
|
||||
// boolean b = showAd();
|
||||
|
||||
finish();
|
||||
showAd();
|
||||
if (isAlreadyShow) {
|
||||
finish();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
} else if (id == R.id.add_whatsapp_tv) {
|
||||
type = 1;
|
||||
// TODO: 2024/7/18 action3
|
||||
// boolean b = showAd();
|
||||
// if (!b) {
|
||||
// addWhatsApp();
|
||||
// }
|
||||
addWhatsApp();
|
||||
showAd();
|
||||
if (isAlreadyShow) {
|
||||
addWhatsApp();
|
||||
} else {
|
||||
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();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLoadFail(String string, MaxError maxError) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLoadSuccess(MaxAd ad) {
|
||||
//
|
||||
// }
|
||||
|
||||
private void addWhatsApp() {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Values.STICKER_ACTION);
|
||||
|
||||
@ -8,12 +8,18 @@ import android.os.CountDownTimer;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
import com.anythink.core.api.ATShowConfig;
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emoticon.wasticker.app.App;
|
||||
import emoticon.wasticker.app.R;
|
||||
import emoticon.wasticker.app.listener.AdListener;
|
||||
import emoticon.wasticker.app.manager.AdLoad;
|
||||
|
||||
import emoticon.wasticker.app.listener.Adcallback;
|
||||
|
||||
import emoticon.wasticker.app.manager.Unit;
|
||||
|
||||
|
||||
public class FirstOpenActivity extends AppCompatActivity {
|
||||
@ -21,96 +27,69 @@ public class FirstOpenActivity extends AppCompatActivity {
|
||||
|
||||
private CountDownTimer countDownTimer;
|
||||
|
||||
// private List<MaxInterstitialAd> ads;
|
||||
private List<ATInterstitial> ads;
|
||||
|
||||
private boolean hasShow = false;
|
||||
public static boolean isAlreadyShow = false;
|
||||
|
||||
// private void initSDK() {
|
||||
// AppLovinSdk instance = AppLovinSdk.getInstance(this);
|
||||
// instance.setMediationProvider("max");
|
||||
// instance.initializeSdk(new AppLovinSdk.SdkInitializationListener() {
|
||||
// @Override
|
||||
// public void onSdkInitialized(AppLovinSdkConfiguration appLovinSdkConfiguration) {
|
||||
// countDownTimer.start();
|
||||
// ads = AdLoad.createAd(FirstOpenActivity.this);
|
||||
// for (int i = 0; i < ads.size() ; i++) {
|
||||
// MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||
// maxInterstitialAd.loadAd();
|
||||
// AdLoad.setAdShowListener(maxInterstitialAd, FirstOpenActivity.this);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_first_open);
|
||||
|
||||
ads = App.lodAd();
|
||||
|
||||
countDownTimer = new CountDownTimer(11000, 100) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
if (!hasShow) {
|
||||
// TODO: 2024/7/18 action1
|
||||
// startShow();
|
||||
if (!isAlreadyShow) {
|
||||
showAd(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
|
||||
goMain();
|
||||
|
||||
// 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
|
||||
// public void onShowSuccess(MaxAd ad) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onHidden() {
|
||||
// goMain();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLoadFail(String string, MaxError maxError) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLoadSuccess(MaxAd ad) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// maxInterstitialAd.showAd();
|
||||
// }else {
|
||||
// goMain();
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!isAlreadyShow) {
|
||||
showAd(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
countDownTimer.start();
|
||||
// initSDK();
|
||||
}
|
||||
//
|
||||
// private void startShow() {
|
||||
// MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||
// if (maxInterstitialAd != null) {
|
||||
// hasShow = true;
|
||||
// maxInterstitialAd.showAd();
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
private void showAd(boolean go) {
|
||||
ATInterstitial mInterstitialAd = Unit.onCache(ads);
|
||||
if (mInterstitialAd == null) {
|
||||
isAlreadyShow = false;
|
||||
if (go) {
|
||||
goMain();
|
||||
}
|
||||
} else {
|
||||
if (mInterstitialAd.isAdReady()) {
|
||||
isAlreadyShow = true;
|
||||
Unit.setCallback(mInterstitialAd, new Adcallback() {
|
||||
@Override
|
||||
public void onShowFail(AdError ad) {
|
||||
isAlreadyShow = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdHidden() {
|
||||
isAlreadyShow = true;
|
||||
goMain();
|
||||
}
|
||||
});
|
||||
|
||||
mInterstitialAd.show(this);
|
||||
} else {
|
||||
mInterstitialAd.load();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
@ -121,37 +100,10 @@ public class FirstOpenActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public void onShowFail(MaxAd ad) {
|
||||
// hasShow = false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onShowSuccess(MaxAd ad) {
|
||||
// hasShow = true;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onHidden() {
|
||||
// goMain();
|
||||
// }
|
||||
//
|
||||
//
|
||||
private void goMain(){
|
||||
private void goMain() {
|
||||
Intent intent = new Intent(FirstOpenActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
// @Override
|
||||
// public void onLoadFail(String str, MaxError maxError) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onLoadSuccess(MaxAd ad) {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@ -1,11 +1,6 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
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.firebase.crashlytics") version "2.9.2" 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
|
||||
}
|
||||
//buildscript{
|
||||
// dependencies{
|
||||
// classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
|
||||
// }
|
||||
//}
|
||||
@ -3,7 +3,8 @@ pluginManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
// maven{url = uri("https://artifacts.applovin.com/android")}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
@ -11,7 +12,9 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// maven ("https://artifact.bytedance.com/repository/pangle")
|
||||
maven("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
||||
maven("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
||||
maven("https://jfrog.anythinktech.com/artifactory/debugger")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user