|
@@ -25,6 +25,7 @@ import com.xugame.gameconsole.util.PermissionsUtils;
|
|
|
|
|
|
import java.io.BufferedOutputStream;
|
|
import java.io.BufferedOutputStream;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
|
+import java.io.FileInputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
@@ -167,17 +168,18 @@ public class TextCopyFileActivity extends Activity {
|
|
|
|
|
|
private boolean copyFile(String file_path, String fileName) {
|
|
private boolean copyFile(String file_path, String fileName) {
|
|
Log.i(TAG, "copyFile" + "filepath=" + file_path+"filename="+fileName);
|
|
Log.i(TAG, "copyFile" + "filepath=" + file_path+"filename="+fileName);
|
|
- try {
|
|
|
|
- String fileNames[] = this.getAssets().list("xucores");
|
|
|
|
- for (int i=0;i<fileNames.length;i++)
|
|
|
|
- Log.i(TAG,"name="+fileNames[i]);
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
|
|
+ File baseFile=new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/arcade/cores/");
|
|
|
|
+ if(!baseFile.exists())//创建/arcade/cores文件夹
|
|
|
|
+ baseFile.mkdirs();
|
|
|
|
+
|
|
|
|
+ File file=new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/arcade/cores/"+fileName);
|
|
|
|
+ if(!file.exists())//检测cores文件夹下是否存在.so
|
|
|
|
+ return false;
|
|
Log.i(TAG,"");
|
|
Log.i(TAG,"");
|
|
try {
|
|
try {
|
|
InputStream in = null;
|
|
InputStream in = null;
|
|
- in = this.getResources().getAssets().open("xucores/"+fileName);
|
|
|
|
|
|
+// in = this.getResources().getAssets().open("xucores/"+fileName);
|
|
|
|
+ in= new FileInputStream(file);
|
|
BufferedOutputStream outStream
|
|
BufferedOutputStream outStream
|
|
= new BufferedOutputStream(new FileOutputStream(file_path, false));
|
|
= new BufferedOutputStream(new FileOutputStream(file_path, false));
|
|
byte[] buffer = new byte[1024];
|
|
byte[] buffer = new byte[1024];
|