Commit 71aed9b4 authored by wanglei's avatar wanglei

...

parent 9937ecf8
package com.base.locationsharewhite
/**
*Create by SleepDog on 2024-12-24
*/
object GlobalConfig {
//包名
const val PACKAGE_NAME = "com.loactation.alibabab.ccccaa"
// 域名
/**
* Url Event 上报接口
*/
const val URL_EVENT = "https://rp.gamexzonerk.xyz"
/**
* Url Api 业务接口
*/
const val URL_API = "https://api.gamexzonerk.xyz"
/**
* Url Privacy 隐私链接
*/
const val URL_PRIVACY = "https://sites.google.com/view/locationuses/location"
/**
* Url Use 使用条款
*/
const val URL_USE = ""
/**
* Key Aes 加密key
*/
const val KEY_AES = "pex50vwzuhpim3yh"
/**
* Key solar 归因key
*/
const val KEY_SOLAR = ""
// admob广告位id
inline val ID_ADMOB_INTER get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/1033173712" else "ca-app-pub-3940256099942544/1033173712"
inline val ID_ADMOB_NATIVE get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/2247696110" else "ca-app-pub-3940256099942544/2247696110"
inline val ID_ADMOB_OPEN get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/9257395921" else "ca-app-pub-3940256099942544/9257395921"
inline val ID_ADMOB_BANNER get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/9214589741" else "ca-app-pub-3940256099942544/9214589741"
inline val ID_ADMOB_REWARD get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/5224354917" else "ca-app-pub-3940256099942544/5224354917"
// max广告位id
inline val ID_MAX_APP get() = if (BuildConfig.DEBUG) "GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW" else "GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
inline val ID_MAX_INTER get() = if (BuildConfig.DEBUG) "3a9efc39d536ffe6" else "3a9efc39d536ffe6"
inline val ID_MAX_NATIVE get() = if (BuildConfig.DEBUG) "cc0cc5b36a2608ca" else "cc0cc5b36a2608ca"
inline val ID_MAX_OPEN get() = if (BuildConfig.DEBUG) "ad4efa4a0bc2a585" else "ad4efa4a0bc2a585"
inline val ID_MAX_BANNER get() = if (BuildConfig.DEBUG) "" else ""
inline val ID_MAX_REWARD get() = if (BuildConfig.DEBUG) "" else ""
}
\ No newline at end of file
package com.base.locationsharewhite.ads
import com.base.locationsharewhite.BuildConfig
/**
* 部分常量配置相关,如admob广告位id与通知渠道等
*/
object ConstConfig {
//用于替换admob广告位,区分debug与正式广告位id
inline val ADMOB_OPEN_UNIT_ID get() = if (BuildConfig.DEBUG) OPEN_ADMOB_ID_TEST else OPEN_ADMOB_ID
inline val ADMOB_BANNER_UNIT_ID get() = if (BuildConfig.DEBUG) BANNER_ADMOB_ID_TEST else BANNER_ADMOB_ID
inline val ADMOB_INSERT_UNIT_ID get() = if (BuildConfig.DEBUG) INTER_ADMOB_ID_TEST else INTER_ADMOB_ID
inline val ADMOB_NATIVE_UNIT_ID get() = if (BuildConfig.DEBUG) NATIVE_ADMOB_ID_TEST else NATIVE_ADMOB_ID
//云控remoteConfig对应的key
const val REMOTE_MSG = "MsgConfig"//云控消息配置对应的key
const val REMOTE_AD = "AdmobConfig"//云控广告配置对应的key
//admob test id
const val OPEN_ADMOB_ID_TEST = "ca-app-pub-3940256099942544/9257395921"
const val INTER_ADMOB_ID_TEST = "ca-app-pub-3940256099942544/1033173712"
const val NATIVE_ADMOB_ID_TEST = "ca-app-pub-3940256099942544/2247696110"
const val BANNER_ADMOB_ID_TEST = "ca-app-pub-3940256099942544/9214589741"
// admob广告id
const val OPEN_ADMOB_ID = "ca-app-pub-3940256099942544/9257395921"
const val INTER_ADMOB_ID = "ca-app-pub-3940256099942544/1033173712"
const val NATIVE_ADMOB_ID = "ca-app-pub-3940256099942544/2247696110"
const val BANNER_ADMOB_ID = "ca-app-pub-3940256099942544/9214589741"
const val MAX_SDK_KEY =
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
const val MAX_OPEN_UNIT_ID = "d1d943cdd3127c90"
const val MAX_INSERT_UNIT_ID = "b31e7f6d11ee659e"
const val MAX_BANNER_UNIT_ID = "ca-app-pub-3940256099942544/9214589741"
const val MAX_NATIVE_UNIT_ID = "96e8fe78b0efc5d1"
}
\ No newline at end of file
......@@ -3,9 +3,9 @@ package com.base.locationsharewhite.ads.admob
import android.os.Bundle
import android.view.ViewGroup
import android.view.ViewTreeObserver
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdsMgr
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.LimitUtils
import com.google.ads.mediation.admob.AdMobAdapter
import com.google.android.gms.ads.AdListener
......@@ -49,7 +49,7 @@ class AdBannerMgr {
val adWidth = (parent.width / screenPixelDensity).toInt()
val adSize =
AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(parent.context, adWidth)
adView?.adUnitId = ConstConfig.ADMOB_BANNER_UNIT_ID
adView?.adUnitId = GlobalConfig.ID_ADMOB_BANNER
adView?.setAdSize(adSize)
loadAd(admobEvent, collapsible, adClose)
parent.viewTreeObserver.removeOnGlobalLayoutListener(listener)
......
......@@ -2,11 +2,11 @@ package com.base.locationsharewhite.ads.admob
import android.app.Activity
import android.content.Context
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdDialog.showAdPreparingDialog
import com.base.locationsharewhite.ads.AdEvent
import com.base.locationsharewhite.ads.AdsShowCallBack
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig.ADMOB_INSERT_UNIT_ID
import com.base.locationsharewhite.ads.LimitUtils
import com.base.locationsharewhite.ads.adState
import com.google.android.gms.ads.AdError
......@@ -127,7 +127,7 @@ class AdInsertMgr {
adEvent.adPulStart()
InterstitialAd.load(context, ADMOB_INSERT_UNIT_ID, AdRequest.Builder().build(),
InterstitialAd.load(context, GlobalConfig.ID_ADMOB_INTER, AdRequest.Builder().build(),
object : InterstitialAdLoadCallback() {
override fun onAdLoaded(ad: InterstitialAd) {
adState.onAdLoaded(ad)
......
package com.base.locationsharewhite.ads.admob
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.NativeParentView
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.LimitUtils
import com.google.android.gms.ads.AdListener
import com.google.android.gms.ads.AdLoader
......@@ -39,7 +39,7 @@ class AdNativeMgr {
var currentNativeAd: NativeAd? = null
val adLoader = AdLoader.Builder(
parent.context,
ConstConfig.ADMOB_NATIVE_UNIT_ID
GlobalConfig.ID_ADMOB_NATIVE
).forNativeAd { nativeAd ->
currentNativeAd = nativeAd
cacheItems.offer(nativeAd)
......
......@@ -2,10 +2,10 @@ package com.base.locationsharewhite.ads.admob
import android.app.Activity
import android.content.Context
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdEvent
import com.base.locationsharewhite.ads.AdsShowCallBack
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.LimitUtils
import com.base.locationsharewhite.ads.adState
import com.google.android.gms.ads.AdError
......@@ -121,7 +121,7 @@ class AdOpenMgr {
AppOpenAd.load(
context,
ConstConfig.ADMOB_OPEN_UNIT_ID,
GlobalConfig.ID_ADMOB_OPEN,
AdRequest.Builder().build(),
object : AppOpenAd.AppOpenAdLoadCallback() {
override fun onAdLoaded(appOpenAd: AppOpenAd) {
......
......@@ -6,11 +6,11 @@ import com.applovin.mediation.MaxAd
import com.applovin.mediation.MaxAdListener
import com.applovin.mediation.MaxError
import com.applovin.mediation.ads.MaxInterstitialAd
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdDialog.showAdPreparingDialog
import com.base.locationsharewhite.ads.AdEvent
import com.base.locationsharewhite.ads.AdsShowCallBack
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.LimitUtils
import com.base.locationsharewhite.ads.adState
import java.lang.ref.WeakReference
......@@ -140,7 +140,7 @@ class MaxInsertMgr {
adEvent.adPulStart()
adState.currentAd = MaxInterstitialAd(ConstConfig.MAX_INSERT_UNIT_ID, context)
adState.currentAd = MaxInterstitialAd(GlobalConfig.ID_MAX_INTER, context)
adState.currentAd?.setListener(object : MaxAdListener {
override fun onAdDisplayed(p0: MaxAd) = Unit
......
......@@ -7,8 +7,8 @@ import com.applovin.mediation.MaxError
import com.applovin.mediation.nativeAds.MaxNativeAdListener
import com.applovin.mediation.nativeAds.MaxNativeAdLoader
import com.applovin.mediation.nativeAds.MaxNativeAdView
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.NativeParentView
import com.base.locationsharewhite.ads.LimitUtils
import com.base.locationsharewhite.helper.EventUtils
......@@ -45,7 +45,7 @@ class MaxNativeMgr {
obj.put("req_id", reqId)
obj.put("ad_type", "nativeAd")
val nativeAdLoader = MaxNativeAdLoader(ConstConfig.MAX_NATIVE_UNIT_ID, parent.context)
val nativeAdLoader = MaxNativeAdLoader(GlobalConfig.ID_MAX_NATIVE, parent.context)
nativeAdLoader.setNativeAdListener(object : MaxNativeAdListener() {
......
......@@ -6,10 +6,10 @@ import com.applovin.mediation.MaxAd
import com.applovin.mediation.MaxAdListener
import com.applovin.mediation.MaxError
import com.applovin.mediation.ads.MaxAppOpenAd
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.ads.AdEvent
import com.base.locationsharewhite.ads.AdsShowCallBack
import com.base.locationsharewhite.ads.AdsType
import com.base.locationsharewhite.ads.ConstConfig
import com.base.locationsharewhite.ads.LimitUtils
import com.base.locationsharewhite.ads.adState
import java.lang.ref.WeakReference
......@@ -129,7 +129,7 @@ class MaxOpenMgr {
adEvent.adPulStart()
adState.currentAd = MaxAppOpenAd(ConstConfig.MAX_OPEN_UNIT_ID, context)
adState.currentAd = MaxAppOpenAd(GlobalConfig.ID_MAX_OPEN, context)
adState.currentAd?.setListener(object : MaxAdListener {
override fun onAdLoaded(ad: MaxAd) {
adState.onAdLoaded(null)
......
package com.base.locationsharewhite.helper
import android.util.Base64
import com.base.locationsharewhite.GlobalConfig
import java.security.SecureRandom
import javax.crypto.Cipher
import javax.crypto.spec.GCMParameterSpec
......@@ -8,7 +9,7 @@ import javax.crypto.spec.SecretKeySpec
object AESHelper {
private const val aesKey = "pex50vwzuhpim3yh"
private const val aesKey = GlobalConfig.KEY_AES
private val cipher by lazy {
Cipher.getInstance("AES/GCM/NoPadding")
......
package com.base.locationsharewhite.helper
import com.base.locationsharewhite.ui.splash.SplashActivity
object AppConfig {
const val privacyPolicy: String = "https://sites.google.com/view/locationuses/location"
const val termService: String = ""
// 正式包名
const val packageName = "com.loactation.alibabab.ccccaa"
// 域名
const val eventUrl = "https://rp.gamexzonerk.xyz"
const val apiUrl = "https://api.gamexzonerk.xyz"
val noLoadingActivities = listOf(
"full", // 过滤全屏广告
"adActivity",
"AdActivity",
"AppLovinFullscreenActivity",
SplashActivity::class.java.simpleName,
// 返回前台时不跳转启动页的 activity
)
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.base.locationsharewhite.helper
import android.os.Build
import com.base.locationsharewhite.BuildConfig
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.bean.ConstObject.ifAgreePrivacy
import com.base.locationsharewhite.helper.ReportUtils.doPost
import com.base.locationsharewhite.utils.AppPreferences
......@@ -33,7 +34,7 @@ object EventUtils {
Thread {
var paramJson: String? = ""
try {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val s = JSONObject()
.put("action", key)
.put("value", value)
......@@ -71,9 +72,9 @@ object EventUtils {
}
private val url by lazy {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val url = StringBuilder(
"${AppConfig.eventUrl}/${
"${GlobalConfig.URL_EVENT}/${
pkg.filter { it.isLowerCase() }.substring(4, 9)
}sp"
)
......
......@@ -8,6 +8,7 @@ import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.bean.config.ConfigBean
import com.base.locationsharewhite.ads.AdsMgr
import com.base.locationsharewhite.bean.ConstObject.appLanguageCountrySp
......@@ -43,6 +44,15 @@ class MyApplication : Application() {
@JvmField
var PAUSED_VALUE = 0
val noLoadingActivities = listOf(
"full", // 过滤全屏广告
"adActivity",
"AdActivity",
"AppLovinFullscreenActivity",
SplashActivity::class.java.simpleName,
// 返回前台时不跳转启动页的 activity
)
}
......@@ -92,7 +102,7 @@ class MyApplication : Application() {
FacebookSdk.sdkInitialize(applicationContext)
val token = AppPreferences.getInstance().getString("token", "")
val topic = AppConfig.packageName + "_push"
val topic = GlobalConfig.PACKAGE_NAME + "_push"
LogEx.logDebug(TAG, "topic=${topic} token=$token")
FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic)
......@@ -146,7 +156,7 @@ class MyApplication : Application() {
val flag = if (topActivity == null) {
true
} else {
AppConfig.noLoadingActivities.all { !topActivity.localClassName.contains(it, true) }
noLoadingActivities.all { !topActivity.localClassName.contains(it, true) }
}
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
......
......@@ -2,7 +2,7 @@ package com.base.locationsharewhite.location
import android.os.Build
import com.base.locationsharewhite.BuildConfig
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.utils.AppPreferences
import org.json.JSONObject
......@@ -10,7 +10,7 @@ object BpUtils {
fun getBp(): JSONObject {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val bp = JSONObject()
// .put("${pkg}_1", "")
......
......@@ -2,7 +2,6 @@ package com.base.locationsharewhite.location
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils.doPost
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.utils.AppPreferences
import com.base.locationsharewhite.utils.LogEx
import org.json.JSONObject
......
package com.base.locationsharewhite.location
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.utils.LogEx
import org.json.JSONObject
......@@ -10,9 +10,9 @@ object LocationNameUtils {
private val TAG = "LocationNameUtils"
private val url by lazy {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val url = StringBuilder(
"${AppConfig.apiUrl}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}ggca"
"${GlobalConfig.URL_API}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}ggca"
)
url.append("?pkg=$pkg")
url.toString()
......@@ -20,7 +20,7 @@ object LocationNameUtils {
fun renameNickName(nickname: String, callBack: (flag: Boolean) -> Unit) {
Thread {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val data = JSONObject()
data.put("nickName", nickname)
......
package com.base.locationsharewhite.location
import com.base.locationsharewhite.GlobalConfig
import com.base.locationsharewhite.bean.LocationData
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.utils.AppPreferences
import com.base.locationsharewhite.utils.LogEx
import com.google.android.gms.maps.model.LatLng
......@@ -21,9 +21,9 @@ object LocationPositionUtils {
* 上传定位接口
*/
private val uploadUrl by lazy {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val url = StringBuilder(
"${AppConfig.apiUrl}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}x"
"${GlobalConfig.URL_API}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}x"
)
url.append("?pkg=$pkg")
url.toString()
......@@ -62,9 +62,9 @@ object LocationPositionUtils {
* 获取定位接口
*/
private val getLatLngUrl by lazy {
val pkg = AppConfig.packageName
val pkg = GlobalConfig.PACKAGE_NAME
val url = StringBuilder(
"${AppConfig.apiUrl}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}u"
"${GlobalConfig.URL_API}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}u"
)
url.append("?pkg=$pkg")
url.toString()
......
......@@ -4,7 +4,6 @@ import com.base.locationsharewhite.bean.ViewerBean
import com.base.locationsharewhite.bean.ViewingBean
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.utils.AppPreferences
import com.base.locationsharewhite.utils.LogEx
import com.google.gson.Gson
......
......@@ -2,7 +2,6 @@ package com.base.locationsharewhite.location
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.location.LocationLoginUtils.extractData
import com.base.locationsharewhite.utils.AppPreferences
import com.base.locationsharewhite.utils.LogEx
......
......@@ -2,7 +2,6 @@ package com.base.locationsharewhite.location
import com.base.locationsharewhite.helper.AESHelper
import com.base.locationsharewhite.helper.ReportUtils
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.utils.LogEx
import org.json.JSONObject
......
......@@ -9,7 +9,6 @@ import androidx.core.view.updatePadding
import com.base.locationsharewhite.R
import com.base.locationsharewhite.databinding.ActivitySettingBinding
import com.base.locationsharewhite.helper.BaseActivity
import com.base.locationsharewhite.helper.AppConfig
import com.base.locationsharewhite.location.LocationLoginUtils
import com.base.locationsharewhite.ui.views.RateDialog.showRateDialog
import com.base.locationsharewhite.utils.BarUtils
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment