Commit 826024bb authored by fallenstardust's avatar fallenstardust

windbot搬到ygocore下

parent 7a1c5765
...@@ -229,6 +229,9 @@ public class MainActivity extends HomeActivity { ...@@ -229,6 +229,9 @@ public class MainActivity extends HomeActivity {
IOUtils.copyFilesFromAssets(this, getDatapath(Constants.CORE_STRING_PATH), IOUtils.copyFilesFromAssets(this, getDatapath(Constants.CORE_STRING_PATH),
AppsSettings.get().getResourcePath(), true); AppsSettings.get().getResourcePath(), true);
IOUtils.copyFilesFromAssets(this, getDatapath(Constants.WINDBOT_PATH),
AppsSettings.get().getResourcePath(), true);
IOUtils.copyFilesFromAssets(this, getDatapath(Constants.CORE_SKIN_PATH), IOUtils.copyFilesFromAssets(this, getDatapath(Constants.CORE_SKIN_PATH),
AppsSettings.get().getCoreSkinPath(), false); AppsSettings.get().getCoreSkinPath(), false);
} catch (IOException e) { } catch (IOException e) {
......
...@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver; ...@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.res.AssetManager;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException; import android.database.sqlite.SQLiteException;
...@@ -22,7 +21,6 @@ import cn.garymb.ygomobile.AppsSettings; ...@@ -22,7 +21,6 @@ import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.Constants; import cn.garymb.ygomobile.Constants;
import cn.garymb.ygomobile.lite.R; import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.plus.DialogPlus; import cn.garymb.ygomobile.ui.plus.DialogPlus;
import cn.garymb.ygomobile.utils.FileLogUtil;
import cn.garymb.ygomobile.utils.FileUtils; import cn.garymb.ygomobile.utils.FileUtils;
import cn.garymb.ygomobile.utils.IOUtils; import cn.garymb.ygomobile.utils.IOUtils;
import cn.garymb.ygomobile.utils.SystemUtils; import cn.garymb.ygomobile.utils.SystemUtils;
...@@ -145,12 +143,12 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -145,12 +143,12 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SINGLE_PATH), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SINGLE_PATH),
mSettings.getSingleDir(), needsUpdate); mSettings.getSingleDir(), needsUpdate);
} }
String[] textures1=mContext.getAssets().list(getDatapath(Constants.CORE_SKIN_PATH)); String[] textures1 = mContext.getAssets().list(getDatapath(Constants.CORE_SKIN_PATH));
String[] textures2=new File(mSettings.getCoreSkinPath()).list(); String[] textures2 = new File(mSettings.getCoreSkinPath()).list();
//复制资源文件夹 //复制资源文件夹
//如果textures文件夹不存在/textures资源数量不够/是更新则复制,但是不强制复制 //如果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))); setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.game_skins)));
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SKIN_PATH), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SKIN_PATH),
mSettings.getCoreSkinPath(), false); mSettings.getCoreSkinPath(), false);
...@@ -173,9 +171,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -173,9 +171,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_PICS_ZIP), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_PICS_ZIP),
resPath, needsUpdate); resPath, needsUpdate);
} }
//复制人机资源
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.WINDBOT_PATH), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.WINDBOT_PATH),
mContext.getFilesDir().getPath(), needsUpdate); resPath, needsUpdate);//mContext.getFilesDir().getPath()
han.sendEmptyMessage(0); han.sendEmptyMessage(0);
loadData(); loadData();
...@@ -285,7 +283,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -285,7 +283,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
//卡组分享截图文件夹 //卡组分享截图文件夹
Constants.MOBILE_DECK_SHARE, Constants.MOBILE_DECK_SHARE,
//额外卡库文件夹 //额外卡库文件夹
Constants.CORE_EXPANSIONS Constants.CORE_EXPANSIONS,
//人机资源文件夹
Constants.WINDBOT_PATH
}; };
File dirFile = null; File dirFile = null;
for (String dir : dirs) { for (String dir : dirs) {
...@@ -351,7 +351,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -351,7 +351,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
Log.i("路径", mContext.getFilesDir().getPath()); Log.i("路径", mContext.getFilesDir().getPath());
Log.i("路径2", mSettings.getDataBasePath() + "/" + DATABASE_NAME); Log.i("路径2", mSettings.getDataBasePath() + "/" + DATABASE_NAME);
try { try {
WindBot.initAndroid(mContext.getFilesDir().getPath(), WindBot.initAndroid(mSettings.getResourcePath(),
mSettings.getDataBasePath() + "/" + DATABASE_NAME, mSettings.getDataBasePath() + "/" + DATABASE_NAME,
mSettings.getResourcePath() + "/" + CORE_BOT_CONF_PATH); mSettings.getResourcePath() + "/" + CORE_BOT_CONF_PATH);
} catch (Throwable e) { } catch (Throwable e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment