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
12a63913
Commit
12a63913
authored
Jun 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
干掉所有上报
parent
8ba8ed6f
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
6 additions
and
3151 deletions
+6
-3151
NewMainActivity.kt
...com/base/easyfilemanager/activity/home/NewMainActivity.kt
+0
-17
PrivacyAgreementManager.kt
...asyfilemanager/activity/splash/PrivacyAgreementManager.kt
+0
-2
SplashJumpUtils.kt
...m/base/easyfilemanager/activity/splash/SplashJumpUtils.kt
+0
-2
CloseNotificationReceiver.kt
...base/easyfilemanager/display/CloseNotificationReceiver.kt
+0
-3
NotificationHelper.kt
...va/com/base/easyfilemanager/display/NotificationHelper.kt
+0
-5
NotificationUtils.kt
...ava/com/base/easyfilemanager/display/NotificationUtils.kt
+0
-2
FcmHelper.kt
...in/java/com/base/easyfilemanager/display/fcm/FcmHelper.kt
+0
-5
MyFirebaseMessagingReceiver.kt
...asyfilemanager/display/fcm/MyFirebaseMessagingReceiver.kt
+0
-2
MyFirebaseMessagingService.kt
...easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
+0
-2
BaseActivity.kt
.../main/java/com/base/easyfilemanager/helps/BaseActivity.kt
+2
-4
ComUtils.kt
app/src/main/java/com/base/easyfilemanager/helps/ComUtils.kt
+0
-1
EventHelper.kt
...c/main/java/com/base/easyfilemanager/helps/EventHelper.kt
+0
-118
InstallHelps.kt
.../main/java/com/base/easyfilemanager/helps/InstallHelps.kt
+0
-3
KotlinExt.kt
...src/main/java/com/base/easyfilemanager/helps/KotlinExt.kt
+0
-1
AdmobUtils.kt
...ain/java/com/base/easyfilemanager/helps/ads/AdmobUtils.kt
+4
-36
mapping.json
mapping.json
+0
-2948
No files found.
app/src/main/java/com/base/easyfilemanager/activity/home/NewMainActivity.kt
View file @
12a63913
...
@@ -12,13 +12,11 @@ import com.base.easyfilemanager.fragment.FileCategoryFragment
...
@@ -12,13 +12,11 @@ import com.base.easyfilemanager.fragment.FileCategoryFragment
import
com.base.easyfilemanager.fragment.HomeFragment
import
com.base.easyfilemanager.fragment.HomeFragment
import
com.base.easyfilemanager.fragment.ToolsFragment
import
com.base.easyfilemanager.fragment.ToolsFragment
import
com.base.easyfilemanager.helps.BaseActivity
import
com.base.easyfilemanager.helps.BaseActivity
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.view.RateStarPop
import
com.base.easyfilemanager.view.RateStarPop
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
import
org.json.JSONObject
class
NewMainActivity
:
BaseActivity
<
ActivityMainBinding
>()
{
class
NewMainActivity
:
BaseActivity
<
ActivityMainBinding
>()
{
...
@@ -118,19 +116,4 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -118,19 +116,4 @@ class NewMainActivity : BaseActivity<ActivityMainBinding>() {
}
}
}
}
// 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/PrivacyAgreementManager.kt
View file @
12a63913
...
@@ -9,7 +9,6 @@ import android.text.style.UnderlineSpan
...
@@ -9,7 +9,6 @@ import android.text.style.UnderlineSpan
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.databinding.ActivityLayoutSplashBinding
import
com.base.easyfilemanager.databinding.ActivityLayoutSplashBinding
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.EventHelper
class
PrivacyAgreementManager
{
class
PrivacyAgreementManager
{
...
@@ -56,7 +55,6 @@ class PrivacyAgreementManager {
...
@@ -56,7 +55,6 @@ class PrivacyAgreementManager {
clicked
=
true
clicked
=
true
ConfigHelper
.
ifAgreePrivacy
=
true
ConfigHelper
.
ifAgreePrivacy
=
true
(
context
.
application
as
MyApplication
).
initApp
()
(
context
.
application
as
MyApplication
).
initApp
()
EventHelper
.
event
(
"click_start_to_use"
)
listener
.
onAgreePrivacy
()
listener
.
onAgreePrivacy
()
}
}
}
}
...
...
app/src/main/java/com/base/easyfilemanager/activity/splash/SplashJumpUtils.kt
View file @
12a63913
...
@@ -23,7 +23,6 @@ import com.base.easyfilemanager.bean.ConfigBean.Companion.ID_RECENT_USE_APP
...
@@ -23,7 +23,6 @@ import com.base.easyfilemanager.bean.ConfigBean.Companion.ID_RECENT_USE_APP
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.notificationclean.NotificationGuestActivity
import
com.base.easyfilemanager.notificationclean.NotificationGuestActivity
object
SplashJumpUtils
{
object
SplashJumpUtils
{
...
@@ -38,7 +37,6 @@ object SplashJumpUtils {
...
@@ -38,7 +37,6 @@ object SplashJumpUtils {
jumpType
=
str
.
toIntOrNull
()
?:
0
jumpType
=
str
.
toIntOrNull
()
?:
0
}
}
if
(
jumpType
!=
0
)
{
if
(
jumpType
!=
0
)
{
EventHelper
.
event
(
"notification_jump"
,
"jumpType=$jumpType"
)
}
}
when
(
jumpType
)
{
when
(
jumpType
)
{
//=================================主动广播=======================================
//=================================主动广播=======================================
...
...
app/src/main/java/com/base/easyfilemanager/display/CloseNotificationReceiver.kt
View file @
12a63913
...
@@ -6,7 +6,6 @@ import android.content.Context
...
@@ -6,7 +6,6 @@ import android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.text.TextUtils
import
android.text.TextUtils
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.MyApplication
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.helps.LogEx
import
com.base.easyfilemanager.helps.LogEx
class
CloseNotificationReceiver
:
BroadcastReceiver
()
{
class
CloseNotificationReceiver
:
BroadcastReceiver
()
{
...
@@ -15,10 +14,8 @@ class CloseNotificationReceiver : BroadcastReceiver() {
...
@@ -15,10 +14,8 @@ class CloseNotificationReceiver : BroadcastReceiver() {
LogEx
.
logDebug
(
TAG
,
"onReceive intent.action=${intent?.action}"
)
LogEx
.
logDebug
(
TAG
,
"onReceive intent.action=${intent?.action}"
)
//cancel事件,经过测试Intent.action这里无法传递参数
//cancel事件,经过测试Intent.action这里无法传递参数
if
(
intent
?.
action
==
null
)
{
if
(
intent
?.
action
==
null
)
{
EventHelper
.
event
(
"notification_cancel"
,
"use cancel notification!"
)
}
}
intent
?.
let
{
intent
?.
let
{
EventHelper
.
event
(
"notification_userCancel"
,
"userCancel=true"
)
val
notificationId
=
it
.
getIntExtra
(
"notificationId"
,
-
1
)
val
notificationId
=
it
.
getIntExtra
(
"notificationId"
,
-
1
)
LogEx
.
logDebug
(
TAG
,
"notificationId=$notificationId action=$action"
)
LogEx
.
logDebug
(
TAG
,
"notificationId=$notificationId action=$action"
)
...
...
app/src/main/java/com/base/easyfilemanager/display/NotificationHelper.kt
View file @
12a63913
...
@@ -28,7 +28,6 @@ import com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
...
@@ -28,7 +28,6 @@ import com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SCREENSHOT_CLEAN
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import
com.base.easyfilemanager.bean.ConfigBean.Companion.ID_SIMILAR_IMAGE
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.ComUtils
import
com.base.easyfilemanager.helps.ComUtils
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.SPUtils
import
com.base.easyfilemanager.utils.SPUtils
import
kotlin.random.Random
import
kotlin.random.Random
...
@@ -218,10 +217,6 @@ object NotificationHelper {
...
@@ -218,10 +217,6 @@ object NotificationHelper {
SPUtils
.
getInstance
().
put
(
actionId
.
toString
(),
System
.
currentTimeMillis
())
SPUtils
.
getInstance
().
put
(
actionId
.
toString
(),
System
.
currentTimeMillis
())
//大间隔所需值
//大间隔所需值
SPUtils
.
getInstance
().
put
(
"all_last_push_time"
,
System
.
currentTimeMillis
())
SPUtils
.
getInstance
().
put
(
"all_last_push_time"
,
System
.
currentTimeMillis
())
EventHelper
.
event
(
"pushCircleOrder_showNotification"
,
"actionId=$actionId"
)
val
requestCode
=
Random
.
nextInt
(
0
,
1000
)
val
requestCode
=
Random
.
nextInt
(
0
,
1000
)
val
pendingIntent
=
PendingIntent
.
getActivity
(
applicationContext
,
requestCode
,
intent
,
FLAG_UPDATE_CURRENT
or
FLAG_MUTABLE
)
val
pendingIntent
=
PendingIntent
.
getActivity
(
applicationContext
,
requestCode
,
intent
,
FLAG_UPDATE_CURRENT
or
FLAG_MUTABLE
)
...
...
app/src/main/java/com/base/easyfilemanager/display/NotificationUtils.kt
View file @
12a63913
...
@@ -24,7 +24,6 @@ import com.base.easyfilemanager.activity.ScanJunkActivity
...
@@ -24,7 +24,6 @@ import com.base.easyfilemanager.activity.ScanJunkActivity
import
com.base.easyfilemanager.activity.home.NewMainActivity
import
com.base.easyfilemanager.activity.home.NewMainActivity
import
com.base.easyfilemanager.display.NotificationHelper.postActionNotification
import
com.base.easyfilemanager.display.NotificationHelper.postActionNotification
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.helps.KotlinExt.string
import
com.base.easyfilemanager.helps.KotlinExt.string
import
com.base.easyfilemanager.service.FlashlightService
import
com.base.easyfilemanager.service.FlashlightService
import
com.base.easyfilemanager.utils.SPUtils
import
com.base.easyfilemanager.utils.SPUtils
...
@@ -194,7 +193,6 @@ object NotificationUtils {
...
@@ -194,7 +193,6 @@ object NotificationUtils {
val
isPush
=
PushStrategy
.
isPush
(
id
)
val
isPush
=
PushStrategy
.
isPush
(
id
)
val
log
=
"isPush=$isPush "
+
"id=${id} "
val
log
=
"isPush=$isPush "
+
"id=${id} "
Log
.
d
(
TAG
,
log
)
Log
.
d
(
TAG
,
log
)
EventHelper
.
event
(
"pushCircleOrder_isPush"
,
log
)
if
(
isPush
)
{
if
(
isPush
)
{
BaseApplication
.
context
.
postActionNotification
(
id
,
null
,
s
,
actionS
)
BaseApplication
.
context
.
postActionNotification
(
id
,
null
,
s
,
actionS
)
...
...
app/src/main/java/com/base/easyfilemanager/display/fcm/FcmHelper.kt
View file @
12a63913
...
@@ -4,7 +4,6 @@ import android.util.Log
...
@@ -4,7 +4,6 @@ import android.util.Log
import
com.google.android.gms.tasks.OnCompleteListener
import
com.google.android.gms.tasks.OnCompleteListener
import
com.google.android.gms.tasks.Task
import
com.google.android.gms.tasks.Task
import
com.google.firebase.messaging.FirebaseMessaging
import
com.google.firebase.messaging.FirebaseMessaging
import
com.base.easyfilemanager.helps.EventHelper
object
FcmHelper
{
object
FcmHelper
{
...
@@ -15,10 +14,8 @@ object FcmHelper {
...
@@ -15,10 +14,8 @@ object FcmHelper {
FirebaseMessaging
.
getInstance
().
subscribeToTopic
(
"news"
)
FirebaseMessaging
.
getInstance
().
subscribeToTopic
(
"news"
)
.
addOnCompleteListener
{
task
:
Task
<
Void
?
>
->
.
addOnCompleteListener
{
task
:
Task
<
Void
?
>
->
if
(
task
.
isSuccessful
)
{
if
(
task
.
isSuccessful
)
{
EventHelper
.
event
(
"fcm_subscribed_suc"
,
"news"
)
Log
.
d
(
TAG
,
"Subscribed to topic: TOPIC_NAME"
)
Log
.
d
(
TAG
,
"Subscribed to topic: TOPIC_NAME"
)
}
else
{
}
else
{
EventHelper
.
event
(
"fcm_subscribed_fail"
)
Log
.
e
(
TAG
,
"Failed to subscribe to topic: TOPIC_NAME"
,
task
.
exception
)
Log
.
e
(
TAG
,
"Failed to subscribe to topic: TOPIC_NAME"
,
task
.
exception
)
}
}
}
}
...
@@ -30,13 +27,11 @@ object FcmHelper {
...
@@ -30,13 +27,11 @@ object FcmHelper {
FirebaseMessaging
.
getInstance
().
token
FirebaseMessaging
.
getInstance
().
token
.
addOnCompleteListener
(
OnCompleteListener
{
task
->
.
addOnCompleteListener
(
OnCompleteListener
{
task
->
if
(!
task
.
isSuccessful
)
{
if
(!
task
.
isSuccessful
)
{
EventHelper
.
event
(
"fcm_token_fail"
)
Log
.
w
(
TAG
,
"Fetching FCM registration token failed"
,
task
.
exception
)
Log
.
w
(
TAG
,
"Fetching FCM registration token failed"
,
task
.
exception
)
return
@OnCompleteListener
return
@OnCompleteListener
}
}
// Get new FCM registration token
// Get new FCM registration token
val
token
=
task
?.
result
?:
""
val
token
=
task
?.
result
?:
""
EventHelper
.
event
(
"fcm_token_suc"
,
token
)
Log
.
d
(
TAG
,
"token: $token"
)
Log
.
d
(
TAG
,
"token: $token"
)
})
})
}
}
...
...
app/src/main/java/com/base/easyfilemanager/display/fcm/MyFirebaseMessagingReceiver.kt
View file @
12a63913
...
@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver
...
@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.util.Log
import
android.util.Log
import
com.base.easyfilemanager.helps.EventHelper
class
MyFirebaseMessagingReceiver
:
BroadcastReceiver
()
{
class
MyFirebaseMessagingReceiver
:
BroadcastReceiver
()
{
...
@@ -13,7 +12,6 @@ class MyFirebaseMessagingReceiver : BroadcastReceiver() {
...
@@ -13,7 +12,6 @@ class MyFirebaseMessagingReceiver : BroadcastReceiver() {
val
message
=
intent
.
extras
?.
getString
(
"message"
)
val
message
=
intent
.
extras
?.
getString
(
"message"
)
Log
.
d
(
TAG
,
"Received FCM message$message"
)
Log
.
d
(
TAG
,
"Received FCM message$message"
)
EventHelper
.
event
(
"fcm_receiver"
,
message
)
}
}
...
...
app/src/main/java/com/base/easyfilemanager/display/fcm/MyFirebaseMessagingService.kt
View file @
12a63913
...
@@ -7,7 +7,6 @@ import com.google.firebase.messaging.FirebaseMessagingService
...
@@ -7,7 +7,6 @@ import com.google.firebase.messaging.FirebaseMessagingService
import
com.google.firebase.messaging.RemoteMessage
import
com.google.firebase.messaging.RemoteMessage
import
com.base.easyfilemanager.display.NotificationService
import
com.base.easyfilemanager.display.NotificationService
import
com.base.easyfilemanager.display.NotificationUtils
import
com.base.easyfilemanager.display.NotificationUtils
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.SPUtils
import
com.base.easyfilemanager.utils.SPUtils
...
@@ -20,7 +19,6 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
...
@@ -20,7 +19,6 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
val
delay
=
remoteMessage
.
data
[
"delay"
]
?.
toLongOrNull
()
?:
0
val
delay
=
remoteMessage
.
data
[
"delay"
]
?.
toLongOrNull
()
?:
0
val
actionS
=
remoteMessage
.
data
[
"actionS"
]
?.
toIntOrNull
()
?:
0
val
actionS
=
remoteMessage
.
data
[
"actionS"
]
?.
toIntOrNull
()
?:
0
val
lockS
=
remoteMessage
.
data
[
"lockS"
]
?.
toIntOrNull
()
?:
0
val
lockS
=
remoteMessage
.
data
[
"lockS"
]
?.
toIntOrNull
()
?:
0
EventHelper
.
event
(
"fcm_message_received"
,
pushStayTime
.
toString
())
SPUtils
.
getInstance
().
put
(
"notification_open"
,
open
)
SPUtils
.
getInstance
().
put
(
"notification_open"
,
open
)
SPUtils
.
getInstance
().
put
(
"notification_num"
,
num
)
SPUtils
.
getInstance
().
put
(
"notification_num"
,
num
)
...
...
app/src/main/java/com/base/easyfilemanager/helps/BaseActivity.kt
View file @
12a63913
...
@@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity
...
@@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity
import
androidx.viewbinding.ViewBinding
import
androidx.viewbinding.ViewBinding
import
com.base.easyfilemanager.activity.PermissionTripActivity
import
com.base.easyfilemanager.activity.PermissionTripActivity
import
com.base.easyfilemanager.activity.home.NewMainActivity
import
com.base.easyfilemanager.activity.home.NewMainActivity
import
com.base.easyfilemanager.utils.ActivityManagerUtils
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.utils.BarUtils
import
com.base.easyfilemanager.utils.PermissionUtils.STORAGE
import
com.base.easyfilemanager.utils.PermissionUtils.STORAGE
import
com.base.easyfilemanager.view.DialogViews.showGerPermission
import
com.base.easyfilemanager.view.DialogViews.showGerPermission
...
@@ -35,8 +36,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
...
@@ -35,8 +36,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
BarUtils
.
setStatusBarLightMode
(
this
,
it
)
BarUtils
.
setStatusBarLightMode
(
this
,
it
)
}
}
EventHelper
.
event
(
"page_${javaClass.simpleName}"
)
ActivityManagerUtils
.
getInstance
().
addActivity
(
this
)
com
.
base
.
easyfilemanager
.
utils
.
ActivityManagerUtils
.
getInstance
().
addActivity
(
this
)
initView
()
initView
()
initListener
()
initListener
()
}
}
...
@@ -203,9 +203,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
...
@@ -203,9 +203,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"activity"
,
javaClass
.
simpleName
)
obj
.
put
(
"activity"
,
javaClass
.
simpleName
)
if
(
isGranted
)
{
if
(
isGranted
)
{
EventHelper
.
event
(
"permission_allow"
,
ext
=
obj
)
}
else
{
}
else
{
EventHelper
.
event
(
"permission_deny"
,
ext
=
obj
)
}
}
}
}
...
...
app/src/main/java/com/base/easyfilemanager/helps/ComUtils.kt
View file @
12a63913
...
@@ -55,7 +55,6 @@ object ComUtils {
...
@@ -55,7 +55,6 @@ object ComUtils {
.
build
()
.
build
()
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
EventHelper
.
event
(
"config_api_error"
,
value
=
e
.
toString
())
}
}
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
...
...
app/src/main/java/com/base/easyfilemanager/helps/EventHelper.kt
deleted
100644 → 0
View file @
8ba8ed6f
package
com.base.easyfilemanager.helps
import
android.util.Log
import
com.base.easyfilemanager.BuildConfig
import
com.base.easyfilemanager.helps.ConfigHelper.ifAgreePrivacy
import
com.base.easyfilemanager.utils.SPUtils
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
EventHelper
{
private
val
TAG
=
"EventHelper"
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.eventUrl}/${
pkg
.
filter
{
it
.
isLowerCase
()
}.
substring
(
4
,
9
)
}
sp
"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
event
(
key
:
String
,
value
:
String
?
=
null
,
ext
:
JSONObject
?
=
null
,
isSingleEvent
:
Boolean
=
false
)
{
if
(!
ifAgreePrivacy
)
{
Log
.
e
(
TAG
,
"ifAgreePrivacy=$ifAgreePrivacy"
)
return
}
val
filterKey
=
arrayOf
(
"click_start_to_use"
,
"install_referrer"
,
"ad_pull_start"
,
"ad_prepare_show"
,
"notification_jump"
,
"ad_pull"
,
"ad_show"
,
"ad_click"
,
"bigimage_ad_click"
,
"bigimage_ad_show"
,
"ad_price"
,
"fcm_receiver"
,
"fcm_message_received"
)
if
(!
filterKey
.
contains
(
key
))
{
return
}
if
(
isSingleEvent
)
{
val
stringSet
=
SPUtils
.
getInstance
().
getStringSet
(
"singleEvent"
)
if
(
stringSet
.
contains
(
key
))
{
return
}
}
val
pkg
=
ConfigHelper
.
packageName
val
s
=
JSONObject
()
.
put
(
"action"
,
key
)
.
put
(
"value"
,
value
)
.
put
(
"ext"
,
ext
)
val
s2
=
JSONObject
()
.
put
(
"${pkg}_3"
,
SPUtils
.
getInstance
().
getString
(
"Equipment"
))
.
put
(
"${pkg}_4"
,
SPUtils
.
getInstance
().
getString
(
"Manufacturer"
))
.
put
(
"${pkg}_5"
,
SPUtils
.
getInstance
().
getString
(
"svn"
))
.
put
(
"${pkg}_9"
,
SPUtils
.
getInstance
().
getString
(
"uuid"
))
.
put
(
"${pkg}_10"
,
SPUtils
.
getInstance
().
getString
(
"gid"
))
.
put
(
"${pkg}_13"
,
"android"
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
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
(
url
)
.
post
(
body
)
.
build
()
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
}
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
Log
.
d
(
"TAG"
,
"event: $key"
)
if
(
isSingleEvent
)
{
val
stringSet
=
SPUtils
.
getInstance
().
getStringSet
(
"singleEvent"
,
mutableSetOf
())
stringSet
.
add
(
key
)
SPUtils
.
getInstance
().
put
(
"singleEvent"
,
stringSet
)
}
}
})
}
}
\ No newline at end of file
app/src/main/java/com/base/easyfilemanager/helps/InstallHelps.kt
View file @
12a63913
...
@@ -19,15 +19,12 @@ object InstallHelps {
...
@@ -19,15 +19,12 @@ object InstallHelps {
obj
.
put
(
"referrerClickTime"
,
response
.
referrerClickTimestampSeconds
)
obj
.
put
(
"referrerClickTime"
,
response
.
referrerClickTimestampSeconds
)
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
EventHelper
.
event
(
"install_referrer"
,
ext
=
obj
)
}
}
else
->
{
else
->
{
EventHelper
.
event
(
"install_referrer_error"
)
}
}
}
}
}
catch
(
_
:
Exception
)
{
}
catch
(
_
:
Exception
)
{
EventHelper
.
event
(
"install_referrer_error"
)
}
}
}
}
...
...
app/src/main/java/com/base/easyfilemanager/helps/KotlinExt.kt
View file @
12a63913
...
@@ -42,7 +42,6 @@ object KotlinExt {
...
@@ -42,7 +42,6 @@ object KotlinExt {
try
{
try
{
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"view_id"
,
resources
.
getResourceEntryName
(
view
.
id
))
obj
.
put
(
"view_id"
,
resources
.
getResourceEntryName
(
view
.
id
))
EventHelper
.
event
(
"click_id"
,
ext
=
obj
)
break
break
}
catch
(
_
:
Exception
)
{
}
catch
(
_
:
Exception
)
{
view
=
view
.
parent
as
?
View
view
=
view
.
parent
as
?
View
...
...
app/src/main/java/com/base/easyfilemanager/helps/ads/AdmobUtils.kt
View file @
12a63913
...
@@ -29,7 +29,6 @@ import com.base.easyfilemanager.R
...
@@ -29,7 +29,6 @@ import com.base.easyfilemanager.R
import
com.base.easyfilemanager.activity.photocompress.photo.CustomDialog
import
com.base.easyfilemanager.activity.photocompress.photo.CustomDialog
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.BaseApplication
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.ConfigHelper
import
com.base.easyfilemanager.helps.EventHelper
import
com.base.easyfilemanager.utils.SPUtils
import
com.base.easyfilemanager.utils.SPUtils
import
org.json.JSONObject
import
org.json.JSONObject
import
java.util.Calendar
import
java.util.Calendar
...
@@ -140,7 +139,6 @@ object AdmobUtils {
...
@@ -140,7 +139,6 @@ object AdmobUtils {
fun
loadAppOpenAd
(
skip
:
Boolean
=
false
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
fun
loadAppOpenAd
(
skip
:
Boolean
=
false
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
onLoad
?.
invoke
()
onLoad
?.
invoke
()
return
return
}
}
...
@@ -153,7 +151,6 @@ object AdmobUtils {
...
@@ -153,7 +151,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"openAd"
)
obj
.
put
(
"ad_type"
,
"openAd"
)
EventHelper
.
event
(
"ad_pull_start"
,
ext
=
obj
)
AppOpenAd
.
load
(
AppOpenAd
.
load
(
BaseApplication
.
context
,
BaseApplication
.
context
,
ConfigHelper
.
openAdmobId
,
ConfigHelper
.
openAdmobId
,
...
@@ -183,7 +180,6 @@ object AdmobUtils {
...
@@ -183,7 +180,6 @@ object AdmobUtils {
fun
showAppOpenAd
(
activity
:
Activity
,
skip
:
Boolean
=
false
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
showAppOpenAd
(
activity
:
Activity
,
skip
:
Boolean
=
false
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
onHidden
?.
invoke
()
onHidden
?.
invoke
()
return
return
}
}
...
@@ -197,7 +193,6 @@ object AdmobUtils {
...
@@ -197,7 +193,6 @@ object AdmobUtils {
}
}
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventHelper
.
event
(
"ad_prepare_show"
,
ext
=
obj
)
// if (mOpenAd == null || skip) {
// if (mOpenAd == null || skip) {
// onHidden?.invoke()
// onHidden?.invoke()
// return
// return
...
@@ -208,7 +203,6 @@ object AdmobUtils {
...
@@ -208,7 +203,6 @@ object AdmobUtils {
onHidden
?.
invoke
()
onHidden
?.
invoke
()
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventHelper
.
event
(
"ad_expire"
,
ext
=
obj
)
return
return
}
}
if
(
mOpenAd
!=
null
)
{
if
(
mOpenAd
!=
null
)
{
...
@@ -233,7 +227,6 @@ object AdmobUtils {
...
@@ -233,7 +227,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"reason"
,
p0
.
message
)
obj
.
put
(
"reason"
,
p0
.
message
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventHelper
.
event
(
"ad_show_error"
,
ext
=
obj
)
}
}
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
...
@@ -247,7 +240,6 @@ object AdmobUtils {
...
@@ -247,7 +240,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventHelper
.
event
(
"ad_show_error"
,
ext
=
obj
)
}
}
}
}
...
@@ -257,20 +249,16 @@ object AdmobUtils {
...
@@ -257,20 +249,16 @@ object AdmobUtils {
fun
showNativeAd
(
activity
:
Activity
?,
parent
:
ViewGroup
)
{
fun
showNativeAd
(
activity
:
Activity
?,
parent
:
ViewGroup
)
{
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
return
return
}
}
// if (!AdUtils.isShowAd("native_slot")) {
// if (!AdUtils.isShowAd("native_slot")) {
// EventHelper.event("native_strategy_filter")
// return
// return
// }
// }
if
(
isAdLimit
(
true
))
{
if
(
isAdLimit
(
true
))
{
EventHelper
.
event
(
"native_is_limit"
)
return
return
}
}
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"NativeAd"
)
obj
.
put
(
"ad_unit"
,
"NativeAd"
)
EventHelper
.
event
(
"ad_prepare_show"
,
ext
=
obj
)
loadingListener
=
{
loadingListener
=
{
if
(
System
.
currentTimeMillis
()
-
nativeLoadTime
<=
1000
*
60
*
60
)
{
if
(
System
.
currentTimeMillis
()
-
nativeLoadTime
<=
1000
*
60
*
60
)
{
...
@@ -293,7 +281,6 @@ object AdmobUtils {
...
@@ -293,7 +281,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"ad_unit"
,
"nativeAd"
)
obj
.
put
(
"ad_unit"
,
"nativeAd"
)
EventHelper
.
event
(
"ad_show_error"
,
ext
=
obj
)
}
else
{
}
else
{
loadingListener
?.
invoke
()
loadingListener
?.
invoke
()
}
}
...
@@ -303,11 +290,9 @@ object AdmobUtils {
...
@@ -303,11 +290,9 @@ object AdmobUtils {
fun
loadNativeAd
()
{
fun
loadNativeAd
()
{
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
return
return
}
}
if
(
isAdLimit
())
{
if
(
isAdLimit
())
{
EventHelper
.
event
(
"native_limit"
)
return
return
}
}
if
(
nativeAd
!=
null
)
{
if
(
nativeAd
!=
null
)
{
...
@@ -323,7 +308,6 @@ object AdmobUtils {
...
@@ -323,7 +308,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"nativeAd"
)
obj
.
put
(
"ad_type"
,
"nativeAd"
)
EventHelper
.
event
(
"ad_pull_start"
,
ext
=
obj
)
val
adLoader
=
AdLoader
.
Builder
(
val
adLoader
=
AdLoader
.
Builder
(
BaseApplication
.
context
,
ConfigHelper
.
nativeAdmobId
BaseApplication
.
context
,
ConfigHelper
.
nativeAdmobId
...
@@ -355,12 +339,10 @@ object AdmobUtils {
...
@@ -355,12 +339,10 @@ object AdmobUtils {
fun
isInterLoaded
()
=
interAd
!=
null
fun
isInterLoaded
()
=
interAd
!=
null
fun
loadInterstitialAd
(
activity
:
Activity
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
fun
loadInterstitialAd
(
activity
:
Activity
,
onLoad
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
onLoad
?.
invoke
()
onLoad
?.
invoke
()
return
return
}
}
if
(
isAdLimit
())
{
if
(
isAdLimit
())
{
EventHelper
.
event
(
"inter_load_limit"
)
onLoad
?.
invoke
()
onLoad
?.
invoke
()
return
return
}
}
...
@@ -374,7 +356,6 @@ object AdmobUtils {
...
@@ -374,7 +356,6 @@ object AdmobUtils {
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"interAd"
)
obj
.
put
(
"ad_type"
,
"interAd"
)
obj
.
put
(
"from"
,
activity
.
javaClass
.
simpleName
)
obj
.
put
(
"from"
,
activity
.
javaClass
.
simpleName
)
EventHelper
.
event
(
"ad_pull_start"
,
ext
=
obj
)
InterstitialAd
.
load
(
InterstitialAd
.
load
(
activity
,
activity
,
...
@@ -415,20 +396,17 @@ object AdmobUtils {
...
@@ -415,20 +396,17 @@ object AdmobUtils {
return
return
}
}
if
(
isBlack
)
{
if
(
isBlack
)
{
EventHelper
.
event
(
"blacklist_filter"
)
onHidden
?.
invoke
()
onHidden
?.
invoke
()
return
return
}
}
if
(
isAdLimit
())
{
if
(
isAdLimit
())
{
EventHelper
.
event
(
"inter_limit_filter"
)
onHidden
?.
invoke
()
onHidden
?.
invoke
()
return
return
}
}
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
if
(
isASkip
)
{
if
(
isASkip
)
{
EventHelper
.
event
(
"ad_prepare_show"
,
ext
=
obj
)
}
}
if
(
skip
)
{
if
(
skip
)
{
...
@@ -439,7 +417,6 @@ object AdmobUtils {
...
@@ -439,7 +417,6 @@ object AdmobUtils {
interAd
=
null
interAd
=
null
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
EventHelper
.
event
(
"ad_expire"
,
ext
=
obj
)
loadInterstitialAd
(
activity
)
loadInterstitialAd
(
activity
)
onHidden
?.
invoke
()
onHidden
?.
invoke
()
return
return
...
@@ -466,7 +443,6 @@ object AdmobUtils {
...
@@ -466,7 +443,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"reason"
,
p0
.
message
)
obj
.
put
(
"reason"
,
p0
.
message
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
EventHelper
.
event
(
"ad_show_error"
,
ext
=
obj
)
}
}
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
...
@@ -482,7 +458,6 @@ object AdmobUtils {
...
@@ -482,7 +458,6 @@ object AdmobUtils {
loadInterstitialAd
(
activity
)
{
loadInterstitialAd
(
activity
)
{
if
(
isFirst
)
{
if
(
isFirst
)
{
EventHelper
.
event
(
"ad_reload_inter"
)
}
}
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
if
(
isASkip
)
{
if
(
isASkip
)
{
...
@@ -495,7 +470,6 @@ object AdmobUtils {
...
@@ -495,7 +470,6 @@ object AdmobUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"reason"
,
"no_ad"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
EventHelper
.
event
(
"ad_show_error"
,
ext
=
obj
)
if
(!
isASkip
)
{
if
(!
isASkip
)
{
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
onHidden
?.
invoke
()
onHidden
?.
invoke
()
...
@@ -533,7 +507,6 @@ object AdmobUtils {
...
@@ -533,7 +507,6 @@ object AdmobUtils {
obj
.
put
(
"errMsg"
,
error
)
obj
.
put
(
"errMsg"
,
error
)
obj
.
put
(
"status"
,
"2"
)
obj
.
put
(
"status"
,
"2"
)
}
}
EventHelper
.
event
(
"ad_pull"
,
ext
=
obj
)
}
}
private
fun
show
(
responseInfo
:
ResponseInfo
?,
adUnit
:
String
,
activity
:
Activity
?
=
null
)
{
private
fun
show
(
responseInfo
:
ResponseInfo
?,
adUnit
:
String
,
activity
:
Activity
?
=
null
)
{
...
@@ -551,10 +524,8 @@ object AdmobUtils {
...
@@ -551,10 +524,8 @@ object AdmobUtils {
obj
.
put
(
"credentials"
,
credentials
.
toString
())
obj
.
put
(
"credentials"
,
credentials
.
toString
())
obj
.
put
(
"session_id"
,
responseInfo
?.
responseId
)
obj
.
put
(
"session_id"
,
responseInfo
?.
responseId
)
obj
.
put
(
"from"
,
activity
?.
javaClass
?.
simpleName
)
obj
.
put
(
"from"
,
activity
?.
javaClass
?.
simpleName
)
if
(
adUnit
!=
"nativeAd"
){
if
(
adUnit
!=
"nativeAd"
)
{
EventHelper
.
event
(
"ad_show"
,
ext
=
obj
)
}
else
{
}
else
{
EventHelper
.
event
(
"bigimage_ad_show"
,
ext
=
obj
)
}
}
}
}
...
@@ -592,10 +563,8 @@ object AdmobUtils {
...
@@ -592,10 +563,8 @@ object AdmobUtils {
obj
.
put
(
"credentials"
,
credentials
.
toString
())
obj
.
put
(
"credentials"
,
credentials
.
toString
())
obj
.
put
(
"session_id"
,
responseInfo
?.
responseId
)
obj
.
put
(
"session_id"
,
responseInfo
?.
responseId
)
obj
.
put
(
"networkname"
,
responseInfo
?.
mediationAdapterClassName
)
obj
.
put
(
"networkname"
,
responseInfo
?.
mediationAdapterClassName
)
if
(
adUnit
!=
"nativeAd"
){
if
(
adUnit
!=
"nativeAd"
)
{
EventHelper
.
event
(
"ad_click"
,
ext
=
obj
)
}
else
{
}
else
{
EventHelper
.
event
(
"bigimage_ad_click"
,
ext
=
obj
)
}
}
}
}
...
@@ -740,7 +709,6 @@ object AdmobUtils {
...
@@ -740,7 +709,6 @@ object AdmobUtils {
obj
.
put
(
"session_id"
,
sessionId
)
obj
.
put
(
"session_id"
,
sessionId
)
}
}
}
}
EventHelper
.
event
(
"ad_price"
,
ext
=
obj
)
}
}
}
}
}
}
mapping.json
deleted
100644 → 0
View file @
8ba8ed6f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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