Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy File Manager 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 File Manager Junk
Commits
e537abad
Commit
e537abad
authored
Jun 21, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步代码
parent
ad8c266f
Pipeline
#1179
canceled with stages
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
19 deletions
+87
-19
build.gradle
app/build.gradle
+1
-1
MyApplication.kt
app/src/main/java/com/base/easyfilemanager/MyApplication.kt
+1
-0
NetWorkActivity.kt
...java/com/base/easyfilemanager/activity/NetWorkActivity.kt
+1
-0
NewMainActivity.kt
...com/base/easyfilemanager/activity/home/NewMainActivity.kt
+19
-0
NewSplashActivity.kt
...base/easyfilemanager/activity/splash/NewSplashActivity.kt
+7
-1
CloseNotificationReceiver.kt
...base/easyfilemanager/display/CloseNotificationReceiver.kt
+9
-1
NotificationHelper.kt
...va/com/base/easyfilemanager/display/NotificationHelper.kt
+6
-8
NotificationUtils.kt
...ava/com/base/easyfilemanager/display/NotificationUtils.kt
+34
-6
MyFirebaseMessagingService.kt
...easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
+1
-1
activity_layout_network.xml
app/src/main/res/layout/activity_layout_network.xml
+8
-1
No files found.
app/build.gradle
View file @
e537abad
...
...
@@ -21,7 +21,7 @@ android {
abiFilters
'arm64-v8a'
,
'armeabi-v7a'
,
'x86'
,
'x86_64'
}
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
setProperty
(
"archivesBaseName"
,
"easy
junkclean
er-v${versionName}"
)
setProperty
(
"archivesBaseName"
,
"easy
filemanag
er-v${versionName}"
)
}
signingConfigs
{
...
...
app/src/main/java/com/base/easyfilemanager/MyApplication.kt
View file @
e537abad
...
...
@@ -26,6 +26,7 @@ class MyApplication : BaseApplication() {
companion
object
{
var
PAUSED_VALUE
=
0
var
isDeleteNotification
=
false
}
var
uuid
=
""
...
...
app/src/main/java/com/base/easyfilemanager/activity/NetWorkActivity.kt
View file @
e537abad
...
...
@@ -105,6 +105,7 @@ class NetWorkActivity : BaseActivity<ActivityLayoutNetworkBinding>() {
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
AdmobUtils
.
showNativeAd
(
this
,
binding
.
idFlAd
)
binding
.
idTvThisMonth
.
isSelected
=
true
playLottie
()
}
...
...
app/src/main/java/com/base/easyfilemanager/activity/home/NewMainActivity.kt
View file @
e537abad
...
...
@@ -12,11 +12,13 @@ import com.base.easyfilemanager.fragment.FileCategoryFragment
import
com.base.easyfilemanager.fragment.HomeFragment
import
com.base.easyfilemanager.fragment.ToolsFragment
import
com.base.easyfilemanager.helps.BaseActivity
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.view.RateStarPop
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
org.json.JSONObject
class
NewMainActivity
:
BaseActivity
<
ActivityMainBinding
>()
{
...
...
@@ -76,6 +78,7 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOWNLOADS
).
listFiles
()
?.
map
{
it
.
absolutePath
}
?.
toTypedArray
()
)
testEvent
()
}
private
fun
setPage
(
p
:
Int
)
{
...
...
@@ -114,4 +117,20 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
RateStarPop
.
show
(
this
@NewMainActivity
)
}
}
fun
testEvent
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
EventHelper
.
event
(
"click_start_to_use"
)
EventHelper
.
event
(
"install_referrer"
)
EventHelper
.
event
(
"ad_pull_start"
)
EventHelper
.
event
(
"ad_prepare_show"
)
EventHelper
.
event
(
"notification_jump"
)
EventHelper
.
event
(
"ad_pull"
)
EventHelper
.
event
(
"ad_show"
)
EventHelper
.
event
(
"ad_click"
)
EventHelper
.
event
(
"bigimage_ad_click"
)
EventHelper
.
event
(
"bigimage_ad_show"
)
EventHelper
.
event
(
"ad_price"
)
EventHelper
.
event
(
"fcm_receiver"
)
EventHelper
.
event
(
"fcm_message_received"
)
}
}
app/src/main/java/com/base/easyfilemanager/activity/splash/NewSplashActivity.kt
View file @
e537abad
...
...
@@ -18,6 +18,7 @@ import com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.LogEx
import
com.base.easyfilemanager.helps.ads.AdmobUtils
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.utils.SPUtils
@SuppressLint
(
"CustomSplashScreen"
)
class
NewSplashActivity
:
BaseActivity
<
ActivityLayoutSplashBinding
>(),
...
...
@@ -146,7 +147,12 @@ class NewSplashActivity : BaseActivity<ActivityLayoutSplashBinding>(),
if
(
jumpType
!=
0
)
{
val
cancelIntent
=
Intent
(
this
,
CloseNotificationReceiver
::
class
.
java
)
cancelIntent
.
action
=
CloseNotificationReceiver
.
action
cancelIntent
.
putExtra
(
"notificationId"
,
NotificationHelper
.
notificationId
)
val
actionS
=
SPUtils
.
getInstance
().
getInt
(
"notification_actionS"
,
0
)
if
(
actionS
==
1
){
cancelIntent
.
putExtra
(
"notificationId"
,
jumpType
)
}
else
{
cancelIntent
.
putExtra
(
"notificationId"
,
NotificationHelper
.
notificationId
)
}
sendBroadcast
(
cancelIntent
)
}
}
...
...
app/src/main/java/com/base/easyfilemanager/display/CloseNotificationReceiver.kt
View file @
e537abad
...
...
@@ -4,6 +4,8 @@ import android.app.NotificationManager
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.text.TextUtils
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.helps.LogEx
...
...
@@ -21,8 +23,14 @@ class CloseNotificationReceiver : BroadcastReceiver() {
LogEx
.
logDebug
(
TAG
,
"notificationId=$notificationId action=$action"
)
if
(
notificationId
!=
-
1
&&
it
.
action
!=
"DELETE_NOTIFICATION"
)
{
val
notificationManager
=
context
?.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
?
NotificationManager
MyApplication
.
isDeleteNotification
=
true
val
notificationManager
=
context
?.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)
as
?
NotificationManager
notificationManager
?.
cancel
(
NotificationUtils
.
NOTIFICATION_TAG
,
notificationId
)
}
else
if
(
TextUtils
.
equals
(
it
.
action
,
"DELETE_NOTIFICATION"
))
{
MyApplication
.
isDeleteNotification
=
true
}
else
{
}
}
}
...
...
app/src/main/java/com/base/easyfilemanager/display/NotificationHelper.kt
View file @
e537abad
...
...
@@ -117,7 +117,7 @@ object NotificationHelper {
* @param extra 额外参数
*/
@SuppressLint
(
"RemoteViewLayout"
)
fun
Context
.
postActionNotification
(
actionId
:
Int
,
extra
:
Int
?
=
null
,
pushStayTime
:
Long
?
=
null
)
{
fun
Context
.
postActionNotification
(
actionId
:
Int
,
extra
:
Int
?
=
null
,
pushStayTime
:
Long
?
=
null
,
actionS
:
Int
)
{
val
remoteViews
=
RemoteViews
(
packageName
,
R
.
layout
.
notification_common_notify
)
when
(
actionId
)
{
ID_JUNK_CLEAN_PUSH
->
{
...
...
@@ -173,7 +173,8 @@ object NotificationHelper {
remoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
"Detected lots of screenshots? Free up your storage space now!"
)
remoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
"Clean up"
)
}
ID_BATTERY_PUSH
->{
ID_BATTERY_PUSH
->
{
}
//==================================下面是被动推送的情况===============================================
...
...
@@ -222,13 +223,10 @@ object NotificationHelper {
val
requestCode
=
Random
.
nextInt
(
0
,
1000
)
val
pendingIntent
=
PendingIntent
.
getActivity
(
applicationContext
,
requestCode
,
intent
,
FLAG_UPDATE_CURRENT
or
FLAG_MUTABLE
)
val
nId
=
if
(
actionS
==
1
)
actionId
else
notificationId
NotificationUtils
.
showNotification
(
applicationContext
,
notificationId
,
remoteViews
,
R
.
id
.
fl_cancel
,
pendingIntent
,
pushStayTime
?:
0
applicationContext
,
nId
,
remoteViews
,
R
.
id
.
fl_cancel
,
pendingIntent
,
pushStayTime
?:
0
)
}
...
...
app/src/main/java/com/base/easyfilemanager/display/NotificationUtils.kt
View file @
e537abad
...
...
@@ -9,11 +9,14 @@ import android.content.ComponentName
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
android.os.Handler
import
android.os.HandlerThread
import
android.service.notification.StatusBarNotification
import
android.util.Log
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationManagerCompat
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.R
import
com.base.easyfilemanager.activity.AppManagerActivity
import
com.base.easyfilemanager.activity.BatteryInfoActivity
...
...
@@ -24,6 +27,7 @@ import com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.helps.KotlinExt.string
import
com.base.easyfilemanager.service.FlashlightService
import
com.base.easyfilemanager.utils.SPUtils
object
NotificationUtils
{
...
...
@@ -179,7 +183,12 @@ object NotificationUtils {
return
notification
}
fun
sendTimerPush
(
s
:
Long
)
{
fun
sendTimerPush
()
{
val
open
=
SPUtils
.
getInstance
().
getInt
(
"notification_open"
,
0
)
val
num
=
SPUtils
.
getInstance
().
getInt
(
"notification_num"
,
0
)
val
delay
=
SPUtils
.
getInstance
().
getLong
(
"notification_delay"
,
0
)
val
s
=
SPUtils
.
getInstance
().
getLong
(
"notification_push_stay_time"
,
0
)
val
actionS
=
SPUtils
.
getInstance
().
getInt
(
"notification_actionS"
,
0
)
Log
.
d
(
TAG
,
"sendTimerPush"
)
val
id
=
NotificationHelper
.
getPresentPushId
()
val
isPush
=
PushStrategy
.
isPush
(
id
)
...
...
@@ -187,11 +196,30 @@ object NotificationUtils {
Log
.
d
(
TAG
,
log
)
EventHelper
.
event
(
"pushCircleOrder_isPush"
,
log
)
if
(
isPush
)
{
// var extra: Int? = null
// if (id == ID_PHONE_ACCELERATE) {
// extra = RamMemoryEx.getMemoryUsage(BaseApplication.context).toInt()
// }
BaseApplication
.
context
.
postActionNotification
(
id
,
null
,
s
)
BaseApplication
.
context
.
postActionNotification
(
id
,
null
,
s
,
actionS
)
if
(
open
==
1
)
{
val
handlerThread
=
HandlerThread
(
"MyHandlerThread"
)
handlerThread
.
start
()
val
handler
=
Handler
(
handlerThread
.
looper
)
for
(
i
in
1
..
num
)
{
val
time
=
i
*
delay
handler
.
postDelayed
({
if
(
MyApplication
.
PAUSED_VALUE
==
1
||
MyApplication
.
isDeleteNotification
)
{
handler
.
removeCallbacksAndMessages
(
null
)
MyApplication
.
isDeleteNotification
=
false
return
@postDelayed
}
if
(
MyApplication
.
PAUSED_VALUE
!=
1
&&
!
MyApplication
.
isDeleteNotification
)
{
Log
.
d
(
"glc"
,
"发推送"
)
BaseApplication
.
context
.
postActionNotification
(
id
,
null
,
s
,
actionS
)
}
else
{
}
},
time
)
}
}
}
}
...
...
app/src/main/java/com/base/easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
View file @
e537abad
...
...
@@ -15,7 +15,7 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
Log
.
d
(
TAG
,
"onMessageReceived: "
+
remoteMessage
.
from
)
val
pushStayTime
=
remoteMessage
.
data
[
"push_stay_time"
]
?.
toLongOrNull
()
?:
0
EventHelper
.
event
(
"fcm_message_received"
,
pushStayTime
.
toString
())
NotificationUtils
.
sendTimerPush
(
pushStayTime
)
NotificationUtils
.
sendTimerPush
()
// FcmHelper.startFCMCheckAlarm(this)
...
...
app/src/main/res/layout/activity_layout_network.xml
View file @
e537abad
...
...
@@ -93,9 +93,10 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id=
"@+id/id_coord_layout"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0dp
"
android:layout_marginTop=
"15dp"
android:background=
"@color/white"
app:layout_constraintBottom_toTopOf=
"@id/id_fl_ad"
app:layout_constraintTop_toBottomOf=
"@+id/id_ll_top_option"
>
<com.google.android.material.appbar.AppBarLayout
...
...
@@ -285,4 +286,10 @@
</LinearLayout>
<FrameLayout
android:id=
"@+id/id_fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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