Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
fallenstardust
YGOMobile
Commits
b63e6152
Commit
b63e6152
authored
Oct 25, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加多语言超先行卡列表json地址
parent
1a8660c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
...n/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
...e/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
+17
-15
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
View file @
b63e6152
...
...
@@ -43,7 +43,7 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCardData, BaseViewHold
LogUtil
.
d
(
TAG
,
"start fetch"
);
List
<
ExCardData
>
exCardDataList
=
null
;
try
{
Response
response
=
OkhttpUtil
.
synchronousGet
(
URL_PRE_CARD
,
null
,
null
);
Response
response
=
OkhttpUtil
.
synchronousGet
(
ServerUtil
.
preCardListJson
()
,
null
,
null
);
String
responseBodyString
=
response
.
body
().
string
();
Type
listType
=
new
TypeToken
<
List
<
ExCardData
>>()
{
}.
getType
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
View file @
b63e6152
...
...
@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.utils;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ASSET_SERVER_LIST
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
URL_CN_DATAVER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
URL_PRE_CARD
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
URL_SUPERPRE_CN_FILE
;
import
static
cn
.
garymb
.
ygomobile
.
utils
.
StringUtils
.
isHost
;
import
static
cn
.
garymb
.
ygomobile
.
utils
.
StringUtils
.
isNumeric
;
...
...
@@ -54,19 +55,8 @@ public class ServerUtil {
public
static
void
initExCardState
()
{
String
oldVer
=
SharedPreferenceUtil
.
getExpansionDataVer
();
LogUtil
.
i
(
TAG
,
"server util, old pre-card version:"
+
oldVer
);
String
id
=
""
;
String
URL_DATAVER
=
URL_CN_DATAVER
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Korean
.
code
)
id
=
"KR"
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
English
.
code
)
id
=
"EN"
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Spanish
.
code
)
id
=
"ES"
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Japanese
.
code
)
id
=
"JP"
;
URL_DATAVER
=
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Chinese
.
code
)
?
URL_CN_DATAVER
:
"https://github.com/DaruKani/TransSuperpre/blob/main/"
+
id
+
"/version.txt"
;
URL_DATAVER
=
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Chinese
.
code
)
?
URL_CN_DATAVER
:
"https://github.com/DaruKani/TransSuperpre/blob/main/"
+
getLanguageId
()
+
"/version.txt"
;
Log
.
w
(
"seesee"
,
URL_DATAVER
);
OkhttpUtil
.
get
(
URL_DATAVER
,
new
Callback
()
{
@Override
...
...
@@ -310,8 +300,7 @@ public class ServerUtil {
return
(
port
==
Constants
.
PORT_Mycard_Super_Pre_Server
&&
(
addr
.
equals
(
Constants
.
URL_Mycard_Super_Pre_Server
)
||
addr
.
equals
(
Constants
.
URL_Mycard_Super_Pre_Server_2
)));
}
public
static
String
downloadUrl
()
{
String
url
;
private
static
String
getLanguageId
()
{
String
id
=
""
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Korean
.
code
)
id
=
"KR"
;
...
...
@@ -321,11 +310,24 @@ public class ServerUtil {
id
=
"ES"
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Japanese
.
code
)
id
=
"JP"
;
url
=
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Chinese
.
code
)
?
URL_SUPERPRE_CN_FILE
:
"https://raw.githubusercontent.com/DaruKani/TransSuperpre/refs/heads/main/"
+
id
+
"/ygopro-super-pre.ypk"
;
return
id
;
}
public
static
String
downloadUrl
()
{
String
url
;
url
=
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Chinese
.
code
)
?
URL_SUPERPRE_CN_FILE
:
"https://raw.githubusercontent.com/DaruKani/TransSuperpre/refs/heads/main/"
+
getLanguageId
()
+
"/ygopro-super-pre.ypk"
;
Log
.
w
(
"seesee"
,
url
);
return
url
;
}
public
static
String
preCardListJson
()
{
String
json
;
json
=
(
AppsSettings
.
get
().
getDataLanguage
()
==
AppsSettings
.
languageEnum
.
Chinese
.
code
)
?
URL_PRE_CARD
:
"https://raw.githubusercontent.com/DaruKani/TransSuperpre/refs/heads/main/"
+
getLanguageId
()
+
"/test-release.json"
;
Log
.
w
(
"seesee"
,
json
);
return
json
;
}
public
enum
ExCardState
{
/* 已安装最新版扩展卡,扩展卡不是最新版本,无法查询到服务器版本 */
UNCHECKED
,
UPDATED
,
NEED_UPDATE
,
ERROR
...
...
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