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
bac7c7f4
Commit
bac7c7f4
authored
Jul 31, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
8ce33f31
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
81 additions
and
38 deletions
+81
-38
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+13
-3
MyApplication.kt
app/src/main/java/com/base/datarecovery/MyApplication.kt
+13
-9
SplashActivity.kt
...ain/java/com/base/datarecovery/activity/SplashActivity.kt
+20
-4
AdDisplayUtils.java
...c/main/java/com/base/datarecovery/ads/AdDisplayUtils.java
+8
-7
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+1
-1
AdmobCommonUtils.kt
.../java/com/base/datarecovery/ads/admob/AdmobCommonUtils.kt
+1
-1
AdmobOpenUtils.kt
...in/java/com/base/datarecovery/ads/admob/AdmobOpenUtils.kt
+2
-2
AdMaxOpenUtils.kt
...main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
+6
-6
RecoveryFragment.kt
...n/java/com/base/datarecovery/fragment/RecoveryFragment.kt
+5
-1
StayNotificationService.kt
.../com/base/datarecovery/service/StayNotificationService.kt
+11
-4
layout_max_native_big_2.xml
app/src/main/res/layout/layout_max_native_big_2.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
bac7c7f4
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.MANAGE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.MANAGE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<!-- fcm 添加以下权限 -->
<!-- fcm 添加以下权限 -->
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"com.google.android.c2dm.permission.RECEIVE"
/>
<uses-permission
android:name=
"com.google.android.c2dm.permission.RECEIVE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
...
@@ -14,6 +15,9 @@
...
@@ -14,6 +15,9 @@
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_DATA_SYNC"
/>
<queries>
<queries>
<intent>
<intent>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -224,10 +228,14 @@
...
@@ -224,10 +228,14 @@
android:value=
"true"
/>
android:value=
"true"
/>
<meta-data
<meta-data
android:name=
"com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:name=
"com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:value=
"false"
/>
<!-- 常驻通知栏 -->
android:value=
"false"
/>
<!-- 常驻通知栏 -->
<service
<service
android:name=
".service.StayNotificationService"
android:name=
".service.StayNotificationService"
android:foregroundServiceType=
"dataSync"
android:permission=
"android.permission.FOREGROUND_SERVICE"
/>
android:permission=
"android.permission.FOREGROUND_SERVICE"
/>
<service
<service
android:name=
".fcm.MessagingService"
android:name=
".fcm.MessagingService"
android:exported=
"true"
>
android:exported=
"true"
>
...
@@ -238,7 +246,9 @@
...
@@ -238,7 +246,9 @@
<receiver
<receiver
android:name=
".fcm.CloseNotificationReceiver"
android:name=
".fcm.CloseNotificationReceiver"
android:exported=
"false"
/>
<!-- 添加以下接收器 -->
android:exported=
"false"
/>
<!-- 添加以下接收器 -->
<!-- 注册广播 -->
<!-- 注册广播 -->
<receiver
<receiver
android:name=
".fcm.FcmReceiver"
android:name=
".fcm.FcmReceiver"
...
...
app/src/main/java/com/base/datarecovery/MyApplication.kt
View file @
bac7c7f4
...
@@ -18,7 +18,6 @@ import com.base.datarecovery.utils.AppPreferences
...
@@ -18,7 +18,6 @@ import com.base.datarecovery.utils.AppPreferences
import
com.base.datarecovery.utils.InstallHelps
import
com.base.datarecovery.utils.InstallHelps
import
com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.utils.LogEx
import
com.facebook.FacebookSdk
import
com.facebook.FacebookSdk
import
com.facebook.LoggingBehavior
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.MainScope
...
@@ -32,6 +31,8 @@ class MyApplication : BaseApplication() {
...
@@ -32,6 +31,8 @@ class MyApplication : BaseApplication() {
var
uuid
=
""
var
uuid
=
""
companion
object
{
companion
object
{
var
isInterOpenShowing
:
Boolean
=
false
@JvmField
@JvmField
var
PAUSED_VALUE
=
0
var
PAUSED_VALUE
=
0
}
}
...
@@ -113,10 +114,7 @@ class MyApplication : BaseApplication() {
...
@@ -113,10 +114,7 @@ class MyApplication : BaseApplication() {
true
true
}
else
{
}
else
{
ConfigHelper
.
noLoadingActivities
.
all
{
ConfigHelper
.
noLoadingActivities
.
all
{
!
topActivity
.
localClassName
.
contains
(
!
topActivity
.
localClassName
.
contains
(
it
,
true
)
it
,
true
)
}
}
}
}
...
@@ -125,12 +123,18 @@ class MyApplication : BaseApplication() {
...
@@ -125,12 +123,18 @@ class MyApplication : BaseApplication() {
}
}
LogEx
.
logDebug
(
TAG
,
"flag=$flag"
+
" activity:"
+
activity
.
localClassName
)
LogEx
.
logDebug
(
TAG
,
"flag=$flag"
+
" activity:"
+
activity
.
localClassName
)
if
(
flag
)
{
if
(
flag
&&
!
isInterOpenShowing
)
{
if
(
AdmobMaxHelper
.
isOpenAdLoaded
())
{
if
(
AdmobMaxHelper
.
isOpenAdLoaded
())
{
LogEx
.
logDebug
(
TAG
,
"show ad"
)
var
loaded
:
Boolean
=
true
AdmobMaxHelper
.
admobMaxShowOpenAd
(
activity
,
{},
{})
AdmobMaxHelper
.
admobMaxShowOpenAd
(
activity
,
{
loaded
=
it
},
{
val
sp
=
AppPreferences
.
getInstance
().
getString
(
"splashShowInter"
,
"0"
).
toInt
()
if
(
sp
==
1
&&
!
loaded
)
{
AdmobMaxHelper
.
admobMaxShowInterstitialAd
(
activity
)
}
})
}
else
{
}
else
{
LogEx
.
logDebug
(
TAG
,
"jump splash"
)
topActivity
?.
startActivity
(
topActivity
?.
startActivity
(
Intent
(
Intent
(
topActivity
,
topActivity
,
...
...
app/src/main/java/com/base/datarecovery/activity/SplashActivity.kt
View file @
bac7c7f4
...
@@ -42,6 +42,7 @@ import com.base.datarecovery.fcm.NotificationUtil
...
@@ -42,6 +42,7 @@ import com.base.datarecovery.fcm.NotificationUtil
import
com.base.datarecovery.help.BaseActivity
import
com.base.datarecovery.help.BaseActivity
import
com.base.datarecovery.help.ConfigHelper
import
com.base.datarecovery.help.ConfigHelper
import
com.base.datarecovery.service.StayNotificationService.Companion.startStayNotification
import
com.base.datarecovery.service.StayNotificationService.Companion.startStayNotification
import
com.base.datarecovery.utils.AppPreferences
import
com.base.datarecovery.utils.BarUtils
import
com.base.datarecovery.utils.BarUtils
import
com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.utils.LogEx
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
...
@@ -73,6 +74,12 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -73,6 +74,12 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
override
fun
initView
()
{
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
if
(
MyApplication
.
isInterOpenShowing
)
{
finish
()
return
}
startStayNotification
()
startStayNotification
()
NotificationUtil
.
stopNotificationHandler
()
NotificationUtil
.
stopNotificationHandler
()
...
@@ -249,12 +256,21 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -249,12 +256,21 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
private
fun
outTimeAd
()
{
private
fun
outTimeAd
()
{
LogEx
.
logDebug
(
TAG
,
"outTimeAd"
)
LogEx
.
logDebug
(
TAG
,
"outTimeAd"
)
AdmobMaxHelper
.
admobMaxShowOpenAd
(
this
,
showBeforeAction
=
{
var
loaded
:
Boolean
=
true
AdmobMaxHelper
.
admobMaxShowOpenAd
(
this
,
showBeforeAction
=
{
flag
->
loaded
=
flag
job
?.
cancel
()
job
?.
cancel
()
})
{
})
{
LogEx
.
logDebug
(
TAG
,
"onHide"
)
val
sp
=
AppPreferences
.
getInstance
().
getString
(
"splashShowInter"
,
"0"
).
toInt
()
binding
.
pb
.
progress
=
100
if
(
sp
==
1
&&
!
loaded
)
{
jumpNext
()
AdmobMaxHelper
.
admobMaxShowInterstitialAd
(
this
)
{
binding
.
pb
.
progress
=
100
jumpNext
()
}
}
else
{
binding
.
pb
.
progress
=
100
jumpNext
()
}
}
}
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/AdDisplayUtils.java
View file @
bac7c7f4
...
@@ -19,9 +19,11 @@ import java.util.Locale;
...
@@ -19,9 +19,11 @@ import java.util.Locale;
public
class
AdDisplayUtils
{
public
class
AdDisplayUtils
{
private
String
TAG
=
"AdDisplayUtils"
;
private
String
TAG
=
"AdDisplayUtils"
;
private
static
final
int
DEFAULT_MAX_AD_REQUEST_COUNT
=
100
;
// 广告请求次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_REQUEST_FAIL_COUNT
=
20
;
// 单个广告点击次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_DISPLAY_COUNT
=
45
;
// 总广告展示次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_DISPLAY_COUNT
=
45
;
// 总广告展示次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_CLICK_COUNT
=
10
;
// 单个广告点击次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_CLICK_COUNT
=
10
;
// 单个广告点击次数限制默认值
private
static
final
int
DEFAULT_MAX_AD_REQUEST_FAIL_COUNT
=
20
;
// 单个广告点击次数限制默认值
private
static
final
String
AD_PREFS_NAME
=
"ad_prefs"
;
// SharedPreferences 名称
private
static
final
String
AD_PREFS_NAME
=
"ad_prefs"
;
// SharedPreferences 名称
private
static
final
String
AD_DISPLAY_COUNT_KEY
=
"ad_display_count"
;
// 广告展示次数的键
private
static
final
String
AD_DISPLAY_COUNT_KEY
=
"ad_display_count"
;
// 广告展示次数的键
private
static
final
String
AD_CLICK_COUNT_KEY
=
"ad_click_count"
;
// 广告点击次数的键
private
static
final
String
AD_CLICK_COUNT_KEY
=
"ad_click_count"
;
// 广告点击次数的键
...
@@ -46,20 +48,19 @@ public class AdDisplayUtils {
...
@@ -46,20 +48,19 @@ public class AdDisplayUtils {
private
int
adRequestCount
=
0
;
// 当前广告请求次数
private
int
adRequestCount
=
0
;
// 当前广告请求次数
private
int
maxAdRequestCount
=
0
;
// 最大广告请求次数
private
int
maxAdRequestCount
=
0
;
// 最大广告请求次数
private
static
final
int
DEFAULT_MAX_AD_REQUEST_COUNT
=
100
;
// 广告请求次数限制默认值
private
AdDisplayUtils
()
{
private
AdDisplayUtils
()
{
currentDate
=
getCurrentDate
();
currentDate
=
getCurrentDate
();
SharedPreferences
prefs
=
BaseApplication
.
context
.
getSharedPreferences
(
AD_PREFS_NAME
,
0
);
SharedPreferences
prefs
=
BaseApplication
.
context
.
getSharedPreferences
(
AD_PREFS_NAME
,
0
);
maxAdRequestCount
=
prefs
.
getInt
(
MAX_AD_REQUEST_COUNT_KEY
,
DEFAULT_MAX_AD_REQUEST_COUNT
);
maxAdRequestFailCount
=
prefs
.
getInt
(
MAX_AD_REQUEST_FAIL_COUNT_KEY
,
DEFAULT_MAX_AD_REQUEST_FAIL_COUNT
);
maxAdDisplayCount
=
prefs
.
getInt
(
MAX_AD_DISPLAY_COUNT_KEY
,
DEFAULT_MAX_AD_DISPLAY_COUNT
);
maxAdDisplayCount
=
prefs
.
getInt
(
MAX_AD_DISPLAY_COUNT_KEY
,
DEFAULT_MAX_AD_DISPLAY_COUNT
);
maxAdClickCount
=
prefs
.
getInt
(
MAX_AD_CLICK_COUNT_KEY
,
DEFAULT_MAX_AD_CLICK_COUNT
);
maxAdClickCount
=
prefs
.
getInt
(
MAX_AD_CLICK_COUNT_KEY
,
DEFAULT_MAX_AD_CLICK_COUNT
);
maxAdRequestFailCount
=
prefs
.
getInt
(
MAX_AD_REQUEST_FAIL_COUNT_KEY
,
DEFAULT_MAX_AD_REQUEST_FAIL_COUNT
);
adDisplayCount
=
prefs
.
getInt
(
getAdDisplayCountKey
(),
0
);
adClickCount
=
prefs
.
getInt
(
getAdClickCountKey
(),
0
);
adRequestFailCount
=
prefs
.
getInt
(
getAdRequestFailCountKey
(),
0
);
adRequestCount
=
prefs
.
getInt
(
getAdRequestCountKey
(),
0
);
adRequestCount
=
prefs
.
getInt
(
getAdRequestCountKey
(),
0
);
maxAdRequestCount
=
prefs
.
getInt
(
MAX_AD_REQUEST_COUNT_KEY
,
DEFAULT_MAX_AD_REQUEST_COUNT
);
adRequestFailCount
=
prefs
.
getInt
(
getAdRequestFailCountKey
(),
0
);
adDisplayCount
=
prefs
.
getInt
(
getAdDisplayCountKey
(),
0
);
adClickCount
=
prefs
.
getInt
(
getAdClickCountKey
(),
0
);
}
}
public
static
synchronized
AdDisplayUtils
getInstance
()
{
public
static
synchronized
AdDisplayUtils
getInstance
()
{
...
...
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
bac7c7f4
...
@@ -51,7 +51,7 @@ object AdmobMaxHelper {
...
@@ -51,7 +51,7 @@ object AdmobMaxHelper {
}
}
}
}
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
(
flag
:
Boolean
)
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
if
(
isBlack
)
{
onHidden
?.
invoke
()
onHidden
?.
invoke
()
return
return
...
...
app/src/main/java/com/base/datarecovery/ads/admob/AdmobCommonUtils.kt
View file @
bac7c7f4
...
@@ -6,7 +6,7 @@ import com.base.datarecovery.utils.ActivityManagerUtils
...
@@ -6,7 +6,7 @@ import com.base.datarecovery.utils.ActivityManagerUtils
object
AdmobCommonUtils
{
object
AdmobCommonUtils
{
private
var
lastAd
:
Any
?
=
null
private
var
lastAd
:
Any
?
=
null
private
var
maxMultiClick
=
4
private
var
maxMultiClick
=
10
private
var
multiClick
=
0
private
var
multiClick
=
0
fun
isMultiClick
(
currentAd
:
Any
?)
{
fun
isMultiClick
(
currentAd
:
Any
?)
{
if
(
currentAd
==
null
)
{
if
(
currentAd
==
null
)
{
...
...
app/src/main/java/com/base/datarecovery/ads/admob/AdmobOpenUtils.kt
View file @
bac7c7f4
...
@@ -66,7 +66,7 @@ object AdmobOpenUtils {
...
@@ -66,7 +66,7 @@ object AdmobOpenUtils {
}
}
fun
showAppOpenAd
(
activity
:
Activity
,
showBefore
:
(()
->
Unit
)?
=
null
,
onHidden
:
((
where
:
Int
)
->
Unit
)?
=
null
)
{
fun
showAppOpenAd
(
activity
:
Activity
,
showBefore
:
((
flag
:
Boolean
)
->
Unit
)?
=
null
,
onHidden
:
((
where
:
Int
)
->
Unit
)?
=
null
)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
return
return
...
@@ -116,7 +116,7 @@ object AdmobOpenUtils {
...
@@ -116,7 +116,7 @@ object AdmobOpenUtils {
}
}
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
showBefore
?.
invoke
()
showBefore
?.
invoke
(
true
)
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
}
}
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
View file @
bac7c7f4
...
@@ -20,7 +20,7 @@ object AdMaxOpenUtils {
...
@@ -20,7 +20,7 @@ object AdMaxOpenUtils {
private
var
appOpenAd
:
MaxAppOpenAd
?
=
null
private
var
appOpenAd
:
MaxAppOpenAd
?
=
null
private
var
openLoadTime
=
Long
.
MAX_VALUE
private
var
openLoadTime
=
Long
.
MAX_VALUE
private
var
onHidden
:
(()
->
Unit
)?
=
null
private
var
onHidden
:
(()
->
Unit
)?
=
null
private
var
loadingListener
:
(()
->
Unit
)?
=
null
private
var
loadingListener
:
((
flag
:
Boolean
)
->
Unit
)?
=
null
private
var
activityString
=
""
private
var
activityString
=
""
private
fun
setListener
(
activity
:
Activity
)
{
private
fun
setListener
(
activity
:
Activity
)
{
...
@@ -32,7 +32,7 @@ object AdMaxOpenUtils {
...
@@ -32,7 +32,7 @@ object AdMaxOpenUtils {
override
fun
onAdLoaded
(
p0
:
MaxAd
)
{
override
fun
onAdLoaded
(
p0
:
MaxAd
)
{
LogEx
.
logDebug
(
TAG
,
"广告拉取成功"
)
LogEx
.
logDebug
(
TAG
,
"广告拉取成功"
)
openLoadTime
=
System
.
currentTimeMillis
()
openLoadTime
=
System
.
currentTimeMillis
()
loadingListener
?.
invoke
()
loadingListener
?.
invoke
(
true
)
loadingListener
=
null
loadingListener
=
null
AdMaxEvent
.
pullAd
(
p0
,
"openAd"
)
AdMaxEvent
.
pullAd
(
p0
,
"openAd"
)
}
}
...
@@ -41,7 +41,7 @@ object AdMaxOpenUtils {
...
@@ -41,7 +41,7 @@ object AdMaxOpenUtils {
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p1
.
message
.
toString
())
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p1
.
message
.
toString
())
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p0
)
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p0
)
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p1
.
code
)
LogEx
.
logDebug
(
TAG
,
"广告拉取失败了,onAdLoadFailed:"
+
p1
.
code
)
loadingListener
?.
invoke
()
loadingListener
?.
invoke
(
false
)
loadingListener
=
null
loadingListener
=
null
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
...
@@ -86,7 +86,7 @@ object AdMaxOpenUtils {
...
@@ -86,7 +86,7 @@ object AdMaxOpenUtils {
fun
showAppOpenAd
(
fun
showAppOpenAd
(
activity
:
Activity
,
activity
:
Activity
,
loadCallBack
:
(()
->
Unit
)?
=
null
,
loadCallBack
:
((
flag
:
Boolean
)
->
Unit
)?
=
null
,
onHidden
:
(()
->
Unit
)?
=
null
onHidden
:
(()
->
Unit
)?
=
null
)
{
)
{
...
@@ -136,8 +136,8 @@ object AdMaxOpenUtils {
...
@@ -136,8 +136,8 @@ object AdMaxOpenUtils {
LogEx
.
logDebug
(
TAG
,
"展示时候,发现广告需要拉取"
)
LogEx
.
logDebug
(
TAG
,
"展示时候,发现广告需要拉取"
)
val
loaded
=
loadAppOpenAd
(
activity
)
val
loaded
=
loadAppOpenAd
(
activity
)
if
(
loaded
)
{
if
(
loaded
)
{
loadingListener
=
{
loadingListener
=
{
loadResult
->
loadCallBack
?.
invoke
()
loadCallBack
?.
invoke
(
loadResult
)
LogEx
.
logDebug
(
TAG
,
"loadingListener callback"
)
LogEx
.
logDebug
(
TAG
,
"loadingListener callback"
)
if
(
appOpenAd
?.
isReady
==
true
)
{
if
(
appOpenAd
?.
isReady
==
true
)
{
AdMaxOpenUtils
.
onHidden
=
onHidden
AdMaxOpenUtils
.
onHidden
=
onHidden
...
...
app/src/main/java/com/base/datarecovery/fragment/RecoveryFragment.kt
View file @
bac7c7f4
...
@@ -20,7 +20,6 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
...
@@ -20,7 +20,6 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
override
fun
setView
()
{
override
fun
setView
()
{
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
2
)
}
}
override
fun
setListener
()
{
override
fun
setListener
()
{
...
@@ -54,4 +53,9 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
...
@@ -54,4 +53,9 @@ class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {
}
}
}
}
override
fun
onResume
()
{
super
.
onResume
()
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
2
)
}
}
}
\ No newline at end of file
app/src/main/java/com/base/datarecovery/service/StayNotificationService.kt
View file @
bac7c7f4
...
@@ -17,8 +17,10 @@ import androidx.core.app.NotificationCompat
...
@@ -17,8 +17,10 @@ import androidx.core.app.NotificationCompat
import
androidx.core.graphics.drawable.IconCompat
import
androidx.core.graphics.drawable.IconCompat
import
com.base.datarecovery.R
import
com.base.datarecovery.R
import
com.base.datarecovery.activity.MainActivity
import
com.base.datarecovery.activity.MainActivity
import
com.base.datarecovery.activity.SplashActivity
import
com.base.datarecovery.activity.junkclean.ScanJunkActivity
import
com.base.datarecovery.activity.junkclean.ScanJunkActivity
import
com.base.datarecovery.activity.recovery.FileScanResultActivity
import
com.base.datarecovery.activity.recovery.FileScanResultActivity
import
com.base.datarecovery.bean.ConstObject
import
com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.datarecovery.bean.ConstObject.SCAN_PHOTOS
import
com.base.datarecovery.bean.ConstObject.SCAN_PHOTOS
import
com.base.datarecovery.bean.ConstObject.SCAN_VIDEOS
import
com.base.datarecovery.bean.ConstObject.SCAN_VIDEOS
...
@@ -83,14 +85,17 @@ class StayNotificationService : Service() {
...
@@ -83,14 +85,17 @@ class StayNotificationService : Service() {
val
expendView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_big
)
val
expendView
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
stay_notification_big
)
val
requestCode1
=
Random
.
nextInt
(
1800
)
val
requestCode1
=
Random
.
nextInt
(
1800
)
val
intent0
=
Intent
(
context
,
ScanJunkActivity
::
class
.
java
)
val
intent0
=
Intent
(
context
,
SplashActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_JUNK_CLEAN_PUSH
)
}
val
pendingIntent0
=
val
pendingIntent0
=
PendingIntent
.
getActivity
(
context
,
requestCode1
,
intent0
,
PendingIntent
.
FLAG_IMMUTABLE
)
PendingIntent
.
getActivity
(
context
,
requestCode1
,
intent0
,
PendingIntent
.
FLAG_IMMUTABLE
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll_clean
,
pendingIntent0
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll_clean
,
pendingIntent0
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll_clean
,
pendingIntent0
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll_clean
,
pendingIntent0
)
val
requestCode2
=
Random
.
nextInt
(
1800
)
val
requestCode2
=
Random
.
nextInt
(
1800
)
val
intent2
=
Intent
(
context
,
FileScanResultActivity
::
class
.
java
).
apply
{
val
intent2
=
Intent
(
context
,
SplashActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_RECOVERY_PHOTOS
)
putExtra
(
"ScanType"
,
SCAN_PHOTOS
)
putExtra
(
"ScanType"
,
SCAN_PHOTOS
)
}
}
val
pendingIntent2
=
val
pendingIntent2
=
...
@@ -99,7 +104,8 @@ class StayNotificationService : Service() {
...
@@ -99,7 +104,8 @@ class StayNotificationService : Service() {
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_recovery_photos
,
pendingIntent2
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_recovery_photos
,
pendingIntent2
)
val
requestCode3
=
Random
.
nextInt
(
1800
)
val
requestCode3
=
Random
.
nextInt
(
1800
)
val
intent3
=
Intent
(
context
,
FileScanResultActivity
::
class
.
java
).
apply
{
val
intent3
=
Intent
(
context
,
SplashActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_RECOVERY_VIDEOS
)
putExtra
(
"ScanType"
,
SCAN_VIDEOS
)
putExtra
(
"ScanType"
,
SCAN_VIDEOS
)
}
}
val
pendingIntent3
=
val
pendingIntent3
=
...
@@ -116,7 +122,8 @@ class StayNotificationService : Service() {
...
@@ -116,7 +122,8 @@ class StayNotificationService : Service() {
// expendView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
// expendView.setOnClickPendingIntent(R.id.id_screenshot, pendingIntent4)
val
requestCode4
=
Random
.
nextInt
(
1800
)
val
requestCode4
=
Random
.
nextInt
(
1800
)
val
intent4
=
Intent
(
context
,
FileScanResultActivity
::
class
.
java
).
apply
{
val
intent4
=
Intent
(
context
,
SplashActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_RECOVERY_DOCUMENTS
)
putExtra
(
"ScanType"
,
SCAN_DOCUMENTS
)
putExtra
(
"ScanType"
,
SCAN_DOCUMENTS
)
}
}
val
pendingIntent4
=
val
pendingIntent4
=
...
...
app/src/main/res/layout/layout_max_native_big_2.xml
View file @
bac7c7f4
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/bg_ad_button_0073c3"
android:background=
"@drawable/bg_ad_button_0073c3"
android:gravity=
"center"
android:gravity=
"center"
android:paddingHorizontal=
"2dp"
android:textAllCaps=
"false"
android:textAllCaps=
"false"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"15sp"
android:textSize=
"15sp"
...
...
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