Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
acd80b21
Commit
acd80b21
authored
Aug 22, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.0 开发 9
parent
2d36b2ee
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
341 additions
and
186 deletions
+341
-186
app/build.gradle.kts
app/build.gradle.kts
+0
-2
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
...a/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
+4
-3
app/src/main/java/com/ccwangluo/accelerator/manager/PhoneUtils.kt
...main/java/com/ccwangluo/accelerator/manager/PhoneUtils.kt
+1
-1
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
+3
-2
app/src/main/java/com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
...com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
+10
-5
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
...com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
+115
-35
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListModel.kt
...va/com/ccwangluo/accelerator/ui/gameList/GameListModel.kt
+30
-2
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
.../com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
+83
-78
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
...in/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
+7
-3
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
...n/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
+2
-2
app/src/main/java/com/ccwangluo/accelerator/ui/home/NoticeFragment.kt
.../java/com/ccwangluo/accelerator/ui/home/NoticeFragment.kt
+3
-8
app/src/main/java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
...java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
+9
-6
app/src/main/java/com/ccwangluo/accelerator/ui/web/CommonWebViewFragment.kt
...com/ccwangluo/accelerator/ui/web/CommonWebViewFragment.kt
+1
-1
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
.../java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
+11
-6
app/src/main/java/com/ccwangluo/accelerator/utils/SysUtils.kt
...src/main/java/com/ccwangluo/accelerator/utils/SysUtils.kt
+40
-15
app/src/main/java/com/ccwangluo/accelerator/utils/datareport/BaseData.kt
...va/com/ccwangluo/accelerator/utils/datareport/BaseData.kt
+1
-1
app/src/main/java/com/ccwangluo/accelerator/utils/http/HttpGo.kt
.../main/java/com/ccwangluo/accelerator/utils/http/HttpGo.kt
+1
-0
app/src/main/res/layout/fragment_game_list.xml
app/src/main/res/layout/fragment_game_list.xml
+1
-1
app/src/main/res/layout/item_game.xml
app/src/main/res/layout/item_game.xml
+6
-2
buildSrc/src/main/kotlin/Helpers.kt
buildSrc/src/main/kotlin/Helpers.kt
+2
-2
channels.txt
channels.txt
+10
-10
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
+1
-1
No files found.
app/build.gradle.kts
View file @
acd80b21
...
...
@@ -70,8 +70,6 @@ android {
setupApp
()
android
.
defaultConfig
.
applicationId
=
"com.ccwangluo.accelerator"
dependencies
{
implementation
(
fileTree
(
mapOf
(
"dir"
to
"libs"
,
"include"
to
listOf
(
"*.jar"
,
"*.aar"
))))
implementation
(
"androidx.appcompat:appcompat:1.3.1"
)
...
...
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
View file @
acd80b21
...
...
@@ -30,9 +30,9 @@ object GameDownLoadManger {
fun
download
(
activity
:
XPageFragment
,
gameInfo
:
GameInfo
gameInfo
:
GameInfo
,
url
:
String
)
{
var
url
=
gameInfo
.
downloadUrl
if
(
url
.
isNullOrBlank
())
{
return
}
...
...
@@ -51,7 +51,8 @@ object GameDownLoadManger {
)
if
(
file
.
exists
())
{
activity
.
context
?.
let
{
DownloadUtils
.
install
(
file
.
absolutePath
,
it
)
}
// activity.context?.let { DownloadUtils.install(file.absolutePath, it) }
file
.
delete
()
return
}
downloadManager
=
...
...
app/src/main/java/com/ccwangluo/accelerator/manager/PhoneUtils.kt
View file @
acd80b21
...
...
@@ -48,7 +48,7 @@ object PhoneUtils {
}
fun
openLoginAuth
(
context
:
Context
,
callback
:
(
Boolean
,
String
)
->
Unit
)
{
context
?
.
let
{
context
.
let
{
OneKeyLoginManager
.
getInstance
().
setAuthThemeConfig
(
getEConfig
(
it
))
OneKeyLoginManager
.
getInstance
().
openLoginAuth
(
false
,
...
...
app/src/main/java/com/ccwangluo/accelerator/model/Game.kt
View file @
acd80b21
...
...
@@ -7,7 +7,7 @@ data class Game(
data class
GameInfo
(
val
announcementList
:
List
<
Announcement
>,
val
announcementList
:
List
<
Announcement
>
?
,
val
anotherName
:
String
,
val
boosterPackageName
:
String
?,
val
boosterServer
:
String
?,
...
...
@@ -40,5 +40,6 @@ data class Announcement(
val
status
:
Int
,
val
title
:
String
,
val
url
:
String
,
val
type
:
Int
val
type
:
Int
,
val
position
:
Int
=
1
)
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
View file @
acd80b21
...
...
@@ -8,7 +8,6 @@ import com.bumptech.glide.Glide
import
com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.utils.ByteUtils
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.umeng.socialize.utils.DeviceConfigInternal.context
import
com.xuexiang.xpage.base.XPageFragment
...
...
@@ -37,12 +36,18 @@ class GameDownloadDialog(
.
load
(
gameInfo
.
icon
)
.
into
(
appImg
)
}
var
version
=
gameInfo
.
version
if
(
SysUtils
.
compareVersionTo
(
gameInfo
.
versionTools
,
gameInfo
.
version
))
{
gameInfo
.
versionTools
?.
let
{
version
=
it
}
}
val
appName
=
findViewById
<
TextView
>(
R
.
id
.
app_name
)
appName
.
setText
(
gameInfo
.
gameName
)
val
appSize
=
findViewById
<
TextView
>(
R
.
id
.
app_size
)
appSize
.
setText
(
"文件大小:${gameInfo.size}"
)
val
appVersion
=
findViewById
<
TextView
>(
R
.
id
.
app_version
)
appVersion
.
setText
(
"版本号:${
gameInfo.
version}"
)
appVersion
.
setText
(
"版本号:${version}"
)
val
btnLeft
=
findViewById
<
TextView
>(
R
.
id
.
btn_left
)
btnLeft
.
setOnClickListener
{
dismiss
<
GameDownloadDialog
>()
...
...
@@ -50,7 +55,7 @@ class GameDownloadDialog(
}
fun
download
()
{
fun
download
(
url
:
String
)
{
val
btnRight
=
findViewById
<
TextView
>(
R
.
id
.
btn_right
)
btnRight
.
setOnClickListener
{
...
...
@@ -64,12 +69,12 @@ class GameDownloadDialog(
)
.
setBtnLeft
(
"取消"
)
{
}.
setBtnRight
(
"继续"
)
{
GameDownLoadManger
.
download
(
fragment
,
gameInfo
)
GameDownLoadManger
.
download
(
fragment
,
gameInfo
,
url
)
}.
show
<
CommonDialog
>()
}
}
else
{
dialog
.
dismiss
()
GameDownLoadManger
.
download
(
fragment
,
gameInfo
)
GameDownLoadManger
.
download
(
fragment
,
gameInfo
,
url
)
}
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
View file @
acd80b21
...
...
@@ -11,6 +11,7 @@ import android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.lifecycleScope
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
...
...
@@ -18,6 +19,7 @@ import com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.adapter.KotlinDataAdapter
import
com.ccwangluo.accelerator.databinding.FragmentGameListBinding
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.manager.GameDownLoadManger.download
import
com.ccwangluo.accelerator.manager.LoginUtils
import
com.ccwangluo.accelerator.model.Announcement
import
com.ccwangluo.accelerator.model.GameInfo
...
...
@@ -28,13 +30,19 @@ import com.ccwangluo.accelerator.ui.home.NewsFragment
import
com.ccwangluo.accelerator.ui.web.CommonWebViewFragment
import
com.ccwangluo.accelerator.utils.*
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.github.shadowsocks.Core.activity
import
com.github.shadowsocks.bg.AuthManager.gameId
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.http.HttpConfig
import
com.umeng.socialize.utils.DeviceConfigInternal.context
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xpage.core.PageOption
import
com.xuexiang.xpage.utils.TitleBar
import
com.xuexiang.xui.widget.progress.CircleProgressView
import
com.xuexiang.xutil.app.AppUtils
import
com.xuexiang.xutil.tip.ToastUtils
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
java.util.*
import
java.util.stream.Collectors
...
...
@@ -101,8 +109,9 @@ class GameListFragment : XPageFragment() {
val
game_notice_1_1
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
game_notice_1_1
)
val
game_notice_1_2
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
game_notice_1_2
)
val
game_notice_1_3
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
game_notice_1_3
)
val
announcement1
=
itemData
.
announcementList
.
stream
().
filter
{
it
.
addrType
==
3
}
.
collect
(
Collectors
.
toList
())
val
announcement1
=
itemData
.
announcementList
?.
stream
()
?.
filter
{
it
.
addrType
==
3
}
?.
sorted
{
o1
,
o2
->
o1
.
position
.
compareTo
(
o2
.
position
)
}
?.
collect
(
Collectors
.
toList
())
if
(
announcement1
==
null
||
announcement1
.
size
==
0
)
{
game_notice_area_1
.
visibility
=
View
.
GONE
...
...
@@ -110,13 +119,13 @@ class GameListFragment : XPageFragment() {
game_notice_area_1
.
visibility
=
View
.
VISIBLE
game_notice_1_1
.
setText
(
announcement1
.
get
(
0
).
title
)
game_notice_1_1
.
setOnClickListener
{
openNoticePage
(
announcement1
.
get
(
0
))
openNoticePage
(
itemData
,
announcement1
.
get
(
0
))
}
if
(
announcement1
.
size
>
1
)
{
game_notice_1_2
.
visibility
=
View
.
VISIBLE
game_notice_1_2
.
setText
(
announcement1
.
get
(
1
).
title
)
game_notice_1_2
.
setOnClickListener
{
openNoticePage
(
announcement1
.
get
(
1
))
openNoticePage
(
itemData
,
announcement1
.
get
(
1
))
}
}
else
{
game_notice_1_2
.
visibility
=
View
.
GONE
...
...
@@ -125,23 +134,23 @@ class GameListFragment : XPageFragment() {
game_notice_1_3
.
visibility
=
View
.
VISIBLE
game_notice_1_3
.
setText
(
announcement1
.
get
(
2
).
title
)
game_notice_1_3
.
setOnClickListener
{
openNoticePage
(
announcement1
.
get
(
2
))
openNoticePage
(
itemData
,
announcement1
.
get
(
2
))
}
}
else
{
game_notice_1_3
.
visibility
=
View
.
GONE
}
}
val
announcement2
=
itemData
.
announcementList
.
stream
()
.
filter
{
it
.
addrType
==
4
}
.
collect
(
Collectors
.
toList
())
val
announcement2
=
itemData
.
announcementList
?.
stream
()
?
.
filter
{
it
.
addrType
==
4
}
?
.
collect
(
Collectors
.
toList
())
if
(
announcement2
==
null
||
announcement2
.
size
==
0
)
{
game_notice_area_2
.
visibility
=
View
.
GONE
}
else
{
game_notice_area_2
.
visibility
=
View
.
VISIBLE
game_notice_2_1
.
setText
(
announcement2
.
get
(
0
).
content
)
game_notice_2_1
.
setText
(
HtmlUtil
.
getTextFromHtml
(
announcement2
.
get
(
0
).
content
)
)
game_notice_area_2
.
setOnClickListener
{
openNoticePage
(
announcement2
.
get
(
0
))
openNoticePage
(
itemData
,
announcement2
.
get
(
0
))
}
}
...
...
@@ -190,7 +199,7 @@ class GameListFragment : XPageFragment() {
}
//应用加速中
else
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
game
!!
.
id
==
itemData
.
id
)
{
else
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
game
?
.
id
==
itemData
.
id
)
{
btn_uninstall
.
visibility
=
View
.
GONE
btn_acc
.
visibility
=
View
.
GONE
btn_acc_stop
.
visibility
=
View
.
VISIBLE
...
...
@@ -237,26 +246,15 @@ class GameListFragment : XPageFragment() {
}
btn_acc
.
setOnClickListener
{
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
)
{
context
?.
let
{
CommonDialog
(
it
)
.
setContent
(
"当前${AcceleratorUtils.game?.gameName}应用正在加速,是否取消"
)
.
setBtnLeft
(
"取消"
)
{
}.
setBtnRight
(
"确定"
)
{
AcceleratorUtils
.
stopAccelerator
()
AcceleratorUtils
.
setGameInfo
(
itemData
)
openPage
(
AcceleratorFragment
::
class
.
java
)
}.
show
<
CommonDialog
>()
startAccBtn
(
itemData
)
}
}
else
{
AcceleratorUtils
.
setGameInfo
(
itemData
)
openPage
(
AcceleratorFragment
::
class
.
java
)
}
game_img
.
setOnClickListener
{
openWebviewForResult
(
HttpConfig
.
UI_GAME_URL
,
itemData
)
}
game_name
.
setOnClickListener
{
openWebviewForResult
(
HttpConfig
.
UI_GAME_URL
,
itemData
)
}
tx_game_update_notice
.
setOnClickListener
{
...
...
@@ -307,23 +305,100 @@ class GameListFragment : XPageFragment() {
})
}
registerListener
()
var
gameInfo
:
GameInfo
?
=
null
private
val
CLICK_START_ACC_REQUEST_CODE
:
Int
=
100
;
private
fun
openWebviewForResult
(
url
:
String
,
itemData
:
GameInfo
)
{
gameInfo
=
itemData
PageOption
.
to
(
CommonWebViewFragment
::
class
.
java
)
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
HttpConfig
.
UI_MAIN_URL
+
url
)
.
putInt
(
CommonWebViewFragment
.
GAME_ID
,
itemData
.
id
)
.
setRequestCode
(
CLICK_START_ACC_REQUEST_CODE
)
.
open
(
this
)
}
override
fun
onFragmentResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onFragmentResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
CLICK_START_ACC_REQUEST_CODE
)
{
Handler
(
Looper
.
getMainLooper
()).
post
{
gameInfo
?.
let
{
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
game
?.
id
==
it
.
id
)
{
context
?.
let
{
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
.
setContent
(
"停止加速可能会导致游戏断线,是否确认停止?"
)
.
setBtnLeft
(
"取消"
)
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
}.
setBtnRight
(
"停止加速"
)
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
AcceleratorUtils
.
stopAccelerator
({})
}.
show
<
CommonDialog
>()
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
}
else
{
startAccBtn
(
it
)
}
}
}
}
}
private
fun
openNoticePage
(
ann
:
Announcement
)
{
private
fun
startAccBtn
(
itemData
:
GameInfo
)
{
LoginUtils
.
token
?.
let
{
startAccPage
(
itemData
)
}
?:
let
{
context
?.
let
{
it1
->
LoginUtils
.
login
(
it1
)
{
if
(
it
)
{
startAccPage
(
itemData
)
}
}
}
}
}
private
fun
startAccPage
(
itemData
:
GameInfo
)
{
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
)
{
context
?.
let
{
CommonDialog
(
it
)
.
setContent
(
"当前${AcceleratorUtils.game?.gameName}应用正在加速,是否取消"
)
.
setBtnLeft
(
"取消"
)
{
}.
setBtnRight
(
"确定"
)
{
AcceleratorUtils
.
stopAccelerator
{
AcceleratorUtils
.
setGameInfo
(
itemData
)
openPage
(
AcceleratorFragment
::
class
.
java
)
}
}.
show
<
CommonDialog
>()
}
}
else
{
AcceleratorUtils
.
setGameInfo
(
itemData
)
openPage
(
AcceleratorFragment
::
class
.
java
)
}
}
private
fun
openNoticePage
(
itemData
:
GameInfo
,
ann
:
Announcement
)
{
if
(
ann
.
type
==
2
)
{
val
params
=
Bundle
()
params
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
ann
.
url
)
params
.
putInt
(
CommonWebViewFragment
.
GAME_ID
,
ann
.
gameId
)
params
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
HttpConfig
.
UI_MAIN_URL
+
"/notice?noticeId=${ann.id}"
)
params
.
putInt
(
CommonWebViewFragment
.
GAME_ID
,
itemData
.
id
)
openPage
(
CommonWebViewFragment
::
class
.
java
,
params
)
}
else
if
(
ann
.
type
==
1
)
{
val
params
=
Bundle
()
params
.
putInt
(
Constants
.
GAME_ID
,
ann
.
gameId
)
params
.
putInt
(
NewsFragment
.
GAME_ID
,
itemData
.
id
)
params
.
putString
(
NewsFragment
.
GAME_NAME
,
itemData
.
gameName
)
openPage
(
NewsFragment
::
class
.
java
,
params
)
}
}
override
fun
initListeners
()
{
_binding
.
accShare
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_share_clk"
,
mapOf
(
"scene"
to
"3"
))
...
...
@@ -332,7 +407,9 @@ class GameListFragment : XPageFragment() {
_binding
.
refreshGame
.
setOnRefreshListener
{
page
=
1
gameListModel
.
freshData
(
this
,
page
)
//
_binding
.
refreshGame
.
postDelayed
({
_binding
.
refreshGame
.
isRefreshing
=
false
},
2000
)
}
_binding
.
gameList
.
addOnScrollListener
(
object
:
RecyclerView
.
OnScrollListener
()
{
override
fun
onScrollStateChanged
(
recyclerView
:
RecyclerView
,
newState
:
Int
)
{
...
...
@@ -349,6 +426,7 @@ class GameListFragment : XPageFragment() {
}
}
})
registerListener
()
}
protected
fun
isSlideToBottom
(
recyclerView
:
RecyclerView
?):
Boolean
{
...
...
@@ -368,8 +446,8 @@ class GameListFragment : XPageFragment() {
fun
registerListener
()
{
AcceleratorUtils
.
registerStateListener
{
state
,
l
,
net
->
acctime
=
l
if
(
state
==
BaseService
.
State
.
Connected
)
{
Handler
(
Looper
.
getMainLooper
()).
post
{
if
(
state
==
BaseService
.
State
.
Connected
)
{
AcceleratorUtils
.
game
?.
let
{
if
(
dataList
.
indexOf
(
AcceleratorUtils
.
game
)
==
0
)
{
_binding
.
gameList
.
adapter
?.
notifyItemChanged
(
...
...
@@ -381,6 +459,8 @@ class GameListFragment : XPageFragment() {
_binding
.
gameList
.
adapter
?.
notifyDataSetChanged
()
}
}
}
else
{
_binding
.
gameList
.
adapter
?.
notifyDataSetChanged
()
}
}
}
...
...
@@ -403,7 +483,7 @@ class GameListFragment : XPageFragment() {
GameDownloadDialog
(
itemData
,
this
@GameListFragment
).
show
<
GameDownloadDialog
>().
download
(
);
).
show
<
GameDownloadDialog
>().
download
(
downloadUrl
)
}
else
{
CommonDialog
(
it
)
.
setContent
(
"TT不提供下载功能,有需要浏览游戏资讯,可前往Qooapp等途径获取。"
)
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListModel.kt
View file @
acd80b21
...
...
@@ -9,6 +9,7 @@ import com.ccwangluo.accelerator.utils.AcceleratorUtils
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.http.HttpGo
import
com.github.shadowsocks.bg.BaseService
import
com.umeng.socialize.utils.DeviceConfigInternal.context
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xutil.app.AppUtils
import
kotlinx.coroutines.Dispatchers
...
...
@@ -20,12 +21,30 @@ class GameListModel : ViewModel() {
val
gameModel
=
MutableLiveData
<
Game
>()
val
clearList
=
MutableLiveData
<
Boolean
>()
val
gameList
=
mutableListOf
<
String
>()
fun
freshData
(
xPageFragment
:
XPageFragment
,
page
:
Int
)
{
var
packageName
=
if
(
AcceleratorUtils
.
game
==
null
||
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Connected
)
""
else
AcceleratorUtils
.
game
!!
.
packageName
var
packageName
=
if
(
AcceleratorUtils
.
game
==
null
||
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Connected
)
""
else
AcceleratorUtils
.
game
!!
.
packageName
xPageFragment
.
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
if
(
page
==
1
||
gameList
.
size
==
0
)
{
getSupportGameList
(
xPageFragment
)
}
var
gamelist
=
""
xPageFragment
.
context
?.
let
{
var
applist
=
StringBuffer
()
for
(
s
in
SysUtils
.
getAllAppInfo
(
it
))
{
if
(
gameList
.
contains
(
s
)){
applist
.
append
(
s
+
","
)
}
}
if
(
applist
.
isNotBlank
()){
gamelist
=
applist
.
substring
(
0
,
applist
.
lastIndex
-
1
)
}
}
val
res
=
HttpGo
.
getSync
<
Game
>(
"/api/new/game/list?page=${page}&s
ize=20&channelId=${SysUtils.getChannel()}&packageName=${packageName
}"
)
HttpGo
.
getSync
<
Game
>(
"/api/new/game/list?page=${page}&s
tatus=1&size=10&channelId=${SysUtils.getChannel()}&packageName=${packageName}&packageNameList=${gamelist
}"
)
res
?.
let
{
it
.
data
?.
let
{
clearList
.
postValue
(
page
==
1
)
...
...
@@ -35,4 +54,13 @@ class GameListModel : ViewModel() {
}
}
}
suspend
fun
getSupportGameList
(
xPageFragment
:
XPageFragment
)
{
val
res
=
HttpGo
.
getSync
<
List
<
String
>>(
"/api/new/game/getPackageNameList"
)
res
?.
let
{
it
.
data
?.
let
{
it1
->
gameList
.
addAll
(
it1
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
View file @
acd80b21
...
...
@@ -10,6 +10,7 @@ import android.view.animation.Animation
import
android.view.animation.LinearInterpolator
import
android.view.animation.RotateAnimation
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.lifecycleScope
import
com.bumptech.glide.Glide
import
com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.databinding.FragmentQuickBinding
...
...
@@ -19,6 +20,7 @@ import com.ccwangluo.accelerator.ui.dialog.MemberDialog
import
com.ccwangluo.accelerator.ui.web.CommonWebViewFragment
import
com.ccwangluo.accelerator.utils.AcceleratorUtils
import
com.ccwangluo.accelerator.manager.LoginUtils
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.utils.AcceleratorUtils.state
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
...
...
@@ -40,6 +42,7 @@ class AcceleratorFragment : XPageFragment() {
private
lateinit
var
binding
:
FragmentQuickBinding
private
lateinit
var
acceleratorViewModel
:
AccelertorViewModel
private
var
accTimer
=
0L
private
var
gameInfo
:
GameInfo
?
=
null
override
fun
initTitleBar
():
TitleBar
?
{
//不使用@Page标注的一定要注意覆盖这个方法
...
...
@@ -66,6 +69,7 @@ class AcceleratorFragment : XPageFragment() {
override
fun
initViews
()
{
gameInfo
=
AcceleratorUtils
.
game
acceleratorViewModel
.
netState
.
observe
(
this
)
{
if
(
it
.
preNetDelay
!=
-
1
&&
state
==
BaseService
.
State
.
Connected
)
{
//有网络
...
...
@@ -128,14 +132,6 @@ class AcceleratorFragment : XPageFragment() {
}
}
acceleratorViewModel
.
userProfile
.
observe
(
this
)
{
// if (it.hasUnreadNotice) {
// binding.iconNoticeBadge.visibility = View.VISIBLE
// } else {
// binding.iconNoticeBadge.visibility = View.GONE
// }
}
binding
.
progressViewCircleSmall
.
setProgressViewUpdateListener
(
object
:
CircleProgressView
.
CircleProgressUpdateListener
{
override
fun
onCircleProgressStart
(
view
:
View
?)
{
...
...
@@ -159,8 +155,8 @@ class AcceleratorFragment : XPageFragment() {
binding
.
gamePicOut
.
startAnimation
(
getDefaultAnim
())
}
binding
.
radiusTv
.
visibility
=
if
(
SysUtils
.
getChannel
()
==
3
)
View
.
GONE
else
View
.
VISIBLE
binding
.
accGameName
.
setText
(
AcceleratorUtils
.
game
!!
.
gameName
)
AcceleratorUtils
.
game
?.
icon
?.
let
{
binding
.
accGameName
.
setText
(
gameInfo
!!
.
gameName
)
gameInfo
?.
icon
?.
let
{
Glide
.
with
(
this
)
.
load
(
it
)
.
into
(
binding
.
gameBg
)
...
...
@@ -217,7 +213,45 @@ class AcceleratorFragment : XPageFragment() {
}
}
binding
.
btnQuick
.
setOnClickListener
{
acceleratorViewModel
.
accState
.
value
?.
let
{
startBtnClick
()
}
binding
.
gameStart
.
setOnClickListener
{
if
(!
binding
.
expandableLayout1
.
isExpanded
)
{
AcceleratorUtils
.
game
?.
let
{
DataRePortUtils
.
report
(
"st_speed_game_start_clk"
)
try
{
AppUtils
.
launchApp
(
it
.
packageName
)
}
catch
(
e
:
Exception
)
{
}
if
(
state
==
BaseService
.
State
.
Connected
)
{
binding
.
gameStart
.
postDelayed
({
ToastUtils
.
show
(
"TT正在为游戏加速"
)
},
1000
)
}
}
}
}
binding
.
btnClose
.
setOnClickListener
{
popToBack
()
}
AcceleratorUtils
.
registerStateListener
{
state
,
l
,
net
->
net
?.
let
{
acceleratorViewModel
.
netState
.
postValue
(
net
)
}
accTimer
=
l
acceleratorViewModel
.
accState
.
postValue
(
state
)
}
if
(
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Stopping
)
{
binding
.
btnQuick
.
performClick
()
}
}
fun
startBtnClick
()
{
AcceleratorUtils
.
state
.
let
{
if
(
it
.
canStop
)
{
context
?.
let
{
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
...
...
@@ -226,16 +260,17 @@ class AcceleratorFragment : XPageFragment() {
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
}).
setBtnRight
(
"停止加速"
,
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
AcceleratorUtils
.
stopAccelerator
(
)
AcceleratorUtils
.
stopAccelerator
({}
)
}).
show
<
CommonDialog
>()
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
DataRePortUtils
.
report
(
"st_speed_stop_clk"
)
return
@setOnClickListener
return
}
else
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
)
}
}
gameInfo
?.
let
{
AcceleratorUtils
.
setGameInfo
(
it
)
}
context
?.
let
{
it1
->
AcceleratorUtils
.
openLocation
(
it1
)
}
if
(!
LoginUtils
.
hasToken
())
{
context
?.
let
{
it1
->
...
...
@@ -244,7 +279,7 @@ class AcceleratorFragment : XPageFragment() {
})
}
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"3"
))
return
@setOnClickListener
return
}
if
(!
SysUtils
.
getConnectivityStatus
())
{
...
...
@@ -254,11 +289,11 @@ class AcceleratorFragment : XPageFragment() {
binding
.
quickTopToast
.
visibility
=
View
.
GONE
},
2000
)
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"3"
))
return
@setOnClickListener
return
}
//
AcceleratorUtils
.
game
?.
let
{
gameInfo
?.
let
{
if
(!
SysUtils
.
isPackageInstall
(
requireContext
(),
it
.
packageName
))
{
binding
.
quickTopToast
.
visibility
=
View
.
VISIBLE
binding
.
quickTopToastTx
.
setText
(
"请先安装游戏后加速"
)
...
...
@@ -269,7 +304,7 @@ class AcceleratorFragment : XPageFragment() {
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"1"
)
)
return
@setOnClickListener
return
}
}
//用户是否有使用时长
...
...
@@ -287,36 +322,6 @@ class AcceleratorFragment : XPageFragment() {
}
}
binding
.
gameStart
.
setOnClickListener
{
if
(!
binding
.
expandableLayout1
.
isExpanded
)
{
AcceleratorUtils
.
game
?.
let
{
DataRePortUtils
.
report
(
"st_speed_game_start_clk"
)
try
{
AppUtils
.
launchApp
(
it
.
packageName
)
}
catch
(
e
:
Exception
)
{
}
if
(
state
==
BaseService
.
State
.
Connected
)
{
binding
.
gameStart
.
postDelayed
({
ToastUtils
.
show
(
"TT正在为游戏加速"
)
},
1000
)
}
}
}
}
binding
.
btnClose
.
setOnClickListener
{
popToBack
()
}
AcceleratorUtils
.
registerStateListener
{
state
,
l
,
net
->
net
?.
let
{
acceleratorViewModel
.
netState
.
postValue
(
net
)
}
accTimer
=
l
acceleratorViewModel
.
accState
.
postValue
(
state
)
}
}
fun
openToWebview
(
url
:
String
)
{
val
params
=
Bundle
()
params
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
HttpConfig
.
UI_MAIN_URL
+
url
)
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
View file @
acd80b21
...
...
@@ -57,7 +57,8 @@ class NewsFragment : XPageFragment() {
val
titles
=
arrayOf
(
"全部"
,
"攻略"
,
"视频"
,
"评价"
,
"问答"
)
var
adapter
:
NewsCollectionAdapter
?
=
null
override
fun
initViews
()
{
gameId
=
arguments
?.
getInt
(
CommonWebViewFragment
.
GAME_ID
)
!!
gameId
=
arguments
?.
getInt
(
GAME_ID
)
!!
val
gameName
=
arguments
?.
getString
(
GAME_NAME
)
!!
newsViewModel
.
notice
.
observe
(
this
)
{
it1
->
binding
.
newsNotice
.
visibility
=
View
.
VISIBLE
binding
.
tvMarquee
.
addDisplayString
(
it1
.
title
)
...
...
@@ -67,7 +68,7 @@ class NewsFragment : XPageFragment() {
openToWebviewNative
(
"/notice?noticeId=${it1.id}"
)
}
}
binding
.
newsTitle
.
setText
(
if
(
SysUtils
.
getChannel
()
==
3
)
"地下城与勇士"
else
"地下城与勇士 韩服"
)
binding
.
newsTitle
.
setText
(
gameName
)
newsViewModel
.
isRefresh
.
observe
(
this
,
Observer
{
binding
.
refreshNews
.
isRefreshing
=
false
})
...
...
@@ -157,7 +158,7 @@ class NewsFragment : XPageFragment() {
dataList
.
addAll
(
it
)
binding
.
gameNewsList
.
adapter
?.
notifyDataSetChanged
()
})
adapter
=
NewsCollectionAdapter
(
this
,
titles
,
gameId
)
adapter
=
NewsCollectionAdapter
(
this
,
titles
,
gameId
)
binding
.
viewPager
.
adapter
=
adapter
TabLayoutMediator
(
binding
.
tabLayout
,
binding
.
viewPager
)
{
tab
,
position
->
tab
.
setCustomView
(
R
.
layout
.
item_tab
)
...
...
@@ -221,6 +222,9 @@ class NewsFragment : XPageFragment() {
val
fragment
=
NewsFragment
()
return
fragment
}
val
GAME_NAME
=
"GAME_NAME"
val
GAME_ID
=
"GAME_ID"
}
}
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
View file @
acd80b21
...
...
@@ -21,7 +21,7 @@ class NewsViewModel : ViewModel() {
fun
getNotice
(
gameId
:
Int
)
{
viewModelScope
.
launch
(
Dispatchers
.
IO
)
{
val
res
=
HttpGo
.
getSync
<
NoticeList
>(
"/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}"
)
HttpGo
.
getSync
<
NoticeList
>(
"/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}
&addrType=1
"
)
res
?.
let
{
if
(
it
.
code
==
200
)
{
it
.
data
?.
list
?.
let
{
...
...
@@ -37,7 +37,7 @@ class NewsViewModel : ViewModel() {
fun
getPlugin
(
gameId
:
Int
)
{
viewModelScope
.
launch
(
Dispatchers
.
IO
)
{
val
res
=
HttpGo
.
getSync
<
PluginModel
>(
"/api/plugin/list?gameId=$
gameId
&page=1&size=10&channelId=${SysUtils.getChannel()}"
)
HttpGo
.
getSync
<
PluginModel
>(
"/api/plugin/list?gameId=$
{gameId}
&page=1&size=10&channelId=${SysUtils.getChannel()}"
)
res
?.
let
{
if
(
it
.
code
==
200
)
{
it
.
data
?.
list
?.
let
{
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/NoticeFragment.kt
View file @
acd80b21
...
...
@@ -34,7 +34,8 @@ class NoticeFragment : XPageFragment() {
}
override
fun
initViews
()
{
var
weburl
=
HttpConfig
.
UI_MAIN_URL
+
HttpConfig
.
UI_MESSAGE_URL
+
"?channel=${SysUtils.getChannel()}"
var
weburl
=
HttpConfig
.
UI_MAIN_URL
+
HttpConfig
.
UI_MESSAGE_URL
+
"?channel=${SysUtils.getChannel()}"
LoginUtils
.
token
?.
let
{
weburl
=
weburl
+
"&token=${it}"
}
...
...
@@ -85,13 +86,7 @@ class NoticeFragment : XPageFragment() {
}
private
fun
refreshLogin
()
{
LoginUtils
.
token
?.
let
{
agentWeb
?.
getJsAccessEntrace
()
?.
quickCallJs
(
"userToken"
,
it
)
}
?:
let
{
agentWeb
?.
getJsAccessEntrace
()
?.
quickCallJs
(
"clearToken"
)
}
agentWeb
?.
webCreator
?.
webView
?.
reload
()
}
override
fun
onPause
()
{
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
View file @
acd80b21
...
...
@@ -24,7 +24,11 @@ import com.tencent.bugly.beta.Beta
/**
* js注入的方法
*/
class
AndroidInterface
(
val
xPageFragment
:
XPageFragment
,
val
agentWeb
:
AgentWeb
)
{
class
AndroidInterface
(
val
xPageFragment
:
XPageFragment
,
val
agentWeb
:
AgentWeb
,
var
gameId
:
Int
=
-
1
)
{
@JavascriptInterface
fun
callAndroid
(
msg
:
String
)
{
...
...
@@ -164,7 +168,7 @@ class AndroidInterface(val xPageFragment: XPageFragment, val agentWeb: AgentWeb)
*/
@JavascriptInterface
fun
getAccelerateState
(
callback
:
String
)
{
if
(
BaseService
.
State
.
Connected
==
AcceleratorUtils
.
state
)
{
if
(
BaseService
.
State
.
Connected
==
AcceleratorUtils
.
state
&&
AcceleratorUtils
.
game
?.
id
==
gameId
)
{
agentWeb
.
jsAccessEntrace
.
quickCallJs
(
callback
,
"1"
)
}
else
{
...
...
@@ -180,10 +184,9 @@ class AndroidInterface(val xPageFragment: XPageFragment, val agentWeb: AgentWeb)
*/
@JavascriptInterface
fun
clickAccelerateBtn
()
{
handler
.
post
{
xPageFragment
.
setFragmentResult
(
500
,
Intent
())
xPageFragment
.
popToBack
()
}
xPageFragment
.
setFragmentResult
(
500
,
Intent
())
}
/**
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/web/CommonWebViewFragment.kt
View file @
acd80b21
...
...
@@ -71,7 +71,7 @@ class CommonWebViewFragment : XPageFragment() {
createAgentWeb
(
this
,
binding
.
commonWebview
,
weburl
)
}
agentWeb
?.
getJsInterfaceHolder
()
?.
addJavaObject
(
"android"
,
AndroidInterface
(
this
,
agentWeb
!!
)
)
?.
addJavaObject
(
"android"
,
gameId
?.
let
{
AndroidInterface
(
this
,
agentWeb
!!
,
it
)
}
)
agentWeb
?.
webCreator
?.
webView
?.
requestFocus
(
View
.
FOCUS_DOWN
);
}
...
...
app/src/main/java/com/ccwangluo/accelerator/utils/AcceleratorUtils.kt
View file @
acd80b21
...
...
@@ -96,7 +96,7 @@ object AcceleratorUtils : TencentLocationListener {
.
toInt
()
LoginUtils
.
getUserHasTimer
{
haveTime
->
if
(!
haveTime
)
{
//没有加速时长关闭服务
stopAccelerator
()
stopAccelerator
(
{}
)
}
}
netState
.
accNetDelay
=
...
...
@@ -238,17 +238,22 @@ object AcceleratorUtils : TencentLocationListener {
}
}
fun
stopAccelerator
()
{
var
stopListener
:
()
->
Unit
?
=
{}
fun
stopAccelerator
(
listener
:
()
->
Unit
)
{
Core
.
stopService
()
game
=
null
stopListener
=
listener
}
private
val
shadowsocksConnection
=
object
:
ShadowsocksConnection
.
Callback
{
override
fun
stateChanged
(
state
:
BaseService
.
State
,
profileName
:
String
?,
msg
:
String
?)
{
AcceleratorUtils
.
state
=
state
stateListener
(
state
)
if
(
state
==
BaseService
.
State
.
Stopped
)
{
stopListener
()
stopListener
=
{}
}
if
(
state
==
BaseService
.
State
.
Stopped
&&
!
msg
.
isNullOrBlank
())
{
game
=
null
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
3
.
toString
())
...
...
@@ -256,7 +261,7 @@ object AcceleratorUtils : TencentLocationListener {
if
(
"vip到期"
.
equals
(
msg
)
||
(
msg
!=
null
&&
msg
.
startsWith
(
"vip已到期"
)))
{
vipExpireListener
()
}
else
{
stopAccelerator
()
stopAccelerator
(
{}
)
ToastUtils
.
show
(
msg
)
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/utils/SysUtils.kt
View file @
acd80b21
...
...
@@ -9,6 +9,7 @@ import android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
android.util.DisplayMetrics
import
com.ccwangluo.accelerator.utils.SysUtils.channelString
import
com.ccwangluo.cc_quickly.utils.SettingSPUtils
import
com.hjq.toast.ToastUtils
import
com.mcxiaoke.packer.helper.PackerNg
...
...
@@ -27,6 +28,8 @@ object SysUtils {
return
NetworkUtils
.
isHaveInternet
()
}
var
channelString
:
String
?
=
""
fun
getActiveNet
():
String
{
when
(
NetworkUtils
.
getNetStateType
())
{
NetworkUtils
.
NetState
.
NET_WIFI
->
return
"WIFI"
...
...
@@ -114,20 +117,37 @@ object SysUtils {
// return 4
}
fun
getReportChannel
():
Int
{
return
when
(
channelString
)
{
"v2_guanwang"
->
51
"v2_huawei"
->
52
"v2_xiaomi"
->
53
"v2_vivo"
->
54
"v2_yingyongbao"
->
55
"v2_OPPO"
->
56
"v2_baiduzhushou"
->
57
"v2_wufan"
->
58
"v2_share"
->
59
"v2_update"
->
60
else
->
51
}
}
fun
initChannel
(
context
:
Context
)
{
if
(
SettingSPUtils
.
channel
==
0
)
{
val
channel
=
PackerNg
.
getChannel
(
context
)
SettingSPUtils
.
channel
=
when
(
channel
)
{
"guanwang"
->
1
"huawei"
->
2
"xiaomi"
->
3
"vivo"
->
4
"yingyongbao"
->
5
"OPPO"
->
6
"baiduzhushou"
->
7
"wufan"
->
8
"share"
->
9
"update"
->
10
channelString
=
PackerNg
.
getChannel
(
context
)
SettingSPUtils
.
channel
=
when
(
channel
String
)
{
"
v2_
guanwang"
->
1
"
v2_
huawei"
->
2
"
v2_
xiaomi"
->
3
"v
2_v
ivo"
->
4
"
v2_
yingyongbao"
->
5
"
v2_
OPPO"
->
6
"
v2_
baiduzhushou"
->
7
"
v2_
wufan"
->
8
"
v2_
share"
->
9
"
v2_
update"
->
10
else
->
1
}
}
...
...
@@ -213,6 +233,7 @@ object SysUtils {
}
catch
(
e
:
java
.
lang
.
Exception
)
{
e
.
printStackTrace
()
println
(
"localVersion = $localVersion remoteVersion=${remoteVersion}"
)
}
return
true
}
...
...
@@ -223,17 +244,21 @@ object SysUtils {
* @return
*/
fun
getAllAppInfo
(
ctx
:
Context
):
List
<
String
>
{
val
appBean
List
=
mutableListOf
<
String
>()
val
game
List
=
mutableListOf
<
String
>()
val
packageManager
=
ctx
.
packageManager
val
list
=
packageManager
.
getInstalledPackages
(
0
)
for
(
p
in
list
)
{
val
flags
=
p
.
applicationInfo
.
flags
// 判断是否是属于系统的apk
if
(
flags
!=
ApplicationInfo
.
FLAG_SYSTEM
)
{
appBeanList
.
add
(
p
.
applicationInfo
.
packageName
)
val
packageName
=
p
.
applicationInfo
.
packageName
if
(
packageName
.
contains
(
"samsung"
))
{
continue
}
gameList
.
add
(
p
.
applicationInfo
.
packageName
)
}
}
return
appBean
List
return
game
List
}
}
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/utils/datareport/BaseData.kt
View file @
acd80b21
...
...
@@ -6,7 +6,7 @@ import com.google.gson.JsonObject
import
java.time.LocalDateTime
data class
BaseData
(
var
channel
:
Int
=
SysUtils
.
getChannel
(),
var
channel
:
Int
=
SysUtils
.
get
Report
Channel
(),
var
client_ip
:
String
=
"127.0.0.1"
,
var
did
:
String
?
=
SysUtils
.
getDeviceUUID
(),
var
ds
:
String
=
LocalDateTime
.
now
().
toString
(),
...
...
app/src/main/java/com/ccwangluo/accelerator/utils/http/HttpGo.kt
View file @
acd80b21
...
...
@@ -60,6 +60,7 @@ object HttpGo {
logger
.
info
(
url
)
val
call
=
okHttpClient
.
newCall
(
request
.
build
())
val
response
:
Response
=
call
.
execute
()
logger
.
info
(
response
.
toString
())
if
(
response
.
isSuccessful
)
{
val
type
=
object
:
TypeToken
<
BaseModel
<
T
>>()
{}.
type
val
string
=
response
.
body
?.
string
()
...
...
app/src/main/res/layout/fragment_game_list.xml
View file @
acd80b21
...
...
@@ -2,7 +2,7 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/
divide_gray
"
android:background=
"@color/
white
"
android:orientation=
"vertical"
>
<LinearLayout
...
...
app/src/main/res/layout/item_game.xml
View file @
acd80b21
...
...
@@ -217,8 +217,6 @@
android:id=
"@+id/game_notice_area_1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7.75dp"
android:layout_marginBottom=
"7.75dp"
android:orientation=
"horizontal"
>
<TextView
...
...
@@ -226,6 +224,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:paddingTop=
"7.5dp"
android:paddingBottom=
"7.5dp"
android:layout_weight=
"1"
android:gravity=
"center"
android:maxLength=
"6"
...
...
@@ -245,6 +245,8 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:paddingTop=
"7.5dp"
android:paddingBottom=
"7.5dp"
android:gravity=
"center"
android:maxLength=
"6"
android:text=
"资讯社区"
...
...
@@ -263,6 +265,8 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:paddingTop=
"7.5dp"
android:paddingBottom=
"7.5dp"
android:maxLength=
"6"
android:gravity=
"center"
android:text=
"资讯社区"
...
...
buildSrc/src/main/kotlin/Helpers.kt
View file @
acd80b21
...
...
@@ -56,8 +56,8 @@ fun Project.setupCore() {
setupCommon
()
android
.
apply
{
defaultConfig
{
versionCode
=
3
versionName
=
"1.0.
3
"
versionCode
=
1
versionName
=
"1.0.
0
"
}
compileOptions
.
isCoreLibraryDesugaringEnabled
=
true
lintOptions
{
...
...
channels.txt
View file @
acd80b21
guanwang
huawei
xiaomi
vivo
yingyongbao
OPPO
baiduzhushou
wufan
share
update
\ No newline at end of file
v2_guanwang
v2_huawei
v2_xiaomi
v2_vivo
v2_yingyongbao
v2_OPPO
v2_baiduzhushou
v2_wufan
v2_share
v2_update
\ No newline at end of file
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
View file @
acd80b21
...
...
@@ -26,7 +26,7 @@ object HttpConfig {
//隐私政策
val
url_privacy_policy_no_title
=
"https://sdk-static.srccwl.com/tt_html_n/private.html"
val
UI_MESSAGE_URL
=
"/
m
essage"
val
UI_MESSAGE_URL
=
"/
systemM
essage"
val
UI_GAME_URL
=
"/game"
...
...
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