Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
b75e9002
Commit
b75e9002
authored
Jul 17, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
max广告
parent
eb1ce437
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
39 deletions
+59
-39
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+32
-1
SplashActivity.kt
...om/base/filerecoveryrecyclebin/activity/SplashActivity.kt
+7
-20
FileRecoveryActivity.kt
...overyrecyclebin/activity/recovery/FileRecoveryActivity.kt
+6
-4
AdmobOpenUtils.kt
...m/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
+1
-0
AdMaxInterstitialUtils.kt
.../filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
+3
-3
AdMaxOpenUtils.kt
...com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
+4
-5
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+2
-5
InstallHelps.kt
...ava/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
+3
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
b75e9002
...
@@ -4,8 +4,10 @@ import android.annotation.SuppressLint
...
@@ -4,8 +4,10 @@ import android.annotation.SuppressLint
import
android.app.Activity
import
android.app.Activity
import
android.content.Intent
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInit.initAdMax
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
...
@@ -18,10 +20,17 @@ import com.base.filerecoveryrecyclebin.utils.InstallHelps
...
@@ -18,10 +20,17 @@ import com.base.filerecoveryrecyclebin.utils.InstallHelps
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.NewComUtils
import
com.base.filerecoveryrecyclebin.utils.NewComUtils
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.async
import
kotlinx.coroutines.launch
import
java.util.UUID
class
MyApplication
:
BaseApplication
()
{
class
MyApplication
:
BaseApplication
()
{
private
val
TAG
=
"MyApplication"
private
val
TAG
=
"MyApplication"
var
uuid
=
""
companion
object
{
companion
object
{
@JvmField
@JvmField
...
@@ -29,9 +38,18 @@ class MyApplication : BaseApplication() {
...
@@ -29,9 +38,18 @@ class MyApplication : BaseApplication() {
}
}
override
fun
init
()
{
override
fun
init
()
{
initUUid
()
initApp
()
initApp
()
}
}
private
fun
initUUid
()
{
uuid
=
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)
if
(
TextUtils
.
isEmpty
(
uuid
))
{
uuid
=
UUID
.
randomUUID
().
toString
()
+
System
.
currentTimeMillis
()
AppPreferences
.
getInstance
().
put
(
"uuid"
,
uuid
)
}
}
fun
initApp
()
{
fun
initApp
()
{
val
topic
=
ConfigHelper
.
packageName
+
"_push"
val
topic
=
ConfigHelper
.
packageName
+
"_push"
FCMManager
.
initFirebase
(
this
)
FCMManager
.
initFirebase
(
this
)
...
@@ -53,8 +71,8 @@ class MyApplication : BaseApplication() {
...
@@ -53,8 +71,8 @@ class MyApplication : BaseApplication() {
}
}
}
}
}
}
if
(
ifAgreePrivacy
)
{
InstallHelps
.
init
()
InstallHelps
.
init
()
if
(
ifAgreePrivacy
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
...
@@ -63,6 +81,19 @@ class MyApplication : BaseApplication() {
...
@@ -63,6 +81,19 @@ class MyApplication : BaseApplication() {
initAdMax
()
initAdMax
()
}
}
MainScope
().
launch
(
Dispatchers
.
Main
)
{
val
deferred
=
async
(
Dispatchers
.
IO
)
{
try
{
AdvertisingIdClient
.
getAdvertisingIdInfo
(
context
).
id
}
catch
(
_
:
Exception
)
{
"unknown"
}
}
val
gid
=
deferred
.
await
()
?:
""
AppPreferences
.
getInstance
().
put
(
"gid"
,
gid
)
}
}
}
initLifeListener
()
initLifeListener
()
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SplashActivity.kt
View file @
b75e9002
...
@@ -16,6 +16,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
...
@@ -16,6 +16,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
...
@@ -228,29 +229,15 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -228,29 +229,15 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
private
fun
outTimeAd
()
{
private
fun
outTimeAd
()
{
LogEx
.
logDebug
(
TAG
,
"outTimeAd"
)
LogEx
.
logDebug
(
TAG
,
"outTimeAd"
)
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
loadAppOpenAd
{
AdmobMaxHelper
.
admobMaxShowOpenAd
(
this
,
showBeforeAction
=
{
LogEx
.
logDebug
(
TAG
,
"load where=$it"
)
job
?.
cancel
()
AdmobOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
)
{
LogEx
.
logDebug
(
TAG
,
"adCallBack=$it"
)
binding
.
pb
.
progress
=
100
jumpNext
()
}
}
}
else
{
AdMaxOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
,
loaded
=
{
job
?.
cancel
()
job
?.
cancel
()
},
},
onHidden
=
{
onHidden
=
{
binding
.
pb
.
progress
=
100
binding
.
pb
.
progress
=
100
jumpNext
()
jumpNext
()
})
})
}
}
}
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
LogEx
.
logDebug
(
TAG
,
"onResume"
)
LogEx
.
logDebug
(
TAG
,
"onResume"
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/recovery/FileRecoveryActivity.kt
View file @
b75e9002
...
@@ -75,12 +75,14 @@ class FileRecoveryActivity : BaseActivity<ActivityFileRecoveryBinding>() {
...
@@ -75,12 +75,14 @@ class FileRecoveryActivity : BaseActivity<ActivityFileRecoveryBinding>() {
SCAN_PHOTOS
->
{
SCAN_PHOTOS
->
{
var
size
=
0
var
size
=
0
folderBean
?.
recoveryList
?.
forEach
{
folderBean
?.
recoveryList
?.
forEach
{
runCatching
{
val
bitmap
=
BitmapFactory
.
decodeFile
(
it
.
path
)
val
bitmap
=
BitmapFactory
.
decodeFile
(
it
.
path
)
if
(
bitmap
.
height
<
256
||
bitmap
.
width
<
256
)
{
if
(
bitmap
.
height
<
256
||
bitmap
.
width
<
256
)
{
size
++
size
++
it
.
isThumbnails
=
true
it
.
isThumbnails
=
true
}
}
}
}
}
binding
.
tvThumbnails
.
text
=
"Hide thumbnails (${size})"
binding
.
tvThumbnails
.
text
=
"Hide thumbnails (${size})"
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
View file @
b75e9002
...
@@ -114,6 +114,7 @@ object AdmobOpenUtils {
...
@@ -114,6 +114,7 @@ object AdmobOpenUtils {
}
}
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
showBefore
?.
invoke
()
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
}
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
View file @
b75e9002
...
@@ -150,13 +150,13 @@ object AdMaxInterstitialUtils {
...
@@ -150,13 +150,13 @@ object AdMaxInterstitialUtils {
}
}
fun
loadInterstitialAd
(
activity
:
Activity
)
{
fun
loadInterstitialAd
(
activity
:
Activity
)
{
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
return
}
setListener
(
activity
)
setListener
(
activity
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
return
return
}
}
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"loadInterstitialAd"
)
LogEx
.
logDebug
(
TAG
,
"loadInterstitialAd"
)
interstitialAd
?.
loadAd
()
interstitialAd
?.
loadAd
()
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
View file @
b75e9002
package
com.base.filerecoveryrecyclebin.ads.max
package
com.base.filerecoveryrecyclebin.ads.max
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
com.applovin.mediation.MaxAd
import
com.applovin.mediation.MaxAd
...
@@ -128,18 +129,16 @@ object AdMaxOpenUtils {
...
@@ -128,18 +129,16 @@ object AdMaxOpenUtils {
}
}
fun
loadAppOpenAd
(
activity
:
Activity
)
{
fun
loadAppOpenAd
(
activity
:
Activity
)
{
setListener
(
activity
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
return
return
}
}
setListener
(
activity
)
LogEx
.
logDebug
(
TAG
,
"loadAppOpenAd1"
)
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"
loadAppOpenAd2
"
)
LogEx
.
logDebug
(
TAG
,
"
appOpenAd load
"
)
appOpenAd
?.
loadAd
()
appOpenAd
?.
loadAd
()
}
else
{
LogEx
.
logDebug
(
TAG
,
"loadAppOpenAd3"
)
}
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
b75e9002
...
@@ -13,6 +13,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
...
@@ -13,6 +13,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_DOCUMENTS
...
@@ -33,11 +34,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
...
@@ -33,11 +34,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override
fun
setView
()
{
override
fun
setView
()
{
animatorSet
=
createHeartbeatAnimation
(
binding
.
flScan
)
animatorSet
=
createHeartbeatAnimation
(
binding
.
flScan
)
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
0
)
AdmobNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
)
}
else
{
AdMaxNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
)
}
}
}
override
fun
setListener
()
{
override
fun
setListener
()
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
View file @
b75e9002
...
@@ -5,6 +5,9 @@ import com.android.installreferrer.api.InstallReferrerStateListener
...
@@ -5,6 +5,9 @@ import com.android.installreferrer.api.InstallReferrerStateListener
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
org.json.JSONObject
import
org.json.JSONObject
/**
* call before agree
*/
object
InstallHelps
{
object
InstallHelps
{
fun
init
()
{
fun
init
()
{
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
...
...
app/src/main/res/values/strings.xml
View file @
b75e9002
<resources>
<resources>
<string
name=
"app_name"
>
File Recovery
&
RecycleBin
</string>
<string
name=
"app_name"
>
Photo/Video Recovery
</string>
<!-- TODO: Remove or change this placeholder text -->
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"facebook_app_id"
>
1141667540450666
</string>
<string
name=
"facebook_app_id"
>
1141667540450666
</string>
...
...
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