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
5d65020d
Commit
5d65020d
authored
Jul 25, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
08e6c416
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
1 deletion
+108
-1
build.gradle
app/build.gradle
+2
-0
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+25
-1
BlackUtils.kt
app/src/main/java/com/base/datarecovery/help/BlackUtils.kt
+81
-0
No files found.
app/build.gradle
View file @
5d65020d
...
@@ -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/datarecovery/ads/AdmobMaxHelper.kt
View file @
5d65020d
...
@@ -19,6 +19,8 @@ import com.google.android.gms.ads.MobileAds
...
@@ -19,6 +19,8 @@ import com.google.android.gms.ads.MobileAds
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
object
AdmobMaxHelper
{
object
AdmobMaxHelper
{
var
isBlack
:
Boolean
=
false
private
val
TAG
=
""
private
val
TAG
=
""
var
isAdInit
=
AtomicBoolean
(
false
)
var
isAdInit
=
AtomicBoolean
(
false
)
...
@@ -32,6 +34,11 @@ object AdmobMaxHelper {
...
@@ -32,6 +34,11 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
onHidden
?.
invoke
()
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
()
onHidden
?.
invoke
()
...
@@ -44,6 +51,11 @@ object AdmobMaxHelper {
...
@@ -44,6 +51,11 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
isBlack
)
{
onHidden
?.
invoke
()
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
onHidden
?.
invoke
()
onHidden
?.
invoke
()
...
@@ -56,6 +68,10 @@ object AdmobMaxHelper {
...
@@ -56,6 +68,10 @@ object AdmobMaxHelper {
}
}
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
else
{
}
else
{
...
@@ -75,11 +91,15 @@ object AdmobMaxHelper {
...
@@ -75,11 +91,15 @@ object AdmobMaxHelper {
return
ss
==
1
return
ss
==
1
}
}
fun
haveSpAdmobTrueMaxFalse
():
Boolean
{
fun
haveSpAdmobTrueMaxFalse
():
Boolean
{
return
AppPreferences
.
getInstance
().
getInt
(
"admobTrueMaxFalse"
,
-
1
)
!=
-
1
return
AppPreferences
.
getInstance
().
getInt
(
"admobTrueMaxFalse"
,
-
1
)
!=
-
1
}
}
fun
initAdmobMaxAd
(
activity
:
Activity
?
=
null
)
{
fun
initAdmobMaxAd
(
activity
:
Activity
?
=
null
)
{
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
())
{
if
(
getSpAdmobTrueMaxFalse
())
{
if
(!
isAdInit
.
get
())
{
if
(!
isAdInit
.
get
())
{
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
...
@@ -94,6 +114,10 @@ object AdmobMaxHelper {
...
@@ -94,6 +114,10 @@ object AdmobMaxHelper {
}
}
fun
preloadAd
(
activity
:
Activity
)
{
fun
preloadAd
(
activity
:
Activity
)
{
if
(
isBlack
)
{
return
}
if
(
ConfigHelper
.
admobTrueMaxFalse
)
{
if
(
ConfigHelper
.
admobTrueMaxFalse
)
{
AdmobOpenUtils
.
loadAppOpenAd
()
AdmobOpenUtils
.
loadAppOpenAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
...
...
app/src/main/java/com/base/datarecovery/help/BlackUtils.kt
0 → 100644
View file @
5d65020d
package
com.base.datarecovery.help
import
com.base.datarecovery.BuildConfig
import
com.base.datarecovery.ads.AdmobMaxHelper
import
com.base.datarecovery.utils.AESHelper
import
com.base.datarecovery.utils.AppPreferences
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
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
)
AdmobMaxHelper
.
isBlack
=
str
.
equals
(
"true"
)
}
}
}
}
})
}
}
\ 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