Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Data Recovery White
Commits
a33567a3
Commit
a33567a3
authored
Jul 16, 2024
by
leichao.gao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加渠道
parent
dcdf0978
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
17 deletions
+28
-17
MyApplication.kt
app/src/main/java/com/base/datarecovery/MyApplication.kt
+1
-16
InstallHelps.kt
...src/main/java/com/base/datarecovery/utils/InstallHelps.kt
+26
-0
NewComUtils.kt
app/src/main/java/com/base/datarecovery/utils/NewComUtils.kt
+1
-1
No files found.
app/src/main/java/com/base/datarecovery/MyApplication.kt
View file @
a33567a3
...
@@ -55,23 +55,8 @@ class MyApplication : BaseApplication() {
...
@@ -55,23 +55,8 @@ class MyApplication : BaseApplication() {
FCMManager
.
initFirebase
(
this
)
FCMManager
.
initFirebase
(
this
)
FCMManager
.
subscribeToTopic
(
topic
)
FCMManager
.
subscribeToTopic
(
topic
)
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
ScreenStatusReceiver
.
setupScreenStatusListener
(
this
)
InstallHelps
.
init
()
InstallHelps
.
init
()
NewComUtils
.
requestCfg
{
ScreenStatusReceiver
.
setupScreenStatusListener
(
this
)
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
timerInterval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerInterval"
,
"7"
).
toIntOrNull
()
?:
7
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
)
{
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
(
timerDelay
*
60
*
1000
).
toLong
(),
(
timerInterval
*
60
*
1000
).
toLong
()
)
}
}
}
if
(
ifAgreePrivacy
)
{
if
(
ifAgreePrivacy
)
{
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
}
}
...
...
app/src/main/java/com/base/datarecovery/utils/InstallHelps.kt
View file @
a33567a3
...
@@ -2,6 +2,8 @@ package com.base.datarecovery.utils
...
@@ -2,6 +2,8 @@ package com.base.datarecovery.utils
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.fcm.RecoveryTimerManager
import
com.base.datarecovery.fcm.ScreenStatusReceiver
import
com.base.datarecovery.help.BaseApplication
import
com.base.datarecovery.help.BaseApplication
import
org.json.JSONObject
import
org.json.JSONObject
...
@@ -21,6 +23,30 @@ object InstallHelps {
...
@@ -21,6 +23,30 @@ object InstallHelps {
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
EventUtils
.
event
(
"install_referrer"
,
ext
=
obj
,
isSingleEvent
=
true
)
EventUtils
.
event
(
"install_referrer"
,
ext
=
obj
,
isSingleEvent
=
true
)
if
(
listOf
(
"gclid"
,
"facebook"
,
"instagram"
).
all
{
!
installInfo
.
contains
(
it
,
true
)
})
{
//自然用户
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"origin"
)
}
else
{
//渠道用户
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"channel"
)
}
NewComUtils
.
requestCfg
{
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
timerInterval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerInterval"
,
"7"
).
toIntOrNull
()
?:
7
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
)
{
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
(
timerDelay
*
60
*
1000
).
toLong
(),
(
timerInterval
*
60
*
1000
).
toLong
()
)
}
}
}
}
}
else
->
{
else
->
{
...
...
app/src/main/java/com/base/datarecovery/utils/NewComUtils.kt
View file @
a33567a3
...
@@ -26,7 +26,7 @@ object NewComUtils {
...
@@ -26,7 +26,7 @@ object NewComUtils {
private
val
url
:
String
by
lazy
{
private
val
url
:
String
by
lazy
{
val
packageName
=
ConfigHelper
.
packageName
val
packageName
=
ConfigHelper
.
packageName
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
"$API_URL/$appCode spk?pkg=$packageName"
"$API_URL/$appCode spk?pkg=$packageName"
+
"&source="
+
AppPreferences
.
getInstance
().
getString
(
"install_source"
,
"origin"
)
}
}
fun
requestCfg
(
callback
:
(
ConfigBean
?)
->
Unit
)
{
fun
requestCfg
(
callback
:
(
ConfigBean
?)
->
Unit
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment