Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy Cleaner Junk
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
Easy Cleaner Junk
Commits
cb525120
Commit
cb525120
authored
Jul 26, 2024
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8a764fe5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
49 deletions
+50
-49
MyApplication.kt
.../main/java/com/test/easy/easycleanerjunk/MyApplication.kt
+18
-10
BatteryInfoAnimationActivity.kt
...junk/activity/batteryinfo/BatteryInfoAnimationActivity.kt
+25
-16
PrepareScanActivity.kt
.../easycleanerjunk/activity/scanjunk/PrepareScanActivity.kt
+0
-17
MaxAdUtils.kt
...ava/com/test/easy/easycleanerjunk/helps/ads/MaxAdUtils.kt
+7
-6
No files found.
app/src/main/java/com/test/easy/easycleanerjunk/MyApplication.kt
View file @
cb525120
...
...
@@ -14,12 +14,14 @@ import com.test.easy.easycleanerjunk.fcm.FCMUtil
import
com.test.easy.easycleanerjunk.helps.BaseApplication
import
com.test.easy.easycleanerjunk.helps.BlackUtils
import
com.test.easy.easycleanerjunk.helps.ConfigHelper
import
com.test.easy.easycleanerjunk.helps.EventUtils
import
com.test.easy.easycleanerjunk.helps.InstallHelps
import
com.test.easy.easycleanerjunk.helps.LogEx
import
com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import
com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import
com.test.easy.easycleanerjunk.utils.ActivityManagerUtils
import
com.test.easy.easycleanerjunk.utils.SPUtils
import
org.json.JSONObject
import
java.util.UUID
import
java.util.concurrent.Executors
...
...
@@ -33,7 +35,7 @@ class MyApplication : BaseApplication() {
var
uuid
=
""
override
fun
init
()
{
// registerActivityLifecycleCallbacks(this)
// registerActivityLifecycleCallbacks(this)
initUUid
()
initApp
()
...
...
@@ -88,6 +90,7 @@ class MyApplication : BaseApplication() {
ActionBroadcast
.
initBroadcast
(
this
)
}
private
var
lastTimePause
=
0L
private
var
lastTimeResume
=
0L
private
fun
isHotLaunch
():
Boolean
{
...
...
@@ -96,6 +99,7 @@ class MyApplication : BaseApplication() {
}
return
false
}
private
fun
initLifeListener
()
{
registerActivityLifecycleCallbacks
(
object
:
ActivityLifecycleCallbacks
{
private
var
count
=
0
...
...
@@ -115,17 +119,21 @@ class MyApplication : BaseApplication() {
}
else
{
ConfigHelper
.
noLoadingActivities
.
all
{
!
topActivity
.
localClassName
.
contains
(
it
,
true
)
}
!
topActivity
.
localClassName
.
contains
(
it
,
true
)
}
}
if
(
activity
.
localClassName
.
contains
(
"AppLovinFullscreenActivity"
))
{
flag
=
false
}
if
(
ConfigHelper
.
isInterAdShow
){
flag
=
false
val
obj
=
JSONObject
()
obj
.
put
(
"topActivity"
,
topActivity
?.
localClassName
)
obj
.
put
(
"InterAdShow"
,
"ifAdShow:"
+
ConfigHelper
.
isInterAdShow
)
EventUtils
.
event
(
"ifAdShow"
,
ext
=
obj
)
if
(
ConfigHelper
.
isInterAdShow
)
{
flag
=
false
}
if
(
flag
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
)
{
if
(
MaxAdUtils
.
isOpenAdLoaded
())
{
MaxAdUtils
.
showAppOpenAd
(
activity
)
}
else
{
...
...
@@ -138,7 +146,7 @@ class MyApplication : BaseApplication() {
putExtra
(
"type"
,
-
1
)
})
}
}
else
{
}
else
{
if
(
AdmobUtils
.
isOpenAdLoaded
())
{
AdmobUtils
.
showAppOpenAd
(
activity
)
}
else
{
...
...
@@ -158,7 +166,7 @@ class MyApplication : BaseApplication() {
}
override
fun
onActivityResumed
(
activity
:
Activity
)
{
LogEx
.
logDebug
(
"glc"
,
"onActivityResumed"
+
activity
.
localClassName
)
LogEx
.
logDebug
(
"glc"
,
"onActivityResumed"
+
activity
.
localClassName
)
PAUSED_VALUE
=
1
}
...
...
@@ -166,7 +174,7 @@ class MyApplication : BaseApplication() {
override
fun
onActivityPaused
(
activity
:
Activity
)
{
PAUSED_VALUE
=
2
lastTimePause
=
System
.
currentTimeMillis
()
LogEx
.
logDebug
(
"glc"
,
"onActivityPaused"
+
activity
.
localClassName
)
LogEx
.
logDebug
(
"glc"
,
"onActivityPaused"
+
activity
.
localClassName
)
}
...
...
@@ -177,7 +185,7 @@ class MyApplication : BaseApplication() {
override
fun
onActivitySaveInstanceState
(
activity
:
Activity
,
outState
:
Bundle
)
{}
override
fun
onActivityDestroyed
(
activity
:
Activity
)
{
LogEx
.
logDebug
(
"glc"
,
"onActivityDestroyed"
+
activity
.
localClassName
)
LogEx
.
logDebug
(
"glc"
,
"onActivityDestroyed"
+
activity
.
localClassName
)
ActivityManagerUtils
.
getInstance
().
removeActivity
(
activity
)
}
})
...
...
app/src/main/java/com/test/easy/easycleanerjunk/activity/batteryinfo/BatteryInfoAnimationActivity.kt
View file @
cb525120
package
com.test.easy.easycleanerjunk.activity.batteryinfo
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.view.View
import
android.widget.Toast
...
...
@@ -12,6 +11,7 @@ import com.test.easy.easycleanerjunk.helps.ConfigHelper
import
com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import
com.test.easy.easycleanerjunk.helps.ads.MaxAdUtils
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
kotlin.random.Random
...
...
@@ -21,10 +21,10 @@ class BatteryInfoAnimationActivity : BaseActivity<ActivityBatteryInfoAnimationBi
override
val
binding
:
ActivityBatteryInfoAnimationBinding
by
lazy
{
ActivityBatteryInfoAnimationBinding
.
inflate
(
layoutInflater
)
}
private
var
job
:
Job
?
=
null
override
fun
initView
()
{
play
Lottie
()
resume
Lottie
()
}
override
fun
initListener
()
{
...
...
@@ -33,19 +33,31 @@ class BatteryInfoAnimationActivity : BaseActivity<ActivityBatteryInfoAnimationBi
}
}
@SuppressLint
(
"SetTextI18n"
)
private
fun
playLottie
()
{
override
fun
onPause
()
{
super
.
onPause
()
binding
.
lottie
.
pauseAnimation
()
job
?.
cancel
()
}
override
fun
onResume
()
{
super
.
onResume
()
resumeLottie
()
job
=
waitJob
()
}
fun
resumeLottie
(){
binding
.
lottie
.
imageAssetsFolder
=
"battery_scan/images/"
binding
.
lottie
.
setAnimation
(
"battery_scan/data.json"
)
binding
.
lottie
.
playAnimation
()
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
delay
(
Random
.
nextLong
(
3000
,
4500
))
binding
.
lottie
.
visibility
=
View
.
GONE
binding
.
lottieCompleted
.
visibility
=
View
.
VISIBLE
binding
.
lottieCompleted
.
playAnimation
()
binding
.
tv
.
text
=
"Completed!"
delay
(
1000
)
}
private
fun
waitJob
()
=
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
delay
(
Random
.
nextLong
(
3000
,
4500
))
binding
.
lottie
.
visibility
=
View
.
GONE
binding
.
lottieCompleted
.
visibility
=
View
.
VISIBLE
binding
.
lottieCompleted
.
playAnimation
()
binding
.
tv
.
text
=
"Completed!"
delay
(
1000
)
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
){
MaxAdUtils
.
showInterstitialAd
(
this
@BatteryInfoAnimationActivity
)
{
binding
.
lottie
.
clearAnimation
()
...
...
@@ -59,9 +71,6 @@ class BatteryInfoAnimationActivity : BaseActivity<ActivityBatteryInfoAnimationBi
finish
()
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/test/easy/easycleanerjunk/activity/scanjunk/PrepareScanActivity.kt
View file @
cb525120
...
...
@@ -113,22 +113,5 @@ class PrepareScanActivity : BaseActivity<ActivityLayoutParepreScanBinding>() {
}
}
private
fun
playLottie
()
{
binding
.
root
.
postDelayed
({
if
(
ConfigHelper
.
admobTrueMaxFlase
==
0
)
{
MaxAdUtils
.
showInterstitialAd
(
this
)
{
startActivity
(
Intent
(
this
,
CleanJunkActivity
::
class
.
java
))
finish
()
}
}
else
{
AdmobUtils
.
showInterstitialAd
(
this
)
{
startActivity
(
Intent
(
this
,
CleanJunkActivity
::
class
.
java
))
finish
()
}
}
},
kotlin
.
random
.
Random
.
nextLong
(
2000
,
4500
))
}
}
\ No newline at end of file
app/src/main/java/com/test/easy/easycleanerjunk/helps/ads/MaxAdUtils.kt
View file @
cb525120
...
...
@@ -3,7 +3,6 @@ package com.test.easy.easycleanerjunk.helps.ads
import
android.app.Activity
import
android.app.Dialog
import
android.os.Bundle
import
android.util.Log
import
android.view.ViewGroup
import
com.applovin.mediation.MaxAd
import
com.applovin.mediation.MaxAdListener
...
...
@@ -75,7 +74,9 @@ object MaxAdUtils {
maxAdPullReport
(
p0
,
"openAd"
,
reqId
=
reqId
)
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{
}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{}
...
...
@@ -85,7 +86,7 @@ object MaxAdUtils {
mOpenAd
=
null
onLoad
?.
invoke
()
maxAdPullReport
(
null
,
"AppOpenAd"
,
p1
.
message
)
Log
.
e
(
"MXL"
,
"onAdLoadFailed: "
+
p1
)
//
Log.e("MXL", "onAdLoadFailed: " + p1)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
}
...
...
@@ -153,7 +154,7 @@ object MaxAdUtils {
obj
.
put
(
"reason"
,
p1
.
message
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj
)
Log
.
e
(
"MXL"
,
"onAdDisplayFailed: "
+
p1
.
message
)
//
Log.e("MXL", "onAdDisplayFailed: "+p1.message )
}
})
if
(
isOpenAdLoaded
())
{
...
...
@@ -212,7 +213,7 @@ object MaxAdUtils {
}
override
fun
onAdDisplayed
(
p0
:
MaxAd
)
{
isInterAdShow
=
true
}
override
fun
onAdHidden
(
p0
:
MaxAd
)
{
...
...
@@ -226,7 +227,7 @@ object MaxAdUtils {
maxAdPullReport
(
null
,
"InterstitialAd"
,
p1
.
message
)
onLoad
?.
invoke
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
Log
.
e
(
"MXL"
,
"interAdLoadFailed: "
+
p1
.
message
)
//
Log.e("MXL", "interAdLoadFailed: "+p1.message )
// retryAttempt++
// Handler(Looper.getMainLooper()).postDelayed({
// retryAttempt++
...
...
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