Commit da086dd1 authored by fallenstardust's avatar fallenstardust

fix有时strings.conf为空的问题,添加复制前大小检查

更新x5内核依赖
parent d542dd15
......@@ -111,7 +111,7 @@ dependencies {
//跨进程SharedPreferencesPlus工具
implementation 'com.github.zhangliangming:PreferencesProvider:v1.3'
implementation 'org.apache.commons:commons-lang3:3.7'
api 'com.tencent.tbs:tbssdk:44085'
api 'com.tencent.tbs:tbssdk:44226'
//http请求库
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.bm.photoview:library:1.4.1'
......
......@@ -36,8 +36,6 @@ import cn.garymb.ygomobile.utils.NetUtils;
public class MainActivity extends HomeActivity implements BottomNavigationBar.OnTabSelectedListener {
private final String[] PERMISSIONS = {
// Manifest.permission.RECORD_AUDIO,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.SYSTEM_ALERT_WINDOW,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
......@@ -115,19 +113,6 @@ public class MainActivity extends HomeActivity implements BottomNavigationBar.On
}
}
});
/*DialogPlus dialog = new DialogPlus(this)
.setTitleText(getString(R.string.settings_about_change_log))
.loadUrl("file:///android_asset/changelog.html", Color.TRANSPARENT)
.hideButton()
.setOnCloseLinster((dlg) -> {
dlg.dismiss();
//mImageUpdater
if (NETWORK_IMAGE && NetUtils.isConnected(getContext())) {
if (!mImageUpdater.isRunning()) {
mImageUpdater.start();
}
}
});*/
dialog.setOnDismissListener(dialogInterface -> {
// if (AppsSettings.get().isServiceDuelAssistant() && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
// YGOUtil.isServicePermission(MainActivity.this, true);
......@@ -251,8 +236,4 @@ public class MainActivity extends HomeActivity implements BottomNavigationBar.On
public void onTabReselected(int position) {
}
/* checkResourceDownload((result, isNewVersion) -> {
Toast.makeText(this, R.string.tip_reset_game_res, Toast.LENGTH_SHORT).show();
});*/
}
......@@ -368,21 +368,20 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
}
private int copyCoreConfig(String toPath, boolean needsUpdate) {
File systemfile, stringfile, botfile;
systemfile = new File(AppsSettings.get().getResourcePath(), CORE_SYSTEM_PATH);
stringfile = new File(AppsSettings.get().getResourcePath(), CORE_STRING_PATH);
botfile = new File(AppsSettings.get().getResourcePath(), BOT_CONF);
try {
/* String path = getDatapath("conf");
int count = IOUtils.copyFilesFromAssets(mContext, path, toPath, needsUpdate);
if (count < 3) {
return ERROR_CORE_CONFIG_LOST;
}*/
File systemfile = new File(AppsSettings.get().getResourcePath(), CORE_SYSTEM_PATH);
File stringfile = new File(AppsSettings.get().getResourcePath(), CORE_STRING_PATH);
File botfile = new File(AppsSettings.get().getResourcePath(), BOT_CONF);
if (!systemfile.exists()) {
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_SYSTEM_PATH, toPath, false);
}
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_LIMIT_PATH, toPath, needsUpdate);
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_STRING_PATH, toPath, needsUpdate);
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_BOT_CONF_PATH, toPath, needsUpdate);
if (!stringfile.exists() || stringfile.length() < new File(getDatapath("conf") + "/" + CORE_STRING_PATH).length()) {
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_STRING_PATH, toPath, needsUpdate);
}
IOUtils.copyFilesFromAssets(mContext, getDatapath("conf") + "/" + CORE_BOT_CONF_PATH, toPath, needsUpdate);
//替换换行符
fixString(stringfile.getAbsolutePath());
fixString(botfile.getAbsolutePath());
......
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