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
536585c5
Commit
536585c5
authored
Jan 23, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..
parent
0cb91aed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
MyApplication.kt
app/src/main/java/com/base/scanqrclear/MyApplication.kt
+2
-2
NewComUtils.kt
app/src/main/java/com/base/scanqrclear/helper/NewComUtils.kt
+6
-6
StartActivity.kt
.../main/java/com/base/scanqrclear/ui/start/StartActivity.kt
+6
-4
No files found.
app/src/main/java/com/base/scanqrclear/MyApplication.kt
View file @
536585c5
...
...
@@ -254,7 +254,7 @@ class MyApplication : Application() {
initConfig
(
config
)
}
else
{
EventUtils
.
event
(
"configNull"
)
writeLogFile
(
"config"
,
"configNull"
)
//
writeLogFile("config", "configNull")
}
}
}
...
...
@@ -264,7 +264,7 @@ class MyApplication : Application() {
kotlin
.
runCatching
{
val
configBean
=
Gson
().
fromJson
(
config
,
ConfigBean
::
class
.
java
)
writeLogFile
(
"config"
,
config
)
//
writeLogFile("config", config)
val
jsonObject
=
JSONObject
()
jsonObject
.
put
(
"ut"
,
configBean
.
ut
)
...
...
app/src/main/java/com/base/scanqrclear/helper/NewComUtils.kt
View file @
536585c5
...
...
@@ -4,7 +4,6 @@ import com.base.scanqrclear.BuildConfig
import
com.base.scanqrclear.GlobalConfig
import
com.base.scanqrclear.utils.AppPreferences
import
com.base.scanqrclear.utils.LogEx
import
com.base.scanqrclear.utils.WriteLogEx.writeLogFile
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -49,7 +48,7 @@ object NewComUtils {
fun
requestCfg
(
callback
:
(
json
:
String
?)
->
Unit
)
{
CoroutineScope
(
Dispatchers
.
IO
).
launch
{
val
response
=
doGet
()
writeLogFile
(
"response"
,
response
.
toString
())
//
writeLogFile("response", response.toString())
if
(
response
==
null
)
{
withContext
(
Dispatchers
.
Main
)
{
callback
(
null
)
...
...
@@ -58,7 +57,7 @@ object NewComUtils {
}
val
data
=
extractData
(
response
)
writeLogFile
(
"extractData"
,
data
.
toString
())
//
writeLogFile("extractData", data.toString())
if
(
data
==
null
)
{
withContext
(
Dispatchers
.
Main
)
{
callback
(
null
)
...
...
@@ -81,14 +80,15 @@ object NewComUtils {
conn
.
setRequestMethod
(
"GET"
)
conn
.
connectTimeout
=
150000
val
code
=
conn
.
getResponseCode
()
writeLogFile
(
"code"
,
code
.
toString
())
LogEx
.
logDebug
(
TAG
,
"code=$code"
)
// writeLogFile("code", code.toString())
if
(
200
==
code
)
{
val
json
=
BufferedReader
(
InputStreamReader
(
conn
.
inputStream
)).
readLine
()
writeLogFile
(
"json"
,
json
)
//
writeLogFile("json", json)
return
json
}
}
catch
(
e
:
Exception
)
{
writeLogFile
(
"Exception"
,
e
.
message
.
toString
())
//
writeLogFile("Exception", e.message.toString())
}
return
null
}
...
...
app/src/main/java/com/base/scanqrclear/ui/start/StartActivity.kt
View file @
536585c5
...
...
@@ -63,14 +63,11 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
// finish()
// return
NotificationHoverUtils
.
stopNotificationHandler
()
if
(
ConstObject
.
ifAgreePrivacy
)
{
agreePrivacy
()
}
NotificationHoverUtils
.
stopNotificationHandler
()
startJob
()
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
TIRAMISU
)
{
launcher
.
launch
(
arrayOf
(
Manifest
.
permission
.
POST_NOTIFICATIONS
))
{
LogEx
.
logDebug
(
TAG
,
"POST_NOTIFICATIONS"
)
...
...
@@ -78,6 +75,10 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
}
}
override
fun
onResumeOneShoot
()
{
super
.
onResumeOneShoot
()
}
private
fun
agreePrivacy
()
{
...
...
@@ -265,6 +266,7 @@ class StartActivity : BaseActivity<ActivityStartBinding>(ActivityStartBinding::i
}
finish
()
intent
.
extras
?.
clear
()
LogEx
.
logDebug
(
TAG
,
"finish"
)
}
private
fun
firstLauncherJump
()
{
...
...
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