Commit 66a2fc7a authored by fallenstardust's avatar fallenstardust

复制配置文件进应用文件

parent d324273c
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
注意:如果您是通过付费购买或者付费获得下载渠道而获得本软件的话,您已经上当受骗。本软件——免费! 注意:如果您是通过付费购买或者付费获得下载渠道而获得本软件的话,您已经上当受骗。本软件——免费!
特别感谢: 菜菜,尸体,废话多,,龙道香姐,晓L,幻兽L 的支持与努力. 特别感谢: 菜菜,尸体,废话多,龙道香姐,晓L,幻兽L 的支持与努力.
</pre> </pre>
<ul> <ul>
<li style="color:#ffff00">3.2.1</li> <li style="color:#ffff00">3.2.1</li>
......
...@@ -28,6 +28,7 @@ import ocgcore.ConfigManager; ...@@ -28,6 +28,7 @@ import ocgcore.ConfigManager;
import ocgcore.handler.CardManager; import ocgcore.handler.CardManager;
import static cn.garymb.ygomobile.Constants.ASSETS_PATH; import static cn.garymb.ygomobile.Constants.ASSETS_PATH;
import static cn.garymb.ygomobile.Constants.DATABASE_NAME;
public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
private static final String TAG = "ResCheckTask"; private static final String TAG = "ResCheckTask";
...@@ -157,18 +158,21 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -157,18 +158,21 @@ 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);
} }
if(needsUpdate) { //if (needsUpdate) {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.WINDBOT_PATH), File filesDir = mContext.getFilesDir();
new File(resPath, Constants.WINDBOT_PATH).getAbsolutePath(), needsUpdate); IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.WINDBOT_PATH),
} filesDir.getPath(), needsUpdate);
//初始化windbot // }
checkWindbot();
if (needsUpdate) { if (needsUpdate) {
setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.ex_pack))); setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.ex_pack)));
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_EXPANSIONS), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_EXPANSIONS),
mSettings.getExpansionsPath().getAbsolutePath(), true, needsUpdate); mSettings.getExpansionsPath().getAbsolutePath(), true, needsUpdate);
} }
//checkWindbot();
} catch (Exception e) { } catch (Exception e) {
if (Constants.DEBUG) if (Constants.DEBUG)
Log.e(TAG, "check", e); Log.e(TAG, "check", e);
...@@ -179,7 +183,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -179,7 +183,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
void copyCdbFile(boolean needsUpdate) throws IOException { void copyCdbFile(boolean needsUpdate) throws IOException {
File dbFile = new File(mSettings.getDataBasePath(), Constants.DATABASE_NAME); File dbFile = new File(mSettings.getDataBasePath(), DATABASE_NAME);
boolean copyDb = true; boolean copyDb = true;
if (dbFile.exists()) { if (dbFile.exists()) {
copyDb = false; copyDb = false;
...@@ -189,7 +193,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -189,7 +193,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
} }
} }
if (copyDb) { if (copyDb) {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.DATABASE_NAME), mSettings.getDataBasePath(), needsUpdate); IOUtils.copyFilesFromAssets(mContext, getDatapath(DATABASE_NAME), mSettings.getDataBasePath(), needsUpdate);
// doSomeTrickOnDatabase(dbFile.getAbsolutePath()); // doSomeTrickOnDatabase(dbFile.getAbsolutePath());
} }
} }
...@@ -319,7 +323,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -319,7 +323,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
} }
public void checkWindbot(){ public void checkWindbot(){
WindBot.initAndroid("/storage/emulated/0/ygocore/deck","/storage/emulated/0/ygocore/cards.cdb"); Log.i("路径", mContext.getFilesDir().getPath());
Log.i("路径2", mSettings.getDataBasePath()+"/"+ DATABASE_NAME);
WindBot.initAndroid(mContext.getFilesDir().getPath(),mSettings.getDataBasePath()+"/"+ DATABASE_NAME);
ResCheckTask.MessageReceiver mReceiver = new ResCheckTask.MessageReceiver(); ResCheckTask.MessageReceiver mReceiver = new ResCheckTask.MessageReceiver();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction("RUN_WINDBOT"); filter.addAction("RUN_WINDBOT");
......
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