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
402e9d9a
Commit
402e9d9a
authored
Apr 09, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
可选是否替换
parent
d0381018
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+3
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+4
-4
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
...le/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
+5
-4
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
402e9d9a
...
@@ -249,10 +249,9 @@ public class MainActivity extends HomeActivity {
...
@@ -249,10 +249,9 @@ public class MainActivity extends HomeActivity {
AppsSettings
.
get
().
getSoundPath
(),
false
);
AppsSettings
.
get
().
getSoundPath
(),
false
);
//复制原目录文件
//复制原目录文件
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
());
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
(),
false
);
FileUtils
.
copyDir
(
ORI_REPLAY
,
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
Constants
.
CORE_REPLAY_PATH
);
FileUtils
.
copyDir
(
ORI_REPLAY
,
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
Constants
.
CORE_REPLAY_PATH
,
false
);
FileUtils
.
copyDir
(
ORI_TEXTURES
,
AppsSettings
.
get
().
getCoreSkinPath
());
FileUtils
.
copyDir
(
ORI_PICS
,
AppsSettings
.
get
().
getCardImagePath
(),
false
);
FileUtils
.
copyDir
(
ORI_PICS
,
AppsSettings
.
get
().
getCardImagePath
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
Log
.
e
(
"MainActivity"
,
"错误"
+
e
);
Log
.
e
(
"MainActivity"
,
"错误"
+
e
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
402e9d9a
...
@@ -271,10 +271,10 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
...
@@ -271,10 +271,10 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
resPath
,
needsUpdate
);
resPath
,
needsUpdate
);
//复制原目录文件
//复制原目录文件
FileUtils
.
copyDir
(
ORI_DECK
,
mSettings
.
getDeckDir
());
FileUtils
.
copyDir
(
ORI_DECK
,
mSettings
.
getDeckDir
()
,
false
);
FileUtils
.
copyDir
(
ORI_REPLAY
,
resPath
+
"/"
+
Constants
.
CORE_REPLAY_PATH
);
FileUtils
.
copyDir
(
ORI_REPLAY
,
resPath
+
"/"
+
Constants
.
CORE_REPLAY_PATH
,
false
);
FileUtils
.
copyDir
(
ORI_TEXTURES
,
mSettings
.
getCoreSkinPath
());
FileUtils
.
copyDir
(
ORI_TEXTURES
,
mSettings
.
getCoreSkinPath
()
,
true
);
FileUtils
.
copyDir
(
ORI_PICS
,
mSettings
.
getCardImagePath
());
FileUtils
.
copyDir
(
ORI_PICS
,
mSettings
.
getCardImagePath
()
,
false
);
han
.
sendEmptyMessage
(
0
);
han
.
sendEmptyMessage
(
0
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
View file @
402e9d9a
...
@@ -170,8 +170,9 @@ public class FileUtils {
...
@@ -170,8 +170,9 @@ public class FileUtils {
out
.
write
(
data
,
0
,
len
);
out
.
write
(
data
,
0
,
len
);
}
}
}
}
//复制文件夹全部文件
//复制文件夹全部文件
public
static
void
copyDir
(
String
oldPath
,
String
newPath
)
throws
IOException
{
public
static
void
copyDir
(
String
oldPath
,
String
newPath
,
boolean
isReplaced
)
throws
IOException
{
File
file
=
new
File
(
oldPath
);
File
file
=
new
File
(
oldPath
);
//文件名称列表
//文件名称列表
String
[]
filePath
=
file
.
list
();
String
[]
filePath
=
file
.
list
();
...
@@ -182,11 +183,11 @@ public class FileUtils {
...
@@ -182,11 +183,11 @@ public class FileUtils {
for
(
int
i
=
0
;
i
<
filePath
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
filePath
.
length
;
i
++)
{
if
((
new
File
(
oldPath
+
file
.
separator
+
filePath
[
i
])).
isDirectory
())
{
if
((
new
File
(
oldPath
+
file
.
separator
+
filePath
[
i
])).
isDirectory
())
{
copyDir
(
oldPath
+
file
.
separator
+
filePath
[
i
],
newPath
+
file
.
separator
+
filePath
[
i
]
);
copyDir
(
oldPath
+
file
.
separator
+
filePath
[
i
],
newPath
+
file
.
separator
+
filePath
[
i
],
false
);
}
}
if
(
new
File
(
oldPath
+
file
.
separator
+
filePath
[
i
]).
isFile
())
{
if
(
new
File
(
oldPath
+
file
.
separator
+
filePath
[
i
]).
isFile
())
{
if
(!(
new
File
(
newPath
+
file
.
separator
+
filePath
[
i
]).
exists
()))
if
(!(
new
File
(
newPath
+
file
.
separator
+
filePath
[
i
]).
exists
())
||
isReplaced
)
copyFile
(
oldPath
+
file
.
separator
+
filePath
[
i
],
newPath
+
file
.
separator
+
filePath
[
i
],
true
);
copyFile
(
oldPath
+
file
.
separator
+
filePath
[
i
],
newPath
+
file
.
separator
+
filePath
[
i
],
true
);
}
}
...
...
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