Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
scanqrwhitecopy
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
scanqrwhitecopy
Commits
20b1053d
Commit
20b1053d
authored
Jan 20, 2025
by
周文华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5105733a
92e402ed
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
11 deletions
+64
-11
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+6
-0
GlobalConfig.kt
app/src/main/java/com/base/scanqrclear/GlobalConfig.kt
+3
-3
MyApplication.kt
app/src/main/java/com/base/scanqrclear/MyApplication.kt
+4
-1
MyNotificationManager.kt
...ase/scanqrclear/fcm/notification/MyNotificationManager.kt
+1
-1
NotificationUiUtil.kt
...m/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
+7
-1
BaseActivity2.kt
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
+9
-0
WeatherInterface.kt
...c/main/java/com/base/scanqrclear/luma/WeatherInterface.kt
+23
-4
WeatherUtils.kt
app/src/main/java/com/base/scanqrclear/luma/WeatherUtils.kt
+5
-0
bg_0571ed_18.xml
app/src/main/res/drawable/bg_0571ed_18.xml
+5
-0
activity_weather.xml
app/src/main/res/layout/activity_weather.xml
+1
-1
img_guangbiao_tuisong.png
app/src/main/res/mipmap-xxhdpi/img_guangbiao_tuisong.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
20b1053d
...
@@ -219,6 +219,12 @@
...
@@ -219,6 +219,12 @@
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".luma.WeatherInterface"
android:exported=
"false"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<provider
<provider
android:name=
"androidx.core.content.FileProvider"
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${applicationId}.provider"
android:authorities=
"${applicationId}.provider"
...
...
app/src/main/java/com/base/scanqrclear/GlobalConfig.kt
View file @
20b1053d
...
@@ -5,7 +5,7 @@ package com.base.scanqrclear
...
@@ -5,7 +5,7 @@ package com.base.scanqrclear
*/
*/
object
GlobalConfig
{
object
GlobalConfig
{
//包名
//包名
const
val
PACKAGE_NAME
=
"com.
scan.barcode.deeplink
"
const
val
PACKAGE_NAME
=
"com.
ok.ai.browser.jojo
"
// 域名
// 域名
/**
/**
...
@@ -16,7 +16,7 @@ object GlobalConfig {
...
@@ -16,7 +16,7 @@ object GlobalConfig {
/**
/**
* Url Api 业务接口
* Url Api 业务接口
*/
*/
const
val
URL_API
=
"https://api.
gamexzonerk
.xyz"
const
val
URL_API
=
"https://api.
rocioxyn
.xyz"
/**
/**
* Url Privacy 隐私链接
* Url Privacy 隐私链接
...
@@ -31,7 +31,7 @@ object GlobalConfig {
...
@@ -31,7 +31,7 @@ object GlobalConfig {
/**
/**
* Key Aes 加密key
* Key Aes 加密key
*/
*/
const
val
KEY_AES
=
"
o3yb8vzeptlki1ve
"
const
val
KEY_AES
=
"
ez9r013lcubfpepu
"
/**
/**
* Key solar 归因key
* Key solar 归因key
...
...
app/src/main/java/com/base/scanqrclear/MyApplication.kt
View file @
20b1053d
...
@@ -26,6 +26,7 @@ import com.base.scanqrclear.helper.InstallHelps
...
@@ -26,6 +26,7 @@ import com.base.scanqrclear.helper.InstallHelps
import
com.base.scanqrclear.helper.NewComUtils
import
com.base.scanqrclear.helper.NewComUtils
import
com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME
import
com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME
import
com.base.scanqrclear.luma.SpUtils
import
com.base.scanqrclear.luma.SpUtils
import
com.base.scanqrclear.luma.WeatherUtils.requestWeatherData
import
com.base.scanqrclear.service.StayJobService.Companion.startJob
import
com.base.scanqrclear.service.StayJobService.Companion.startJob
import
com.base.scanqrclear.ui.start.StartActivity
import
com.base.scanqrclear.ui.start.StartActivity
import
com.base.scanqrclear.utils.ActivityManagerUtils
import
com.base.scanqrclear.utils.ActivityManagerUtils
...
@@ -158,6 +159,8 @@ class MyApplication : Application() {
...
@@ -158,6 +159,8 @@ class MyApplication : Application() {
MyNotificationManager
.
startNotificationQueue
()
MyNotificationManager
.
startNotificationQueue
()
appContext
.
initSolarEngine
(
true
)
appContext
.
initSolarEngine
(
true
)
requestWeatherData
()
}
}
private
fun
initAppConfig
()
{
private
fun
initAppConfig
()
{
...
@@ -273,7 +276,7 @@ class MyApplication : Application() {
...
@@ -273,7 +276,7 @@ class MyApplication : Application() {
//广告
//广告
AdConfigBean
.
adsConfigBean
=
configBean
.
adConfigBean
AdConfigBean
.
adsConfigBean
=
configBean
.
adConfigBean
LogEx
.
logDebug
(
"initConfig"
,
"adsConfigBean=${AdConfigBean.adsConfigBean.
numDisplayLimit
}"
)
LogEx
.
logDebug
(
"initConfig"
,
"adsConfigBean=${AdConfigBean.adsConfigBean.
functionBackShowAd
}"
)
//通知
//通知
PopupConfigBean
.
popupConfigBean
=
configBean
.
popupConfigBean
PopupConfigBean
.
popupConfigBean
=
configBean
.
popupConfigBean
...
...
app/src/main/java/com/base/scanqrclear/fcm/notification/MyNotificationManager.kt
View file @
20b1053d
...
@@ -71,7 +71,7 @@ object MyNotificationManager {
...
@@ -71,7 +71,7 @@ object MyNotificationManager {
val
next
=
actionIdList
[
0
]
val
next
=
actionIdList
[
0
]
actionIdList
.
removeAt
(
0
)
actionIdList
.
removeAt
(
0
)
if
(
BuildConfig
.
DEBUG
)
{
if
(
BuildConfig
.
DEBUG
)
{
return
ACTION_ID_
CLEAN_JUNK
return
ACTION_ID_
WEATHER
}
}
return
next
return
next
}
}
...
...
app/src/main/java/com/base/scanqrclear/fcm/notification/NotificationUiUtil.kt
View file @
20b1053d
...
@@ -187,7 +187,10 @@ object NotificationUiUtil {
...
@@ -187,7 +187,10 @@ object NotificationUiUtil {
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_weather_small
)
val
smallRemoteViews
=
RemoteViews
(
MyApplication
.
appContext
.
packageName
,
R
.
layout
.
notification_weather_small
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_city
,
weatherBean
.
city
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_city
,
weatherBean
.
city
)
val
min
=
subBean
.
tempMin
.
toInt
()
val
min
=
subBean
.
tempMin
.
toInt
()
val
max
=
subBean
.
tempMax
.
toInt
()
var
max
=
subBean
.
tempMax
.
toInt
()
if
(
max
<=
min
)
{
max
=
min
+
1
}
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
val
icon
=
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
val
icon
=
when
(
WeatherUtils
.
getWeatherType
(
subBean
.
iconDay
.
toInt
()))
{
"Sunny day"
->
R
.
mipmap
.
d_qing
"Sunny day"
->
R
.
mipmap
.
d_qing
...
@@ -219,6 +222,9 @@ object NotificationUiUtil {
...
@@ -219,6 +222,9 @@ object NotificationUiUtil {
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
sendBean
.
bigRemoteViews
=
bigRemoteViews
sendBean
.
smallRemoteViews
=
smallRemoteViews
}
}
...
...
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
View file @
20b1053d
...
@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter
...
@@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter
import
android.animation.ValueAnimator
import
android.animation.ValueAnimator
import
android.app.Activity
import
android.app.Activity
import
android.app.Dialog
import
android.app.Dialog
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
android.view.animation.LinearInterpolator
import
android.view.animation.LinearInterpolator
...
@@ -279,4 +280,12 @@ open class BaseActivity2 : AppCompatActivity() {
...
@@ -279,4 +280,12 @@ open class BaseActivity2 : AppCompatActivity() {
// }
// }
// finish()
// finish()
}
}
fun
finishToMainTop
()
{
val
intent
=
Intent
(
this
,
MainActivity
::
class
.
java
)
intent
.
putExtra
(
"where"
,
"finishToMainTop"
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
startActivity
(
intent
)
finish
()
}
}
}
\ No newline at end of file
app/src/main/java/com/base/scanqrclear/luma/WeatherInterface.kt
View file @
20b1053d
...
@@ -17,6 +17,7 @@ import com.base.scanqrclear.ads.AdsMgr
...
@@ -17,6 +17,7 @@ import com.base.scanqrclear.ads.AdsMgr
import
com.base.scanqrclear.ads.AdsShowCallBack
import
com.base.scanqrclear.ads.AdsShowCallBack
import
com.base.scanqrclear.bean.ListBean
import
com.base.scanqrclear.bean.ListBean
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.bean.config.AdConfigBean
import
com.base.scanqrclear.databinding.ActivityWeatherBinding
import
com.base.scanqrclear.databinding.ActivityWeatherBinding
import
com.base.scanqrclear.utils.BarUtils
import
com.base.scanqrclear.utils.BarUtils
import
kotlin.random.Random
import
kotlin.random.Random
...
@@ -24,18 +25,19 @@ import kotlin.random.Random
...
@@ -24,18 +25,19 @@ import kotlin.random.Random
@SuppressLint
(
"SimpleDateFormat"
)
@SuppressLint
(
"SimpleDateFormat"
)
class
WeatherInterface
:
BaseActivity2
()
{
class
WeatherInterface
:
BaseActivity2
()
{
val
binding
:
ActivityWeatherBinding
by
lazy
{
val
binding
:
ActivityWeatherBinding
by
lazy
{
ActivityWeatherBinding
.
inflate
(
layoutInflater
)
ActivityWeatherBinding
.
inflate
(
layoutInflater
)
}
}
var
wBean
:
WeatherBean
?
=
null
var
wBean
:
WeatherBean
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
setContentView
(
binding
.
root
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
getData
()
getData
()
initListener
()
initListener
()
// AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd)
AdsMgr
.
showNative
(
binding
.
idFlAd
,
R
.
layout
.
layout_admob_native_custom
)
}
}
...
@@ -45,7 +47,24 @@ class WeatherInterface : BaseActivity2() {
...
@@ -45,7 +47,24 @@ class WeatherInterface : BaseActivity2() {
}
}
onBackPressedDispatcher
.
addCallback
(
object
:
OnBackPressedCallback
(
true
)
{
onBackPressedDispatcher
.
addCallback
(
object
:
OnBackPressedCallback
(
true
)
{
override
fun
handleOnBackPressed
()
{
override
fun
handleOnBackPressed
()
{
finish
()
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
@WeatherInterface
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMainTop
()
}
})
}
else
{
finishToMainTop
()
}
}
}
})
})
}
}
...
@@ -59,7 +78,7 @@ class WeatherInterface : BaseActivity2() {
...
@@ -59,7 +78,7 @@ class WeatherInterface : BaseActivity2() {
WeatherUtils
.
requestWeatherData
()
WeatherUtils
.
requestWeatherData
()
}
}
binding
.
root
.
postDelayed
({
binding
.
root
.
postDelayed
({
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
override
fun
close
(
where
:
Int
)
{
binding
.
idFlLoading
.
isVisible
=
false
binding
.
idFlLoading
.
isVisible
=
false
}
}
...
...
app/src/main/java/com/base/scanqrclear/luma/WeatherUtils.kt
View file @
20b1053d
...
@@ -7,6 +7,7 @@ import com.base.scanqrclear.GlobalConfig
...
@@ -7,6 +7,7 @@ import com.base.scanqrclear.GlobalConfig
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.bean.WeatherBean
import
com.base.scanqrclear.helper.AESHelper
import
com.base.scanqrclear.helper.AESHelper
import
com.base.scanqrclear.utils.AppPreferences
import
com.base.scanqrclear.utils.AppPreferences
import
com.base.scanqrclear.utils.LogEx
import
com.google.gson.Gson
import
com.google.gson.Gson
import
okhttp3.Call
import
okhttp3.Call
import
okhttp3.Callback
import
okhttp3.Callback
...
@@ -151,6 +152,7 @@ object WeatherUtils {
...
@@ -151,6 +152,7 @@ object WeatherUtils {
.
url
(
url
)
.
url
(
url
)
.
get
()
.
get
()
.
build
()
.
build
()
LogEx
.
logDebug
(
"requestWeatherData"
,
"url=$url"
)
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
client
.
newCall
(
request
).
enqueue
(
object
:
Callback
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
override
fun
onFailure
(
call
:
Call
,
e
:
IOException
)
{
...
@@ -158,11 +160,14 @@ object WeatherUtils {
...
@@ -158,11 +160,14 @@ object WeatherUtils {
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
override
fun
onResponse
(
call
:
Call
,
response
:
Response
)
{
response
.
body
?.
string
()
?.
let
{
response
.
body
?.
string
()
?.
let
{
LogEx
.
logDebug
(
"requestWeatherData"
,
"it=$it"
)
val
i
=
Regex
(
"\"data\":\"(.*?)\""
).
find
(
it
)
val
i
=
Regex
(
"\"data\":\"(.*?)\""
).
find
(
it
)
if
(
i
.
toString
()
!=
"null"
)
{
if
(
i
.
toString
()
!=
"null"
)
{
i
?.
groupValues
?.
get
(
1
).
let
{
i
?.
groupValues
?.
get
(
1
).
let
{
LogEx
.
logDebug
(
"requestWeatherData"
,
"it=$it"
)
if
(!
TextUtils
.
isEmpty
(
it
))
{
if
(!
TextUtils
.
isEmpty
(
it
))
{
val
str
=
AESHelper
.
decrypt
(
it
!!
)
val
str
=
AESHelper
.
decrypt
(
it
!!
)
LogEx
.
logDebug
(
"requestWeatherData"
,
"str=$str"
)
saveWeatherData
(
str
)
saveWeatherData
(
str
)
}
}
}
}
...
...
app/src/main/res/drawable/bg_0571ed_18.xml
0 → 100644
View file @
20b1053d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#0571ED"
/>
<corners
android:radius=
"18dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_weather.xml
View file @
20b1053d
...
@@ -166,7 +166,7 @@
...
@@ -166,7 +166,7 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
</LinearLayout>
<
FrameLayout
<
com.base.scanqrclear.ads.NativeParentView
android:id=
"@+id/id_fl_ad"
android:id=
"@+id/id_fl_ad"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/mipmap-xxhdpi/img_guangbiao_tuisong.png
0 → 100644
View file @
20b1053d
9.14 KB
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