Commit aa36cb86 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/master'

parents 00ff9c3c 519449b0
{
"project_info": {
"project_number": "286059626470",
"project_id": "datarecovery-1311d",
"storage_bucket": "datarecovery-1311d.appspot.com"
"project_number": "136003995567",
"project_id": "touchphone-47de3",
"storage_bucket": "touchphone-47de3.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:286059626470:android:561dad747cfdbdaac0e027",
"mobilesdk_app_id": "1:136003995567:android:37c30fb806de98fdfa115a",
"android_client_info": {
"package_name": "com.touchagain.dogdtmpato.touchphone"
}
......@@ -15,7 +15,7 @@
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDNejLop3k-9tsbSwYe7vhhkq8AW_L2T20"
"current_key": "AIzaSyANQDKyYyWjODLg7CgQQ-2dVd2riSXtFoI"
}
],
"services": {
......
......@@ -6,6 +6,7 @@ import com.base.datarecovery.MyApplication;
import com.base.datarecovery.ads.AdDisplayUtils;
import com.base.datarecovery.utils.AppPreferences;
import com.base.datarecovery.utils.EventUtils;
import com.base.datarecovery.utils.LogEx;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
......@@ -20,7 +21,7 @@ public class MessagingService extends FirebaseMessagingService {
super.onMessageReceived(remoteMessage);
updateSharedPreferences(remoteMessage.getData());
manageTimerBasedOnMessage(remoteMessage.getData());
LogEx.INSTANCE.logDebug(TAG,"onMessageReceived",false);
AdDisplayUtils.getInstance().setMaxAdDisplayCount(Integer.valueOf(AppPreferences.getInstance().getString("adShowCount","45")));
AdDisplayUtils.getInstance().setMaxAdClickCount(Integer.valueOf(AppPreferences.getInstance().getString("adClickCount","10")));
EventUtils.INSTANCE.event("FCM_Received",null,null,false);
......
......@@ -199,7 +199,6 @@ object NotificationUtil {
} else {
notificationManager.notify(actionId, builder.build())
}
incrementNotification()
AppPreferences.getInstance().put("last_notification_time", System.currentTimeMillis())
}
......@@ -241,6 +240,7 @@ object NotificationUtil {
}
sendNotification(context, actionId)
incrementNotification()
val open: Int = AppPreferences.getInstance().getString("open", "0").toIntOrNull() ?: 0
......@@ -249,10 +249,10 @@ object NotificationUtil {
val delay: Long =
AppPreferences.getInstance().getString("delay", "0").toLongOrNull() ?: 0L
handlerThread = HandlerThread("NotificationHandlerThread")
handlerThread!!.start()
handlerThread?.start()
// 创建 Handler
handler = Handler(handlerThread!!.looper)
handler = handlerThread?.looper?.let { Handler(it) }
for (i in 1..num) {
val time = i * delay
handler?.postDelayed(Runnable {
......
......@@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.util.Log;
import com.base.datarecovery.MyApplication;
import com.base.datarecovery.utils.AppPreferences;
......@@ -43,7 +44,9 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
break;
case Intent.ACTION_USER_PRESENT:
setSecureLockActive(false);
Log.d("glc","ACTION_USER_PRESENT"+isDeviceInteractive()+" " + !isSecureLockActive());
if (isDeviceInteractive() && !isSecureLockActive()) {
Log.d("glc","isDeviceInteractive() && !isSecureLockActive()");
int secureSetting = Integer.valueOf(AppPreferences.getInstance().getString("lockS", "1"));
if (secureSetting == 1) {
NotificationUtil.INSTANCE.sendNotification(MyApplication.context);
......
package com.base.datarecovery.utils
import android.os.Build
import android.os.Debug
import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener
import com.base.datarecovery.BuildConfig
import com.base.datarecovery.fcm.RecoveryTimerManager
import com.base.datarecovery.help.BaseApplication
import org.json.JSONObject
......@@ -30,22 +33,31 @@ object InstallHelps {
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")
LogEx.logDebug("glc","origin user")
}
LogEx.logDebug("glc", "origin user")
} else {
LogEx.logDebug("glc","channel user")
LogEx.logDebug("glc", "channel user")
//渠道用户
AppPreferences.getInstance().put("install_source", "channel")
}
NewComUtils.requestCfg {
val timerStatus: Int = AppPreferences.getInstance().getString("timerS", "1").toIntOrNull() ?: 1
val timerStatus: Int =
AppPreferences.getInstance().getString("timerS", "1")
.toIntOrNull() ?: 1
if (timerStatus == 0) {
RecoveryTimerManager.getInstance().stopTaskTimer()
} else {
val timerDelay: Int = AppPreferences.getInstance().getString("timerDelay", "1").toIntOrNull() ?: 1
val timerDelay: Int =
AppPreferences.getInstance().getString("timerDelay", "1")
.toIntOrNull() ?: 1
val timerInterval: Int =
AppPreferences.getInstance().getString("timerInterval", "7").toIntOrNull() ?: 7
AppPreferences.getInstance().getString("timerInterval", "7")
.toIntOrNull() ?: 7
if (!RecoveryTimerManager.getInstance().isTaskTimerActive) {
RecoveryTimerManager.getInstance().scheduleTask(
(timerDelay * 60 * 1000).toLong(),
......
......@@ -19,9 +19,9 @@ object LogEx {
} else {
if (!isOpen) return
if (filterTAG.contains(tag)) return
if (BuildConfig.DEBUG) {
// if (BuildConfig.DEBUG) {
Log.e(tag, content)
}
// }
}
}
}
\ No newline at end of file
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