Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
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
appzxhy
Commits
1c365aab
Commit
1c365aab
authored
Jun 06, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[测试]远程获取配置
parent
d91d0843
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
21 deletions
+71
-21
GlobalConfig.kt
app/src/main/java/com/base/appzxhy/GlobalConfig.kt
+5
-5
MyApplication.kt
app/src/main/java/com/base/appzxhy/MyApplication.kt
+6
-9
AdsMgr.kt
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
+13
-1
NewComUtils.kt
...main/java/com/base/appzxhy/business/helper/NewComUtils.kt
+40
-2
StayJobService.kt
.../java/com/base/appzxhy/business/service/StayJobService.kt
+1
-1
BatteryReceiver.kt
...n/java/com/base/appzxhy/ui/batteryinfo/BatteryReceiver.kt
+2
-1
SettingsFragment.kt
...src/main/java/com/base/appzxhy/ui/set/SettingsFragment.kt
+4
-2
No files found.
app/src/main/java/com/base/appzxhy/GlobalConfig.kt
View file @
1c365aab
...
...
@@ -5,23 +5,23 @@ package com.base.appzxhy
*/
object
GlobalConfig
{
//包名
const
val
PACKAGE_NAME
=
"com.
loactation.alibabab.ccccaa
"
const
val
PACKAGE_NAME
=
"com.
dumpster.cleaner.tbt
"
// 域名
/**
* Url Event 上报接口
*/
const
val
URL_EVENT
=
"https://rp.
gamexzonerk
.xyz"
const
val
URL_EVENT
=
"https://rp.
kubukubanten
.xyz"
/**
* Url Api 业务接口
*/
const
val
URL_API
=
"https://api.
gamexzonerk
.xyz"
const
val
URL_API
=
"https://api.
kubukubanten
.xyz"
/**
* Url Privacy 隐私链接
*/
const
val
URL_PRIVACY
=
"https://sites.google.com/view/
locationuses/location
"
const
val
URL_PRIVACY
=
"https://sites.google.com/view/
dumpster-cleaner/dumpster-cleaner
"
/**
* Url Use 使用条款
...
...
@@ -31,7 +31,7 @@ object GlobalConfig {
/**
* Key Aes 加密key
*/
const
val
KEY_AES
=
"
pex50vwzuhpim3yh
"
const
val
KEY_AES
=
"
d1mnzmn2cs20xpmx
"
/**
* Key solar 归因key
...
...
app/src/main/java/com/base/appzxhy/MyApplication.kt
View file @
1c365aab
...
...
@@ -31,12 +31,14 @@ import com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.bean.config.ConfigBean
import
com.base.appzxhy.bean.config.PopupConfigBean
import
com.base.appzxhy.business.ads.AdsMgr
import
com.base.appzxhy.business.helper.NewComUtils.spConfig
import
com.base.appzxhy.business.push.fcm.FCMManager
import
com.base.appzxhy.business.push.notification.MyNotificationManager
import
com.base.appzxhy.push.receiver.AlarmReceiver.Companion.startAlarm
import
com.base.appzxhy.push.receiver.ScreenStatusReceiver
import
com.base.appzxhy.push.timer.TimerManager.Companion.changeTimer
import
com.base.appzxhy.push.work.RepeatingWorker.Companion.schedulePeriodicWork
import
com.base.appzxhy.ui.batteryinfo.BatteryReceiver.Companion.registerBatteryReceiver
import
com.base.appzxhy.ui.splash.SplashActivity
...
...
@@ -142,7 +144,7 @@ class MyApplication : Application() {
ScreenStatusReceiver
.
registerScreenStatusReceiver
(
this
)
// PackageStatusReceiver.registerPackageStatusReceiver(this)
// BatteryStatusReceiver.registerBatteryStatus
Receiver(this)
registerBattery
Receiver
(
this
)
//workManager
schedulePeriodicWork
(
appContext
)
...
...
@@ -160,10 +162,7 @@ class MyApplication : Application() {
private
fun
initAppConfig
()
{
Thread
{
val
config
=
AppPreferences
.
getInstance
().
getString
(
"config"
,
""
)
if
(
config
.
isNotEmpty
())
{
initConfig
(
config
)
}
initConfig
()
InstallHelps
.
init
{
initRemoteConfig
()
...
...
@@ -219,7 +218,6 @@ class MyApplication : Application() {
PAUSED_VALUE
=
1
}
override
fun
onActivityPaused
(
activity
:
Activity
)
{
PAUSED_VALUE
=
2
lastTimePause
=
System
.
currentTimeMillis
()
...
...
@@ -242,7 +240,6 @@ class MyApplication : Application() {
NewComUtils
.
requestCfg
{
config
->
LogEx
.
logDebug
(
"requestCfg"
,
"config=$config"
)
if
(
config
!=
null
)
{
AppPreferences
.
getInstance
().
put
(
"config"
,
config
)
initConfig
(
config
)
}
else
{
EventUtils
.
event
(
"configNull"
)
...
...
@@ -251,7 +248,8 @@ class MyApplication : Application() {
}
private
fun
initConfig
(
config
:
String
)
{
private
fun
initConfig
(
config
:
String
=
spConfig
)
{
if
(
config
.
isEmpty
())
return
// kotlin.runCatching {
val
configBean
=
Gson
().
fromJson
(
config
,
ConfigBean
::
class
.
java
)
...
...
@@ -279,5 +277,4 @@ class MyApplication : Application() {
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/business/ads/AdsMgr.kt
View file @
1c365aab
...
...
@@ -10,7 +10,6 @@ import com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.base.appzxhy.BuildConfig
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.bean.config.AdConfigBean
import
com.base.appzxhy.bean.config.AdConfigBean.Companion.adsConfigBean
import
com.base.appzxhy.bean.config.ConfigBean.Companion.configBean
import
com.base.appzxhy.business.ads.admob.AdBannerMgr
...
...
@@ -72,6 +71,15 @@ object AdsMgr {
var
isMaxInit
=
false
private
set
var
isAdUtEvent
=
false
fun
eventAdUt
()
{
if
(!
isAdUtEvent
)
{
isAdUtEvent
=
true
EventUtils
.
event
(
"ad_ut_${configBean.ut}"
)
}
}
/**
* Init 初始化
*
...
...
@@ -157,6 +165,8 @@ object AdsMgr {
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
)
{
eventAdUt
()
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
"isInBlackList=${configBean.isInBlackList}"
)
showCallBack
?.
failed
()
...
...
@@ -196,6 +206,8 @@ object AdsMgr {
isUnLimit
:
Boolean
=
false
,
showCallBack
:
AdsShowCallBack
?
=
null
,
)
{
eventAdUt
()
if
(
configBean
.
isInBlackList
)
{
EventUtils
.
event
(
"isInBlackList"
,
configBean
.
isInBlackList
.
toString
())
showCallBack
?.
failed
()
...
...
app/src/main/java/com/base/appzxhy/business/helper/NewComUtils.kt
View file @
1c365aab
...
...
@@ -4,6 +4,7 @@ import android.util.Base64
import
android.util.Log
import
com.base.appzxhy.BuildConfig
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.bean.config.ConfigBean
import
com.base.appzxhy.utils.AppPreferences
import
com.base.appzxhy.utils.LogEx
import
kotlinx.coroutines.CoroutineScope
...
...
@@ -22,6 +23,26 @@ object NewComUtils {
private
const
val
PACKAGE_NAME_PREFIX
=
GlobalConfig
.
PACKAGE_NAME
private
const
val
DATA_KEY
=
"data"
//sp配置缓存
var
spConfig
=
""
get
()
{
return
AppPreferences
.
getInstance
().
getString
(
"spConfig"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"spConfig"
,
value
,
true
)
}
//上次请求时间
private
var
lastRequestTime
=
0L
get
()
{
return
AppPreferences
.
getInstance
().
getLong
(
"lastRequestTime"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"lastRequestTime"
,
value
,
true
)
}
private
val
url
:
String
by
lazy
{
val
packageName
=
GlobalConfig
.
PACKAGE_NAME
val
appCode
=
packageName
.
substringAfter
(
PACKAGE_NAME_PREFIX
).
take
(
5
).
toLowerCase
(
Locale
.
getDefault
())
...
...
@@ -39,7 +60,7 @@ object NewComUtils {
"&aid=${AppPreferences.getInstance().getString("
uuid
", "")}"
if
(
BuildConfig
.
DEBUG
)
{
s
=
"$s&mode=
3
"
s
=
"$s&mode=
4
"
}
s
// mode =3 google mode=2 facebook mode=1 自然,mode=4 测试
...
...
@@ -48,7 +69,22 @@ object NewComUtils {
fun
requestCfg
(
callback
:
(
json
:
String
?)
->
Unit
)
{
CoroutineScope
(
Dispatchers
.
IO
).
launch
{
val
passHour
=
(
System
.
currentTimeMillis
()
-
lastRequestTime
)
/
3600000
if
(
BuildConfig
.
DEBUG
)
{
lastRequestTime
=
0L
}
if
(
lastRequestTime
!=
0L
&&
passHour
<
ConfigBean
.
configBean
.
getConfigInterval
)
{
callback
.
invoke
(
null
)
Log
.
e
(
TAG
,
"请求间隔 passHour=$passHour"
)
return
@launch
}
val
response
=
doGet
()
if
(
response
==
null
)
{
withContext
(
Dispatchers
.
Main
)
{
...
...
@@ -64,8 +100,10 @@ object NewComUtils {
}
return
@launch
}
lastRequestTime
=
System
.
currentTimeMillis
()
val
decryptedData
=
AESHelper
.
decrypt
(
data
)
LogEx
.
logDebug
(
TAG
,
"decryptedData=$decryptedData"
)
spConfig
=
decryptedData
withContext
(
Dispatchers
.
Main
)
{
callback
(
decryptedData
)
}
...
...
app/src/main/java/com/base/appzxhy/business/service/StayJobService.kt
View file @
1c365aab
...
...
@@ -81,7 +81,7 @@ class StayJobService : JobService() {
}
private
fun
notifyForeground
()
{
LogEx
.
logDebug
(
TAG
,
"notifyForeground"
)
//
LogEx.logDebug(TAG, "notifyForeground")
val
notificationManager
=
getSystemService
(
NOTIFICATION_SERVICE
)
as
NotificationManager
...
...
app/src/main/java/com/base/appzxhy/ui/batteryinfo/BatteryReceiver.kt
View file @
1c365aab
...
...
@@ -25,7 +25,7 @@ class BatteryReceiver(
var
mA
=
0.0F
//电流
var
avmA
=
0.0F
//平均电流
fun
register
(
context
:
Context
)
{
fun
register
BatteryReceiver
(
context
:
Context
)
{
val
intentFilter
=
IntentFilter
().
apply
{
addAction
(
Intent
.
ACTION_BATTERY_CHANGED
)
}
...
...
@@ -71,5 +71,6 @@ class BatteryReceiver(
private
fun
uiHandle
(
context
:
Context
)
{
}
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/set/SettingsFragment.kt
View file @
1c365aab
...
...
@@ -21,6 +21,7 @@ import com.base.appzxhy.utils.ClipboardUtils.copyText
import
com.base.appzxhy.utils.MyAnimationUtils
import
com.base.appzxhy.utils.ToastUtils.toast
import
com.google.gson.Gson
import
com.google.gson.GsonBuilder
class
SettingsFragment
:
BaseFragment
<
FragmentSettingsBinding
>(
FragmentSettingsBinding
::
inflate
)
{
...
...
@@ -52,8 +53,9 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
}
binding
.
tvSettings
.
setOnClickListener
{
val
configBean
=
ConfigBean
()
val
json
=
Gson
().
toJson
(
configBean
)
val
configBean
=
ConfigBean
.
configBean
val
gson
=
GsonBuilder
().
setPrettyPrinting
().
create
()
val
json
=
gson
.
toJson
(
configBean
)
requireContext
().
copyText
(
"json"
,
json
)
requireContext
().
toast
(
"copy json"
)
}
...
...
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