V1.0.1(2)接入max和firebase

This commit is contained in:
lihongwei 2025-03-21 18:25:57 +08:00
parent 4dc2dfc9cf
commit 3086b20756
19 changed files with 643 additions and 239 deletions

View File

@ -7,8 +7,15 @@ plugins {
id("org.jetbrains.kotlin.android")
// id("com.google.gms.google-services")
// id("com.google.firebase.crashlytics")
id("applovin-quality-service")
kotlin("kapt")
id ("kotlin-android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
applovin{
apiKey = "BZDQbDZMA_vHnf2beVZtUdTM4e_7yAGWognV5U_oPzbJD8Pfr54orKJFNRCVscsx1Hdx3ZR_Rbb8DHH8wHbAvw"
}
val timestamp = SimpleDateFormat("MM_dd_HH_mm").format(Date())
@ -21,8 +28,8 @@ android {
applicationId = "com.color.keyboard.black"
minSdk = 23
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
versionCode = 2
versionName = "1.0.1"
setProperty(
"archivesBaseName",
"Color Keyboard_V" + versionName + "(${versionCode})_$timestamp"
@ -79,69 +86,35 @@ dependencies {
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.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")
// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
// Add the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-config")
//-----------------------------------------------TopOn(pangle、IronSource、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")
//
// //Ironsource
// implementation("com.anythink.sdk:adapter-tpn-ironsource:6.3.68")
// implementation("com.ironsource.sdk:mediationsdk:8.1.0")
// implementation("com.google.android.gms:play-services-appset:16.0.2")
// implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
// implementation("com.google.android.gms:play-services-basement:18.1.0")
//
// //Bigo
// implementation("com.anythink.sdk:adapter-tpn-bigo:6.3.68")
// implementation("com.bigossp:bigo-ads:4.7.4")
//
// //Pangle
// implementation("com.anythink.sdk:adapter-tpn-pangle-nonchina:6.3.68.1")
// implementation( "com.pangle.global:ads-sdk:6.0.0.3")
// implementation( "com.google.android.gms:play-services-ads-identifier:18.0.1")
//
// //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")
//
// // Debugger UI Tools
// implementation ("com.anythink.sdk:debugger-ui:1.0.7")
//--------------------------MAXLiftoff Monetizevungle、Mintegral、Pangle、Unity Ads
implementation("com.applovin:applovin-sdk:+")
implementation("com.applovin.mediation:bigoads-adapter:+")
implementation("com.applovin.mediation:chartboost-adapter:+")
implementation("com.google.android.gms:play-services-base:16.1.0")
implementation("com.applovin.mediation:fyber-adapter:+")
//Google Ad Manager
// implementation("com.applovin.mediation:google-ad-manager-adapter:+")
//----------------------------------------------TopOn
//Google Bidding and Google AdMob
//implementation("com.applovin.mediation:google-adapter:+")
implementation("com.applovin.mediation:inmobi-adapter:+")
implementation("com.squareup.picasso:picasso:2.71828")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.applovin.mediation:ironsource-adapter:+")
implementation("com.applovin.mediation:vungle-adapter:+")
implementation("com.applovin.mediation:facebook-adapter:+")
implementation("com.applovin.mediation:moloco-adapter:+")
implementation("com.applovin.mediation:bytedance-adapter:+")
implementation("com.applovin.mediation:unityads-adapter:+")
}

29
app/google-services.json Normal file
View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "971312823419",
"project_id": "color-keyboard-f928a",
"storage_bucket": "color-keyboard-f928a.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:971312823419:android:e988ab47ee91885bf3b6de",
"android_client_info": {
"package_name": "com.color.keyboard.black"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDtyh4K_hd9EOFyCCfaKWotPu5CdzM4aF8"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -1,16 +1,23 @@
package com.color.keyboard.black
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
import android.app.Application
import android.content.Intent
import android.graphics.Typeface
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.applovin.sdk.AppLovinMediationProvider
import com.applovin.sdk.AppLovinSdk
import com.applovin.sdk.AppLovinSdkInitializationConfiguration
import com.color.keyboard.black.bean.ChildData
import com.color.keyboard.black.bean.ClassData
//import com.pretty.keyboard.theme.keyboard.helper.ObjectBox
import org.json.JSONArray
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStream
import java.io.InputStreamReader
import java.io.StringWriter
import java.security.AccessController.getContext
class ColorApp : Application() {
companion object {
@ -22,6 +29,11 @@ class ColorApp : Application() {
var defaultFont: Typeface? = null
const val DB_VERSION = 1
const val DB_NAME = "db_name"
const val AD_BROADCAST: String = "on_success_action"
const val MAX_SDK: String =
"CiVvkZKZlVhJJ696v3IBuPvq8pmLmwWefV1aP489QxDAUhVNsllZM8Uwvm7w1UUwURQ1RX6fO9Omo3fuvo7NlT"
var initSDK: Boolean = false
}
override fun onCreate() {
@ -30,9 +42,25 @@ class ColorApp : Application() {
defaultFont = Typeface.createFromAsset(assets, "font5.otf")
dealFile()
initSdk()
}
private fun initSdk() {
val initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
.setMediationProvider(AppLovinMediationProvider.MAX)
.build()
AppLovinSdk.getInstance(this).initialize(initConfig) {
initSDK = true
LocalBroadcastManager.getInstance(colorAppInstance.applicationContext)
.sendBroadcast(Intent(AD_BROADCAST))
}
AppLovinSdk.getInstance(this).settings.setVerboseLogging(true)
//MAX广告测试
// AppLovinSdk.getInstance( this ).showMediationDebugger();
}
private fun dealFile() {
val openFile = colorAppInstance.assets.open("data.json")
val jsonString = getJsonString(openFile)
@ -71,13 +99,13 @@ class ColorApp : Application() {
}
childDataList.add(
ChildData().apply {
setImgPath(imgPath)
setZipPath(zipPath)
setTitleName(title)
setImgGif(imgGif)
thumbUrl = thUrl
thumbGif = thGif
})
setImgPath(imgPath)
setZipPath(zipPath)
setTitleName(title)
setImgGif(imgGif)
thumbUrl = thUrl
thumbGif = thGif
})
}
@ -85,9 +113,9 @@ class ColorApp : Application() {
val shuffled = childDataList.shuffled()
val dataClassData = ClassData()
.apply {
parentName = pName
keyboardList = shuffled
}
parentName = pName
keyboardList = shuffled
}
dataList.add(dataClassData)
}
@ -101,6 +129,7 @@ class ColorApp : Application() {
list = mainList
}
private fun getJsonString(fileInputStream: InputStream): String? {
return try {
// FileInputStream fileInputStream = new FileInputStream(path);
@ -119,5 +148,4 @@ class ColorApp : Application() {
}
}

View File

@ -22,16 +22,18 @@ import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.color.keyboard.black.ColorApp
import com.color.keyboard.black.bean.ChildData
import com.color.keyboard.black.R
import com.color.keyboard.black.database.DbHelper
import com.color.keyboard.black.myfragment.DialogStep
import com.color.keyboard.black.manager.ZipManager
import com.color.keyboard.black.myapi.ApplyApi
import com.color.keyboard.black.adapter.AdapterRecom
import com.color.keyboard.black.myapi.OnItemApi
import com.color.keyboard.black.bean.ChildData
import com.color.keyboard.black.database.DbHelper
import com.color.keyboard.black.manager.Common
import com.color.keyboard.black.manager.ThemeStore
import com.color.keyboard.black.manager.ZipManager
import com.color.keyboard.black.max.MaxManager
import com.color.keyboard.black.max.onAdAfterAction
import com.color.keyboard.black.myapi.ApplyApi
import com.color.keyboard.black.myapi.OnItemApi
import com.color.keyboard.black.myfragment.DialogStep
import kotlinx.coroutines.launch
import java.io.File
@ -89,6 +91,9 @@ class ApplyActivity : AppCompatActivity() {
setContentView(R.layout.layout_apply)
Common.initFullScreen(this,true)
MaxManager.onLoadAd()
MaxManager.startShowMaxAd(this) { }
findViewId()
getExtraData()
displayData()

View File

@ -7,39 +7,42 @@ import android.widget.ProgressBar
import androidx.appcompat.app.AppCompatActivity
import com.color.keyboard.black.R
import com.color.keyboard.black.manager.Common
import com.color.keyboard.black.max.MaxManager
import com.color.keyboard.black.max.WelComManager
import kotlin.math.roundToInt
class LauncherActivity : AppCompatActivity() {
private lateinit var progressBar: ProgressBar
private var countTime = 1000L
private lateinit var timer: CountDownTimer
private var countTime = 11000L
private var timer: CountDownTimer? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.layout_launcher)
Common.initFullScreen(this,true)
MaxManager.onLoadAd()
init()
findView()
}
private fun init() {
timer = object : CountDownTimer(countTime, 100) {
override fun onTick(millisUntilFinished: Long) {
val timer = WelComManager.initTimer(
activity = this,
countTime = countTime,
countAction = { millisUntilFinished ->
val percentage: Float = 100 - millisUntilFinished.toFloat() / countTime * 100
val round = percentage.roundToInt()
progressBar.progress = round
}
override fun onFinish() {
},
goMainAction = {
progressBar.progress = 100
toHome()
}
}
)
timer.start()
}
@ -55,7 +58,8 @@ class LauncherActivity : AppCompatActivity() {
override fun onDestroy() {
super.onDestroy()
timer.cancel()
timer?.cancel()
timer = null
}

View File

@ -23,6 +23,8 @@ import com.color.keyboard.black.databinding.LayoutPreviewBinding;
import com.color.keyboard.black.manager.Common;
import com.color.keyboard.black.manager.MyKey;
import com.color.keyboard.black.manager.ThemeStore;
import com.color.keyboard.black.max.MaxManager;
import com.color.keyboard.black.max.onAdAfterAction;
import jp.wasabeef.glide.transformations.BlurTransformation;
@ -36,7 +38,7 @@ public class PreviewActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Common.INSTANCE.initFullScreen(this,true);
Common.INSTANCE.initFullScreen(this, true);
vb = LayoutPreviewBinding.inflate(getLayoutInflater());
setContentView(vb.getRoot());
@ -44,10 +46,16 @@ public class PreviewActivity extends AppCompatActivity {
}
public void onInit() {
MaxManager.onLoadAd();
MaxManager.startShowMaxAd(this, new onAdAfterAction() {
@Override
public void onAction() {
}
});
String stringExtra = getIntent().getStringExtra(key_name);
vb.title.setText(stringExtra);
@ -56,14 +64,19 @@ public class PreviewActivity extends AppCompatActivity {
vb.idBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
MaxManager.startShowMaxAd(PreviewActivity.this, new onAdAfterAction() {
@Override
public void onAction() {
finish();
}
});
}
});
if (curPath == null) {
return;
}
String bgPath = curPath+"res/drawable-xxhdpi-v4/"+ MyKey.previewBg;
String bgPath = curPath + "res/drawable-xxhdpi-v4/" + MyKey.previewBg;
Drawable bgDraw = Common.INSTANCE.getBgDrawable(this, bgPath);
if (bgDraw != null) {

View File

@ -13,14 +13,17 @@ import com.color.keyboard.black.bean.ClassData;
import com.color.keyboard.black.databinding.LayoutSeeAllBinding;
import com.color.keyboard.black.manager.Common;
import com.color.keyboard.black.manager.Space;
import com.color.keyboard.black.max.MaxManager;
import com.color.keyboard.black.max.onAdAfterAction;
import java.util.List;
public class SeeActivity extends AppCompatActivity {
private LayoutSeeAllBinding vb;
public static final String KEY_NAME ="class_name";
public static final String KEY_NAME = "class_name";
private String name;
private List<ChildData> data;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -33,25 +36,40 @@ public class SeeActivity extends AppCompatActivity {
initClick();
}
private void initData(){
private void initData() {
MaxManager.onLoadAd();
MaxManager.startShowMaxAd(this, new onAdAfterAction() {
@Override
public void onAction() {
}
});
vb.className.setText(name);
for (ClassData classData : ColorApp.list) {
if(classData.getParentName().equals(name)){
if (classData.getParentName().equals(name)) {
data = classData.getKeyboardList();
}
}
Space space = new Space(3, 3, 0);
AdapterHomeChild adapterMain = new AdapterHomeChild(this,data);
vb.recycler.setLayoutManager(new GridLayoutManager(SeeActivity.this,2));
AdapterHomeChild adapterMain = new AdapterHomeChild(this, data);
vb.recycler.setLayoutManager(new GridLayoutManager(SeeActivity.this, 2));
vb.recycler.setAdapter(adapterMain);
vb.recycler.addItemDecoration(space);
}
private void initClick(){
private void initClick() {
vb.back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
MaxManager.startShowMaxAd(SeeActivity.this, new onAdAfterAction() {
@Override
public void onAction() {
finish();
}
});
}
});
}

View File

@ -0,0 +1,11 @@
package com.color.keyboard.black.max;
import com.applovin.mediation.MaxAd;
public interface MaxListener {
void onFail(MaxAd ad);
void onShowSuccess(MaxAd ad);
void onHidden();
}

View File

@ -0,0 +1,179 @@
package com.color.keyboard.black.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.color.keyboard.black.ColorApp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class MaxManager {
/**
Color_inter_1
467f91f020d7493e
Color_inter_2
b3cc3a858d61727e
Color_inter_3
020e7e0f9b418944
*/
private static final String one_AD = "467f91f020d7493e";
private static final String two_Ad = "b3cc3a858d61727e";
private static final String three_ad = "020e7e0f9b418944";
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, ColorApp.colorAppInstance.getApplicationContext());
MaxInterstitialAd AdOne = new MaxInterstitialAd(one_AD, ColorApp.colorAppInstance.getApplicationContext());
MaxInterstitialAd AdThree = new MaxInterstitialAd(three_ad, ColorApp.colorAppInstance.getApplicationContext());
adList.add(AdOne);
adList.add(AdT);
adList.add(AdThree);
}
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(ColorApp.TAG, "-------onAdLoaded-----maxAd=" + maxAd.getAdUnitId());
}
@Override
public void onAdDisplayed(@NonNull MaxAd maxAd) {
Log.d(ColorApp.TAG, "-------onAdDisplayed-----maxAd=" + maxAd.getAdUnitId());
maxListener.onShowSuccess(maxAd);
}
@Override
public void onAdHidden(@NonNull MaxAd maxAd) {
Log.d(ColorApp.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(ColorApp.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();
}
}
});
}
}

View File

@ -0,0 +1,45 @@
package com.color.keyboard.black.max
import android.app.Activity
import android.os.CountDownTimer
import android.util.Log
import com.color.keyboard.black.ColorApp
object WelComManager {
private lateinit var timer: CountDownTimer
private var need_Show = true
@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(ColorApp.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(ColorApp.TAG, "--onTick---------enter")
goMainAction.invoke()
}
}
}
}
override fun onFinish() {
if (need_Show) {
MaxManager.ShowAd(activity) {
goMainAction.invoke()
}
}
}
}
return timer
}
}

View File

@ -0,0 +1,6 @@
package com.color.keyboard.black.max;
public interface onAdAfterAction {
void onAction();
}

View File

@ -0,0 +1,6 @@
package com.color.keyboard.black.max;
public interface onAdStatusListener {
void onAdStatus(int type);
}

View File

@ -1,8 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.1.0" apply false
id("com.android.application") version "8.9.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.20" 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
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.3" apply false
}
buildscript {
dependencies {
classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
}
}

View File

@ -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. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

Binary file not shown.

View File

@ -1,6 +1,7 @@
#Thu Dec 21 17:14:29 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

297
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -15,69 +15,104 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +122,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,88 +133,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

37
gradlew.bat vendored
View File

@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -25,7 +27,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View File

@ -4,6 +4,7 @@ pluginManagement {
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://artifacts.applovin.com/android") }
}
}
dependencyResolutionManagement {
@ -13,6 +14,10 @@ dependencyResolutionManagement {
mavenCentral()
maven("https://jitpack.io")
maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
maven { url = uri("https://android-sdk.is.com") }
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
}
}