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
fdd79655
Commit
fdd79655
authored
Jul 18, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
c27c0b82
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
12 deletions
+27
-12
MyApplication.kt
app/src/main/java/com/base/datarecovery/MyApplication.kt
+1
-1
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+8
-0
AdMaxInterstitialUtils.kt
...a/com/base/datarecovery/ads/max/AdMaxInterstitialUtils.kt
+8
-5
AdMaxOpenUtils.kt
...main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
+10
-6
No files found.
app/src/main/java/com/base/datarecovery/MyApplication.kt
View file @
fdd79655
...
...
@@ -116,7 +116,7 @@ class MyApplication : BaseApplication() {
LogEx
.
logDebug
(
TAG
,
"flag=$flag"
)
if
(
flag
)
{
if
(
Admob
OpenUtils
.
isOpenAdLoaded
())
{
if
(
Admob
MaxHelper
.
isOpenAdLoaded
())
{
LogEx
.
logDebug
(
TAG
,
"show ad"
)
AdmobMaxHelper
.
admobMaxShowOpenAd
(
activity
)
}
else
{
...
...
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
fdd79655
...
...
@@ -16,6 +16,14 @@ import com.base.datarecovery.utils.LogEx
object
AdmobMaxHelper
{
private
val
TAG
=
""
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
}
else
{
AdMaxOpenUtils
.
isOpenAdLoaded
()
}
}
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxInterstitialUtils.kt
View file @
fdd79655
...
...
@@ -32,11 +32,7 @@ object AdMaxInterstitialUtils {
private
fun
setListener
(
activity
:
Activity
)
{
if
(
interstitialAd
==
null
)
{
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"interAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interstitialAd
=
MaxInterstitialAd
(
ConfigHelper
.
interAdMaxId
,
activity
)
interstitialAd
?.
setListener
(
object
:
MaxAdListener
{
override
fun
onAdLoaded
(
p0
:
MaxAd
)
{
...
...
@@ -44,11 +40,13 @@ object AdMaxInterstitialUtils {
loadingListener
?.
invoke
()
interLoadTime
=
System
.
currentTimeMillis
()
retryAttempt
=
0
val
reqId
=
UUID
.
randomUUID
().
toString
()
AdMaxEvent
.
pullAd
(
p0
,
"interAd"
,
reqId
=
reqId
)
}
override
fun
onAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
LogEx
.
logDebug
(
TAG
,
"onAdLoadFailed"
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
AdMaxEvent
.
pullAd
(
null
,
"interAd"
,
reqId
=
reqId
)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
retryAttempt
++
...
...
@@ -169,6 +167,11 @@ object AdMaxInterstitialUtils {
}
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"loadInterstitialAd"
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"interAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interstitialAd
?.
loadAd
()
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
View file @
fdd79655
...
...
@@ -29,20 +29,20 @@ object AdMaxOpenUtils {
LogEx
.
logDebug
(
TAG
,
"onAdLoaded"
)
openLoadTime
=
System
.
currentTimeMillis
()
loadingListener
?.
invoke
()
AdMaxEvent
.
pullAd
(
p0
,
"openAd"
)
AdMaxEvent
.
pullAd
(
p0
,
"openAd"
)
}
override
fun
onAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
LogEx
.
logDebug
(
TAG
,
"onAdLoadFailed:"
+
p1
.
message
.
toString
())
LogEx
.
logDebug
(
TAG
,
"onAdLoadFailed:"
+
p1
.
message
.
toString
())
onHidden
?.
invoke
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
AdMaxEvent
.
pullAd
(
null
,
"openAd"
)
AdMaxEvent
.
pullAd
(
null
,
"openAd"
)
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{
AdDisplayUtils
.
getInstance
().
incrementAdDisplayCount
()
AdMaxEvent
.
showAd
(
p0
,
"openAd"
,
Activity
())
AdMaxEvent
.
showAd
(
p0
,
"openAd"
,
Activity
())
}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{
...
...
@@ -55,7 +55,7 @@ object AdMaxOpenUtils {
AdDisplayUtils
.
getInstance
().
incrementAdClickCount
()
// com.base.datarecovery.ads.max.AdMaxEvent.clickAd(appOpenAd, "openAd")
AdmobCommonUtils
.
isMultiClick
(
appOpenAd
)
AdMaxEvent
.
clickAd
(
p0
,
"openAd"
)
AdMaxEvent
.
clickAd
(
p0
,
"openAd"
)
}
...
...
@@ -71,7 +71,7 @@ object AdMaxOpenUtils {
}
})
appOpenAd
?.
setRevenueListener
(
AdMaxEvent
.
EventOnPaidEventListener
())
appOpenAd
?.
setRevenueListener
(
AdMaxEvent
.
EventOnPaidEventListener
())
}
}
...
...
@@ -144,5 +144,9 @@ object AdMaxOpenUtils {
}
}
fun
isOpenAdLoaded
():
Boolean
{
return
appOpenAd
?.
isReady
==
true
}
}
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