diff --git a/build.gradle.kts b/build.gradle.kts index 327342f..77345d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { alias(libs.plugins.android.application) apply false + 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/gradle.properties b/gradle.properties index 4387edc..20b22f5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. For more details, visit # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects diff --git a/keystore.properties b/keystore.properties new file mode 100644 index 0000000..29dd666 --- /dev/null +++ b/keystore.properties @@ -0,0 +1,6 @@ +app_name=Wallpaper Engine +package_name=com.wall.engine.wallpaper +keystoreFile=app/WallpaperEngine +key_alias=WallpaperEnginekey0 +key_store_password=654321 +key_password=654321 \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 5d60160..16cb2f1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,6 +18,27 @@ dependencyResolutionManagement { google() mavenCentral() maven { url = uri("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") + } } } diff --git a/test2/.gitignore b/test2/.gitignore index 42afabf..aa8c439 100644 --- a/test2/.gitignore +++ b/test2/.gitignore @@ -1 +1,18 @@ -/build \ No newline at end of file +/build +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/captures +.externalNativeBuild +.cxx +local.properties +.idea/ +.safedk/ +app/debug/ \ No newline at end of file diff --git a/test2/build.gradle.kts b/test2/build.gradle.kts index 4c510af..516ac31 100644 --- a/test2/build.gradle.kts +++ b/test2/build.gradle.kts @@ -3,6 +3,8 @@ import java.util.Date plugins { alias(libs.plugins.android.application) + id("com.google.gms.google-services") + id("com.google.firebase.crashlytics") } val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date()) @@ -14,8 +16,8 @@ android { applicationId = "com.wall.engine.wallpaper" minSdk = 24 targetSdk = 36 - versionCode = 1 - versionName = "1.0" + versionCode = 2 + versionName = "1.1" setProperty("archivesBaseName","Wallpaper Engine_v"+versionName+"(${versionCode})_$timestamp") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -67,4 +69,85 @@ dependencies { implementation("androidx.core:core-ktx:1.12.0") implementation("androidx.appcompat:appcompat:1.6.1") + + implementation(files("libs/TradPlusLibrary_11_25_15_02-release.aar")) + implementation(files("libs/UpLoadLibrary_12_03_15_13-release.aar")) + implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") + + implementation(platform("com.google.firebase:firebase-bom:33.7.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/test2/google-services.json b/test2/google-services.json new file mode 100644 index 0000000..585ab74 --- /dev/null +++ b/test2/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "580373442500", + "project_id": "wallpaperengine-f3fac", + "storage_bucket": "wallpaperengine-f3fac.firebasestorage.app" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:580373442500:android:cfa7a056335fbac1b67e91", + "android_client_info": { + "package_name": "com.wall.engine.wallpaper" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBGo5XTtldFVP33fT1b_IoiRdJ1q8dU04M" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/test2/libs/TradPlusLibrary_11_25_15_02-release.aar b/test2/libs/TradPlusLibrary_11_25_15_02-release.aar new file mode 100644 index 0000000..803bb1c Binary files /dev/null and b/test2/libs/TradPlusLibrary_11_25_15_02-release.aar differ diff --git a/test2/libs/UpLoadLibrary_12_03_15_13-release.aar b/test2/libs/UpLoadLibrary_12_03_15_13-release.aar new file mode 100644 index 0000000..a3e30aa Binary files /dev/null and b/test2/libs/UpLoadLibrary_12_03_15_13-release.aar differ diff --git a/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_11-release.apk b/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_11-release.apk deleted file mode 100644 index e3cc843..0000000 Binary files a/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_11-release.apk and /dev/null differ diff --git a/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_24-release.aab b/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_24-release.aab deleted file mode 100644 index 3aa661a..0000000 Binary files a/test2/release/Wallpaper Engine_v1.0(1)_11_28_17_24-release.aab and /dev/null differ diff --git a/test2/release/baselineProfiles/0/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm b/test2/release/baselineProfiles/0/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm deleted file mode 100644 index 6f2e8c0..0000000 Binary files a/test2/release/baselineProfiles/0/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm and /dev/null differ diff --git a/test2/release/baselineProfiles/1/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm b/test2/release/baselineProfiles/1/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm deleted file mode 100644 index 3bd1fa0..0000000 Binary files a/test2/release/baselineProfiles/1/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm and /dev/null differ diff --git a/test2/release/output-metadata.json b/test2/release/output-metadata.json index 47a10d5..5d4b387 100644 --- a/test2/release/output-metadata.json +++ b/test2/release/output-metadata.json @@ -11,9 +11,9 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 1, - "versionName": "1.0", - "outputFile": "Wallpaper Engine_v1.0(1)_11_28_17_11-release.apk" + "versionCode": 2, + "versionName": "1.1", + "outputFile": "Wallpaper Engine_v1.1(2)_12_04_15_00-release.apk" } ], "elementType": "File", @@ -22,14 +22,14 @@ "minApi": 28, "maxApi": 30, "baselineProfiles": [ - "baselineProfiles/1/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm" + "baselineProfiles/1/Wallpaper Engine_v1.1(2)_12_04_15_00-release.dm" ] }, { "minApi": 31, "maxApi": 2147483647, "baselineProfiles": [ - "baselineProfiles/0/Wallpaper Engine_v1.0(1)_11_28_17_11-release.dm" + "baselineProfiles/0/Wallpaper Engine_v1.1(2)_12_04_15_00-release.dm" ] } ], diff --git a/test2/src/main/AndroidManifest.xml b/test2/src/main/AndroidManifest.xml index 2b9026a..54ca00c 100644 --- a/test2/src/main/AndroidManifest.xml +++ b/test2/src/main/AndroidManifest.xml @@ -1,22 +1,28 @@ - + + @@ -26,16 +32,19 @@ diff --git a/test2/src/main/java/com/wall/engine/wallpaper/App.java b/test2/src/main/java/com/wall/engine/wallpaper/App.java new file mode 100644 index 0000000..c348cfa --- /dev/null +++ b/test2/src/main/java/com/wall/engine/wallpaper/App.java @@ -0,0 +1,25 @@ +package com.wall.engine.wallpaper; + +import android.app.Application; + +import com.up.uploadlibrary.UpLoadManager; + +import kotlin.Unit; +import kotlin.jvm.functions.Function2; + +public class App extends Application { + + + public static String TAG = "==========="; + @Override + public void onCreate() { + super.onCreate(); + + UpLoadManager.INSTANCE.init(this, TAG, new Function2() { + @Override + public Unit invoke(String s, String s2) { + return null; + } + }); + } +} diff --git a/test2/src/main/java/com/wall/engine/wallpaper/FavoriteActivity.java b/test2/src/main/java/com/wall/engine/wallpaper/FavoriteActivity.java index 778309e..873d1f6 100644 --- a/test2/src/main/java/com/wall/engine/wallpaper/FavoriteActivity.java +++ b/test2/src/main/java/com/wall/engine/wallpaper/FavoriteActivity.java @@ -14,9 +14,15 @@ import androidx.core.view.WindowCompat; import androidx.core.view.WindowInsetsControllerCompat; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; + +import com.ad.tradpluslibrary.TPAdManager; + import java.util.ArrayList; import java.util.List; +import kotlin.Unit; +import kotlin.jvm.functions.Function0; + public class FavoriteActivity extends AppCompatActivity { private RecyclerView rvFavoriteImages; @@ -34,6 +40,12 @@ public class FavoriteActivity extends AppCompatActivity { initViews(); setupRecyclerView(); loadFavoriteData(); + TPAdManager.INSTANCE.showTPAD(FavoriteActivity.this, new Function0() { + @Override + public Unit invoke() { + return null; + } + }); } private void setupStatusBar() { diff --git a/test2/src/main/java/com/wall/engine/wallpaper/FullImageActivity.java b/test2/src/main/java/com/wall/engine/wallpaper/FullImageActivity.java index be2c305..fa3e4f1 100644 --- a/test2/src/main/java/com/wall/engine/wallpaper/FullImageActivity.java +++ b/test2/src/main/java/com/wall/engine/wallpaper/FullImageActivity.java @@ -26,6 +26,7 @@ import androidx.core.view.WindowCompat; import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsControllerCompat; +import com.ad.tradpluslibrary.TPAdManager; import com.bumptech.glide.Glide; import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.DecodeFormat; @@ -43,6 +44,9 @@ import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; +import kotlin.Unit; +import kotlin.jvm.functions.Function0; + // 壁纸设置类型常量 interface WallpaperType { int TYPE_HOME = 1; // 桌面 @@ -85,6 +89,13 @@ public class FullImageActivity extends AppCompatActivity implements WallpaperTyp initClick(); // 初始化点赞状态 initFavoriteState(); + + TPAdManager.INSTANCE.showTPAD(FullImageActivity.this, new Function0() { + @Override + public Unit invoke() { + return null; + } + }); } private void initFullScreen() { @@ -174,10 +185,23 @@ public class FullImageActivity extends AppCompatActivity implements WallpaperTyp binding.imageviewBack.setOnClickListener(v -> finish()); // 下载按钮(无需权限) - binding.layoutDownload.setOnClickListener(v -> startDownload()); + binding.layoutDownload.setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(FullImageActivity.this, new Function0() { + @Override + public Unit invoke() { + startDownload(); + return null; + } + }) + ); // 修正:设置壁纸按钮ID为button_set1(与布局一致) - binding.buttonSet1.setOnClickListener(v -> showWallpaperTypeDialog()); + binding.buttonSet1.setOnClickListener(v -> TPAdManager.INSTANCE.showTPAD(FullImageActivity.this, new Function0() { + @Override + public Unit invoke() { + showWallpaperTypeDialog(); + return null; + } + })); // 点赞按钮 binding.imageFavorite.setOnClickListener(v -> toggleFavorite()); @@ -193,7 +217,7 @@ public class FullImageActivity extends AppCompatActivity implements WallpaperTyp item.setId(imageId); item.setAlt_description(imageDesc); - Urls urls = new Urls(); + Urls urls = new Urls(); urls.setRegular(imageUrl); urls.setSmall(imageUrl); urls.setFull(imageUrl); diff --git a/test2/src/main/java/com/wall/engine/wallpaper/MainActivity.java b/test2/src/main/java/com/wall/engine/wallpaper/MainActivity.java index b8cd522..5bfdc02 100644 --- a/test2/src/main/java/com/wall/engine/wallpaper/MainActivity.java +++ b/test2/src/main/java/com/wall/engine/wallpaper/MainActivity.java @@ -2,6 +2,7 @@ package com.wall.engine.wallpaper; import android.content.Intent; import android.os.Bundle; +import android.os.CountDownTimer; import android.os.Handler; import android.os.Looper; import android.widget.ProgressBar; @@ -12,12 +13,19 @@ import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import com.ad.tradpluslibrary.TPAdManager; + +import kotlin.Unit; +import kotlin.jvm.functions.Function0; +import kotlin.jvm.functions.Function1; + public class MainActivity extends AppCompatActivity { private ProgressBar progressBar; - private int progress = 0; - private Handler handler; + private Handler handler; + private long totalTime = 13000; + private CountDownTimer countDownTimer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -28,39 +36,33 @@ public class MainActivity extends AppCompatActivity { progressBar = findViewById(R.id.progressBar); handler = new Handler(Looper.getMainLooper()); - // 进度条更新逻辑 - new Thread(new Runnable() { - @Override - public void run() { - // 循环更新进度,直到100 - while (progress < 100) { - progress += 1; // 每次+1 - // 切回主线程更新UI - handler.post(new Runnable() { - @Override - public void run() { - progressBar.setProgress(progress); - } - }); - try { - // 控制进度条加载速度(总时长约1.5秒,可调整) - Thread.sleep(15); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - // 进度到100后,跳转到MainActivity2 - handler.post(new Runnable() { - @Override - public void run() { - Intent intent = new Intent(MainActivity.this, MainActivity2.class); - startActivity(intent); - finish(); // 关闭启动页,避免返回键回到此页面 - } - }); + TPAdManager.INSTANCE.init(MainActivity.this, App.TAG, "AA8164DB9D6A35CF63E3DA2B6566D611", "D5E5214E665A8B7F389884D96E888B12", "D3F5AAA6CE3FB2559A14115FE435AE12", "A8EFAD3EA7A59AC823B44C0F53718E12", new Function0() { + @Override + public Unit invoke() { + return null; } - }).start(); + }); + + countDownTimer = TPAdManager.INSTANCE.showWelcomeAd(MainActivity.this, totalTime, new Function1() { + @Override + public Unit invoke(Long aLong) { + int progressPercentage = (int) ((100 * aLong) / totalTime); + int countdownPercentage = 100 - progressPercentage; + progressBar.setProgress(countdownPercentage); + return null; + } + }, new Function0() { + @Override + public Unit invoke() { + Intent intent = new Intent(MainActivity.this, MainActivity2.class); + startActivity(intent); + finish(); // 关闭启动页,避免返回键回到此页面 + return null; + } + }); + countDownTimer.start(); + // 适配系统状态栏(保留原有逻辑) ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { @@ -77,5 +79,9 @@ public class MainActivity extends AppCompatActivity { if (handler != null) { handler.removeCallbacksAndMessages(null); } + if (countDownTimer != null) { + countDownTimer.cancel(); + countDownTimer = null; + } } } \ No newline at end of file diff --git a/test2/src/main/res/layout/activity_main.xml b/test2/src/main/res/layout/activity_main.xml index 21e99d2..e422b31 100644 --- a/test2/src/main/res/layout/activity_main.xml +++ b/test2/src/main/res/layout/activity_main.xml @@ -14,27 +14,25 @@ + android:textStyle="bold" /> - + - \ No newline at end of file + \ No newline at end of file diff --git a/test2/src/main/res/xml/net.xml b/test2/src/main/res/xml/net.xml new file mode 100644 index 0000000..0ac6102 --- /dev/null +++ b/test2/src/main/res/xml/net.xml @@ -0,0 +1,6 @@ + + + + mobile-server.lux-ad.com + +