diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2245fc6..d4e3699 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,6 +7,8 @@ plugins { id("org.jetbrains.kotlin.android") kotlin("kapt") id ("kotlin-android") + id("com.google.gms.google-services") + id("com.google.firebase.crashlytics") } val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date()) @@ -19,15 +21,14 @@ android { applicationId = "com.keypalette.theme" minSdk = 24 targetSdk = 36 - versionCode = 1 - versionName = "1.0" + versionCode = 2 + versionName = "1.1" setProperty( "archivesBaseName", "KeyPalette_V" + versionName + "(${versionCode})_$timestamp" ) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - buildTypes { release { isMinifyEnabled = true @@ -70,4 +71,85 @@ dependencies { implementation ("androidx.room:room-ktx:$room_version") implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2") + + implementation(files("libs/TradPlusLibrary_11_25_15_02-release.aar")) + implementation(files("libs/UpLoadLibrary_11_24_18_30-release.aar")) + implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") + + implementation(platform("com.google.firebase:firebase-bom:34.6.0")) + implementation("com.google.firebase:firebase-crashlytics") + implementation("com.google.firebase:firebase-analytics") + implementation("com.google.firebase:firebase-config") + + + // TradPlus + implementation("com.tradplusad:tradplus:14.5.0.1") + //noinspection GradleCompatible + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("androidx.appcompat:appcompat:1.3.0-alpha02") + // Meta + implementation("com.facebook.android:audience-network-sdk:6.20.0") + implementation("com.tradplusad:tradplus-facebook:1.14.5.0.1") + // Applovin + implementation("com.applovin:applovin-sdk:13.3.1") + implementation("com.tradplusad:tradplus-applovin:9.14.5.0.1") + implementation("com.google.android.gms:play-services-ads-identifier:18.2.0") + // Ironsource + implementation("com.ironsource.sdk:mediationsdk:8.10.0") + implementation("com.tradplusad:tradplus-ironsource:10.14.5.0.1") + implementation("com.google.android.gms:play-services-appset:16.0.0") + implementation("com.google.android.gms:play-services-ads-identifier:17.0.0") + implementation("com.google.android.gms:play-services-basement:17.5.0") + // Adcolony + implementation("com.adcolony:sdk:4.8.0") + implementation("com.tradplusad:tradplus-adcolony:4.14.5.0.1") + implementation("com.google.android.gms:play-services-ads-identifier:17.0.0") + // Pangle + implementation("com.tradplusad:tradplus-pangle:19.14.5.0.1") + implementation("com.pangle.global:pag-sdk:7.3.0.3") + // UnityAds + implementation("com.tradplusad:tradplus-unity:5.14.5.0.1") + implementation("com.unity3d.ads:unity-ads:4.15.1") + // Chartboost + implementation("com.tradplusad:tradplus-chartboostx:15.14.5.0.1") + implementation("com.chartboost:chartboost-sdk:9.8.3") + implementation("com.google.android.gms:play-services-ads-identifier:17.0.0") + implementation("com.google.android.gms:play-services-base:17.4.0") + // Inmobi + implementation("com.tradplusad:tradplus-inmobix:23.14.5.0.1") + implementation("com.inmobi.monetization:inmobi-ads-kotlin:10.8.3") + implementation("androidx.core:core-ktx:1.5.0") + implementation("com.inmobi.omsdk:inmobi-omsdk:1.5.2.0") + // Fyber + implementation("com.fyber:marketplace-sdk:8.3.7") + implementation("com.tradplusad:tradplus-fyber:24.14.5.0.1") + implementation("com.google.android.gms:play-services-ads-identifier:17.0.0") + implementation("com.google.android.gms:play-services-base:17.4.0") + // Start.io + implementation("com.startapp:inapp-sdk:5.2.3") + implementation("com.tradplusad:tradplus-startapp:28.14.5.0.1") + // Mintegral + implementation("com.tradplusad:tradplus-mintegralx_overseas:18.14.5.0.1") + implementation("androidx.recyclerview:recyclerview:1.1.0") + implementation("com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.71") + // Liftoff + implementation("com.tradplusad:tradplus-vunglex:7.14.5.0.1") + implementation("com.vungle:vungle-ads:7.5.0") + // Yandex + implementation("com.yandex.android:mobileads:7.13.0") { + exclude(group = "com.caverock", module = "androidsvg-aar") + } + implementation("com.tradplusad:tradplus-yandex:50.14.6.10.1") + // Bigo + implementation("com.bigossp:bigo-ads:5.4.0") + implementation("com.tradplusad:tradplus-bigo:57.14.5.0.1") + // Cross Promotion + implementation("com.tradplusad:tradplus-crosspromotion:27.14.5.0.1") + // TP Exchange + // 请注意保持与主包版本同步更新 + implementation("com.google.code.gson:gson:2.8.6") + implementation("com.tradplusad:tp_exchange:40.14.5.0.1") + + // Google UMP + implementation ("com.google.android.ump:user-messaging-platform:3.2.0") } \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..7f1612d --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "212936744078", + "project_id": "keypalette-7290a", + "storage_bucket": "keypalette-7290a.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:212936744078:android:7890a6d3cf3cc5360f3ddf", + "android_client_info": { + "package_name": "com.keypalette.theme" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDR8F_xFl9yiV3f9Hsgi_zw_BL_mesGIk0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/libs/TradPlusLibrary_11_25_15_02-release.aar b/app/libs/TradPlusLibrary_11_25_15_02-release.aar new file mode 100644 index 0000000..803bb1c Binary files /dev/null and b/app/libs/TradPlusLibrary_11_25_15_02-release.aar differ diff --git a/app/libs/UpLoadLibrary_11_24_18_30-release.aar b/app/libs/UpLoadLibrary_11_24_18_30-release.aar new file mode 100644 index 0000000..01829d2 Binary files /dev/null and b/app/libs/UpLoadLibrary_11_24_18_30-release.aar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cdf8bd5..92d45dd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + + Log.d("------------","-UpLoadManager--status=${status} msg= ${msg}") + } } private fun dealFile() { diff --git a/app/src/main/java/com/keypalette/theme/activity/PageApply.kt b/app/src/main/java/com/keypalette/theme/activity/PageApply.kt index 6318b8d..84a1f0b 100644 --- a/app/src/main/java/com/keypalette/theme/activity/PageApply.kt +++ b/app/src/main/java/com/keypalette/theme/activity/PageApply.kt @@ -13,6 +13,7 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope +import com.ad.tradpluslibrary.TPAdManager import com.bumptech.glide.Glide import com.bumptech.glide.integration.webp.decoder.WebpDrawable import com.bumptech.glide.load.DataSource @@ -21,13 +22,12 @@ import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.target.Target import com.keypalette.theme.KeyApp import com.keypalette.theme.R - import com.keypalette.theme.dataabout.database.LikeFunction -import com.keypalette.theme.other.listener.ListenerDownload import com.keypalette.theme.dataabout.resource.Data import com.keypalette.theme.other.Helper import com.keypalette.theme.other.SpSkins import com.keypalette.theme.other.ZipFile +import com.keypalette.theme.other.listener.ListenerDownload import kotlinx.coroutines.launch import java.io.File @@ -70,7 +70,7 @@ class PageApply : AppCompatActivity() { displayData() setApply() onClick() - + TPAdManager.showTPAD(this) { null } } @@ -158,24 +158,7 @@ class PageApply : AppCompatActivity() { } -// recommendedRecycler.run { -// adapter = AdaList( -// this@ActDownload -// ).apply { -// val shuffled = forYouList[0].keyboardList.shuffled() -// setForYouList(shuffled.subList(0,8)) -// }.apply { -// setClickAction(object : OnClick { -// override fun onItemClick() { -// finish() -// } -// -// }) -// } -// -// layoutManager = GridLayoutManager(this@ActDownload, 2) -// -// } + } @@ -216,9 +199,10 @@ class PageApply : AppCompatActivity() { private fun setApply() { applyBtn.setOnClickListener { - startDown() - + TPAdManager.showTPAD(this@PageApply){ + startDown() + } } } diff --git a/app/src/main/java/com/keypalette/theme/activity/PageSkinsAll.java b/app/src/main/java/com/keypalette/theme/activity/PageSkinsAll.java index 5024961..c89f5ac 100644 --- a/app/src/main/java/com/keypalette/theme/activity/PageSkinsAll.java +++ b/app/src/main/java/com/keypalette/theme/activity/PageSkinsAll.java @@ -6,6 +6,7 @@ import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.GridLayoutManager; +import com.ad.tradpluslibrary.TPAdManager; import com.keypalette.theme.AllAdapter; import com.keypalette.theme.KeyApp; import com.keypalette.theme.dataabout.resource.Data; @@ -16,6 +17,9 @@ import com.keypalette.theme.other.ItemDecoration; import java.util.List; +import kotlin.Unit; +import kotlin.jvm.functions.Function0; + public class PageSkinsAll extends AppCompatActivity { private PageSkinsAllBinding vb; public static final String KEY_NAME = "class_name"; @@ -32,6 +36,12 @@ public class PageSkinsAll extends AppCompatActivity { name = getIntent().getStringExtra(KEY_NAME); initData(); initClick(); + TPAdManager.INSTANCE.showTPAD(this, new Function0() { + @Override + public Unit invoke() { + return null; + } + }); } @@ -55,9 +65,14 @@ public class PageSkinsAll extends AppCompatActivity { vb.back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - finish(); + TPAdManager.INSTANCE.showTPAD(PageSkinsAll.this, new Function0() { + @Override + public Unit invoke() { + finish(); + return null; + } + }); } }); } - } \ No newline at end of file diff --git a/app/src/main/java/com/keypalette/theme/activity/PageSplash.kt b/app/src/main/java/com/keypalette/theme/activity/PageSplash.kt index 4352b82..0b64f54 100644 --- a/app/src/main/java/com/keypalette/theme/activity/PageSplash.kt +++ b/app/src/main/java/com/keypalette/theme/activity/PageSplash.kt @@ -6,6 +6,8 @@ import android.os.CountDownTimer import android.widget.ProgressBar import android.widget.TextView import androidx.appcompat.app.AppCompatActivity +import com.ad.tradpluslibrary.TPAdManager +import com.keypalette.theme.KeyApp import com.keypalette.theme.R import com.keypalette.theme.other.Helper @@ -14,42 +16,43 @@ import kotlin.math.roundToInt class PageSplash : AppCompatActivity() { private lateinit var progressBar: ProgressBar - private var countTime = 2000L + private var countTime = 13000L private lateinit var timer: CountDownTimer - private lateinit var tvProgress:TextView + private lateinit var tvProgress: TextView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.page_splash) - Helper.initFullScreen(this,true) + Helper.initFullScreen(this, true) progressBar = findViewById(R.id.progress) tvProgress = findViewById(R.id.tv_progress) init() - } - private fun init() { - timer = object : CountDownTimer(countTime,100){ - - override fun onTick(millisUntilFinished: Long) { - val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100 - val round = percentage.roundToInt() - progressBar.progress = round - val format =getString(R.string.tv_wel_progress, round) - tvProgress.text = format - } - - override fun onFinish() { - progressBar.progress = 100 - tvProgress.text = getString(R.string.tv_wel_progress, 100) - toHome() - } + TPAdManager.init( + this, + KeyApp.TAG, + "9DA82673EEAFF267945A9D92F545AD11", + "648581FB64E2985CA42DC32A3D3DDF12", + "F1367D28B7CFB7C282D82F208E2ECD12", + "44693489BA735BD1D15EE3034AE15212" + ) { } - + timer = TPAdManager.showWelcomeAd(this, countTime, { millisUntilFinished -> + val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100 + val round = percentage.roundToInt() + progressBar.progress = round + val format = getString(R.string.tv_wel_progress, round) + tvProgress.text = format + }) { + progressBar.progress = 100 + tvProgress.text = getString(R.string.tv_wel_progress, 100) + toHome() + } timer.start() - } + private fun toHome() { startActivity(Intent(this, PageMain::class.java)) finish() diff --git a/app/src/main/java/com/keypalette/theme/code/MyKeyView.java b/app/src/main/java/com/keypalette/theme/code/MyKeyView.java index 4fb623f..9a2ecde 100644 --- a/app/src/main/java/com/keypalette/theme/code/MyKeyView.java +++ b/app/src/main/java/com/keypalette/theme/code/MyKeyView.java @@ -114,7 +114,7 @@ public class MyKeyView extends CodeView { int i = 0; for (CodeKeyBoard.Key curKey : getKeyboard().getKeys()) { int code = curKey.codes[0]; - if (config != null&&config.getLayouts().size()>0) { + if (config != null&& !config.getLayouts().isEmpty()) { if (code == 113 ||code == 81 || code == 49||code == 91) { i = 0; ConfigWrapper configWrapper = config.getLayouts().get(0); diff --git a/build.gradle.kts b/build.gradle.kts index 80d88ca..08ea93d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,4 +3,6 @@ plugins { id("com.android.application") version "8.6.1" apply false id("org.jetbrains.kotlin.android") version "2.2.21" apply false kotlin("kapt") version "2.0.0" + id("com.google.gms.google-services") version "4.4.2" apply false + id ("com.google.firebase.crashlytics") version "3.0.2" apply false } diff --git a/settings.gradle.kts b/settings.gradle.kts index 22a5e29..987ec80 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,6 +12,28 @@ dependencyResolutionManagement { google() mavenCentral() maven("https://jitpack.io") + + + //------------------------- TradPlus + // Ironsource + maven { url = uri("https://android-sdk.is.com/") } + // Pangle + maven { + url = uri("https://artifact.bytedance.com/repository/pangle") + } + // Chartboost + maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") } + maven { + name = "Chartboost Mediation’s maven repo" + url = uri("https://cboost.jfrog.io/artifactory/chartboost-mediation") + } + // Mintegral + //Launch GP market application, Android X Version + //If you fail to pull the code using gradle, add the maven warehouse configuration to the project root build.gradle file + maven { + url = + uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") + } } } rootProject.name = "KeyPalette"