Commit aa36cb86 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/master'

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