Commit cc6dc0ac authored by guest's avatar guest

1

parent b128354b
{
"project_info": {
"project_number": "135677224109",
"project_id": "scream-1bc70",
"storage_bucket": "scream-1bc70.firebasestorage.app"
"project_number": "944507974954",
"project_id": "dumpster-photo-recovery",
"storage_bucket": "dumpster-photo-recovery.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:135677224109:android:5e3fd3c8cfce99d40a1224",
"mobilesdk_app_id": "1:944507974954:android:1309986ccc55e242589a53",
"android_client_info": {
"package_name": "confine.scream"
"package_name": "com.baloota.photorecyclebin.awm.sp"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBIUMrPv6OOQWBheBAylXU94bkwvZgBFsg"
"current_key": "AIzaSyDBejd5HFvww_CVve-aFYRBjR-d6XwIBFA"
}
],
"services": {
......
......@@ -60,4 +60,5 @@
-keepattributes AnnotationDefault, RuntimeVisibleAnnotations
-keep class com.bytedance.sdk.** { *; }
-dontwarn com.google.android.gms.ads.R$layout
-dontwarn com.google.android.gms.ads.R$styleable
\ No newline at end of file
-dontwarn com.google.android.gms.ads.R$styleable
-keep class com.base.filerecoveryrecyclebin.bean.** {*;}
\ No newline at end of file
......@@ -306,14 +306,14 @@
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.test.easy.cleanerjunk" />
<category android:name="com.baloota.photorecyclebin.awm.sp" />
</intent-filter>
</receiver>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
android:value="ca-app-pub-3838048042416287~9437965450" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
......
......@@ -123,6 +123,7 @@ object AdmobEvent {
val mediationGroupName = extras.getString("mediation_group_name")
val mediationABTestName = extras.getString("mediation_ab_test_name")
val mediationABTestVariant = extras.getString("mediation_ab_test_variant")
obj.put("ad_unit", "openAd")
obj.put("adUnitId", adUnitId)
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
......@@ -147,6 +148,7 @@ object AdmobEvent {
val mediationABTestName = extras.getString("mediation_ab_test_name")
val mediationABTestVariant = extras.getString("mediation_ab_test_variant")
obj.put("adUnitId", adUnitId)
obj.put("ad_unit", "interAd")
obj.put("adSourceName", adSourceName)
obj.put("adSourceId", adSourceId)
obj.put("adSourceInstanceName", adSourceInstanceName)
......@@ -190,6 +192,7 @@ object AdmobEvent {
val mediationABTestName = extras?.getString("mediation_ab_test_name")
val mediationABTestVariant = extras?.getString("mediation_ab_test_variant")
obj.put("adSourceName", adSourceName)
obj.put("ad_unit", "nativeAd")
obj.put("adSourceId", adSourceId)
obj.put("adSourceInstanceName", adSourceInstanceName)
obj.put("adSourceInstanceId", adSourceInstanceId)
......@@ -218,11 +221,7 @@ object AdmobEvent {
obj.put("credentials", credentials.toString())
obj.put("session_id", responseInfo?.responseId)
obj.put("networkname", responseInfo?.mediationAdapterClassName)
if (adUnit != "nativeAd") {
EventUtils.event("ad_click", ext = obj)
} else {
EventUtils.event("bigimage_ad_click", ext = obj)
}
EventUtils.event("ad_click", ext = obj)
}
fun showAd(responseInfo: ResponseInfo?, adUnit: String, activity: Activity? = null) {
......@@ -239,10 +238,6 @@ object AdmobEvent {
obj.put("credentials", credentials.toString())
obj.put("session_id", responseInfo?.responseId)
obj.put("from", activity?.javaClass?.simpleName)
if (adUnit != "nativeAd") {
EventUtils.event("ad_show", ext = obj)
} else {
EventUtils.event("bigimage_ad_show", ext = obj)
}
EventUtils.event("ad_show", ext = obj)
}
}
\ No newline at end of file
......@@ -79,7 +79,7 @@ object AdmobNativeUtils {
fun showNativeAd(activity: Activity?, parent: ViewGroup, layout: Int = R.layout.layout_native_custom) {
val obj = JSONObject()
obj.put("ad_unit", "NativeAd")
EventUtils.event("ad_prepare_show_native", ext = obj)
EventUtils.event("ad_prepare_show", ext = obj)
if (!AdDisplayUtils.getInstance().shouldShowAd("NativeAd")) {
return
}
......
......@@ -4,8 +4,7 @@ import android.annotation.SuppressLint;
import androidx.annotation.NonNull;
import com.base.filerecoveryrecyclebin.MyApplication;
import com.base.filerecoveryrecyclebin.ads.AdDisplayUtils;
import com.base.filerecoveryrecyclebin.help.BaseApplication;
import com.base.filerecoveryrecyclebin.utils.AppPreferences;
import com.base.filerecoveryrecyclebin.utils.EventUtils;
import com.google.firebase.messaging.FirebaseMessagingService;
......@@ -79,7 +78,7 @@ public class MessagingService extends FirebaseMessagingService {
// Consider implementing this method if local notifications are needed
private void sendLocalNotification() {
NotificationUtil.INSTANCE.sendNotification(MyApplication.context, "MessagingService");
NotificationUtil.INSTANCE.sendNotification(BaseApplication.context, "MessagingService");
}
}
\ No newline at end of file
......@@ -7,7 +7,6 @@ import com.base.filerecoveryrecyclebin.R
import com.base.filerecoveryrecyclebin.activity.MainActivity
import com.base.filerecoveryrecyclebin.activity.guide.GuideActivity
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import com.base.filerecoveryrecyclebin.bean.ConstObject
import com.base.filerecoveryrecyclebin.databinding.FragmentGuideBinding
import com.base.filerecoveryrecyclebin.help.BaseFragment
import com.base.filerecoveryrecyclebin.utils.AppPreferences
......@@ -65,28 +64,15 @@ class GuideFragment : BaseFragment<FragmentGuideBinding>() {
}
private fun jumpNext() {
if (false) {
// startActivity(Intent(requireContext(), VipActivity::class.java).apply {
// putExtra("isSkip", true)
// })
// requireActivity().finish()
// isInstallVip = false
} else {
if(!ConstObject.isCLeanGuide){
(requireActivity() as GuideActivity).lauchPermisson()
}else{
val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "0")?.toInt()
if (showAd == 1) {
AdmobMaxHelper.admobMaxShowInterstitialAd(requireActivity(), isLoading = false) {
startActivity(Intent(requireContext(), MainActivity::class.java))
requireActivity().finish()
}
} else {
startActivity(Intent(requireContext(), MainActivity::class.java))
requireActivity().finish()
}
val showAd = AppPreferences.getInstance().getString("isShowGuideAd", "0")?.toInt()
if (showAd == 1) {
AdmobMaxHelper.admobMaxShowInterstitialAd(requireActivity(), isLoading = false) {
startActivity(Intent(requireContext(), MainActivity::class.java))
requireActivity().finish()
}
} else {
startActivity(Intent(requireContext(), MainActivity::class.java))
requireActivity().finish()
}
}
}
\ No newline at end of file
......@@ -18,10 +18,10 @@ object ConfigHelper {
const val nativeAdmobIdTest = "ca-app-pub-3940256099942544/2247696110"
// admob广告id
const val interAdmobId = "ca-app-pub-3940256099942544/1033173712"
const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696110"
const val openAdmobId = "ca-app-pub-3940256099942544/9257395921"
const val bannerAdmobId = "ca-app-pub-3940256099942544/9214589741"
const val interAdmobId = "ca-app-pub-3838048042416287/8234531162"
const val nativeAdmobId = "ca-app-pub-3838048042416287/6196724440"
const val openAdmobId = "ca-app-pub-3838048042416287/8720350971"
const val bannerAdmobId = "ca-app-pub-3838048042416287/6921449490"
//max id
const val interAdMaxId = "b31e7f6d11ee659e"
......
package com.base.filerecoveryrecyclebin.help
import android.os.Build
import androidx.annotation.RequiresApi
import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener
import com.base.filerecoveryrecyclebin.BuildConfig
......@@ -10,6 +8,9 @@ import com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
import com.base.filerecoveryrecyclebin.utils.AppPreferences
import com.base.filerecoveryrecyclebin.utils.EventUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import org.json.JSONObject
/**
......@@ -19,63 +20,54 @@ object InstallHelps {
private val TAG = "InstallHelps"
fun init() = Thread {
//InstallReferrer not empty
// if (!TextUtils.isEmpty(AppPreferences.getInstance().getString("install_source", ""))) {
// if (AdmobMaxHelper.haveSpAdmobTrueMaxFalse()) {
// AdmobMaxHelper.initAdmobMaxAd()
// requestCfg(false)
// } else {
// requestCfg(true)
// }
// return
// }
val referrerClient = InstallReferrerClient.newBuilder(BaseApplication.context).build()
referrerClient.startConnection(object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(responseCode: Int) {
try {
when (responseCode) {
InstallReferrerClient.InstallReferrerResponse.OK -> {
val response = referrerClient.installReferrer
val installInfo = response.installReferrer
val obj = JSONObject()
obj.put("referrerUrl", response.installReferrer)
obj.put("referrerClickTime", response.referrerClickTimestampSeconds)
obj.put("appInstallTime", response.installBeginTimestampSeconds)
obj.put("instantExperienceLaunched", installInfo.toString())
EventUtils.event("install_referrer", ext = obj, isSingleEvent = true)
AppPreferences.getInstance().put("referrer", response.installReferrer)
if (listOf("gclid", "facebook", "instagram").all { !installInfo.contains(it, true) }) {
//自然用户
if (BuildConfig.DEBUG) {
AppPreferences.getInstance().put("install_source", "channel")
fun init() {
MainScope().launch(Dispatchers.IO) {
val referrerClient = InstallReferrerClient.newBuilder(BaseApplication.context).build()
referrerClient.startConnection(object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(responseCode: Int) {
try {
when (responseCode) {
InstallReferrerClient.InstallReferrerResponse.OK -> {
val response = referrerClient.installReferrer
val installInfo = response.installReferrer
val obj = JSONObject()
obj.put("referrerUrl", response.installReferrer)
obj.put("referrerClickTime", response.referrerClickTimestampSeconds)
obj.put("appInstallTime", response.installBeginTimestampSeconds)
obj.put("instantExperienceLaunched", installInfo.toString())
EventUtils.event("install_referrer", ext = obj, isSingleEvent = true)
AppPreferences.getInstance().put("referrer", response.installReferrer)
if (listOf("gclid", "facebook", "instagram").all { !installInfo.contains(it, true) }) {
//自然用户
if (BuildConfig.DEBUG) {
AppPreferences.getInstance().put("install_source", "channel")
} else {
AppPreferences.getInstance().put("install_source", "origin")
}
} else {
AppPreferences.getInstance().put("install_source", "origin")
//渠道用户
AppPreferences.getInstance().put("install_source", "channel")
}
} else {
//渠道用户
AppPreferences.getInstance().put("install_source", "channel")
requestCfg(true)
}
requestCfg(true)
}
else -> {
EventUtils.event("install_referrer_error")
requestCfg(true)
else -> {
EventUtils.event("install_referrer_error")
requestCfg(true)
}
}
} catch (_: Exception) {
EventUtils.event("install_referrer_error")
}
} catch (_: Exception) {
EventUtils.event("install_referrer_error")
}
}
override fun onInstallReferrerServiceDisconnected() {
}
})
}
override fun onInstallReferrerServiceDisconnected() {
}
})
}.start()
}
fun requestCfg(callBackAd: Boolean) {
......
package com.base.filerecoveryrecyclebin.help
import android.os.Build
import android.util.Log
import com.base.filerecoveryrecyclebin.BuildConfig
import com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
......@@ -12,7 +11,6 @@ import com.base.filerecoveryrecyclebin.utils.LogEx
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
......@@ -22,7 +20,6 @@ import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.HttpURLConnection
import java.net.URL
import java.util.Base64
import java.util.Locale
object NewComUtils {
......@@ -114,13 +111,17 @@ object NewComUtils {
val gson = Gson()
val type = object : TypeToken<Map<String, String>>() {}.type
val configMap = gson.fromJson<Map<String, String>>(json, type)
try {
configMap.forEach { t, u ->
// 对于整型值使用parseInt, 长整型使用parseLong
AppPreferences.getInstance().put(t, u)
LogEx.logDebug(TAG, "t=$t u=$u")
}
}catch (_:Exception){
configMap.forEach { t, u ->
// 对于整型值使用parseInt, 长整型使用parseLong
AppPreferences.getInstance().put(t, u)
LogEx.logDebug(TAG, "t=$t u=$u")
}
val jsonObject = JSONObject()
jsonObject.put("ut", AppPreferences.getInstance().getString("ut", ""))
EventUtils.event("user_type", ext = jsonObject)
......
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