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
026ef044
Commit
026ef044
authored
Jul 24, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
5a1a8a98
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
24 deletions
+47
-24
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+4
-0
InstallHelps.kt
...src/main/java/com/base/datarecovery/utils/InstallHelps.kt
+43
-24
No files found.
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
026ef044
...
...
@@ -75,6 +75,10 @@ object AdmobMaxHelper {
return
ss
==
1
}
fun
haveSpAdmobTrueMaxFalse
():
Boolean
{
return
AppPreferences
.
getInstance
().
getInt
(
"admobTrueMaxFalse"
,
-
1
)
!=
-
1
}
fun
initAdmobMaxAd
(
activity
:
Activity
?
=
null
)
{
if
(
getSpAdmobTrueMaxFalse
())
{
if
(!
isAdInit
.
get
())
{
...
...
app/src/main/java/com/base/datarecovery/utils/InstallHelps.kt
View file @
026ef044
...
...
@@ -14,15 +14,28 @@ import org.json.JSONObject
* call before agree
*/
object
InstallHelps
{
private
val
TAG
=
"InstallHelps"
private
val
TAG
=
"InstallHelps"
fun
init
()
{
//InstallReferrer not empty
if
(
AppPreferences
.
getInstance
().
getString
(
"install_source"
,
""
)
!=
""
)
{
if
(
AdmobMaxHelper
.
haveSpAdmobTrueMaxFalse
())
{
AdmobMaxHelper
.
initAdmobMaxAd
()
requestCfg
(
false
)
}
else
{
requestCfg
(
true
)
}
return
}
//InstallReferrer empty
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
referrerClient
.
startConnection
(
object
:
InstallReferrerStateListener
{
override
fun
onInstallReferrerSetupFinished
(
responseCode
:
Int
)
{
try
{
when
(
responseCode
)
{
InstallReferrerClient
.
InstallReferrerResponse
.
OK
->
{
LogEx
.
logDebug
(
TAG
,
"InstallReferrerResponse.OK"
)
LogEx
.
logDebug
(
TAG
,
"InstallReferrerResponse.OK"
)
val
response
=
referrerClient
.
installReferrer
val
installInfo
=
response
.
installReferrer
val
obj
=
JSONObject
()
...
...
@@ -45,9 +58,31 @@ object InstallHelps {
//渠道用户
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"channel"
)
}
requestCfg
(
true
)
}
else
->
{
EventUtils
.
event
(
"install_referrer_error"
)
}
}
}
catch
(
_
:
Exception
)
{
EventUtils
.
event
(
"install_referrer_error"
)
}
}
override
fun
onInstallReferrerServiceDisconnected
()
{
}
})
}
fun
requestCfg
(
callBackAd
:
Boolean
)
{
NewComUtils
.
requestCfg
{
if
(
callBackAd
)
{
AdmobMaxHelper
.
initAdmobMaxAd
()
}
val
timerStatus
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerS"
,
"1"
)
.
toIntOrNull
()
?:
1
...
...
@@ -69,20 +104,4 @@ object InstallHelps {
}
}
}
else
->
{
EventUtils
.
event
(
"install_referrer_error"
)
}
}
}
catch
(
_
:
Exception
)
{
EventUtils
.
event
(
"install_referrer_error"
)
}
}
override
fun
onInstallReferrerServiceDisconnected
()
{
}
})
}
}
\ No newline at end of file
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