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
d7b4c5a7
Commit
d7b4c5a7
authored
Jul 26, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
....
parent
aa9596be
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
207 additions
and
53 deletions
+207
-53
build.gradle
app/build.gradle
+2
-0
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+12
-26
SplashActivity.kt
...om/base/filerecoveryrecyclebin/activity/SplashActivity.kt
+1
-1
AdDisplayUtils.java
...a/com/base/filerecoveryrecyclebin/ads/AdDisplayUtils.java
+0
-1
AdmobMaxHelper.kt
...ava/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
+40
-10
MessagingService.java
...com/base/filerecoveryrecyclebin/fcm/MessagingService.java
+5
-2
NotificationUtil.kt
...a/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
+5
-4
RecoveryTimerManager.java
...base/filerecoveryrecyclebin/fcm/RecoveryTimerManager.java
+3
-1
ScreenStatusReceiver.java
...base/filerecoveryrecyclebin/fcm/ScreenStatusReceiver.java
+5
-3
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+0
-2
BlackUtils.kt
...n/java/com/base/filerecoveryrecyclebin/help/BlackUtils.kt
+84
-0
InstallHelps.kt
...ava/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
+50
-2
NewComUtils.kt
...java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
+0
-1
No files found.
app/build.gradle
View file @
d7b4c5a7
...
@@ -82,6 +82,8 @@ dependencies {
...
@@ -82,6 +82,8 @@ dependencies {
//网络
//网络
implementation
group:
'com.google.code.gson'
,
name:
'gson'
,
version:
'2.10.1'
implementation
group:
'com.google.code.gson'
,
name:
'gson'
,
version:
'2.10.1'
implementation
"com.squareup.okhttp3:okhttp:4.9.0"
implementation
'com.squareup.okhttp3:logging-interceptor:4.9.0'
//facebook
//facebook
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
implementation
(
"com.facebook.android:facebook-android-sdk:[8,9)"
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
d7b4c5a7
...
@@ -7,18 +7,16 @@ import android.os.Bundle
...
@@ -7,18 +7,16 @@ import android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
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.ScreenStatusReceiver
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BlackUtils
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils
import
com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.InstallHelps
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.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
...
@@ -50,31 +48,20 @@ class MyApplication : BaseApplication() {
...
@@ -50,31 +48,20 @@ class MyApplication : BaseApplication() {
}
}
}
}
fun
initApp
()
{
fun
initApp
(
isStartClick
:
Boolean
=
false
)
{
if
(!
isStartClick
)
{
val
topic
=
ConfigHelper
.
packageName
+
"_push"
val
topic
=
ConfigHelper
.
packageName
+
"_push"
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
FCMManager
.
initFirebase
(
this
)
FCMManager
.
initFirebase
(
this
)
FCMManager
.
subscribeToTopic
(
topic
)
FCMManager
.
subscribeToTopic
(
topic
)
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
InstallHelps
.
init
()
NewComUtils
.
requestCfg
{
ScreenStatusReceiver
.
setupScreenStatusListener
(
this
)
ScreenStatusReceiver
.
setupScreenStatusListener
(
this
)
val
timerStatus
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerS"
,
"1"
).
toIntOrNull
()
?:
1
InstallHelps
.
init
()
if
(
timerStatus
==
0
)
{
BlackUtils
.
requestBlack
()
RecoveryTimerManager
.
getInstance
().
stopTaskTimer
()
initLifeListener
()
}
else
{
val
timerDelay
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerDelay"
,
"1"
).
toIntOrNull
()
?:
1
val
timerInterval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerInterval"
,
"7"
).
toIntOrNull
()
?:
7
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
)
{
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
(
timerDelay
*
60
*
1000
).
toLong
(),
(
timerInterval
*
60
*
1000
).
toLong
()
)
}
}
}
}
if
(
ifAgreePrivacy
)
{
AdmobMaxHelper
.
initAdmobMaxAd
()
if
(
ifAgreePrivacy
)
{
MainScope
().
launch
(
Dispatchers
.
Main
)
{
MainScope
().
launch
(
Dispatchers
.
Main
)
{
...
@@ -90,7 +77,6 @@ class MyApplication : BaseApplication() {
...
@@ -90,7 +77,6 @@ class MyApplication : BaseApplication() {
}
}
}
}
initLifeListener
()
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SplashActivity.kt
View file @
d7b4c5a7
...
@@ -180,7 +180,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -180,7 +180,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
}
}
oneClickStart
=
true
oneClickStart
=
true
ifAgreePrivacy
=
true
ifAgreePrivacy
=
true
(
application
as
MyApplication
).
initApp
()
(
application
as
MyApplication
).
initApp
(
true
)
AdmobMaxHelper
.
preloadAd
(
this
)
AdmobMaxHelper
.
preloadAd
(
this
)
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdDisplayUtils.java
View file @
d7b4c5a7
...
@@ -85,7 +85,6 @@ public class AdDisplayUtils {
...
@@ -85,7 +85,6 @@ public class AdDisplayUtils {
return
adClickCount
<
maxAdClickCount
;
return
adClickCount
<
maxAdClickCount
;
}
}
public
boolean
shouldShowAd
(
String
ad_unit
)
{
public
boolean
shouldShowAd
(
String
ad_unit
)
{
if
(
BuildConfig
.
DEBUG
)
{
if
(
BuildConfig
.
DEBUG
)
{
return
true
;
return
true
;
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
View file @
d7b4c5a7
...
@@ -13,18 +13,31 @@ import com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
...
@@ -13,18 +13,31 @@ import com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxOpenUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxOpenUtils
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.
help.ConfigHelper
import
com.base.filerecoveryrecyclebin.
utils.AppPreferences
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.MobileAds
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
object
AdmobMaxHelper
{
object
AdmobMaxHelper
{
private
val
TAG
=
"AdmobMaxHelper"
private
val
TAG
=
"AdmobMaxHelper"
var
isAdInit
=
AtomicBoolean
(
false
)
var
isAdInit
=
AtomicBoolean
(
false
)
var
isBlack
:
Boolean
=
false
fun
haveSpAdmobTrueMaxFalse
():
Boolean
{
return
AppPreferences
.
getInstance
().
getString
(
"admobTrueMaxFalse"
,
"-1"
).
toInt
()
!=
-
1
}
private
fun
getSpAdmobTrueMaxFalse
():
Boolean
{
val
ss
=
AppPreferences
.
getInstance
().
getString
(
"admobTrueMaxFalse"
,
"0"
).
toInt
()
return
ss
==
1
}
//Begin
//Begin
fun
initAdmobMaxAd
()
{
fun
initAdmobMaxAd
()
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
if
(!
isAdInit
.
get
())
{
if
(!
isAdInit
.
get
())
{
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
isAdInit
.
set
(
true
)
isAdInit
.
set
(
true
)
...
@@ -36,9 +49,10 @@ object AdmobMaxHelper {
...
@@ -36,9 +49,10 @@ object AdmobMaxHelper {
}
}
}
}
}
}
//End end
//End end
fun
isOpenAdLoaded
():
Boolean
{
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
return
if
(
getSpAdmobTrueMaxFalse
()
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
AdmobOpenUtils
.
isOpenAdLoaded
()
}
else
{
}
else
{
AdMaxOpenUtils
.
isOpenAdLoaded
()
AdMaxOpenUtils
.
isOpenAdLoaded
()
...
@@ -46,8 +60,13 @@ object AdmobMaxHelper {
...
@@ -46,8 +60,13 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
ifBackSp
:
Boolean
=
false
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
isBlack
)
{
onHidden
?.
invoke
()
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
()
onHidden
?.
invoke
()
}
}
...
@@ -59,7 +78,11 @@ object AdmobMaxHelper {
...
@@ -59,7 +78,11 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
isBlack
)
{
onHidden
?.
invoke
()
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
onHidden
?.
invoke
()
onHidden
?.
invoke
()
}
}
...
@@ -71,7 +94,10 @@ object AdmobMaxHelper {
...
@@ -71,7 +94,10 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
else
{
}
else
{
var
layout
=
R
.
layout
.
layout_max_native_small
var
layout
=
R
.
layout
.
layout_max_native_small
...
@@ -86,8 +112,12 @@ object AdmobMaxHelper {
...
@@ -86,8 +112,12 @@ object AdmobMaxHelper {
}
}
fun
preloadAd
(
activity
:
Activity
)
{
fun
preloadAd
(
activity
:
Activity
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
isBlack
)
{
// AdmobOpenUtils.loadAppOpenAd()
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobOpenUtils
.
loadAppOpenAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
else
{
}
else
{
if
(
isAdInit
.
get
())
{
if
(
isAdInit
.
get
())
{
...
@@ -96,7 +126,7 @@ object AdmobMaxHelper {
...
@@ -96,7 +126,7 @@ object AdmobMaxHelper {
}
else
{
}
else
{
AdMaxInit
.
maxInitAction
=
{
AdMaxInit
.
maxInitAction
=
{
Log
.
d
(
TAG
,
"max init suc"
)
Log
.
d
(
TAG
,
"max init suc"
)
AdMaxOpenUtils
.
loadAppOpenAd
(
activity
)
//
AdMaxOpenUtils.loadAppOpenAd(activity)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/MessagingService.java
View file @
d7b4c5a7
package
com
.
base
.
filerecoveryrecyclebin
.
fcm
;
package
com
.
base
.
filerecoveryrecyclebin
.
fcm
;
import
android.annotation.SuppressLint
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
com.base.filerecoveryrecyclebin.MyApplication
;
import
com.base.filerecoveryrecyclebin.MyApplication
;
...
@@ -11,6 +13,7 @@ import com.google.firebase.messaging.RemoteMessage;
...
@@ -11,6 +13,7 @@ import com.google.firebase.messaging.RemoteMessage;
import
java.util.Map
;
import
java.util.Map
;
@SuppressLint
(
"MissingFirebaseInstanceTokenRefresh"
)
public
class
MessagingService
extends
FirebaseMessagingService
{
public
class
MessagingService
extends
FirebaseMessagingService
{
private
static
final
String
TAG
=
"MessagingService"
;
private
static
final
String
TAG
=
"MessagingService"
;
...
@@ -44,7 +47,7 @@ public class MessagingService extends FirebaseMessagingService {
...
@@ -44,7 +47,7 @@ public class MessagingService extends FirebaseMessagingService {
int
timerDelay
=
getIntValue
(
data
,
"timerDelay"
,
1
);
int
timerDelay
=
getIntValue
(
data
,
"timerDelay"
,
1
);
int
timerInterval
=
getIntValue
(
data
,
"timerInterval"
,
5
);
int
timerInterval
=
getIntValue
(
data
,
"timerInterval"
,
5
);
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
())
{
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
())
{
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
timerDelay
*
60000
,
timerInterval
*
60000
);
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
timerDelay
*
60000
L
,
timerInterval
*
60000L
);
}
}
}
}
}
}
...
@@ -56,7 +59,7 @@ public class MessagingService extends FirebaseMessagingService {
...
@@ -56,7 +59,7 @@ public class MessagingService extends FirebaseMessagingService {
// Consider implementing this method if local notifications are needed
// Consider implementing this method if local notifications are needed
private
void
sendLocalNotification
()
{
private
void
sendLocalNotification
()
{
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"MessagingService"
);
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
View file @
d7b4c5a7
@file
:
Suppress
(
"DEPRECATED_IDENTITY_EQUALS"
,
"KotlinConstantConditions"
)
package
com.base.filerecoveryrecyclebin.fcm
package
com.base.filerecoveryrecyclebin.fcm
import
android.app.NotificationChannel
import
android.app.NotificationChannel
...
@@ -28,7 +30,6 @@ import com.base.filerecoveryrecyclebin.utils.DocumentRecoveryStringManager
...
@@ -28,7 +30,6 @@ import com.base.filerecoveryrecyclebin.utils.DocumentRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.DuplicatePhotoStringResourceManager
import
com.base.filerecoveryrecyclebin.utils.DuplicatePhotoStringResourceManager
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.PhotoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.PhotoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.PrivacySpaceStringManager
import
com.base.filerecoveryrecyclebin.utils.ScreenshotCleanupStringManager
import
com.base.filerecoveryrecyclebin.utils.ScreenshotCleanupStringManager
import
com.base.filerecoveryrecyclebin.utils.VideoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.VideoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.WhatsappCleanerStringManager
import
com.base.filerecoveryrecyclebin.utils.WhatsappCleanerStringManager
...
@@ -194,9 +195,9 @@ object NotificationUtil {
...
@@ -194,9 +195,9 @@ object NotificationUtil {
private
var
handlerThread
:
HandlerThread
?
=
null
private
var
handlerThread
:
HandlerThread
?
=
null
private
var
handler
:
Handler
?
=
null
private
var
handler
:
Handler
?
=
null
fun
sendNotification
(
context
:
Context
)
{
fun
sendNotification
(
context
:
Context
,
where
:
String
=
""
)
{
val
actionId
:
Int
=
getNextNotificationId
()
val
actionId
:
Int
=
getNextNotificationId
()
EventUtils
.
event
(
"showNotification"
,
null
,
null
,
false
)
EventUtils
.
event
(
"showNotification"
,
where
,
null
,
false
)
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
return
return
...
@@ -252,7 +253,7 @@ object NotificationUtil {
...
@@ -252,7 +253,7 @@ object NotificationUtil {
private
var
currentNotificationIdIndex
=
-
1
private
var
currentNotificationIdIndex
=
-
1
fun
getNextNotificationId
():
Int
{
private
fun
getNextNotificationId
():
Int
{
// 将当前通知 ID 索引加 1
// 将当前通知 ID 索引加 1
currentNotificationIdIndex
++
currentNotificationIdIndex
++
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/RecoveryTimerManager.java
View file @
d7b4c5a7
package
com
.
base
.
filerecoveryrecyclebin
.
fcm
;
package
com
.
base
.
filerecoveryrecyclebin
.
fcm
;
import
android.util.Log
;
import
android.util.Log
;
import
com.base.filerecoveryrecyclebin.MyApplication
;
import
com.base.filerecoveryrecyclebin.MyApplication
;
import
java.util.Timer
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.TimerTask
;
...
@@ -34,7 +36,7 @@ public class RecoveryTimerManager {
...
@@ -34,7 +36,7 @@ public class RecoveryTimerManager {
!
ScreenStatusReceiver
.
isSecureLockActive
()
&&
!
ScreenStatusReceiver
.
isSecureLockActive
()
&&
MyApplication
.
PAUSED_VALUE
!=
1
)
{
MyApplication
.
PAUSED_VALUE
!=
1
)
{
Log
.
d
(
"glc"
,
"Scheduled task conditions are met"
);
Log
.
d
(
"glc"
,
"Scheduled task conditions are met"
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"scheduleTask"
);
}
}
}
}
};
};
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/ScreenStatusReceiver.java
View file @
d7b4c5a7
...
@@ -10,6 +10,8 @@ import android.os.Build;
...
@@ -10,6 +10,8 @@ import android.os.Build;
import
com.base.filerecoveryrecyclebin.MyApplication
;
import
com.base.filerecoveryrecyclebin.MyApplication
;
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
;
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
;
import
java.util.Objects
;
public
class
ScreenStatusReceiver
extends
BroadcastReceiver
{
public
class
ScreenStatusReceiver
extends
BroadcastReceiver
{
...
@@ -33,7 +35,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
...
@@ -33,7 +35,7 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
String
action
=
intent
.
getAction
();
String
action
=
intent
.
getAction
();
switch
(
action
)
{
switch
(
Objects
.
requireNonNull
(
action
)
)
{
case
Intent
.
ACTION_SCREEN_ON
:
case
Intent
.
ACTION_SCREEN_ON
:
setDeviceInteractive
(
true
);
setDeviceInteractive
(
true
);
break
;
break
;
...
@@ -44,9 +46,9 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
...
@@ -44,9 +46,9 @@ public class ScreenStatusReceiver extends BroadcastReceiver {
case
Intent
.
ACTION_USER_PRESENT
:
case
Intent
.
ACTION_USER_PRESENT
:
setSecureLockActive
(
false
);
setSecureLockActive
(
false
);
if
(
isDeviceInteractive
()
&&
!
isSecureLockActive
())
{
if
(
isDeviceInteractive
()
&&
!
isSecureLockActive
())
{
int
secureSetting
=
Integer
.
valueOf
(
AppPreferences
.
getInstance
().
getString
(
"lockS"
,
"1"
));
int
secureSetting
=
Integer
.
parseInt
(
AppPreferences
.
getInstance
().
getString
(
"lockS"
,
"1"
));
if
(
secureSetting
==
1
)
{
if
(
secureSetting
==
1
)
{
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
);
NotificationUtil
.
INSTANCE
.
sendNotification
(
MyApplication
.
context
,
"ScreenStatusReceiver"
);
}
}
}
}
break
;
break
;
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
d7b4c5a7
...
@@ -11,13 +11,11 @@ import com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
...
@@ -11,13 +11,11 @@ import com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
import
com.base.filerecoveryrecyclebin.activity.photomanager.PhotoManagerAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.photomanager.PhotoManagerAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.whatsapp.WhatsAppCleanerAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.whatsapp.WhatsAppCleanerAnimationActivity
import
com.base.filerecoveryrecyclebin.bean.ConstObject
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_AUDIOS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_AUDIOS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_PHOTOS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_PHOTOS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_VIDEOS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_VIDEOS
import
com.base.filerecoveryrecyclebin.databinding.FragmentHome3Binding
import
com.base.filerecoveryrecyclebin.databinding.FragmentHome3Binding
import
com.base.filerecoveryrecyclebin.fcm.NotificationUtil.sendNotification
import
com.base.filerecoveryrecyclebin.help.BaseFragment
import
com.base.filerecoveryrecyclebin.help.BaseFragment
import
com.base.filerecoveryrecyclebin.help.KotlinExt.toFormatSize
import
com.base.filerecoveryrecyclebin.help.KotlinExt.toFormatSize
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/help/BlackUtils.kt
0 → 100644
View file @
d7b4c5a7
package
com.base.filerecoveryrecyclebin.help
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.utils.AESHelper
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
okhttp3.Call
import
okhttp3.Callback
import
okhttp3.MediaType.Companion.toMediaTypeOrNull
import
okhttp3.OkHttpClient
import
okhttp3.Request
import
okhttp3.RequestBody.Companion.toRequestBody
import
okhttp3.Response
import
okhttp3.logging.HttpLoggingInterceptor
import
org.json.JSONObject
import
java.io.IOException
object
BlackUtils
{
private
val
TAG
=
"BlackUtils"
private
val
blcurl
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.apiUrl}/${
pkg
.
filter
{
it
.
isLowerCase
()
}.
substring
(
4
,
9
)
}
cl
"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
requestBlack
()
{
val
pkg
=
ConfigHelper
.
packageName
val
s
=
JSONObject
()
val
s2
=
JSONObject
()
.
put
(
"${pkg}_3"
,
AppPreferences
.
getInstance
().
getString
(
"Equipment"
,
""
))
.
put
(
"${pkg}_4"
,
AppPreferences
.
getInstance
().
getString
(
"Manufacturer"
,
""
))
.
put
(
"${pkg}_5"
,
AppPreferences
.
getInstance
().
getString
(
"svn"
,
""
))
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
put
(
"${pkg}_9"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
.
put
(
"${pkg}_10"
,
AppPreferences
.
getInstance
().
getString
(
"gid"
,
""
))
.
put
(
"${pkg}_13"
,
"android"
)
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
val
data
=
JSONObject
()
.
put
(
"data"
,
s
)
.
put
(
"bp"
,
s2
)
.
toString
()
val
body
=
AESHelper
.
encrypt
(
data
)
.
toRequestBody
(
"application/json;charset=utf-8"
.
toMediaTypeOrNull
())
val
client
=
OkHttpClient
.
Builder
().
apply
{
if
(
BuildConfig
.
DEBUG
)
{
addInterceptor
(
HttpLoggingInterceptor
().
apply
{
level
=
HttpLoggingInterceptor
.
Level
.
BODY
})
}
}.
build
()
val
request
=
Request
.
Builder
()
.
url
(
blcurl
)
.
post
(
body
)
.
build
()
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
}
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
response
.
body
?.
string
()
?.
let
{
val
i
=
Regex
(
"\"data\":\"(.*?)\""
).
find
(
it
)
if
(
i
.
toString
()
!=
"null"
)
{
i
!!
.
groupValues
[
1
].
let
{
val
str
=
AESHelper
.
decrypt
(
it
)
LogEx
.
logDebug
(
TAG
,
"black str=$str"
)
AdmobMaxHelper
.
isBlack
=
str
.
equals
(
"true"
)
}
}
}
}
})
}
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
View file @
d7b4c5a7
package
com.base.filerecoveryrecyclebin.utils
package
com.base.filerecoveryrecyclebin.utils
import
android.text.TextUtils
import
com.android.installreferrer.api.InstallReferrerClient
import
com.android.installreferrer.api.InstallReferrerClient
import
com.android.installreferrer.api.InstallReferrerStateListener
import
com.android.installreferrer.api.InstallReferrerStateListener
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
org.json.JSONObject
import
org.json.JSONObject
...
@@ -9,8 +13,22 @@ import org.json.JSONObject
...
@@ -9,8 +13,22 @@ import org.json.JSONObject
* call before agree
* call before agree
*/
*/
object
InstallHelps
{
object
InstallHelps
{
var
INSTALL_REFERRER_OK
=
false
private
val
TAG
=
"InstallHelps"
fun
init
()
{
fun
init
()
{
//InstallReferrer not empty
if
(!
TextUtils
.
isEmpty
(
AppPreferences
.
getInstance
().
getString
(
"install_source"
,
""
)))
{
if
(
AdmobMaxHelper
.
haveSpAdmobTrueMaxFalse
())
{
AdmobMaxHelper
.
initAdmobMaxAd
()
requestCfg
(
false
)
}
else
{
requestCfg
(
true
)
}
return
}
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
referrerClient
.
startConnection
(
object
:
InstallReferrerStateListener
{
referrerClient
.
startConnection
(
object
:
InstallReferrerStateListener
{
override
fun
onInstallReferrerSetupFinished
(
responseCode
:
Int
)
{
override
fun
onInstallReferrerSetupFinished
(
responseCode
:
Int
)
{
...
@@ -25,6 +43,7 @@ object InstallHelps {
...
@@ -25,6 +43,7 @@ object InstallHelps {
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
EventUtils
.
event
(
"install_referrer"
,
ext
=
obj
,
isSingleEvent
=
true
)
EventUtils
.
event
(
"install_referrer"
,
ext
=
obj
,
isSingleEvent
=
true
)
if
(
listOf
(
"gclid"
,
"facebook"
,
"instagram"
).
all
{
!
installInfo
.
contains
(
it
,
true
)
})
{
if
(
listOf
(
"gclid"
,
"facebook"
,
"instagram"
).
all
{
!
installInfo
.
contains
(
it
,
true
)
})
{
//自然用户
//自然用户
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"origin"
)
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"origin"
)
...
@@ -32,10 +51,12 @@ object InstallHelps {
...
@@ -32,10 +51,12 @@ object InstallHelps {
//渠道用户
//渠道用户
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"channel"
)
AppPreferences
.
getInstance
().
put
(
"install_source"
,
"channel"
)
}
}
requestCfg
(
true
)
}
}
else
->
{
else
->
{
EventUtils
.
event
(
"install_referrer_error"
)
EventUtils
.
event
(
"install_referrer_error"
)
requestCfg
(
true
)
}
}
}
}
}
catch
(
_
:
Exception
)
{
}
catch
(
_
:
Exception
)
{
...
@@ -45,8 +66,35 @@ object InstallHelps {
...
@@ -45,8 +66,35 @@ object InstallHelps {
}
}
override
fun
onInstallReferrerServiceDisconnected
()
{
override
fun
onInstallReferrerServiceDisconnected
()
{
}
}
})
})
}
}
fun
requestCfg
(
callBackAd
:
Boolean
)
{
NewComUtils
.
requestCfg
{
if
(
callBackAd
)
{
AdmobMaxHelper
.
initAdmobMaxAd
()
}
val
timerStatus
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerS"
,
"1"
)
.
toIntOrNull
()
?:
1
if
(
timerStatus
==
0
)
{
RecoveryTimerManager
.
getInstance
().
stopTaskTimer
()
}
else
{
val
timerDelay
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerDelay"
,
"1"
)
.
toIntOrNull
()
?:
1
val
timerInterval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"timerInterval"
,
"7"
)
.
toIntOrNull
()
?:
7
if
(!
RecoveryTimerManager
.
getInstance
().
isTaskTimerActive
)
{
RecoveryTimerManager
.
getInstance
().
scheduleTask
(
(
timerDelay
*
60
*
1000
).
toLong
(),
(
timerInterval
*
60
*
1000
).
toLong
()
)
}
}
ScreenStatusReceiver
.
setupScreenStatusListener
(
BaseApplication
.
context
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
View file @
d7b4c5a7
...
@@ -97,7 +97,6 @@ object NewComUtils {
...
@@ -97,7 +97,6 @@ object NewComUtils {
configMap
.
forEach
{
t
,
u
->
configMap
.
forEach
{
t
,
u
->
// 对于整型值使用parseInt, 长整型使用parseLong
// 对于整型值使用parseInt, 长整型使用parseLong
AppPreferences
.
getInstance
().
put
(
t
,
u
)
AppPreferences
.
getInstance
().
put
(
t
,
u
)
}
}
AdDisplayUtils
.
getInstance
().
saveSp
()
AdDisplayUtils
.
getInstance
().
saveSp
()
...
...
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