Commit dab6ea09 authored by guest's avatar guest

1

parent 7587d20a
......@@ -10,7 +10,7 @@ android {
compileSdk 34
defaultConfig {
applicationId "com.cleaner.recovery.tencgog"
applicationId "confine.scream"
minSdk 24
targetSdk 34
versionCode 1
......@@ -115,9 +115,9 @@ dependencies {
implementation("com.google.firebase:firebase-messaging")
implementation 'com.google.firebase:firebase-analytics:21.6.2'
implementation("com.google.firebase:firebase-messaging-directboot")
//work
implementation("androidx.work:work-runtime-ktx:2.7.1") // 请使用最新版本
implementation("androidx.work:work-runtime-ktx:2.9.1")
implementation 'com.google.android.ump:user-messaging-platform:3.0.0'
implementation 'com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3'
implementation 'com.reyun.solar.engine:se-plugin-oaid:1.2.8.3'
}
\ No newline at end of file
{
"project_info": {
"project_number": "107894849092",
"project_id": "clean-junk-recovery-privacy",
"storage_bucket": "clean-junk-recovery-privacy.firebasestorage.app"
"project_number": "135677224109",
"project_id": "scream-1bc70",
"storage_bucket": "scream-1bc70.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:107894849092:android:09196dc899c9edd61dc611",
"mobilesdk_app_id": "1:135677224109:android:5e3fd3c8cfce99d40a1224",
"android_client_info": {
"package_name": "com.cleaner.recovery.tencgog"
"package_name": "confine.scream"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDlzkN29SqWCYkUj1sOr9HFB27Yw5MpLNM"
"current_key": "AIzaSyBIUMrPv6OOQWBheBAylXU94bkwvZgBFsg"
}
],
"services": {
......
......@@ -291,18 +291,19 @@
<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.base.datarecovery" />
</intent-filter>
</receiver>
<receiver
android:name=".fcm.alarm.AlarmJobReceiver"
android:name=".fcm.work.JobReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.TIMEZONE_CHANGED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
......@@ -324,7 +325,14 @@
<data android:scheme="file" />
</intent-filter>
</receiver>
<receiver android:name=".fcm.work.AlterReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"/>
<receiver android:name=".fcm.work.AlterReceiver2"
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
......
......@@ -2,6 +2,9 @@ package com.base.datarecovery
import android.annotation.SuppressLint
import android.app.Activity
import android.app.AlarmManager
import android.app.PendingIntent
import android.app.job.JobService
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
......@@ -15,22 +18,29 @@ import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.bean.ConstObject.ifAgreePrivacy
import com.base.datarecovery.fcm.FCMManager
import com.base.datarecovery.fcm.ScreenStatusReceiver
import com.base.datarecovery.fcm.work.AlterReceiver
import com.base.datarecovery.fcm.work.AlterReceiver2
import com.base.datarecovery.fcm.work.WorkHelp
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.help.BlackUtils
import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.service.StayJobService.Companion.startJob
import com.base.datarecovery.service.StayNotificationService.Companion.startStayNotification
import com.base.datarecovery.utils.ActivityManagerUtils
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.EventUtils
import com.base.datarecovery.utils.InstallHelps
import com.base.datarecovery.utils.LogEx
import com.facebook.FacebookSdk
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import com.reyun.solar.engine.OnAttributionListener
import com.reyun.solar.engine.SolarEngineConfig
import com.reyun.solar.engine.SolarEngineManager
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import org.json.JSONObject
import java.util.Calendar
import java.util.UUID
import java.util.concurrent.TimeUnit
......@@ -50,28 +60,24 @@ class MyApplication : BaseApplication() {
// initUUid()
// initApp()
startStayNotification()
startJob()
initLifeListener()
// solarInit()
solarInit()
if(ifAgreePrivacy){
initApp()
}
startWorkManager()
// startAlarm()
// start48Alarm()
// start72Alarm()
startAlarm()
start48Alarm()
start72Alarm()
}
private fun initUUid() {
fun initApp() {
uuid = AppPreferences.getInstance().getString("uuid", "")
if (TextUtils.isEmpty(uuid)) {
uuid = UUID.randomUUID().toString() + System.currentTimeMillis()
AppPreferences.getInstance().put("uuid", uuid)
}
}
fun initApp() {
FacebookSdk.sdkInitialize(applicationContext)
// FacebookSdk.setIsDebugEnabled(true)
// FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS)
......@@ -83,7 +89,7 @@ class MyApplication : BaseApplication() {
InstallHelps.init()
BlackUtils.requestBlack()
initLifeListener()
startJob()
// startJob()
if (ifAgreePrivacy) {
......@@ -207,6 +213,89 @@ class MyApplication : BaseApplication() {
}
})
}
private fun solarInit(){
SolarEngineManager.getInstance().preInit(context, "f6b7345fd1edd658")
val config = SolarEngineConfig.Builder()
// .logEnabled() //开启本地调试日志
.build()
SolarEngineManager.getInstance().initialize(
context, "f6b7345fd1edd658", config
) { code ->
if (code == 0) {
//初始化成功
config.setOnAttributionListener(object : OnAttributionListener {
override fun onAttributionSuccess(attribution: JSONObject) {
//获取归因结果成功时执行的动作
// Log.e("MXL", "onAttributionSuccess: "+attribution.toString() )
EventUtils.event("source_atrribute", ext = attribution)
}
override fun onAttributionFail(errorCode: Int) {
//获取归因结果失败时执行的动作
// Log.e("MXL", "onAttributionFail: "+errorCode )
}
})
} else {
//初始化失败,具体失败原因参考下方code码释义
}
}
}
fun startAlarm(){
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
this, 1,
Intent(this, AlterReceiver::class.java),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val calendar = Calendar.getInstance()
calendar.set(Calendar.HOUR_OF_DAY, 6)
calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0)
alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP,
calendar.timeInMillis,
1800000,
pendingIntent
)
}
fun start48Alarm(){
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
this, 2,
Intent(this, AlterReceiver2::class.java),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val calendar = Calendar.getInstance()
calendar.set(Calendar.HOUR_OF_DAY, 6)
calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0)
alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP,
calendar.timeInMillis,
1800000*2*48,
pendingIntent
)
}
fun start72Alarm(){
val alarmManager = getSystemService(JobService.ALARM_SERVICE) as AlarmManager
val pendingIntent = PendingIntent.getBroadcast(
this, 3,
Intent(this, AlterReceiver2::class.java),
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
)
val calendar = Calendar.getInstance()
calendar.set(Calendar.HOUR_OF_DAY, 6)
calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0)
alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP,
calendar.timeInMillis,
1800000*2*72,
pendingIntent
)
}
}
\ No newline at end of file
package com.base.datarecovery.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.net.Uri
......@@ -13,6 +16,7 @@ import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.service.StayJobService
import com.base.datarecovery.service.StayJobService.Companion.startJob
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.BarUtils
import com.base.datarecovery.view.RateStarPop.showRateStarPopDialog
......@@ -70,6 +74,15 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding.llScore.setOnClickListener {
showRateStarPopDialog(mustShow = true)
}
binding.idToken.text= AppPreferences.getInstance().getString("token","")
binding.idCopy.setOnClickListener {
copyText(this,binding.idToken.text.toString())
}
}
fun copyText(context: Context, text: String?) {
val clipboardManager: ClipboardManager =
context.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("simple text", text)
clipboardManager.setPrimaryClip(clip)
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.base.datarecovery.ads.admob
import android.app.Activity
import android.os.Bundle
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.EventUtils
import com.facebook.appevents.AppEventsConstants
import com.facebook.appevents.AppEventsLogger
......@@ -17,6 +18,7 @@ import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase
import org.json.JSONObject
import kotlin.random.Random
object AdmobEvent {
fun pullAd(
......@@ -63,6 +65,14 @@ object AdmobEvent {
class EventOnPaidEventListener(private val ad: Any?) : OnPaidEventListener {
override fun onPaidEvent(adValue: AdValue) {
val adRatio = AppPreferences.getInstance().getString("adRatio", "100").toInt()
val random = Random.Default.nextInt(1, 100)
if (random > adRatio) {
taichiSharedPreferencesEditor.putFloat("TaichiTroasCache", 0f)
taichiSharedPreferencesEditor.commit()
EventUtils.event("ad_price_limit")
return
}
val valueMicros = adValue.valueMicros
val currencyCode = adValue.currencyCode
val precision = adValue.precisionType
......@@ -92,7 +102,8 @@ object AdmobEvent {
val previousTaichiTroasCache = taichiPref.getFloat("TaichiTroasCache", 0f)
val currentTaichiTroasCache = (previousTaichiTroasCache +
currentImpressionRevenue).toFloat()
if (currentTaichiTroasCache >= 0.01) {//如果超过0.01就触发一次tROAS taichi事件
val adValue = AppPreferences.getInstance().getString("adValue", "1").toInt() / 100f
if (currentTaichiTroasCache >= adValue) {//如果超过0.01就触发一次tROAS taichi事件
val roasbundle = Bundle()
roasbundle.putDouble(
FirebaseAnalytics.Param.VALUE,
......
package com.base.datarecovery.fcm;
package com.base.datarecovery.fcm
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.base.datarecovery.fcm.NotificationUtil.sendNotification
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.EventUtils.event
import org.json.JSONObject
import com.base.datarecovery.MyApplication;
import com.base.datarecovery.utils.EventUtils;
public class FcmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
EventUtils.INSTANCE.event("FCM_Received", "FcmReceiver", null, false);
NotificationUtil.INSTANCE.sendNotification(MyApplication.context, "FcmReceiver");
class FcmReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val requestId = intent.extras?.getString("requestID")
if (!requestId.isNullOrEmpty()) {
val json = JSONObject()
json.put("requestID", requestId)
event("FCM_Received", ext = json)
}
sendNotification(BaseApplication.context, "Fcm")
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import android.annotation.SuppressLint;
import androidx.annotation.NonNull;
import com.base.datarecovery.MyApplication;
import com.base.datarecovery.help.BaseApplication;
import com.base.datarecovery.utils.EventUtils;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
......@@ -21,30 +21,19 @@ public class MessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
String id = remoteMessage.getMessageId();
JSONObject ext = new JSONObject();
try {
ext.put("getMessageType", remoteMessage.getMessageType());
ext.put("getData", remoteMessage.getData());
ext.put("getCollapseKey", remoteMessage.getCollapseKey());
ext.put("getFrom", remoteMessage.getFrom());
ext.put("getPriority", remoteMessage.getPriority());
ext.put("getSenderId", remoteMessage.getSenderId());
ext.put("getSentTime", remoteMessage.getSentTime());
JSONObject data = new JSONObject(remoteMessage.getData().toString());
EventUtils.INSTANCE.event("FCM_Received", "", data, false);
} catch (JSONException e) {
EventUtils.INSTANCE.event("FCM_Received_Error", id, ext, false);
throw new RuntimeException(e);
} finally {
}
EventUtils.INSTANCE.event("FCM_Received", id, ext, false);
sendLocalNotification();
}
// Consider implementing this method if local notifications are needed
private void sendLocalNotification() {
NotificationUtil.INSTANCE.sendNotification(MyApplication.context, "MessagingService");
NotificationUtil.INSTANCE.sendNotification(BaseApplication.context, "FCM");
}
}
\ No newline at end of file
......@@ -30,8 +30,8 @@ import com.base.datarecovery.bean.ConstObject.ID_SCREENSHOT_CLEAN
import com.base.datarecovery.bean.ConstObject.ID_SIMILAR_IMAGE
import com.base.datarecovery.bean.ConstObject.ID_WHATSAPP_CLEANER
import com.base.datarecovery.utils.AppManagerStringManager
import com.base.datarecovery.utils.AppProcessStringManager
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.AppProcessStringManager
import com.base.datarecovery.utils.BatteryInfoStringManager
import com.base.datarecovery.utils.CleanJunkStringResourceManager
import com.base.datarecovery.utils.DocumentRecoveryStringManager
......@@ -89,14 +89,14 @@ object NotificationUtil {
val actionId: Int = getNextNotificationId()
sendNotification(context, actionId)
sendNotification(context, actionId,where)
incrementNotification()
EventUtils.event("showNotification", where, null, false)
startHover(context, actionId)
}
fun sendNotification(context: Context, actionId: Int) {
fun sendNotification(context: Context, actionId: Int,type:String) {
val bigRemoteViews = RemoteViews(context.packageName, R.layout.notification_common)
val smallRemoteViews = RemoteViews(context.packageName, R.layout.notification_common_small)
......@@ -179,6 +179,7 @@ object NotificationUtil {
bigRemoteViews.setImageViewResource(R.id.iv_icon, icon)
bigRemoteViews.setTextViewText(R.id.tv_desc, desc)
bigRemoteViews.setTextViewText(R.id.tv_btn, btn)
bigRemoteViews.setTextViewText(R.id.id_tv_where,type)
smallRemoteViews.setImageViewResource(R.id.iv_icon, icon)
smallRemoteViews.setTextViewText(R.id.tv_desc, desc)
......@@ -317,8 +318,8 @@ object NotificationUtil {
}
return@Runnable
}
if (MyApplication.PAUSED_VALUE != 1 && ScreenStatusReceiver.isDeviceInteractive() && !ScreenStatusReceiver.isSecureLockActive()) {
sendNotification(context, actionId)
if (ScreenStatusReceiver.isDeviceInteractive() && !ScreenStatusReceiver.isSecureLockActive()) {
sendNotification(context, actionId,"timer")
}
}, time)
}
......
package com.base.datarecovery.fcm.work
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.base.datarecovery.fcm.NotificationUtil
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.AppPreferences
import com.base.datarecovery.utils.EventUtils
class AlterReceiver : BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
EventUtils.event("alarm_push")
val firstAlemtime = AppPreferences.getInstance().getLong("firstAlemtime", 0L)
if (firstAlemtime > 0) {
val leatTime = System.currentTimeMillis()
if (leatTime - firstAlemtime >= 1000 * 30 * 60) {
NotificationUtil.sendNotification(BaseApplication.context, "alarm")
}
}
AppPreferences.getInstance().put("firstAlemtime", System.currentTimeMillis())
return
}
}
\ No newline at end of file
package com.base.datarecovery.fcm.work
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.base.datarecovery.MyApplication
import com.base.datarecovery.fcm.NotificationUtil
import com.base.datarecovery.help.BaseApplication
import com.base.datarecovery.utils.EventUtils
class AlterReceiver2: BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
EventUtils.event("alarm_push2")
NotificationUtil.sendNotification(BaseApplication.context, "alarm2")
(BaseApplication.context as MyApplication).startWorkManager()
return
}
}
\ No newline at end of file
package com.base.datarecovery.fcm.work
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
class JobReceiver : BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
// p0?.startNotification()
}
}
\ No newline at end of file
......@@ -22,7 +22,10 @@ import androidx.core.graphics.drawable.IconCompat
import androidx.work.Configuration
import com.base.datarecovery.R
import com.base.datarecovery.activity.MainActivity
import com.base.datarecovery.activity.splash.Splash2Activity
import com.base.datarecovery.bean.ConstObject
import com.base.datarecovery.utils.LogEx
import kotlin.random.Random
/**
......@@ -44,18 +47,16 @@ class StayJobService : JobService() {
var isRunning = false
private const val JOB_INFO_ID: Int = 101
private const val JOB_PERIODIC: Long = 5 * 1000L
fun Context.startJob() {
isCancel = false
if (isRunning) return
val jobScheduler = getSystemService(JOB_SCHEDULER_SERVICE) as JobScheduler
val componentName = ComponentName(this, StayJobService::class.java)
val jobInfo = JobInfo.Builder(JOB_INFO_ID, componentName)
.setMinimumLatency(30000)
.setMinimumLatency(10000)
.build()
jobScheduler.schedule(jobInfo)
}
var isCancel: Boolean = false
fun createPermanentNotification(context: Context): Notification {
......@@ -65,6 +66,45 @@ class StayJobService : JobService() {
val contentView = RemoteViews(context.packageName, R.layout.stay_notification_big)
val expendView = RemoteViews(context.packageName, R.layout.stay_notification_big)
val requestCode1 = Random.nextInt(1800)
val intent0 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_JUNK_CLEAN_PUSH)
}
val pendingIntent0 =
PendingIntent.getActivity(context, requestCode1, intent0, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_ll_clean, pendingIntent0)
expendView.setOnClickPendingIntent(R.id.id_ll_clean, pendingIntent0)
val requestCode2 = Random.nextInt(1800)
val intent2 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_RECOVERY_PHOTOS)
putExtra("ScanType", ConstObject.SCAN_PHOTOS)
}
val pendingIntent2 =
PendingIntent.getActivity(context, requestCode2, intent2, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_recovery_photos, pendingIntent2)
expendView.setOnClickPendingIntent(R.id.id_recovery_photos, pendingIntent2)
val requestCode3 = Random.nextInt(1800)
val intent3 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_RECOVERY_VIDEOS)
putExtra("ScanType", ConstObject.SCAN_VIDEOS)
}
val pendingIntent3 =
PendingIntent.getActivity(context, requestCode3, intent3, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_recovery_videos, pendingIntent3)
expendView.setOnClickPendingIntent(R.id.id_recovery_videos, pendingIntent3)
val requestCode4 = Random.nextInt(1800)
val intent4 = Intent(context, Splash2Activity::class.java).apply {
putExtra("actionId", ConstObject.ID_RECOVERY_DOCUMENTS)
putExtra("ScanType", ConstObject.SCAN_DOCUMENTS)
}
val pendingIntent4 =
PendingIntent.getActivity(context, requestCode4, intent4, PendingIntent.FLAG_IMMUTABLE)
contentView.setOnClickPendingIntent(R.id.id_recovery_documents, pendingIntent4)
expendView.setOnClickPendingIntent(R.id.id_recovery_documents, pendingIntent4)
val builder = NotificationCompat.Builder(context, channelId)
val smallIcon = IconCompat.createFromIcon(
......@@ -171,11 +211,9 @@ class StayJobService : JobService() {
}
override fun onFinish() {
if (!isCancel) {
notifyForeground()
Timer().start()
}
}
}
......
......@@ -7,6 +7,7 @@ import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.utils.ReportUtils.doPost
import org.json.JSONException
import org.json.JSONObject
import java.util.Locale
import java.util.TimeZone
object EventUtils {
......@@ -39,8 +40,8 @@ object EventUtils {
.put("value", value)
.put("ext", ext)
val s2 = JSONObject()
.put("${pkg}_3", AppPreferences.getInstance().getString("Equipment", ""))
.put("${pkg}_4", AppPreferences.getInstance().getString("Manufacturer", ""))
.put("${pkg}_3", getDeviceName())
.put("${pkg}_4", Build.MANUFACTURER)
.put("${pkg}_5", Build.VERSION.SDK_INT)
.put("${pkg}_8", BuildConfig.VERSION_NAME)
.put("${pkg}_9", AppPreferences.getInstance().getString("uuid", ""))
......@@ -78,5 +79,29 @@ object EventUtils {
url.append("?pkg=$pkg")
url.toString()
}
fun getDeviceName(): String? {
val manufacturer = Build.MANUFACTURER
val model = Build.MODEL
val flag = model.lowercase(Locale.getDefault()).startsWith(manufacturer.lowercase(Locale.getDefault()))
return if (flag) {
if (model.isNullOrEmpty()) {
model
} else {
model.substring(0, 1)
.uppercase(Locale.getDefault()) + model.substring(1)
.lowercase(Locale.getDefault())
}
} else {
val ss = if (manufacturer.isNullOrEmpty()) {
manufacturer
} else {
manufacturer.substring(0, 1)
.uppercase(Locale.getDefault()) + manufacturer.substring(1)
.lowercase(Locale.getDefault())
}
"$ss $model"
}
}
}
\ No newline at end of file
package com.base.datarecovery.utils
import android.os.Build
import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener
import com.base.datarecovery.BuildConfig
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.fcm.RecoveryTimerManager
import com.base.datarecovery.fcm.RecoveryTimerManager.changeTimerSp
import com.base.datarecovery.help.BaseApplication
import org.json.JSONObject
......@@ -44,7 +41,7 @@ object InstallHelps {
obj.put("referrerClickTime", response.referrerClickTimestampSeconds)
obj.put("appInstallTime", response.installBeginTimestampSeconds)
obj.put("instantExperienceLaunched", installInfo.toString())
EventUtils.event("install_referrer", ext = obj, isSingleEvent = true)
EventUtils.event("install_referrer", ext = obj)
AppPreferences.getInstance().put("referrerUrl", response.installReferrer)
if (listOf("gclid", "facebook", "instagram").all { !installInfo.contains(it, true) }) {
//自然用户
......
......@@ -317,6 +317,8 @@ object DialogViews {
binding.tvExit.setOnClickListener {
dialog.dismiss()
android.os.Process.killProcess(android.os.Process.myPid())
System.exit(0)
this.finish()
}
}
......
......@@ -264,6 +264,20 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/id_token"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"/>
<TextView
android:id="@+id/id_copy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/theme_color"
android:padding="10dp"
android:text="Copy"
android:textColor="@color/white" />
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="208dp"
android:layout_height="220dp"
android:layout_marginHorizontal="10dp"
android:background="@drawable/bg_ffffff_10"
android:orientation="vertical">
......@@ -52,6 +52,15 @@
</LinearLayout>
<TextView
android:id="@+id/id_tv_where"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="15sp"
android:textColor="#EF0D0D"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_icon"
android:layout_width="35dp"
......
<resources>
<string name="app_name">Cleaner Junk: Recovery, Privacy</string>
<string name="app_name">File Recovery - Cleaner Junk</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="facebook_app_id">957095216483769</string>
<!-- Strings used for fragments for navigation -->
......
......@@ -21,6 +21,11 @@ dependencyResolutionManagement {
maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" }
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url "https://s01.oss.sonatype.org/content/groups/public" }
maven { url 'https://dl-maven-android.mintegral.com/repository/se_sdk_for_android/'}
maven {
url "https://developer.huawei.com/repo/"
}
maven { url "https://developer.hihonor.com/repo" }
}
}
......
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