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
826024bb
Commit
826024bb
authored
Jul 19, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windbot搬到ygocore下
parent
7a1c5765
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+3
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+9
-9
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
826024bb
...
...
@@ -229,6 +229,9 @@ public class MainActivity extends HomeActivity {
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_STRING_PATH
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
AppsSettings
.
get
().
getResourcePath
(),
true
);
IOUtils
.
copyFilesFromAssets
(
this
,
getDatapath
(
Constants
.
CORE_SKIN_PATH
),
AppsSettings
.
get
().
getCoreSkinPath
(),
false
);
}
catch
(
IOException
e
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
826024bb
...
...
@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.content.res.AssetManager
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteDatabase
;
import
android.database.sqlite.SQLiteException
;
...
...
@@ -22,7 +21,6 @@ import cn.garymb.ygomobile.AppsSettings;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
import
cn.garymb.ygomobile.utils.FileUtils
;
import
cn.garymb.ygomobile.utils.IOUtils
;
import
cn.garymb.ygomobile.utils.SystemUtils
;
...
...
@@ -145,12 +143,12 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_SINGLE_PATH
),
mSettings
.
getSingleDir
(),
needsUpdate
);
}
String
[]
textures1
=
mContext
.
getAssets
().
list
(
getDatapath
(
Constants
.
CORE_SKIN_PATH
));
String
[]
textures2
=
new
File
(
mSettings
.
getCoreSkinPath
()).
list
();
String
[]
textures1
=
mContext
.
getAssets
().
list
(
getDatapath
(
Constants
.
CORE_SKIN_PATH
));
String
[]
textures2
=
new
File
(
mSettings
.
getCoreSkinPath
()).
list
();
//复制资源文件夹
//如果textures文件夹不存在/textures资源数量不够/是更新则复制,但是不强制复制
if
(
textures2
==
null
||(
textures1
!=
null
&&
textures1
.
length
>
textures2
.
length
)||
needsUpdate
)
{
if
(
textures2
==
null
||
(
textures1
!=
null
&&
textures1
.
length
>
textures2
.
length
)
||
needsUpdate
)
{
setMessage
(
mContext
.
getString
(
R
.
string
.
check_things
,
mContext
.
getString
(
R
.
string
.
game_skins
)));
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_SKIN_PATH
),
mSettings
.
getCoreSkinPath
(),
false
);
...
...
@@ -173,9 +171,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_PICS_ZIP
),
resPath
,
needsUpdate
);
}
//复制人机资源
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
WINDBOT_PATH
),
mContext
.
getFilesDir
().
getPath
(),
needsUpdate
);
resPath
,
needsUpdate
);
//mContext.getFilesDir().getPath()
han
.
sendEmptyMessage
(
0
);
loadData
();
...
...
@@ -285,7 +283,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
//卡组分享截图文件夹
Constants
.
MOBILE_DECK_SHARE
,
//额外卡库文件夹
Constants
.
CORE_EXPANSIONS
Constants
.
CORE_EXPANSIONS
,
//人机资源文件夹
Constants
.
WINDBOT_PATH
};
File
dirFile
=
null
;
for
(
String
dir
:
dirs
)
{
...
...
@@ -351,7 +351,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
Log
.
i
(
"路径"
,
mContext
.
getFilesDir
().
getPath
());
Log
.
i
(
"路径2"
,
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
);
try
{
WindBot
.
initAndroid
(
m
Context
.
getFilesDir
().
get
Path
(),
WindBot
.
initAndroid
(
m
Settings
.
getResource
Path
(),
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
,
mSettings
.
getResourcePath
()
+
"/"
+
CORE_BOT_CONF_PATH
);
}
catch
(
Throwable
e
)
{
...
...
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