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
05950917
Commit
05950917
authored
Jun 12, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仅当原路径确实存在文件才复制
parent
f4eb6a5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+6
-3
mobile/src/main/java/cn/garymb/ygomobile/utils/IOUtils.java
mobile/src/main/java/cn/garymb/ygomobile/utils/IOUtils.java
+0
-4
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
05950917
...
@@ -280,9 +280,12 @@ public class MainActivity extends HomeActivity {
...
@@ -280,9 +280,12 @@ public class MainActivity extends HomeActivity {
AppsSettings
.
get
().
getSoundPath
(),
false
);
AppsSettings
.
get
().
getSoundPath
(),
false
);
//复制原目录文件
//复制原目录文件
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
(),
false
);
if
(
new
File
(
ORI_DECK
).
list
()
!=
null
)
FileUtils
.
copyDir
(
ORI_REPLAY
,
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
Constants
.
CORE_REPLAY_PATH
,
false
);
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
(),
false
);
FileUtils
.
copyDir
(
ORI_PICS
,
AppsSettings
.
get
().
getCardImagePath
(),
false
);
if
(
new
File
(
ORI_REPLAY
).
list
()
!=
null
)
FileUtils
.
copyDir
(
ORI_REPLAY
,
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
Constants
.
CORE_REPLAY_PATH
,
false
);
if
(
new
File
(
ORI_PICS
).
list
()
!=
null
)
FileUtils
.
copyDir
(
ORI_PICS
,
AppsSettings
.
get
().
getCardImagePath
(),
false
);
}
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/utils/IOUtils.java
View file @
05950917
...
@@ -6,12 +6,9 @@ import android.content.res.AssetManager;
...
@@ -6,12 +6,9 @@ import android.content.res.AssetManager;
import
android.os.Build
;
import
android.os.Build
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.widget.Toast
;
import
java.io.Closeable
;
import
java.io.Closeable
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -125,7 +122,6 @@ public class IOUtils {
...
@@ -125,7 +122,6 @@ public class IOUtils {
try
{
try
{
inputStream
=
am
.
open
(
assets
);
inputStream
=
am
.
open
(
assets
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Toast
.
makeText
(
context
,
"copyFilesFromAssets error"
+
e
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
if
(
inputStream
!=
null
)
{
if
(
inputStream
!=
null
)
{
copyToFile
(
inputStream
,
tofile
.
getAbsolutePath
());
copyToFile
(
inputStream
,
tofile
.
getAbsolutePath
());
...
...
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