接Topon 1.0.8(9)
This commit is contained in:
parent
a630bd304e
commit
a96c572504
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,3 +12,5 @@ app/build/
|
||||
app/release/keyboardskins_V1.0.3(4)_07_16_14_18-release.aab
|
||||
app/release/keyboardskins_V1.0.3(4)_07_16_14_17-release.apk
|
||||
app/release/output-metadata.json
|
||||
app/release/keyboardskins_V1.0.6(7)_07_19_15_01-release.apk
|
||||
app/release/keyboardskins_V1.0.6(7)_07_19_15_03-release.aab
|
||||
|
||||
@ -19,8 +19,8 @@ android {
|
||||
applicationId = "com.key.keyboardskins"
|
||||
minSdk = 23
|
||||
targetSdk = 34
|
||||
versionCode = 6
|
||||
versionName = "1.0.5"
|
||||
versionCode = 9
|
||||
versionName = "1.0.8"
|
||||
setProperty(
|
||||
"archivesBaseName",
|
||||
"keyboardskins_V" + versionName + "(${versionCode})_$timestamp"
|
||||
@ -61,8 +61,54 @@ dependencies {
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
|
||||
implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
||||
implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
||||
// implementation("com.mbridge.msdk.oversea:newinterstitial:16.7.51")
|
||||
// implementation("com.mbridge.msdk.oversea:mbbid:16.7.51")
|
||||
//
|
||||
// implementation("com.facebook.android:facebook-android-sdk:latest.release")
|
||||
//-----------------------------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")
|
||||
|
||||
|
||||
implementation("com.facebook.android:facebook-android-sdk:latest.release")
|
||||
}
|
||||
61
app/proguard-rules.pro
vendored
61
app/proguard-rules.pro
vendored
@ -22,26 +22,57 @@
|
||||
-keep class com.omicronapplications.** { *; }
|
||||
-keep class net.sf.sevenzipjbinding.** { *; }
|
||||
|
||||
#---------------------------------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.**
|
||||
-keepclassmembers class **.R$* { public static final int 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.*{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV{*;}
|
||||
-keep class com.mbridge.msdk.foundation.tools.FastKV$Builder{*;}
|
||||
-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,5 +1,7 @@
|
||||
package com.exquisite;
|
||||
|
||||
import static android.content.ContentValues.TAG;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@ -9,6 +11,10 @@ import android.widget.Toast;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
|
||||
import com.anythink.core.api.ATSDK;
|
||||
import com.anythink.core.api.NetTrafficeCallback;
|
||||
import com.anythink.debug.api.ATDebuggerUITest;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.exquisite.data.Mydata;
|
||||
import com.exquisite.mintegral.MBrManager;
|
||||
import com.exquisite.tools.Mytools;
|
||||
@ -24,42 +30,57 @@ public class KeyboardSkin extends Application {
|
||||
public static KeyboardSkin app;
|
||||
private static Context context;
|
||||
public static List<Mydata> myDataArrayList;
|
||||
private static final String MAX_SDK = "JE7gVeObwAxnnPBv2tb61lNAIEHd4Udk3kac0g2rNpfhmVP0m6PwUH38KLK7yVPblRTBpgFf8ansDbsMtQJ3mx";
|
||||
public static final String AD_BROADCAST = "on_success_action";
|
||||
public static Boolean initSDK = false;
|
||||
public static final String Place_1="1628319";
|
||||
public static final String AD_2="Keyboard_inter_mintegral_2nd";
|
||||
public static final String AD_3="Keyboard_inter_mintegral_3rd";
|
||||
private static final String TOP_ID = "h66a0b86a344ef";
|
||||
private static final String TOP_KEY = "a95ed90a717c7bcff42cd908db3f05664";
|
||||
private static final String TOP_DEBUG = "8a341b6aa5cc3fa453d7741f01a534c1d5dd766a";
|
||||
public static List<ATInterstitial> ads;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
context = getApplicationContext();
|
||||
app = this;
|
||||
// initSDK();
|
||||
|
||||
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();
|
||||
|
||||
List<Mydata> myData = Mytools.parseJsonToList("keyboard.json");
|
||||
myDataArrayList = myData;
|
||||
}
|
||||
|
||||
private void initSdk() {
|
||||
MBridgeSDK sdk = MBridgeSDKFactory.getMBridgeSDK();
|
||||
Map<String, String> map = sdk.getMBConfigurationMap("301174", "8fe84f59b43d24c2aa49154f37e47bae");
|
||||
sdk.init(map, this,new SDKInitStatusListener() {
|
||||
@Override
|
||||
public void onInitSuccess() {
|
||||
initSDK = true;
|
||||
Log.e("SDKInitStatus", "onInitSuccess");
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
|
||||
}
|
||||
// ATSDK.integrationChecking(context);
|
||||
|
||||
@Override
|
||||
public void onInitFail(String errorMsg) {
|
||||
Log.e("SDKInitStatusFail", errorMsg);
|
||||
}
|
||||
});
|
||||
ATSDK.init(context, TOP_ID, TOP_KEY);
|
||||
|
||||
ads = Mytools.getAllAd();
|
||||
// ATSDK.setNetworkLogDebug(true);
|
||||
// ATDebuggerUITest.showDebuggerUI(context,TOP_DEBUG);
|
||||
|
||||
}
|
||||
|
||||
public static List<ATInterstitial> lodAd() {
|
||||
|
||||
return ads;
|
||||
}
|
||||
|
||||
|
||||
public static Context getAppContext() {
|
||||
return context;
|
||||
}
|
||||
@ -75,20 +96,4 @@ public class KeyboardSkin extends Application {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// private void initSDK() {
|
||||
// AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
|
||||
// .setMediationProvider(AppLovinMediationProvider.MAX)
|
||||
// .build();
|
||||
// AppLovinSdk.getInstance(this).initialize(initConfig, new SdkInitializationListener() {
|
||||
// @Override
|
||||
// public void onSdkInitialized(AppLovinSdkConfiguration appLovinSdkConfiguration) {
|
||||
// initSDK = true;
|
||||
// LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
|
||||
// }
|
||||
// });
|
||||
// AppLovinSdk.getInstance(this).getSettings().setVerboseLogging(true);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -15,6 +15,10 @@ import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.exquisite.KeyboardSkin;
|
||||
import com.exquisite.callback.Adcallback;
|
||||
import com.exquisite.fragment.AllFragment;
|
||||
import com.exquisite.demo08.R;
|
||||
import com.exquisite.mintegral.ADBean;
|
||||
@ -27,7 +31,7 @@ import java.util.List;
|
||||
|
||||
public class AllActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private LinearLayout back;
|
||||
// private static List<MaxInterstitialAd> adsList;
|
||||
private List<ATInterstitial> ads;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
@ -40,12 +44,14 @@ public class AllActivity extends AppCompatActivity implements View.OnClickListen
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
ads = KeyboardSkin.lodAd();
|
||||
|
||||
AllFragment fragment = new AllFragment();
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
transaction.add(R.id.all_activity_fragment, fragment);
|
||||
transaction.commit();
|
||||
// adsList = Mytools.getAllAd();
|
||||
intView();
|
||||
intEvent();
|
||||
}
|
||||
@ -62,75 +68,39 @@ public class AllActivity extends AppCompatActivity implements View.OnClickListen
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.back) {
|
||||
// showAd();
|
||||
startShowAd(new Mylistener() {
|
||||
@Override
|
||||
public void actuion(boolean go) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
showAd();
|
||||
|
||||
}
|
||||
}
|
||||
private void startShowAd(Mylistener mylistener){
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if(cache == null){
|
||||
mylistener.actuion(false);
|
||||
}else{
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
private void showAd() {
|
||||
ATInterstitial mInterstitialAd = Mytools.onCache(ads);
|
||||
if (mInterstitialAd == null) {
|
||||
finish();
|
||||
} else {
|
||||
if (mInterstitialAd.isAdReady()) {
|
||||
Mytools.setCallback(mInterstitialAd, new Adcallback() {
|
||||
@Override
|
||||
public void onShowFail(AdError ad) {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
@Override
|
||||
public void onAdHidden() {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
mInterstitialAd.show(this);
|
||||
} else {
|
||||
mInterstitialAd.load();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// private void showAd() {
|
||||
// MaxInterstitialAd cachedAd = Mytools.onCache(adsList);
|
||||
// if (cachedAd == null) {
|
||||
// } else {
|
||||
// Mytools.setADCAllBack(cachedAd, new AdCallback() {
|
||||
// @Override
|
||||
// public void onShowFail(MaxAd ad) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdHidden() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// cachedAd.showAd(this);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
startShowAd(new Mylistener() {
|
||||
@Override
|
||||
public void actuion(boolean go) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
showAd();
|
||||
}
|
||||
}
|
||||
@ -23,12 +23,15 @@ import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.exquisite.KeyboardSkin;
|
||||
import com.exquisite.adapter.ThumAdapter;
|
||||
|
||||
import com.exquisite.callback.Adcallback;
|
||||
import com.exquisite.callback.DownloadCallback;
|
||||
import com.exquisite.callback.UnzipCallback;
|
||||
import com.exquisite.data.StaticValue;
|
||||
@ -56,7 +59,7 @@ public class PreviewActivity extends AppCompatActivity implements View.OnClickLi
|
||||
private ProgressBar progressBarPreview;
|
||||
|
||||
private ProgressBar progressBarDownload;
|
||||
// private static List<MaxInterstitialAd> adsList;
|
||||
private List<ATInterstitial> ads;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
@ -70,8 +73,10 @@ public class PreviewActivity extends AppCompatActivity implements View.OnClickLi
|
||||
return insets;
|
||||
});
|
||||
|
||||
ads = KeyboardSkin.lodAd();
|
||||
|
||||
intView();
|
||||
// adsList = Mytools.getAllAd();
|
||||
|
||||
imageView.setVisibility(View.GONE);
|
||||
progressBarPreview.setVisibility(View.VISIBLE);
|
||||
progressBarDownload.setVisibility(View.GONE);
|
||||
@ -140,6 +145,31 @@ public class PreviewActivity extends AppCompatActivity implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
private void showAd() {
|
||||
ATInterstitial mInterstitialAd = Mytools.onCache(ads);
|
||||
if (mInterstitialAd == null) {
|
||||
finish();
|
||||
} else {
|
||||
if (mInterstitialAd.isAdReady()) {
|
||||
Mytools.setCallback(mInterstitialAd, new Adcallback() {
|
||||
@Override
|
||||
public void onShowFail(AdError ad) {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdHidden() {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
mInterstitialAd.show(this);
|
||||
} else {
|
||||
mInterstitialAd.load();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void download() {
|
||||
if (!Mytools.isStep1() || !Mytools.isStep2()) {
|
||||
Toast.makeText(this, getString(R.string.text_hint), Toast.LENGTH_SHORT).show();
|
||||
@ -154,12 +184,7 @@ public class PreviewActivity extends AppCompatActivity implements View.OnClickLi
|
||||
StaticValue.PATH = resDirPath;
|
||||
Toast.makeText(PreviewActivity.this, getString(R.string.set_successful), Toast.LENGTH_SHORT).show();
|
||||
progressBarDownload.setVisibility(View.GONE);
|
||||
startShowAd(new Mylistener() {
|
||||
@Override
|
||||
public void actuion(boolean go) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
showAd();
|
||||
|
||||
}
|
||||
});
|
||||
@ -168,54 +193,5 @@ public class PreviewActivity extends AppCompatActivity implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
private void startShowAd(Mylistener mylistener) {
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if (cache == null) {
|
||||
mylistener.actuion(false);
|
||||
} else {
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// private void showAd() {
|
||||
// MaxInterstitialAd cachedAd = Mytools.onCache(adsList);
|
||||
// if (cachedAd == null) {
|
||||
//
|
||||
// } else {
|
||||
// Mytools.setADCAllBack(cachedAd, new AdCallback() {
|
||||
// @Override
|
||||
// public void onShowFail(MaxAd ad) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdHidden() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// cachedAd.showAd();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@ -17,7 +17,10 @@ import android.os.CountDownTimer;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
import com.anythink.interstitial.api.ATInterstitial;
|
||||
import com.exquisite.KeyboardSkin;
|
||||
import com.exquisite.callback.Adcallback;
|
||||
import com.exquisite.demo08.R;
|
||||
import com.exquisite.mintegral.ADBean;
|
||||
import com.exquisite.mintegral.MBrManager;
|
||||
@ -33,9 +36,10 @@ import java.util.List;
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
private CountDownTimer countDownTimer;
|
||||
private boolean needShow = true;
|
||||
private boolean key = true;
|
||||
// private static List<MaxInterstitialAd> adsList;
|
||||
private List<ATInterstitial> ads;
|
||||
|
||||
public static boolean isAlreadyShow = false;
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -48,162 +52,67 @@ public class SplashActivity extends AppCompatActivity {
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
ads = KeyboardSkin.lodAd();
|
||||
|
||||
countDownTimer = new CountDownTimer(11000, 100) {
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
if (needShow) {
|
||||
startShowAd(new Mylistener() {
|
||||
@Override
|
||||
public void actuion(boolean go) {
|
||||
if (go){
|
||||
startView();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!isAlreadyShow) {
|
||||
showAd(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if (needShow) {
|
||||
startShowAd(new Mylistener() {
|
||||
@Override
|
||||
public void actuion(boolean go) {
|
||||
startView();
|
||||
}
|
||||
});
|
||||
if (!isAlreadyShow) {
|
||||
showAd(true);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
starAd();
|
||||
// initializeCountDownTimer();
|
||||
// loadAndStartAd();
|
||||
}
|
||||
private void startShowAd(Mylistener mylistener){
|
||||
ADBean cache = MBrManager.getCache();
|
||||
if(cache == null){
|
||||
mylistener.actuion(false);
|
||||
}else{
|
||||
needShow = false;
|
||||
MBrManager.setCallBack(cache.getInterstitialHandler(), new onAdStatusListener() {
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowFail() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
mylistener.actuion(true);
|
||||
}
|
||||
});
|
||||
cache.getInterstitialHandler().showFromBid();
|
||||
}
|
||||
|
||||
countDownTimer.start();
|
||||
|
||||
}
|
||||
private void starAd() {
|
||||
if (!KeyboardSkin.initSDK){
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
initAD();
|
||||
}
|
||||
}, new IntentFilter(KeyboardSkin.AD_BROADCAST));
|
||||
}else {
|
||||
initAD();
|
||||
}
|
||||
}
|
||||
|
||||
private void initAD() {
|
||||
MBrManager.init(this, new onInterHandlerListener() {
|
||||
@Override
|
||||
public void onAddOK() {
|
||||
countDownTimer.start();
|
||||
private void showAd(boolean go) {
|
||||
ATInterstitial mInterstitialAd = Mytools.onCache(ads);
|
||||
if (mInterstitialAd == null) {
|
||||
isAlreadyShow = false;
|
||||
if (go) {
|
||||
goMain();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (mInterstitialAd.isAdReady()) {
|
||||
isAlreadyShow = true;
|
||||
Mytools.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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// private void initializeCountDownTimer() {
|
||||
// countDownTimer = new CountDownTimer(1000, 100) {
|
||||
// @Override
|
||||
// public void onTick(long millisUntilFinished) {
|
||||
// if (!key) {
|
||||
// showAdOrStartView();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFinish() {
|
||||
// if (key) {
|
||||
// showAdOrStartView();
|
||||
// }
|
||||
// startView();
|
||||
// startView();
|
||||
// }
|
||||
// };
|
||||
// countDownTimer.start();
|
||||
// registerBroadcastReceiver();
|
||||
// }
|
||||
|
||||
// private void showAdOrStartView() {
|
||||
// MaxInterstitialAd cachedAd = Mytools.onCache(adsList);
|
||||
// if (cachedAd == null) {
|
||||
// key = false;
|
||||
// startView();
|
||||
// } else {
|
||||
// key = true;
|
||||
// needShow = false;
|
||||
// Mytools.setADCAllBack(cachedAd, new AdCallback() {
|
||||
// @Override
|
||||
// public void onShowFail(MaxAd ad) {
|
||||
// startView();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdHidden() {
|
||||
// startView();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// cachedAd.showAd();
|
||||
// }
|
||||
// }
|
||||
|
||||
private void startView() {
|
||||
private void goMain() {
|
||||
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
// private void loadAndStartAd() {
|
||||
// adsList = Mytools.getAllAd();
|
||||
// countDownTimer.start();
|
||||
// }
|
||||
|
||||
// private void registerBroadcastReceiver() {
|
||||
// if (!KeyboardSkin.initSDK) {
|
||||
// BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
// @Override
|
||||
// public void onReceive(Context context, Intent intent) {
|
||||
// loadAndStartAd();
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// LocalBroadcastManager.getInstance(this).registerReceiver(receiver, new IntentFilter(KeyboardSkin.AD_BROADCAST));
|
||||
// } else {
|
||||
// loadAndStartAd();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
|
||||
9
app/src/main/java/com/exquisite/callback/Adcallback.java
Normal file
9
app/src/main/java/com/exquisite/callback/Adcallback.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.exquisite.callback;
|
||||
|
||||
|
||||
import com.anythink.core.api.AdError;
|
||||
|
||||
public interface Adcallback {
|
||||
void onShowFail(AdError ad);
|
||||
void onAdHidden( );
|
||||
}
|
||||
@ -19,12 +19,17 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
|
||||
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 com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.exquisite.KeyboardSkin;
|
||||
import com.exquisite.callback.Adcallback;
|
||||
import com.exquisite.callback.DownloadCallback;
|
||||
import com.exquisite.callback.UnzipCallback;
|
||||
import com.exquisite.data.Mydata;
|
||||
@ -56,78 +61,97 @@ import java.util.List;
|
||||
|
||||
public class Mytools {
|
||||
private static InputMethodManager methodManager = (InputMethodManager) KeyboardSkin.app.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
// private static ArrayList<MaxInterstitialAd> adArrayList;
|
||||
private static final String one_AD = "37dcb994d4988394";
|
||||
private static final String two_Ad = "a77c5657a94cbb64";
|
||||
private static final String three_ad = "b3a3acdefa7117ff";
|
||||
private static final String one_AD = "n66a0bcbb92e9e";
|
||||
private static final String two_Ad = "n66a0bc9350f0e";
|
||||
private static final String three_ad = "n66a0b8eca7766";
|
||||
private static ArrayList<ATInterstitial> adArrayList;
|
||||
|
||||
// public static void setADCAllBack(MaxInterstitialAd ad, AdCallback adCallback) {
|
||||
// ad.setListener(new MaxAdListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||
// adCallback.onAdHidden();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||
// adCallback.onShowFail(maxAd);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public static MaxInterstitialAd onCache(List<MaxInterstitialAd> list) {
|
||||
// Collections.shuffle(list);
|
||||
// for (MaxInterstitialAd ad : list) {
|
||||
// if (ad.isReady()) {
|
||||
// return ad;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public static List<MaxInterstitialAd> getAllAd() {
|
||||
// if (adArrayList == null) {
|
||||
// adArrayList = new ArrayList<>();
|
||||
// adArrayList.add(createAd(one_AD, KeyboardSkin.app));
|
||||
// adArrayList.add(createAd(two_Ad, KeyboardSkin.app));
|
||||
// adArrayList.add(createAd(three_ad, KeyboardSkin.app));
|
||||
// }
|
||||
// for (MaxInterstitialAd ad : adArrayList) {
|
||||
// if (!ad.isReady()) {
|
||||
// ad.loadAd();
|
||||
// }
|
||||
// }
|
||||
// return adArrayList;
|
||||
// }
|
||||
//
|
||||
// private static MaxInterstitialAd createAd(String adUnitId, Context context) {
|
||||
// MaxInterstitialAd ad = new MaxInterstitialAd(adUnitId, context);
|
||||
// ad.loadAd();
|
||||
// return ad;
|
||||
// }
|
||||
|
||||
public static void setCallback(ATInterstitial ad, Adcallback adcallback) {
|
||||
ad.setAdListener(new ATInterstitialListener() {
|
||||
@Override
|
||||
public void onInterstitialAdLoaded() {
|
||||
Log.e("zzj", "---------onInterstitialAdLoaded--------" + ad.mPlacementId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterstitialAdLoadFail(AdError adError) {
|
||||
Log.e("zzj", "---------onInterstitialAdLoadFail--------" + adError.getFullErrorInfo());
|
||||
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, KeyboardSkin.app));
|
||||
adArrayList.add(createAd(two_Ad, KeyboardSkin.app));
|
||||
adArrayList.add(createAd(three_ad, KeyboardSkin.app));
|
||||
}
|
||||
for (ATInterstitial ad : adArrayList) {
|
||||
if (!ad.isAdReady()) {
|
||||
setCallback(ad, new Adcallback() {
|
||||
@Override
|
||||
public void onShowFail(AdError ad) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdHidden() {
|
||||
|
||||
}
|
||||
});
|
||||
ad.load();
|
||||
}
|
||||
}
|
||||
return adArrayList;
|
||||
}
|
||||
|
||||
private static ATInterstitial createAd(String adUnitId, Context context) {
|
||||
ATInterstitial ad = new ATInterstitial(context, adUnitId);
|
||||
return ad;
|
||||
}
|
||||
|
||||
|
||||
public static StateListDrawable getStatus(Drawable draw, Drawable drawPress) {
|
||||
|
||||
@ -12,6 +12,9 @@ dependencyResolutionManagement {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
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")
|
||||
maven{url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user