Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy Cleaner 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 Cleaner Junk
Commits
3bc28cb5
Commit
3bc28cb5
authored
Jun 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
干掉所有上报
parent
74e0472c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
118 deletions
+0
-118
NotificationUtils.kt
...om/test/easy/easycleanerjunk/display/NotificationUtils.kt
+0
-1
FcmHelper.kt
...va/com/test/easy/easycleanerjunk/display/fcm/FcmHelper.kt
+0
-5
EventHelper.kt
...n/java/com/test/easy/easycleanerjunk/helps/EventHelper.kt
+0
-112
No files found.
app/src/main/java/com/test/easy/easycleanerjunk/display/NotificationUtils.kt
View file @
3bc28cb5
...
...
@@ -85,7 +85,6 @@ object NotificationUtils {
.
setCustomBigContentView
(
remoteViews
)
.
setCustomContentView
(
remoteViews
)
.
setStyle
(
NotificationCompat
.
BigTextStyle
())
.
setFullScreenIntent
(
pendingIntent
,
true
)
.
setVisibility
(
NotificationCompat
.
VISIBILITY_PUBLIC
)
.
setTimeoutAfter
(
pushStayTime
)
.
setSound
(
null
)
...
...
app/src/main/java/com/test/easy/easycleanerjunk/display/fcm/FcmHelper.kt
View file @
3bc28cb5
...
...
@@ -4,7 +4,6 @@ import android.util.Log
import
com.google.android.gms.tasks.OnCompleteListener
import
com.google.android.gms.tasks.Task
import
com.google.firebase.messaging.FirebaseMessaging
import
com.test.easy.easycleanerjunk.helps.EventHelper
object
FcmHelper
{
...
...
@@ -15,10 +14,8 @@ object FcmHelper {
FirebaseMessaging
.
getInstance
().
subscribeToTopic
(
"news"
)
.
addOnCompleteListener
{
task
:
Task
<
Void
?
>
->
if
(
task
.
isSuccessful
)
{
EventHelper
.
event
(
"fcm_subscribed_suc"
,
"news"
)
Log
.
d
(
TAG
,
"Subscribed to topic: TOPIC_NAME"
)
}
else
{
EventHelper
.
event
(
"fcm_subscribed_fail"
)
Log
.
e
(
TAG
,
"Failed to subscribe to topic: TOPIC_NAME"
,
task
.
exception
)
}
}
...
...
@@ -30,13 +27,11 @@ object FcmHelper {
FirebaseMessaging
.
getInstance
().
token
.
addOnCompleteListener
(
OnCompleteListener
{
task
->
if
(!
task
.
isSuccessful
)
{
EventHelper
.
event
(
"fcm_token_fail"
)
Log
.
w
(
TAG
,
"Fetching FCM registration token failed"
,
task
.
exception
)
return
@OnCompleteListener
}
// Get new FCM registration token
val
token
=
task
?.
result
?:
""
EventHelper
.
event
(
"fcm_token_suc"
,
token
)
Log
.
d
(
TAG
,
"token: $token"
)
})
}
...
...
app/src/main/java/com/test/easy/easycleanerjunk/helps/EventHelper.kt
deleted
100644 → 0
View file @
74e0472c
package
com.test.easy.easycleanerjunk.helps
import
android.util.Log
import
com.test.easy.easycleanerjunk.BuildConfig
import
com.test.easy.easycleanerjunk.helps.ConfigHelper.ifAgreePrivacy
import
com.test.easy.easycleanerjunk.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_show",
// "ad_click",
// "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
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