Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
99557d14
Commit
99557d14
authored
Jan 18, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换.ypk为Constants.YPK_FILE_EX
parent
b3cfcbd0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
8 deletions
+10
-8
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
.../java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
...e/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
+2
-1
mobile/src/main/java/ocgcore/CardManager.java
mobile/src/main/java/ocgcore/CardManager.java
+3
-2
mobile/src/main/java/ocgcore/StringManager.java
mobile/src/main/java/ocgcore/StringManager.java
+1
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
99557d14
...
...
@@ -252,7 +252,7 @@ public class AppsSettings {
return
false
;
}
String
s_name
=
file
.
getName
().
toLowerCase
();
return
s_name
.
endsWith
(
".zip"
)
||
s_name
.
endsWith
(
".ypk"
);
return
s_name
.
endsWith
(
".zip"
)
||
s_name
.
endsWith
(
Constants
.
YPK_FILE_EX
);
});
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
99557d14
...
...
@@ -172,7 +172,7 @@ public class GameUriManager {
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
YDK_FILE_EX
))
{
File
dir
=
Constants
.
COPY_YDK_FILE
?
new
File
(
AppsSettings
.
get
().
getDeckDir
())
:
new
File
(
getActivity
().
getApplicationInfo
().
dataDir
,
"cache"
);
local
=
getDeckFile
(
dir
,
getPathName
(
path
,
true
));
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".ypk"
))
{
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
YPK_FILE_EX
))
{
String
[]
words
=
name
.
trim
().
split
(
"[()() ]+"
);
File
[]
ypkList
=
AppsSettings
.
get
().
getExpansionFiles
();
for
(
int
i
=
0
;
i
<
ypkList
.
length
;
i
++)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
View file @
99557d14
...
...
@@ -133,7 +133,7 @@ public class ExCardListFragment extends Fragment {
textDownload
.
setText
(
"0%"
);
//点击下载后,距离onDownloading触发要等几秒,这一延迟会造成软件响应慢的错觉,因此在下载函数开始就设置文本
String
path
=
AppsSettings
.
get
().
getExpansionsPath
().
getAbsolutePath
();
String
fileName
=
Constants
.
officialExCardPackageName
;
File
file
=
new
File
(
path
+
"/"
+
fileName
+
".ypk"
);
File
file
=
new
File
(
path
+
"/"
+
fileName
+
Constants
.
YPK_FILE_EX
);
/* 删除旧的先行卡包 */
File
[]
files
=
AppsSettings
.
get
().
getExpansionsPath
().
listFiles
();
if
(
files
!=
null
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
99557d14
...
...
@@ -117,7 +117,7 @@ public class MainActivity extends HomeActivity implements BottomNavigationBar.On
});
dialog
.
setOnDismissListener
(
dialogInterface
->
{
DialogPlus
dialogplus
=
new
DialogPlus
(
this
);
File
oldypk
=
new
File
(
AppsSettings
.
get
().
getExpansionsPath
()
+
"/"
+
officialExCardPackageName
+
".ypk"
);
File
oldypk
=
new
File
(
AppsSettings
.
get
().
getExpansionsPath
()
+
"/"
+
officialExCardPackageName
+
Constants
.
YPK_FILE_EX
);
if
(
oldypk
.
exists
())
{
FileUtils
.
deleteFile
(
oldypk
);
dialogplus
.
setMessage
(
R
.
string
.
tip_ypk_is_deleted
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
View file @
99557d14
...
...
@@ -4,6 +4,7 @@ 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
.
Constants
.
YDK_FILE_EX
;
import
static
cn
.
garymb
.
ygomobile
.
utils
.
StringUtils
.
isHost
;
import
static
cn
.
garymb
.
ygomobile
.
utils
.
StringUtils
.
isNumeric
;
import
static
cn
.
garymb
.
ygomobile
.
utils
.
WebParseUtil
.
isValidIP
;
...
...
@@ -108,7 +109,7 @@ public class ServerUtil {
* @param file
*/
public
static
void
loadServerInfoFromZipOrYpk
(
Context
context
,
File
file
)
{
if
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
".ypk"
))
{
if
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
YDK_FILE_EX
))
{
LogUtil
.
e
(
"GameUriManager"
,
"读取压缩包"
);
try
{
String
serverName
=
null
,
serverDesc
=
null
,
serverHost
=
null
,
serverPort
=
null
;
...
...
mobile/src/main/java/ocgcore/CardManager.java
View file @
99557d14
...
...
@@ -26,6 +26,7 @@ import java.util.zip.ZipInputStream;
import
cn.garymb.ygomobile.App
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
ocgcore.data.Card
;
...
...
@@ -151,7 +152,7 @@ public class CardManager {
@Override
public
boolean
accept
(
File
dir
,
String
name
)
{
File
file
=
new
File
(
dir
,
name
);
return
file
.
isFile
()
&&
((
name
.
endsWith
(
".cdb"
)
||
(
name
.
endsWith
(
".zip"
)
||
name
.
endsWith
(
".ypk"
))));
return
file
.
isFile
()
&&
((
name
.
endsWith
(
".cdb"
)
||
(
name
.
endsWith
(
".zip"
)
||
name
.
endsWith
(
Constants
.
YPK_FILE_EX
))));
}
});
//读取全部卡片
...
...
@@ -159,7 +160,7 @@ public class CardManager {
for
(
File
file
:
files
)
{
if
(
file
.
getName
().
endsWith
(
".cdb"
))
{
count
=
readAllCards
(
file
,
cardDataHashMap
);
}
else
if
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
".ypk"
))
{
}
else
if
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
Constants
.
YPK_FILE_EX
))
{
Log
.
e
(
"CardManager"
,
"读取压缩包"
);
try
{
for
(
File
file1
:
readZipCdb
(
file
.
getAbsolutePath
()))
{
...
...
mobile/src/main/java/ocgcore/StringManager.java
View file @
99557d14
...
...
@@ -61,7 +61,7 @@ public class StringManager implements Closeable {
File
[]
files
=
AppsSettings
.
get
().
getExpansionsPath
().
listFiles
();
if
(
files
!=
null
)
{
for
(
File
file
:
files
)
{
if
(
file
.
isFile
()
&&
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
".ypk"
)))
{
if
(
file
.
isFile
()
&&
(
file
.
getName
().
endsWith
(
".zip"
)
||
file
.
getName
().
endsWith
(
Constants
.
YPK_FILE_EX
)))
{
Log
.
e
(
"StringManager"
,
"读取压缩包"
);
try
{
ZipFile
zipFile
=
new
ZipFile
(
file
.
getAbsoluteFile
(),
"GBK"
);
...
...
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