V1.0.2(4),更换为MAX
This commit is contained in:
parent
2bfb955cf0
commit
0bcf78fe7a
BIN
.safedk/api/SafeDKAndroid-6.4.6.jar
Normal file
BIN
.safedk/api/SafeDKAndroid-6.4.6.jar
Normal file
Binary file not shown.
18
.safedk/app_sdks.lst
Normal file
18
.safedk/app_sdks.lst
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
106f9be0e66f52f36eaaaff4dd231971
|
||||||
|
75939c4ce23c53ad9534d43be176b3e9
|
||||||
|
217e8f437c9fc4244d6e74653ac8a8c7
|
||||||
|
66b774de6608db14a84e972fba1ec954
|
||||||
|
e1c9ddef73e5621f62c717badf1be3f2
|
||||||
|
daaea35726ab7cd457ab61d4538fb822
|
||||||
|
946dbe0d5ed7fee91c8ece64d035e70b
|
||||||
|
1be9e72506f3307ce6a9e78d26d65bd0
|
||||||
|
7eac188d3286b05ccbba774f63a2c049
|
||||||
|
4df96d3bc9afd17b812e65e6c6add1ef
|
||||||
|
becf75b2cc99e82716da2e6697879509
|
||||||
|
7eec7b9476b99b3ce94533da4f2eb987
|
||||||
|
974322f19d813702ea048d95288d2b8c
|
||||||
|
29015bbfcc182d80e7f75bd2c38e4521
|
||||||
|
dd2971b0681141d57b221687791ad1bd
|
||||||
|
86a0d598cde251321e21a0da4ab94065
|
||||||
|
74616804a7dc29147dfb0afe122a9fd2
|
||||||
|
|
||||||
BIN
.safedk/dex/SafeDKAndroid-6.4.6.dex
Normal file
BIN
.safedk/dex/SafeDKAndroid-6.4.6.dex
Normal file
Binary file not shown.
BIN
.safedk/dex/android-support-multidex.dex
Normal file
BIN
.safedk/dex/android-support-multidex.dex
Normal file
Binary file not shown.
2
.safedk/hashes.safedk
Normal file
2
.safedk/hashes.safedk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#Thu Sep 19 11:18:12 CST 2024
|
||||||
|
json=-1663032132
|
||||||
1
.safedk/list.enc
Normal file
1
.safedk/list.enc
Normal file
File diff suppressed because one or more lines are too long
6
.safedk/plugin.properties
Normal file
6
.safedk/plugin.properties
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#
|
||||||
|
#Thu Sep 19 11:28:35 CST 2024
|
||||||
|
sdk_analysis_plugin_version=5.4.6
|
||||||
|
set_multidex=true
|
||||||
|
y87o4e7vb5bbqzuGVTFyOIfZiyBG0Nf0Ksq8S3m2MJOHf_A5BcWGJnKuQqoxwxVvtdQdiTC4O3MPzFwy8rJ9Cc=3cUMfTcsZKzlJevxK4IkNysgDAeQA4B5w332p3g8B9ZAgC54WQNZLVxuxnCx4sCHA5StLJnDTAFa68mFTi8rd8
|
||||||
|
yatmRma9RKlsVe1if4NVbCKUizbmnIgxrtP84RJ2FMcQ5IfcZmuauBmU10zf9CTTaOJrzeIoGCmgT7uTlyigFN=Kwbl2wDLdNgp3kE8gk7WW_CCEBAee8xOIUJZQtEdNZX1iwclqFHlbgrUJt_g4zzSHJosSKIN13gv5Lqoe0bPvg
|
||||||
34
.safedk/proguard-safedk.pro
Normal file
34
.safedk/proguard-safedk.pro
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
-keep class androidx.multidex.** { *; }
|
||||||
|
-keep class androidx.browser.customtabs.CustomTabsIntent { *; }
|
||||||
|
-keep class androidx.** {
|
||||||
|
*** startActivityForResult(***);
|
||||||
|
*** startActivity(***);
|
||||||
|
}
|
||||||
|
-keep class android.support.multidex.** { *; }
|
||||||
|
-keep class android.support.v4.app.** { *; }
|
||||||
|
-keep class com.google.android.gms.location.FusedLocationProviderApi { *; }
|
||||||
|
-keep class com.google.android.gms.location.LocationListener { *; }
|
||||||
|
-keep class io.fabric.sdk.android.** { *; }
|
||||||
|
-keep class okio.** { *; }
|
||||||
|
-keep class retrofit2.** { *; }
|
||||||
|
-keep class okhttp3.** { *; }
|
||||||
|
-keep class com.squareup.okhttp.** { *; }
|
||||||
|
-keep class com.android.volley.** { *; }
|
||||||
|
-keep class com.flurry.** { *; }
|
||||||
|
-keep class org.apache.** { *; }
|
||||||
|
-keep class com.applovin.** { *; }
|
||||||
|
-keep class com.google.android.gms.ads.** { *; }
|
||||||
|
-keep class com.ironsource.** { *; }
|
||||||
|
-keep class com.fyber.inneractive.** { *; }
|
||||||
|
-keep class com.vungle.** { *; }
|
||||||
|
-keep class com.unity3d.ads.** { *; }
|
||||||
|
-keep class com.unity3d.services.** { *; }
|
||||||
|
-keep class com.mintegral.msdk.** { *; }
|
||||||
|
-keep class com.mbridge.msdk.** { *; }
|
||||||
|
-keep class com.adcolony.sdk.** { *; }
|
||||||
|
-keep class com.inmobi.** { *; }
|
||||||
|
-keep class com.five_corp.** { *; }
|
||||||
|
-keep class com.bytedance.** { *; }
|
||||||
|
-keep class com.smaato.** { *; }
|
||||||
|
-keep class com.safedk.** { *; }
|
||||||
|
-keep class com.applovin.quality.** { *; }
|
||||||
@ -6,7 +6,12 @@ plugins {
|
|||||||
id ("kotlin-kapt")
|
id ("kotlin-kapt")
|
||||||
id("com.google.gms.google-services")
|
id("com.google.gms.google-services")
|
||||||
id("com.google.firebase.crashlytics")
|
id("com.google.firebase.crashlytics")
|
||||||
|
id("applovin-quality-service")
|
||||||
}
|
}
|
||||||
|
applovin{
|
||||||
|
apiKey = "yatmRma9RKlsVe1if4NVbCKUizbmnIgxrtP84RJ2FMcQ5IfcZmuauBmU10zf9CTTaOJrzeIoGCmgT7uTlyigFN"
|
||||||
|
}
|
||||||
|
|
||||||
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
|
||||||
android {
|
android {
|
||||||
namespace = "com.key.simplekeyboard"
|
namespace = "com.key.simplekeyboard"
|
||||||
@ -61,5 +66,17 @@ dependencies {
|
|||||||
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")
|
||||||
|
|
||||||
|
//--------------------------MAX(Liftoff Monetize(vungle)、Mintegral、Pangle、Unity Ads、inmobi)
|
||||||
|
implementation("com.applovin:applovin-sdk:+")
|
||||||
|
implementation("com.applovin.mediation:vungle-adapter:+")
|
||||||
|
implementation("com.applovin.mediation:mintegral-adapter:+")
|
||||||
|
implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||||
|
implementation("com.applovin.mediation:unityads-adapter:+")
|
||||||
|
|
||||||
|
implementation("com.applovin.mediation:inmobi-adapter:+")
|
||||||
|
implementation("com.squareup.picasso:picasso:2.71828")
|
||||||
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
||||||
|
//MAX
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
6
app/keystore.properties
Normal file
6
app/keystore.properties
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
app_name=Simple Keyboard
|
||||||
|
package_name=com.key.simplekeyboard
|
||||||
|
keystoreFile=app/simplekeyboard.jks
|
||||||
|
key_alias=simplekeyboardkey0
|
||||||
|
key_store_password=simplekeyboard
|
||||||
|
key_password=simplekeyboard
|
||||||
@ -11,9 +11,9 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 1,
|
"versionCode": 3,
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.2",
|
||||||
"outputFile": "simplekeyboard_V1.0.0(1)_08_01_14_24-release.apk"
|
"outputFile": "simplekeyboard_V1.0.2(3)_09_19_11_23-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File"
|
"elementType": "File"
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "com.key.simplekeyboard.test",
|
|
||||||
"variantName": "release",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 1,
|
|
||||||
"versionName": "1.0.0",
|
|
||||||
"outputFile": "simplekeyboard_V1.0.0(1)_07_05_14_06-release.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File"
|
|
||||||
}
|
|
||||||
@ -2,8 +2,15 @@ package com.key.simplekeyboard;
|
|||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
import com.applovin.sdk.AppLovinMediationProvider;
|
||||||
|
import com.applovin.sdk.AppLovinSdk;
|
||||||
|
import com.applovin.sdk.AppLovinSdkConfiguration;
|
||||||
|
import com.applovin.sdk.AppLovinSdkInitializationConfiguration;
|
||||||
import com.key.simplekeyboard.data.Mydata;
|
import com.key.simplekeyboard.data.Mydata;
|
||||||
import com.key.simplekeyboard.data.MydataBase;
|
import com.key.simplekeyboard.data.MydataBase;
|
||||||
import com.key.simplekeyboard.data.Otherdata;
|
import com.key.simplekeyboard.data.Otherdata;
|
||||||
@ -36,11 +43,13 @@ public class SimpleKeyboardSkins extends Application {
|
|||||||
private static boolean isinsert;
|
private static boolean isinsert;
|
||||||
private static final String PREFS_NAME = "MyPrefs";
|
private static final String PREFS_NAME = "MyPrefs";
|
||||||
private static final String KEY_IS_INSERTED = "isinserted";
|
private static final String KEY_IS_INSERTED = "isinserted";
|
||||||
private static final String TOP_ID = "h66ab2087ca5f6";
|
|
||||||
private static final String TOP_KEY = "abd49d8b0a0203888f56dd3c9b35201d3";
|
|
||||||
private static final String TOP_DEBUG = "04e8ce6db9751f67501af2bfed0cd0de0391453a";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final String AD_BROADCAST = "on_success_action";
|
||||||
|
private static final String MAX_SDK = "Kwbl2wDLdNgp3kE8gk7WW_CCEBAee8xOIUJZQtEdNZX1iwclqFHlbgrUJt_g4zzSHJosSKIN13gv5Lqoe0bPvg";
|
||||||
|
public static Boolean initSDK = false;
|
||||||
|
public static final String TAG = "--------------";
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
@ -73,6 +82,20 @@ public class SimpleKeyboardSkins extends Application {
|
|||||||
|
|
||||||
private void initSdk() {
|
private void initSdk() {
|
||||||
|
|
||||||
|
AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
|
||||||
|
.setMediationProvider(AppLovinMediationProvider.MAX)
|
||||||
|
.build();
|
||||||
|
AppLovinSdk.getInstance(this).initialize(initConfig, new AppLovinSdk.SdkInitializationListener() {
|
||||||
|
@Override
|
||||||
|
public void onSdkInitialized(final AppLovinSdkConfiguration sdkConfig) {
|
||||||
|
initSDK = true;
|
||||||
|
LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AppLovinSdk.getInstance(this).getSettings().setVerboseLogging(true);
|
||||||
|
//MAX广告测试
|
||||||
|
// AppLovinSdk.getInstance( this ).showMediationDebugger();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@ import com.google.android.material.tabs.TabLayout;
|
|||||||
import com.key.simplekeyboard.R;
|
import com.key.simplekeyboard.R;
|
||||||
import com.key.simplekeyboard.adapter.PageAdapter;
|
import com.key.simplekeyboard.adapter.PageAdapter;
|
||||||
import com.key.simplekeyboard.fragment.AllFragment;
|
import com.key.simplekeyboard.fragment.AllFragment;
|
||||||
|
import com.key.simplekeyboard.max.MaxManager;
|
||||||
|
import com.key.simplekeyboard.max.onAdAfterAction;
|
||||||
import com.key.simplekeyboard.tools.AdActionListener;
|
import com.key.simplekeyboard.tools.AdActionListener;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -53,6 +55,8 @@ public class AllActivity extends AppCompatActivity {
|
|||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
MaxManager.onLoadAd();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -103,9 +107,12 @@ public class AllActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showAd(AdActionListener listener) {
|
private void showAd(AdActionListener listener) {
|
||||||
|
MaxManager.startShowMaxAd(this, new onAdAfterAction() {
|
||||||
listener.onAction();
|
@Override
|
||||||
// TODO: 2024/9/19
|
public void onAction() {
|
||||||
|
listener.onAction();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,8 @@ import com.key.simplekeyboard.adapter.ThumAdapter;
|
|||||||
import com.key.simplekeyboard.data.MydataBase;
|
import com.key.simplekeyboard.data.MydataBase;
|
||||||
import com.key.simplekeyboard.data.Otherdata;
|
import com.key.simplekeyboard.data.Otherdata;
|
||||||
import com.key.simplekeyboard.fragment.MainFragment;
|
import com.key.simplekeyboard.fragment.MainFragment;
|
||||||
|
import com.key.simplekeyboard.max.MaxManager;
|
||||||
|
import com.key.simplekeyboard.max.onAdAfterAction;
|
||||||
import com.key.simplekeyboard.tools.AdActionListener;
|
import com.key.simplekeyboard.tools.AdActionListener;
|
||||||
import com.key.simplekeyboard.tools.Mytools;
|
import com.key.simplekeyboard.tools.Mytools;
|
||||||
import com.key.simplekeyboard.tools.SpaceItem;
|
import com.key.simplekeyboard.tools.SpaceItem;
|
||||||
@ -62,7 +64,7 @@ public class PreviewActivity extends AppCompatActivity {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
MaxManager.onLoadAd();
|
||||||
|
|
||||||
|
|
||||||
intView();
|
intView();
|
||||||
@ -120,8 +122,12 @@ public class PreviewActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showAd(AdActionListener listener) {
|
private void showAd(AdActionListener listener) {
|
||||||
listener.onAction();
|
MaxManager.startShowMaxAd(this, new onAdAfterAction() {
|
||||||
// TODO: 2024/9/19
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
listener.onAction();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void intEvent() {
|
private void intEvent() {
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.key.simplekeyboard.SimpleKeyboardSkins;
|
|||||||
import com.key.simplekeyboard.adapter.ThumAdapter;
|
import com.key.simplekeyboard.adapter.ThumAdapter;
|
||||||
import com.key.simplekeyboard.data.MydataBase;
|
import com.key.simplekeyboard.data.MydataBase;
|
||||||
import com.key.simplekeyboard.data.Otherdata;
|
import com.key.simplekeyboard.data.Otherdata;
|
||||||
|
import com.key.simplekeyboard.max.MaxManager;
|
||||||
import com.key.simplekeyboard.tools.Mytools;
|
import com.key.simplekeyboard.tools.Mytools;
|
||||||
import com.key.simplekeyboard.tools.SpaceItem;
|
import com.key.simplekeyboard.tools.SpaceItem;
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ public class SearchActivity extends AppCompatActivity {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
MaxManager.onLoadAd();
|
||||||
initView();
|
initView();
|
||||||
faile.setVisibility(View.GONE);
|
faile.setVisibility(View.GONE);
|
||||||
searchText.requestFocus();
|
searchText.requestFocus();
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import android.widget.ImageView;
|
|||||||
|
|
||||||
import com.key.simplekeyboard.R;
|
import com.key.simplekeyboard.R;
|
||||||
import com.key.simplekeyboard.SimpleKeyboardSkins;
|
import com.key.simplekeyboard.SimpleKeyboardSkins;
|
||||||
|
import com.key.simplekeyboard.max.MaxManager;
|
||||||
import com.key.simplekeyboard.tools.Mytools;
|
import com.key.simplekeyboard.tools.Mytools;
|
||||||
|
|
||||||
public class SettingActivity extends AppCompatActivity {
|
public class SettingActivity extends AppCompatActivity {
|
||||||
@ -37,7 +38,7 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
MaxManager.onLoadAd();
|
||||||
intView();
|
intView();
|
||||||
|
|
||||||
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
||||||
|
|||||||
@ -10,16 +10,20 @@ import androidx.core.graphics.Insets;
|
|||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import com.app.wallpaper.max.WelComManager;
|
||||||
import com.key.simplekeyboard.R;
|
import com.key.simplekeyboard.R;
|
||||||
import com.key.simplekeyboard.tools.CustomProgressBar;
|
import com.key.simplekeyboard.tools.CustomProgressBar;
|
||||||
|
|
||||||
|
import kotlin.Unit;
|
||||||
|
import kotlin.jvm.functions.Function0;
|
||||||
|
import kotlin.jvm.functions.Function1;
|
||||||
|
|
||||||
public class SplashActivity extends AppCompatActivity {
|
public class SplashActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
|
private long timer = 12000;
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
|
|
||||||
|
|
||||||
private boolean isAlreadyShow = false;
|
|
||||||
private float i = 0;
|
|
||||||
|
|
||||||
@SuppressLint("MissingInflatedId")
|
@SuppressLint("MissingInflatedId")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -34,39 +38,36 @@ public class SplashActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
CustomProgressBar customProgressBar = findViewById(R.id.splash_pg);
|
CustomProgressBar customProgressBar = findViewById(R.id.splash_pg);
|
||||||
|
|
||||||
countDownTimer = new CountDownTimer(10100, 100) {
|
countDownTimer = WelComManager.initTimer(this, timer, new Function1<Long, Unit>() {
|
||||||
@Override
|
@Override
|
||||||
public void onTick(long l) {
|
public Unit invoke(Long aLong) {
|
||||||
i++;
|
float l1 = (float) aLong / timer;
|
||||||
customProgressBar.setProgress(i);
|
float v = 100 - l1 * 100;
|
||||||
if (!isAlreadyShow) {
|
customProgressBar.setProgress((int) v);
|
||||||
showAd(false);
|
return null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}, new Function0<Unit>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public Unit invoke() {
|
||||||
if (!isAlreadyShow) {
|
starMainactivity();
|
||||||
showAd(true);
|
return null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
countDownTimer.start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAd(boolean go) {
|
|
||||||
if(go){
|
|
||||||
starMainactivity();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void starMainactivity() {
|
private void starMainactivity() {
|
||||||
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
if(countDownTimer!=null){
|
||||||
|
countDownTimer.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.key.simplekeyboard.max;
|
||||||
|
|
||||||
|
import com.applovin.mediation.MaxAd;
|
||||||
|
|
||||||
|
public interface MaxListener {
|
||||||
|
void onFail(MaxAd ad);
|
||||||
|
|
||||||
|
void onShowSuccess(MaxAd ad);
|
||||||
|
|
||||||
|
void onHidden();
|
||||||
|
}
|
||||||
185
app/src/main/java/com/key/simplekeyboard/max/MaxManager.java
Normal file
185
app/src/main/java/com/key/simplekeyboard/max/MaxManager.java
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
package com.key.simplekeyboard.max;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
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 com.key.simplekeyboard.SimpleKeyboardSkins;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MaxManager {
|
||||||
|
/**
|
||||||
|
* Keyboard_inter_1
|
||||||
|
* 7c434fe5706c6992
|
||||||
|
* Keyboard_inter_2
|
||||||
|
* 00624c6bceb0316f
|
||||||
|
* Keyboard_inter_3
|
||||||
|
* 98d734a39afa4806
|
||||||
|
* Keyboard_inter_4
|
||||||
|
* b034a4f35be23afe
|
||||||
|
*/
|
||||||
|
private static final String one_AD = "7c434fe5706c6992";
|
||||||
|
private static final String two_Ad = "00624c6bceb0316f";
|
||||||
|
private static final String three_ad = "98d734a39afa4806";
|
||||||
|
private static final String four_ad = "b034a4f35be23afe";
|
||||||
|
|
||||||
|
|
||||||
|
public static final int type_no_cache = 0;
|
||||||
|
public static final int type_has_cache = 1;
|
||||||
|
public static final int type_show_success = 2;
|
||||||
|
public static final int type_show_close = 3;
|
||||||
|
public static final int type_show_fail = 4;
|
||||||
|
|
||||||
|
private static List<MaxInterstitialAd> adList = new ArrayList<>();
|
||||||
|
|
||||||
|
public static MaxInterstitialAd getAd(List<MaxInterstitialAd> list) {
|
||||||
|
Collections.shuffle(list);
|
||||||
|
for (MaxInterstitialAd ad : list) {
|
||||||
|
if (ad.isReady()) {
|
||||||
|
return ad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MaxInterstitialAd> onLoadAd() {
|
||||||
|
if (adList.isEmpty()) {
|
||||||
|
MaxInterstitialAd AdT = new MaxInterstitialAd(two_Ad, SimpleKeyboardSkins.getContext());
|
||||||
|
MaxInterstitialAd AdOne = new MaxInterstitialAd(one_AD, SimpleKeyboardSkins.getContext());
|
||||||
|
MaxInterstitialAd AdThree = new MaxInterstitialAd(three_ad, SimpleKeyboardSkins.getContext());
|
||||||
|
MaxInterstitialAd AdFour = new MaxInterstitialAd(four_ad, SimpleKeyboardSkins.getContext());
|
||||||
|
adList.add(AdOne);
|
||||||
|
adList.add(AdT);
|
||||||
|
adList.add(AdThree);
|
||||||
|
adList.add(AdFour);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MaxInterstitialAd ad : adList) {
|
||||||
|
if (!ad.isReady()) {
|
||||||
|
setMyListener(ad, new MaxListener() {
|
||||||
|
@Override
|
||||||
|
public void onFail(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.loadAd();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return adList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMyListener(MaxInterstitialAd ad, MaxListener maxListener) {
|
||||||
|
ad.setListener(new MaxAdListener() {
|
||||||
|
@Override
|
||||||
|
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "-------onAdLoaded-----maxAd=" + maxAd.getAdUnitId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "-------onAdDisplayed-----maxAd=" + maxAd.getAdUnitId());
|
||||||
|
maxListener.onShowSuccess(maxAd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "-------onAdHidden-----maxAd=" + maxAd.getAdUnitId());
|
||||||
|
maxListener.onHidden();
|
||||||
|
setMyListener(ad, new MaxListener() {
|
||||||
|
@Override
|
||||||
|
public void onFail(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.loadAd();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "-------onAdLoadFailed-----s=" + s+"----maxError="+maxError.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||||
|
maxListener.onFail(maxAd);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ShowAd(Activity activity, onAdStatusListener listener) {
|
||||||
|
MaxInterstitialAd ad = MaxManager.getAd(adList);
|
||||||
|
if (ad == null) {
|
||||||
|
listener.onAdStatus(type_no_cache);
|
||||||
|
} else {
|
||||||
|
listener.onAdStatus(type_has_cache);
|
||||||
|
MaxManager.setMyListener(ad, new MaxListener() {
|
||||||
|
@Override
|
||||||
|
public void onFail(MaxAd ad) {
|
||||||
|
listener.onAdStatus(type_show_fail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
listener.onAdStatus(type_show_success);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
listener.onAdStatus(type_show_close);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ad.showAd(activity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void startShowMaxAd(Activity activity, onAdAfterAction listener) {
|
||||||
|
MaxManager.ShowAd(activity, new onAdStatusListener() {
|
||||||
|
@Override
|
||||||
|
public void onAdStatus(int type) {
|
||||||
|
if (type == MaxManager.type_show_close || type == MaxManager.type_show_fail || type == MaxManager.type_no_cache) {
|
||||||
|
if (listener != null)
|
||||||
|
listener.onAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package com.app.wallpaper.max
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.os.CountDownTimer
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
|
|
||||||
|
import com.applovin.mediation.ads.MaxInterstitialAd
|
||||||
|
import com.key.simplekeyboard.SimpleKeyboardSkins
|
||||||
|
import com.key.simplekeyboard.max.MaxManager
|
||||||
|
|
||||||
|
|
||||||
|
object WelComManager {
|
||||||
|
|
||||||
|
private lateinit var timer: CountDownTimer
|
||||||
|
|
||||||
|
private var need_Show = true
|
||||||
|
|
||||||
|
private lateinit var lists: List<MaxInterstitialAd>
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun initTimer(activity: Activity, countTime: Long,countAction: (Long) -> Unit, goMainAction: () -> Unit): CountDownTimer {
|
||||||
|
need_Show = true
|
||||||
|
timer = object : CountDownTimer(countTime, 100) {
|
||||||
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
|
countAction.invoke(millisUntilFinished)
|
||||||
|
if (need_Show) {
|
||||||
|
MaxManager.ShowAd(activity) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "--onTick----------it=$it")
|
||||||
|
if (it == MaxManager.type_has_cache) {
|
||||||
|
need_Show = false
|
||||||
|
}
|
||||||
|
if (it == MaxManager.type_show_close || it == MaxManager.type_show_fail) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "--onTick---------enter")
|
||||||
|
goMainAction.invoke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFinish() {
|
||||||
|
if (need_Show) {
|
||||||
|
MaxManager.ShowAd(activity) {
|
||||||
|
if (it == MaxManager.type_show_close || it == MaxManager.type_show_fail || it == MaxManager.type_no_cache) {
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "--onFinish---------enter")
|
||||||
|
goMainAction.invoke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
startAd(activity)
|
||||||
|
return timer
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startAd(activity: Activity) {
|
||||||
|
if (!SimpleKeyboardSkins.initSDK) {
|
||||||
|
LocalBroadcastManager.getInstance(activity)
|
||||||
|
.registerReceiver(object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
lists = MaxManager.onLoadAd()
|
||||||
|
timer.start()
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "------------1sucess")
|
||||||
|
}
|
||||||
|
}, IntentFilter(SimpleKeyboardSkins.AD_BROADCAST))
|
||||||
|
} else {
|
||||||
|
lists = MaxManager.onLoadAd()
|
||||||
|
timer.start()
|
||||||
|
Log.d(SimpleKeyboardSkins.TAG, "------------2sucess")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.key.simplekeyboard.max;
|
||||||
|
|
||||||
|
public interface onAdAfterAction {
|
||||||
|
|
||||||
|
void onAction();
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.key.simplekeyboard.max;
|
||||||
|
|
||||||
|
public interface onAdStatusListener {
|
||||||
|
|
||||||
|
void onAdStatus(int type);
|
||||||
|
}
|
||||||
@ -4,4 +4,9 @@ plugins {
|
|||||||
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
|
id("org.jetbrains.kotlin.android") version "1.9.0" 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:+")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -2,6 +2,9 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url = uri("https://artifacts.applovin.com/android") }
|
||||||
|
|
||||||
|
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12,17 +15,9 @@ dependencyResolutionManagement {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
|
|
||||||
//Anythink(Core)
|
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
|
||||||
maven("https://jfrog.anythinktech.com/artifactory/overseas_sdk")
|
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
|
||||||
//Ironsource
|
|
||||||
maven("https://android-sdk.is.com/")
|
|
||||||
//Mintegral
|
|
||||||
maven("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea")
|
|
||||||
//Pangle
|
|
||||||
maven("https://artifact.bytedance.com/repository/pangle")
|
|
||||||
|
|
||||||
//TopOn集成测试工具
|
|
||||||
// maven ( "https://jfrog.anythinktech.com/artifactory/debugger")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user