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
d0381018
Commit
d0381018
authored
Apr 09, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重置资源也可以搬运原路径文件
parent
29c3f0ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+7
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+10
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+8
-9
No files found.
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
d0381018
package
cn.garymb.ygomobile
;
import
android.os.Environment
;
import
android.view.Gravity
;
import
cn.garymb.ygomobile.lite.BuildConfig
;
...
...
@@ -151,6 +152,12 @@ public interface Constants {
String
SERVER_FILE
=
"server_list.xml"
;
String
SHARE_FILE
=
".share_deck.png"
;
//原目录文件路径
String
ORI_DECK
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_DECK_PATH
;
String
ORI_REPLAY
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_REPLAY_PATH
;
String
ORI_TEXTURES
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_SKIN_PATH
;
String
ORI_PICS
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_IMAGE_PATH
;
long
LOG_TIME
=
2
*
1000
;
/***
* 如果是双击显示,则单击拖拽
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
d0381018
...
...
@@ -35,6 +35,10 @@ import cn.garymb.ygomobile.utils.YGOUtil;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_RELOAD
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
NETWORK_IMAGE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_DECK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_PICS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_REPLAY
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_TEXTURES
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
ResCheckListener
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
...
...
@@ -243,6 +247,12 @@ public class MainActivity extends HomeActivity {
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SOUND_PATH
),
AppsSettings
.
get
().
getSoundPath
(),
false
);
//复制原目录文件
FileUtils
.
copyDir
(
ORI_DECK
,
AppsSettings
.
get
().
getDeckDir
());
FileUtils
.
copyDir
(
ORI_REPLAY
,
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
Constants
.
CORE_REPLAY_PATH
);
FileUtils
.
copyDir
(
ORI_TEXTURES
,
AppsSettings
.
get
().
getCoreSkinPath
());
FileUtils
.
copyDir
(
ORI_PICS
,
AppsSettings
.
get
().
getCardImagePath
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
Log
.
e
(
"MainActivity"
,
"错误"
+
e
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
d0381018
...
...
@@ -36,6 +36,10 @@ import ocgcore.DataManager;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ASSETS_PATH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_BOT_CONF_PATH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
DATABASE_NAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_DECK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_PICS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_REPLAY
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ORI_TEXTURES
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_DEF_GAME_DIR
;
public
class
ResCheckTask
extends
AsyncTask
<
Void
,
Integer
,
Integer
>
{
...
...
@@ -210,11 +214,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
ConfigManager
systemConf
=
DataManager
.
openConfig
(
mSettings
.
getSystemConfig
());
systemConf
.
setFontSize
(
mSettings
.
getFontSize
());
systemConf
.
close
();
//原目录文件路径
String
deck
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_DECK_PATH
;
String
replay
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_REPLAY_PATH
;
String
textures
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_SKIN_PATH
;
String
pics
=
Environment
.
getExternalStorageDirectory
()
+
"/"
+
Constants
.
PREF_DEF_GAME_DIR
+
"/"
+
Constants
.
CORE_IMAGE_PATH
;
//如果是新版本
if
(
needsUpdate
)
{
...
...
@@ -272,10 +271,10 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
resPath
,
needsUpdate
);
//复制原目录文件
FileUtils
.
copyDir
(
deck
,
mSettings
.
getDeckDir
());
FileUtils
.
copyDir
(
replay
,
resPath
+
"/"
+
Constants
.
CORE_REPLAY_PATH
);
FileUtils
.
copyDir
(
textures
,
mSettings
.
getCoreSkinPath
());
FileUtils
.
copyDir
(
pics
,
mSettings
.
getCardImagePath
());
FileUtils
.
copyDir
(
ORI_DECK
,
mSettings
.
getDeckDir
());
FileUtils
.
copyDir
(
ORI_REPLAY
,
resPath
+
"/"
+
Constants
.
CORE_REPLAY_PATH
);
FileUtils
.
copyDir
(
ORI_TEXTURES
,
mSettings
.
getCoreSkinPath
());
FileUtils
.
copyDir
(
ORI_PICS
,
mSettings
.
getCardImagePath
());
han
.
sendEmptyMessage
(
0
);
...
...
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