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
9bc2e765
Commit
9bc2e765
authored
Jul 16, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
1c879217
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
3 deletions
+37
-3
MyApplication.kt
app/src/main/java/com/base/datarecovery/MyApplication.kt
+30
-0
EventUtils.kt
app/src/main/java/com/base/datarecovery/utils/EventUtils.kt
+3
-2
ReportUtils.java
...rc/main/java/com/base/datarecovery/utils/ReportUtils.java
+4
-1
No files found.
app/src/main/java/com/base/datarecovery/MyApplication.kt
View file @
9bc2e765
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import
android.app.Activity
import
android.app.Activity
import
android.content.Intent
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
com.base.datarecovery.activity.SplashActivity
import
com.base.datarecovery.activity.SplashActivity
import
com.base.datarecovery.ads.AdmobOpenUtils
import
com.base.datarecovery.ads.AdmobOpenUtils
import
com.base.datarecovery.bean.ConstObject.ifAgreePrivacy
import
com.base.datarecovery.bean.ConstObject.ifAgreePrivacy
...
@@ -18,10 +19,17 @@ import com.base.datarecovery.utils.InstallHelps
...
@@ -18,10 +19,17 @@ import com.base.datarecovery.utils.InstallHelps
import
com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.utils.NewComUtils
import
com.base.datarecovery.utils.NewComUtils
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.async
import
kotlinx.coroutines.launch
import
java.util.UUID
class
MyApplication
:
BaseApplication
()
{
class
MyApplication
:
BaseApplication
()
{
private
val
TAG
=
"MyApplication"
private
val
TAG
=
"MyApplication"
var
uuid
=
""
companion
object
{
companion
object
{
@JvmField
@JvmField
...
@@ -30,8 +38,19 @@ class MyApplication : BaseApplication() {
...
@@ -30,8 +38,19 @@ class MyApplication : BaseApplication() {
override
fun
init
()
{
override
fun
init
()
{
initApp
()
initApp
()
initUUid
()
}
}
private
fun
initUUid
()
{
uuid
=
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)
if
(
TextUtils
.
isEmpty
(
uuid
))
{
uuid
=
UUID
.
randomUUID
().
toString
()
+
System
.
currentTimeMillis
()
AppPreferences
.
getInstance
().
put
(
"uuid"
,
uuid
)
AppPreferences
.
getInstance
().
put
(
"install_info"
,
uuid
)
}
}
fun
initApp
()
{
fun
initApp
()
{
val
topic
=
ConfigHelper
.
packageName
+
"_push"
val
topic
=
ConfigHelper
.
packageName
+
"_push"
FCMManager
.
initFirebase
(
this
)
FCMManager
.
initFirebase
(
this
)
...
@@ -57,6 +76,17 @@ class MyApplication : BaseApplication() {
...
@@ -57,6 +76,17 @@ class MyApplication : BaseApplication() {
InstallHelps
.
init
()
InstallHelps
.
init
()
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
}
}
MainScope
().
launch
(
Dispatchers
.
Main
)
{
val
deferred
=
async
(
Dispatchers
.
IO
)
{
try
{
AdvertisingIdClient
.
getAdvertisingIdInfo
(
context
).
id
}
catch
(
_
:
Exception
)
{
"unknown"
}
}
val
gid
=
deferred
.
await
()
?:
""
AppPreferences
.
getInstance
().
put
(
"gid"
,
gid
)
}
}
}
initLifeListener
()
initLifeListener
()
}
}
...
...
app/src/main/java/com/base/datarecovery/utils/EventUtils.kt
View file @
9bc2e765
...
@@ -9,7 +9,7 @@ import org.json.JSONException
...
@@ -9,7 +9,7 @@ import org.json.JSONException
import
org.json.JSONObject
import
org.json.JSONObject
object
EventUtils
{
object
EventUtils
{
private
val
TAG
=
"EventUtils"
fun
event
(
fun
event
(
key
:
String
,
key
:
String
,
value
:
String
?
=
null
,
value
:
String
?
=
null
,
...
@@ -52,11 +52,12 @@ object EventUtils {
...
@@ -52,11 +52,12 @@ object EventUtils {
.
put
(
"data"
,
s
)
.
put
(
"data"
,
s
)
.
put
(
"bp"
,
s2
)
.
put
(
"bp"
,
s2
)
.
toString
()
.
toString
()
LogEx
.
logDebug
(
TAG
,
"data=${AppPreferences.getInstance().getString("
uuid
", "")}"
)
parmJson
=
AESHelper
.
encrypt
(
data
)
parmJson
=
AESHelper
.
encrypt
(
data
)
}
catch
(
e
:
JSONException
)
{
}
catch
(
e
:
JSONException
)
{
parmJson
=
""
parmJson
=
""
}
}
LogEx
.
logDebug
(
TAG
,
"report!"
)
doPost
(
doPost
(
url
,
url
,
HashMap
(),
HashMap
(),
...
...
app/src/main/java/com/base/datarecovery/utils/ReportUtils.java
View file @
9bc2e765
...
@@ -9,6 +9,7 @@ import java.net.URL;
...
@@ -9,6 +9,7 @@ import java.net.URL;
import
java.util.Map
;
import
java.util.Map
;
public
class
ReportUtils
{
public
class
ReportUtils
{
private
static
String
TAG
=
"ReportUtils"
;
public
static
String
doPost
(
String
urlPath
,
Map
<
String
,
String
>
paramsMap
,
String
json
)
{
public
static
String
doPost
(
String
urlPath
,
Map
<
String
,
String
>
paramsMap
,
String
json
)
{
try
{
try
{
...
@@ -39,10 +40,12 @@ public class ReportUtils {
...
@@ -39,10 +40,12 @@ public class ReportUtils {
}
else
{
}
else
{
s
=
""
;
s
=
""
;
}
}
LogEx
.
INSTANCE
.
logDebug
(
TAG
,
"code=200"
,
false
);
return
s
;
return
s
;
}
else
{
}
else
{
LogEx
.
INSTANCE
.
logDebug
(
TAG
,
"code!=200"
,
false
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
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