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
c1d33939
Commit
c1d33939
authored
Mar 13, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
a351ba45
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
145 additions
and
67 deletions
+145
-67
GlobalConfig.kt
...main/java/com/base/filerecoveryrecyclebin/GlobalConfig.kt
+57
-0
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+14
-4
SettingActivity.kt
...m/base/filerecoveryrecyclebin/activity/SettingActivity.kt
+7
-5
PrivacyManager.kt
.../filerecoveryrecyclebin/activity/splash/PrivacyManager.kt
+2
-1
AdmobBannerColla.kt
...base/filerecoveryrecyclebin/ads/admob/AdmobBannerColla.kt
+2
-1
AdmobInterstitialUtils.kt
...ilerecoveryrecyclebin/ads/admob/AdmobInterstitialUtils.kt
+2
-2
AdmobNativeUtils.kt
...base/filerecoveryrecyclebin/ads/admob/AdmobNativeUtils.kt
+2
-2
AdmobOpenUtils.kt
...m/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
+3
-2
SolarEngineEvent.kt
...base/filerecoveryrecyclebin/ads/admob/SolarEngineEvent.kt
+4
-3
BlackUtils.kt
...n/java/com/base/filerecoveryrecyclebin/help/BlackUtils.kt
+4
-3
ConfigHelper.kt
...java/com/base/filerecoveryrecyclebin/help/ConfigHelper.kt
+17
-26
NewComUtils.kt
.../java/com/base/filerecoveryrecyclebin/help/NewComUtils.kt
+16
-8
WeatherUtils.kt
...java/com/base/filerecoveryrecyclebin/help/WeatherUtils.kt
+8
-5
EventUtils.kt
.../java/com/base/filerecoveryrecyclebin/utils/EventUtils.kt
+7
-5
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/GlobalConfig.kt
0 → 100644
View file @
c1d33939
package
com.base.filerecoveryrecyclebin
/**
*Create by SleepDog on 2024-12-24
*/
object
GlobalConfig
{
//包名
const
val
PACKAGE_NAME
=
"com.scan.barcode.deeplink"
// 域名
/**
* Url Event 上报接口
*/
const
val
URL_EVENT
=
"https://rp.gamexzonerk.xyz"
/**
* Url Api 业务接口
*/
const
val
URL_API
=
"https://api.gamexzonerk.xyz"
/**
* Url Privacy 隐私链接
*/
const
val
URL_PRIVACY
=
"https://sites.google.com/view/qrbarcodedd/qr"
/**
* Url Use 使用条款
*/
const
val
URL_USE
=
"https://sites.google.com/view/termsofscanqr/terms-of-scan-qr"
/**
* Key Aes 加密key
*/
const
val
KEY_AES
=
"o3yb8vzeptlki1ve"
/**
* Key solar 归因key
*/
const
val
KEY_SOLAR
=
""
// admob广告位id
inline
val
ID_ADMOB_APPLICATION
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544~3347511713"
else
"ca-app-pub-3940256099942544~3347511713"
inline
val
ID_ADMOB_INTER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/1033173712"
else
"ca-app-pub-3940256099942544/1033173712"
inline
val
ID_ADMOB_NATIVE
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/2247696110"
else
"ca-app-pub-3940256099942544/2247696110"
inline
val
ID_ADMOB_OPEN
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/9257395921"
else
"ca-app-pub-3940256099942544/9257395921"
inline
val
ID_ADMOB_BANNER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/9214589741"
else
"ca-app-pub-3940256099942544/9214589741"
inline
val
ID_ADMOB_REWARD
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ca-app-pub-3940256099942544/5224354917"
else
"ca-app-pub-3940256099942544/5224354917"
// max广告位id
inline
val
KEY_MAX
get
()
=
if
(
BuildConfig
.
DEBUG
)
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
else
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
inline
val
ID_MAX_INTER
get
()
=
if
(
BuildConfig
.
DEBUG
)
"3a9efc39d536ffe6"
else
"3a9efc39d536ffe6"
inline
val
ID_MAX_NATIVE
get
()
=
if
(
BuildConfig
.
DEBUG
)
"cc0cc5b36a2608ca"
else
"cc0cc5b36a2608ca"
inline
val
ID_MAX_OPEN
get
()
=
if
(
BuildConfig
.
DEBUG
)
"ad4efa4a0bc2a585"
else
"ad4efa4a0bc2a585"
inline
val
ID_MAX_BANNER
get
()
=
if
(
BuildConfig
.
DEBUG
)
""
else
""
inline
val
ID_MAX_REWARD
get
()
=
if
(
BuildConfig
.
DEBUG
)
""
else
""
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
c1d33939
...
...
@@ -13,7 +13,6 @@ import com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.ScreenStatusReceiver
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.help.BlackUtils
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.InstallHelps
import
com.base.filerecoveryrecyclebin.help.WeatherUtils
import
com.base.filerecoveryrecyclebin.service.StayJobService.Companion.startJob
...
...
@@ -72,7 +71,7 @@ class MyApplication : BaseApplication() {
FacebookSdk
.
sdkInitialize
(
applicationContext
)
// FacebookSdk.setIsDebugEnabled(true)
// FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS)
val
topic
=
ConfigHelper
.
packageName
+
"_push"
val
topic
=
GlobalConfig
.
PACKAGE_NAME
+
"_push"
LogEx
.
logDebug
(
TAG
,
"topic=${topic}"
)
FCMManager
.
initFirebase
(
this
)
FCMManager
.
subscribeToTopic
(
topic
)
...
...
@@ -134,7 +133,7 @@ class MyApplication : BaseApplication() {
var
flag
=
if
(
topActivity
==
null
)
{
true
}
else
{
ConfigHelper
.
noLoadingActivities
.
all
{
!
topActivity
.
localClassName
.
contains
(
it
,
true
)
}
noLoadingActivities
.
all
{
!
topActivity
.
localClassName
.
contains
(
it
,
true
)
}
}
if
(
activity
.
localClassName
.
contains
(
"AppLovinFullscreenActivity"
))
{
flag
=
false
...
...
@@ -198,7 +197,7 @@ class MyApplication : BaseApplication() {
})
}
private
fun
solarInit
(){
private
fun
solarInit
()
{
SolarEngineManager
.
getInstance
().
preInit
(
context
,
"413882174e882211"
)
val
config
=
SolarEngineConfig
.
Builder
()
// .logEnabled() //开启本地调试日志
...
...
@@ -225,4 +224,15 @@ class MyApplication : BaseApplication() {
}
}
}
val
noLoadingActivities
=
listOf
(
"full"
,
// 过滤全屏广告
"adActivity"
,
"AdActivity"
,
"AppLovinFullscreenActivity"
,
Splash2Activity
::
class
.
java
.
simpleName
// 返回前台时不跳转启动页的 activity
)
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SettingActivity.kt
View file @
c1d33939
...
...
@@ -7,6 +7,7 @@ import android.content.Intent
import
android.graphics.Color
import
android.net.Uri
import
androidx.activity.addCallback
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.bean.ConstObject.fcmNotification
import
com.base.filerecoveryrecyclebin.bean.ConstObject.stayNotification
import
com.base.filerecoveryrecyclebin.databinding.ActivitySettingBinding
...
...
@@ -34,7 +35,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
override
fun
initListener
()
{
onBackPressedDispatcher
.
addCallback
{
// copyText(this@SettingActivity, AppPreferences.getInstance().getString("token",""))
// copyText(this@SettingActivity, AppPreferences.getInstance().getString("token",""))
finishToMain
()
}
binding
.
flBack
.
setOnClickListener
{
...
...
@@ -55,7 +56,7 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
}
binding
.
switchFcmNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
fcmNotification
=
isChecked
val
topic
=
"${
ConfigHelper.packageName
}_push"
val
topic
=
"${
GlobalConfig.PACKAGE_NAME
}_push"
if
(
isChecked
)
{
subscribeToTopic
(
topic
)
}
else
{
...
...
@@ -66,18 +67,19 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding
.
llPrivacy
.
setOnClickListener
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
ConfigHelper
.
privacyPolicy
)
Uri
.
parse
(
GlobalConfig
.
URL_PRIVACY
)
)
startActivity
(
intent
)
// NotificationUtil.sendNotification(this, ConstObject.ID_WHEATHER)
// NotificationUtil.sendNotification(this, ConstObject.ID_WHEATHER)
}
binding
.
llScore
.
setOnClickListener
{
showRateStarPopDialog
(
mustShow
=
true
)
// NotificationUtil.sendNotification(this, ConstObject.ID_XINGZUO)
// NotificationUtil.sendNotification(this, ConstObject.ID_XINGZUO)
}
}
fun
copyText
(
context
:
Context
,
text
:
String
?)
{
val
clipboardManager
:
ClipboardManager
=
context
.
getSystemService
(
CLIPBOARD_SERVICE
)
as
ClipboardManager
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/splash/PrivacyManager.kt
View file @
c1d33939
...
...
@@ -6,6 +6,7 @@ import android.net.Uri
import
android.text.SpannableString
import
android.text.Spanned
import
android.text.style.UnderlineSpan
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.MyApplication
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.databinding.ActivitySplashBinding
...
...
@@ -48,7 +49,7 @@ class PrivacyManager {
binding
.
idTvPrivacyPolicy
.
setOnClickListener
{
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
ConfigHelper
.
privacyPolicy
)
Uri
.
parse
(
GlobalConfig
.
URL_PRIVACY
)
)
context
.
startActivity
(
intent
)
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobBannerColla.kt
View file @
c1d33939
...
...
@@ -8,6 +8,7 @@ import android.view.ViewGroup
import
android.view.ViewTreeObserver
import
androidx.core.view.children
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.LogEx
...
...
@@ -46,7 +47,7 @@ object AdmobBannerUtils {
val
screenPixelDensity
=
context
.
resources
.
displayMetrics
.
density
val
adWidth
=
(
parent
.
width
/
screenPixelDensity
).
toInt
()
val
adSize
=
AdSize
.
getCurrentOrientationAnchoredAdaptiveBannerAdSize
(
context
,
adWidth
)
adView
?.
adUnitId
=
if
(
BuildConfig
.
DEBUG
)
ConfigHelper
.
bannerAdmobIdTest
else
ConfigHelper
.
bannerAdmobId
adView
?.
adUnitId
=
GlobalConfig
.
ID_ADMOB_BANNER
adView
?.
setAdSize
(
adSize
)
loadCollapsibleBanner
(
parent
)
parent
.
viewTreeObserver
.
removeOnGlobalLayoutListener
(
listener
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobInterstitialUtils.kt
View file @
c1d33939
...
...
@@ -4,6 +4,7 @@ import android.app.Activity
import
android.app.Dialog
import
android.widget.Toast
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper.lastShowedOnHiddenTime
...
...
@@ -87,8 +88,7 @@ object AdmobInterstitialUtils {
obj
.
put
(
"from"
,
activity
.
javaClass
.
simpleName
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
InterstitialAd
.
load
(
activity
,
if
(
BuildConfig
.
DEBUG
)
ConfigHelper
.
interAdmobIdTest
else
ConfigHelper
.
interAdmobId
,
activity
,
GlobalConfig
.
ID_ADMOB_INTER
,
mRequest
,
object
:
InterstitialAdLoadCallback
()
{
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobNativeUtils.kt
View file @
c1d33939
...
...
@@ -4,6 +4,7 @@ import android.app.Activity
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobEvent.clickAd
...
...
@@ -49,8 +50,7 @@ object AdmobNativeUtils {
obj
.
put
(
"ad_type"
,
"nativeAd"
)
val
adLoader
=
AdLoader
.
Builder
(
BaseApplication
.
context
,
if
(
BuildConfig
.
DEBUG
)
ConfigHelper
.
nativeAdmobIdTest
else
ConfigHelper
.
nativeAdmobId
BaseApplication
.
context
,
GlobalConfig
.
ID_ADMOB_NATIVE
).
forNativeAd
{
nativeLoadTime
=
System
.
currentTimeMillis
()
nativeAd
=
it
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
View file @
c1d33939
...
...
@@ -2,6 +2,7 @@ package com.base.filerecoveryrecyclebin.ads.admob
import
android.app.Activity
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobEvent.clickAd
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobEvent.pullAd
...
...
@@ -43,7 +44,7 @@ object AdmobOpenUtils {
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
AppOpenAd
.
load
(
BaseApplication
.
context
,
if
(
BuildConfig
.
DEBUG
)
ConfigHelper
.
openAdmobIdTest
else
ConfigHelper
.
openAdmobId
,
GlobalConfig
.
ID_ADMOB_OPEN
,
mRequest
,
object
:
AppOpenAd
.
AppOpenAdLoadCallback
()
{
override
fun
onAdLoaded
(
ad
:
AppOpenAd
)
{
...
...
@@ -89,7 +90,7 @@ object AdmobOpenUtils {
EventUtils
.
event
(
"ad_expire"
,
ext
=
obj2
)
return
}
if
(!
isRetry
){
if
(!
isRetry
)
{
val
obj1
=
JSONObject
()
obj1
.
put
(
"ad_unit"
,
"openAd"
)
EventUtils
.
event
(
"ad_prepare_show"
,
ext
=
obj1
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/SolarEngineEvent.kt
View file @
c1d33939
package
com.base.filerecoveryrecyclebin.ads.admob
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.google.android.gms.ads.appopen.AppOpenAd
import
com.google.android.gms.ads.interstitial.InterstitialAd
...
...
@@ -36,7 +37,7 @@ object SolarEngineEvent {
// 0:其它
var
adType
=
-
1
//变现平台的应用 ID
var
adNetworkAppID
=
ConfigHelper
.
ID_ADMOB_APPLICATION
var
adNetworkAppID
=
GlobalConfig
.
ID_ADMOB_APPLICATION
//变现平台的变现广告位 ID
var
adNetworkADID
=
""
//广告 ecpm,单位:元(广告千次展现的变现收入,0或负值表示没传,单位为元)
...
...
@@ -57,7 +58,7 @@ object SolarEngineEvent {
is
NativeAd
->
{
adType
=
6
adNetworkADID
=
ConfigHelper
.
nativeAdmobId
adNetworkADID
=
GlobalConfig
.
ID_ADMOB_NATIVE
}
is
RewardedAd
->
{
...
...
@@ -67,7 +68,7 @@ object SolarEngineEvent {
else
->
{
//banner
adType
=
5
adNetworkADID
=
ConfigHelper
.
bannerAdmobId
adNetworkADID
=
GlobalConfig
.
ID_ADMOB_BANNER
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/help/BlackUtils.kt
View file @
c1d33939
...
...
@@ -2,6 +2,7 @@ package com.base.filerecoveryrecyclebin.help
import
android.os.Build
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.utils.AESHelper
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
...
...
@@ -22,9 +23,9 @@ object BlackUtils {
private
val
TAG
=
"BlackUtils"
private
val
blcurl
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
GlobalConfig
.
PACKAGE_NAME
val
url
=
StringBuilder
(
"${
ConfigHelper.apiUrl
}/${
"${
GlobalConfig.URL_API
}/${
pkg
.
filter
{
it
.
isLowerCase
()
}.
substring
(
4
,
9
)
}
cl
"
)
...
...
@@ -33,7 +34,7 @@ object BlackUtils {
}
fun
requestBlack
()
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
GlobalConfig
.
PACKAGE_NAME
val
s
=
JSONObject
()
val
s2
=
JSONObject
()
.
put
(
"${pkg}_3"
,
AppPreferences
.
getInstance
().
getString
(
"Equipment"
,
""
))
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/help/ConfigHelper.kt
View file @
c1d33939
...
...
@@ -5,45 +5,36 @@ import com.base.filerecoveryrecyclebin.activity.splash.Splash2Activity
object
ConfigHelper
{
const
val
privacyPolicy
=
"https://sites.google.com/view/dumpsterphoto-recovery/home"
//
const val privacyPolicy = "https://sites.google.com/view/dumpsterphoto-recovery/home"
// 域名
const
val
eventUrl
=
"https://rp.rocioxyn.xyz"
const
val
apiUrl
=
"https://api.rocioxyn.xyz"
//
const val eventUrl = "https://rp.rocioxyn.xyz"
//
const val apiUrl = "https://api.rocioxyn.xyz"
//admob test id
const
val
openAdmobIdTest
=
"/6499/example/app-open"
const
val
bannerAdmobIdTest
=
"ca-app-pub-3940256099942544/9214589741"
const
val
interAdmobIdTest
=
"ca-app-pub-3940256099942544/1033173712"
const
val
nativeAdmobIdTest
=
"ca-app-pub-3940256099942544/2247696110"
inline
val
ID_ADMOB_APPLICATION
get
()
=
"ca-app-pub-3940256099942544~3347511713"
//
const val openAdmobIdTest = "/6499/example/app-open"
//
const val bannerAdmobIdTest = "ca-app-pub-3940256099942544/9214589741"
//
const val interAdmobIdTest = "ca-app-pub-3940256099942544/1033173712"
//
const val nativeAdmobIdTest = "ca-app-pub-3940256099942544/2247696110"
//
inline val ID_ADMOB_APPLICATION get() = "ca-app-pub-3940256099942544~3347511713"
// admob广告id
const
val
interAdmobId
=
"ca-app-pub-3940256099942544/1033173712"
const
val
nativeAdmobId
=
"ca-app-pub-3940256099942544/2247696110"
const
val
openAdmobId
=
"ca-app-pub-3940256099942544/9257395921"
const
val
bannerAdmobId
=
"ca-app-pub-3940256099942544/9214589741"
//
const val interAdmobId = "ca-app-pub-3940256099942544/1033173712"
//
const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696110"
//
const val openAdmobId = "ca-app-pub-3940256099942544/9257395921"
//
const val bannerAdmobId = "ca-app-pub-3940256099942544/9214589741"
//max id
const
val
interAdMaxId
=
"b31e7f6d11ee659e"
const
val
nativeAdMaxId
=
"96e8fe78b0efc5d1"
const
val
openAdMaxId
=
"d1d943cdd3127c90"
const
val
bannerMaxId
=
"ca-app-pub-3940256099942544/9214589741"
//
const val interAdMaxId = "b31e7f6d11ee659e"
//
const val nativeAdMaxId = "96e8fe78b0efc5d1"
//
const val openAdMaxId = "d1d943cdd3127c90"
//
const val bannerMaxId = "ca-app-pub-3940256099942544/9214589741"
//一定展示大图广告
var
mustShowNativeAd
:
Boolean
=
false
// 正式包名
const
val
packageName
=
"com.baloota.photorecyclebin.awm.sp"
val
noLoadingActivities
=
listOf
(
"full"
,
// 过滤全屏广告
"adActivity"
,
"AdActivity"
,
"AppLovinFullscreenActivity"
,
Splash2Activity
::
class
.
java
.
simpleName
// 返回前台时不跳转启动页的 activity
)
// const val packageName = "com.baloota.photorecyclebin.awm.sp"
}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/help/NewComUtils.kt
View file @
c1d33939
...
...
@@ -2,6 +2,7 @@ package com.base.filerecoveryrecyclebin.help
import
android.util.Log
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import
com.base.filerecoveryrecyclebin.bean.ConfigBean
import
com.base.filerecoveryrecyclebin.utils.AESHelper
...
...
@@ -23,15 +24,17 @@ import java.net.URL
import
java.util.Locale
object
NewComUtils
{
private
val
TAG
=
"NewComUtils"
private
const
val
API_URL
=
ConfigHelper
.
apiUrl
private
const
val
PACKAGE_NAME_PREFIX
=
ConfigHelper
.
packageName
private
const
val
API_URL
=
GlobalConfig
.
URL_API
private
const
val
PACKAGE_NAME_PREFIX
=
GlobalConfig
.
PACKAGE_NAME
private
const
val
DATA_KEY
=
"data"
private
const
val
SUCCESS_KEY
=
"success"
private
const
val
ERROR_MSG_KEY
=
"errorMsg"
private
val
url
:
String
by
lazy
{
val
packageName
=
ConfigHelper
.
packageName
val
packageName
=
GlobalConfig
.
PACKAGE_NAME
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
val
bRefer
=
android
.
util
.
Base64
.
encodeToString
(
...
...
@@ -39,11 +42,16 @@ object NewComUtils {
android
.
util
.
Base64
.
DEFAULT
)
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences
.
getInstance
().
getString
(
"gid"
,
""
)
}&
aid
=
$
{
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)}
"
var
s
=
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences
.
getInstance
().
getString
(
"gid"
,
""
)
}&
aid
=
$
{
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)}
"
if
(
BuildConfig
.
DEBUG
)
{
s
=
"$s&mode=4"
}
s
}
//origin user = only pick &source=origin
...
...
@@ -54,7 +62,7 @@ object NewComUtils {
// }
fun
requestCfg
(
callback
:
(
ConfigBean
?)
->
Unit
)
{
MainScope
().
launch
(
CoroutineExceptionHandler
{
_
,
_
->
}
+
Dispatchers
.
IO
)
{
MainScope
().
launch
(
CoroutineExceptionHandler
{
_
,
_
->
}
+
Dispatchers
.
IO
)
{
val
response
=
doGet
()
if
(
response
==
null
)
{
withContext
(
Dispatchers
.
Main
)
{
...
...
@@ -116,7 +124,7 @@ object NewComUtils {
AppPreferences
.
getInstance
().
put
(
t
,
u
)
LogEx
.
logDebug
(
TAG
,
"t=$t u=$u"
)
}
}
catch
(
_
:
Exception
)
{
}
catch
(
_
:
Exception
)
{
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/help/WeatherUtils.kt
View file @
c1d33939
package
com.base.filerecoveryrecyclebin.help
import
android.annotation.SuppressLint
import
android.text.TextUtils
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.bean.WeatherBean
import
com.base.filerecoveryrecyclebin.utils.AESHelper
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
...
...
@@ -18,6 +20,7 @@ import java.util.Calendar
import
java.util.concurrent.TimeUnit
@SuppressLint
(
"SimpleDateFormat"
)
object
WeatherUtils
{
private
val
TAG
=
"WeatherUtils"
fun
getWeatherType
(
param
:
Int
):
String
{
...
...
@@ -50,7 +53,7 @@ object WeatherUtils {
fun
getWeatherEntity
():
WeatherBean
?
{
val
str
=
getWeatherJsonStr
()
// LogEx.logDebug(TAG, "getWeatherEntity str=$str")
// LogEx.logDebug(TAG, "getWeatherEntity str=$str")
if
(
TextUtils
.
isEmpty
(
str
))
{
}
else
{
try
{
...
...
@@ -66,9 +69,9 @@ object WeatherUtils {
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
GlobalConfig
.
PACKAGE_NAME
val
url
=
StringBuilder
(
"${
ConfigHelper.apiUrl
}/city/${
"${
GlobalConfig.URL_API
}/city/${
pkg
.
filter
{
it
.
isLowerCase
()
}.
substring
(
4
,
9
)
}
tq
"
)
...
...
@@ -90,7 +93,7 @@ object WeatherUtils {
.
url
(
url
)
.
get
()
.
build
()
// LogEx.logDebug(TAG, "url=$url")
// LogEx.logDebug(TAG, "url=$url")
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
...
...
@@ -101,7 +104,7 @@ object WeatherUtils {
val
i
=
Regex
(
"\"data\":\"(.*?)\""
).
find
(
it
)
if
(
i
.
toString
()
!=
"null"
)
{
i
?.
groupValues
?.
get
(
1
).
let
{
data
->
// LogEx.logDebug(TAG, "data=$data")
// LogEx.logDebug(TAG, "data=$data")
if
(!
TextUtils
.
isEmpty
(
data
))
{
val
str
=
AESHelper
.
decrypt
(
data
?:
""
)
saveWeatherData
(
str
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/EventUtils.kt
View file @
c1d33939
...
...
@@ -3,8 +3,8 @@ package com.base.filerecoveryrecyclebin.utils
import
android.os.Build
import
com.base.filerecoveryrecyclebin.BuildConfig
import
com.base.filerecoveryrecyclebin.GlobalConfig
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.ReportUtils.doPost
import
org.json.JSONException
import
org.json.JSONObject
...
...
@@ -26,6 +26,7 @@ object EventUtils {
}
val
isPushReportSwitch
get
()
=
AppPreferences
.
getInstance
().
getString
(
"push_report_switch"
,
"0"
).
toInt
()
fun
event
(
key
:
String
,
value
:
String
?
=
null
,
...
...
@@ -36,7 +37,7 @@ object EventUtils {
if
(!
ifAgreePrivacy
)
{
return
}
if
(
isPushReportSwitch
==
0
&&
push_limit
.
any
{
key
.
startsWith
(
it
,
ignoreCase
=
true
)
})
{
if
(
isPushReportSwitch
==
0
&&
push_limit
.
any
{
key
.
startsWith
(
it
,
ignoreCase
=
true
)
})
{
return
}
...
...
@@ -50,7 +51,7 @@ object EventUtils {
Thread
{
var
parmJson
:
String
?
=
""
try
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
GlobalConfig
.
PACKAGE_NAME
val
s
=
JSONObject
()
.
put
(
"action"
,
key
)
.
put
(
"value"
,
value
)
...
...
@@ -88,15 +89,16 @@ object EventUtils {
}
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
pkg
=
GlobalConfig
.
PACKAGE_NAME
val
url
=
StringBuilder
(
"${
ConfigHelper.eventUrl
}/${
"${
GlobalConfig.URL_EVENT
}/${
pkg
.
filter
{
it
.
isLowerCase
()
}.
substring
(
4
,
9
)
}
sp
"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
fun
getDeviceName
():
String
?
{
val
manufacturer
=
Build
.
MANUFACTURER
val
model
=
Build
.
MODEL
...
...
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