Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
29c9560c
Commit
29c9560c
authored
Aug 06, 2024
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步配置接口,增加垃圾清理页面广告
parent
28a83394
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
20 deletions
+55
-20
CleanJunkActivity.kt
...ecoveryrecyclebin/activity/junkclean/CleanJunkActivity.kt
+35
-11
InstallHelps.kt
...ava/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
+5
-1
NewComUtils.kt
...java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
+15
-8
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/activity/junkclean/CleanJunkActivity.kt
View file @
29c9560c
...
...
@@ -8,7 +8,6 @@ import android.view.View
import
androidx.activity.OnBackPressedCallback
import
androidx.core.view.isVisible
import
androidx.lifecycle.lifecycleScope
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.activity.ResultActivity
import
com.base.filerecoveryrecyclebin.activity.photomanager.PhotoManagerAnimationActivity
...
...
@@ -108,13 +107,26 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
when
(
binding
.
tvBtn
.
text
)
{
"Got it"
->
{
if
(){
AdmobMaxHelper
.
admobMaxShowInterstitialAd
(
this
,
false
){
startActivity
(
Intent
(
this
@CleanJunkActivity
,
ResultActivity
::
class
.
java
).
apply
{
putExtra
(
"clean_size"
,
JUNK_CLEANER
)
putExtra
(
"from"
,
0
)
})
}
}
else
{
startActivity
(
Intent
(
this
@CleanJunkActivity
,
ResultActivity
::
class
.
java
).
apply
{
putExtra
(
"clean_size"
,
JUNK_CLEANER
)
putExtra
(
"from"
,
0
)
})
}
}
else
->
{
if
(){
AdmobMaxHelper
.
admobMaxShowInterstitialAd
(
this
,
false
){
startActivity
(
Intent
(
this
,
CleaningActivity
::
class
.
java
).
apply
{
val
list
=
junkExpandAdapter
.
getChoosePath
()
...
...
@@ -122,6 +134,18 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
putExtra
(
"size"
,
list
.
sumOf
{
it
.
childSize
})
}
)
}
}
else
{
startActivity
(
Intent
(
this
,
CleaningActivity
::
class
.
java
).
apply
{
val
list
=
junkExpandAdapter
.
getChoosePath
()
putExtra
(
"list"
,
list
.
map
{
it
.
chilepath
}.
toTypedArray
())
putExtra
(
"size"
,
list
.
sumOf
{
it
.
childSize
})
}
)
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
View file @
29c9560c
...
...
@@ -2,6 +2,7 @@ package com.base.filerecoveryrecyclebin.utils
import
android.os.Build
import
android.text.TextUtils
import
androidx.annotation.RequiresApi
import
com.android.installreferrer.api.InstallReferrerClient
import
com.android.installreferrer.api.InstallReferrerStateListener
import
com.base.filerecoveryrecyclebin.BuildConfig
...
...
@@ -18,6 +19,7 @@ object InstallHelps {
private
val
TAG
=
"InstallHelps"
@RequiresApi
(
Build
.
VERSION_CODES
.
O
)
fun
init
()
{
//InstallReferrer not empty
if
(!
TextUtils
.
isEmpty
(
AppPreferences
.
getInstance
().
getString
(
"install_source"
,
""
)))
{
...
...
@@ -33,6 +35,7 @@ object InstallHelps {
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
referrerClient
.
startConnection
(
object
:
InstallReferrerStateListener
{
@RequiresApi
(
Build
.
VERSION_CODES
.
O
)
override
fun
onInstallReferrerSetupFinished
(
responseCode
:
Int
)
{
try
{
when
(
responseCode
)
{
...
...
@@ -45,7 +48,7 @@ object InstallHelps {
obj
.
put
(
"appInstallTime"
,
response
.
installBeginTimestampSeconds
)
obj
.
put
(
"instantExperienceLaunched"
,
installInfo
.
toString
())
EventUtils
.
event
(
"install_referrer"
,
ext
=
obj
,
isSingleEvent
=
true
)
AppPreferences
.
getInstance
().
put
(
"referrer"
,
response
.
installReferrer
)
if
(
listOf
(
"gclid"
,
"facebook"
,
"instagram"
).
all
{
!
installInfo
.
contains
(
it
,
true
)
})
{
//自然用户
if
(
BuildConfig
.
DEBUG
){
...
...
@@ -76,6 +79,7 @@ object InstallHelps {
})
}
@RequiresApi
(
Build
.
VERSION_CODES
.
O
)
fun
requestCfg
(
callBackAd
:
Boolean
)
{
NewComUtils
.
requestCfg
{
if
(
callBackAd
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/NewComUtils.kt
View file @
29c9560c
package
com.base.filerecoveryrecyclebin.utils
import
android.os.Build
import
android.util.Log
import
androidx.annotation.RequiresApi
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.bean.ConfigBean
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
...
...
@@ -14,8 +17,10 @@ import java.io.BufferedReader
import
java.io.InputStreamReader
import
java.net.HttpURLConnection
import
java.net.URL
import
java.util.Base64
import
java.util.Locale
@RequiresApi
(
Build
.
VERSION_CODES
.
O
)
object
NewComUtils
{
private
const
val
API_URL
=
ConfigHelper
.
apiUrl
private
const
val
PACKAGE_NAME_PREFIX
=
ConfigHelper
.
packageName
...
...
@@ -26,15 +31,17 @@ object NewComUtils {
private
val
url
:
String
by
lazy
{
val
packageName
=
ConfigHelper
.
packageName
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
"$API_URL/${appCode}spk?pkg=$packageName&source=channel"
val
bRefer
=
Base64
.
getEncoder
().
encodeToString
(
AppPreferences
.
getInstance
().
getString
(
"referrer"
,
""
).
toByteArray
())
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}"
}
//origin user = only pick &source=origin
private
fun
getOriginUrl
():
String
{
val
packageName
=
ConfigHelper
.
packageName
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
return
"$API_URL/${appCode}spk?pkg=$packageName&source=origin"
}
//
private fun getOriginUrl(): String {
//
val packageName = ConfigHelper.packageName
//
val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault())
//
return "$API_URL/${appCode}spk?pkg=$packageName&source=origin"
//
}
fun
requestCfg
(
callback
:
(
ConfigBean
?)
->
Unit
)
{
CoroutineScope
(
Dispatchers
.
IO
).
launch
{
...
...
@@ -63,8 +70,8 @@ object NewComUtils {
}
private
fun
doGet
():
String
?
{
val
originFlag
=
AppPreferences
.
getInstance
().
getString
(
"install_source"
,
""
)
==
"origin"
val
urlPath
=
if
(
originFlag
)
getOriginUrl
()
else
url
//
val originFlag = AppPreferences.getInstance().getString("install_source", "") == "origin"
val
urlPath
=
url
Log
.
d
(
"okhttp"
,
urlPath
)
try
{
val
conn
:
HttpURLConnection
=
URL
(
urlPath
).
openConnection
()
as
HttpURLConnection
...
...
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