上线专用客户端修复工具
This commit is contained in:
parent
825b3d820f
commit
d18de231d0
@ -10,6 +10,7 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -30,6 +31,7 @@ public class MainActivity implements BaseActivityInterface {
|
|||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private KProgressHUD hud;
|
private KProgressHUD hud;
|
||||||
|
|
||||||
public MainActivity() {
|
public MainActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +46,6 @@ public class MainActivity implements BaseActivityInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRestart() {
|
public void onRestart() {
|
||||||
|
|
||||||
@ -97,12 +98,22 @@ public class MainActivity implements BaseActivityInterface {
|
|||||||
Button button = new Button(context);
|
Button button = new Button(context);
|
||||||
Button button2 = new Button(context);
|
Button button2 = new Button(context);
|
||||||
final Switch siwtch = new Switch(context);
|
final Switch siwtch = new Switch(context);
|
||||||
siwtch.setTextOn("覆盖版");
|
siwtch.setText("共存版");
|
||||||
siwtch.setTextOff("共存版");
|
text1.setText("请将proj.manifest、Cocos2dxPrefsFile.xml和压缩包放到jianRMG/harmony/文件夹中");
|
||||||
text1.setText("请将proj.manifest、Cocos2dxPrefsFile.xml和压缩包放到jianRMG/harmony/文件夹中\n压缩包请重命名为data.zip");
|
|
||||||
button.setText("创建harmony文件夹");
|
button.setText("创建harmony文件夹");
|
||||||
button2.setText("开始");
|
button2.setText("开始");
|
||||||
|
|
||||||
|
siwtch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if(isChecked){
|
||||||
|
siwtch.setText("覆盖版");
|
||||||
|
}else{
|
||||||
|
siwtch.setText("共存版");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
linearLayout.addView(text1);
|
linearLayout.addView(text1);
|
||||||
linearLayout.addView(button);
|
linearLayout.addView(button);
|
||||||
linearLayout.addView(button2);
|
linearLayout.addView(button2);
|
||||||
@ -123,40 +134,29 @@ public class MainActivity implements BaseActivityInterface {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
hud.show();
|
hud.show();
|
||||||
new Thread(new Runnable() {
|
final File file = new File(Utils.getAppPath() + "/harmony/");
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
File file=new File(Utils.getAppPath()+"/harmony/");
|
|
||||||
if (file.listFiles().length == 0) {
|
if (file.listFiles().length == 0) {
|
||||||
Utils.toast(context, "文件夹内为空,请放入harmony文件夹中");
|
Utils.toast(context, "文件夹内为空,请放入harmony文件夹中");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (File listFile : file.listFiles()) {
|
File xml = new File(file.getAbsolutePath() + "/Cocos2dxPrefsFile.xml");
|
||||||
System.out.println("处理文件:"+listFile.getAbsolutePath());
|
System.out.println(xml.getAbsoluteFile());
|
||||||
switch (listFile.getName()){
|
if (xml.exists()) {
|
||||||
case "proj.manifest":
|
ClientUttls.install(context, xml, "../shared_prefs/", new ModInterface() {
|
||||||
|
|
||||||
ClientUttls.install(context, listFile, "/files/", new ModInterface() {
|
|
||||||
@Override
|
|
||||||
public void onAction(boolean flag, int type) {
|
|
||||||
System.out.println("操作manifest文件:"+flag);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "Cocos2dxPrefsFile.xml":
|
|
||||||
ClientUttls.install(context, listFile, "../shared_prefs/", new ModInterface() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onAction(boolean flag, int type) {
|
public void onAction(boolean flag, int type) {
|
||||||
System.out.println("处理xml:" + flag);
|
System.out.println("处理xml:" + flag);
|
||||||
}
|
if (flag) {
|
||||||
});
|
for (File listFile : file.listFiles()) {
|
||||||
break;
|
System.out.println("处理文件:" + listFile.getAbsolutePath());
|
||||||
case "data.zip":
|
if (listFile.getName().contains(".zip")) {
|
||||||
File path;
|
File path;
|
||||||
if (siwtch.isChecked()) {
|
if (siwtch.isChecked()) {
|
||||||
path = new File(Utils.getSDCardPath() + "/Android/data/com.huanmeng.zhanjian2/files/res_default/10/");
|
path = new File(Utils.getSDCardPath() + "/Android/data/com.huanmeng.zhanjian2/files/res_default/10/");
|
||||||
|
System.out.println("操作对象:覆盖版");
|
||||||
} else {
|
} else {
|
||||||
path = new File(Utils.getSDCardPath() + "/Android/data/com.bigzhao.jianrmagicbox/files/res_default/10/");
|
path = new File(Utils.getSDCardPath() + "/Android/data/com.bigzhao.jianrmagicbox/files/res_default/10/");
|
||||||
|
System.out.println("操作对象:共存版");
|
||||||
}
|
}
|
||||||
if (!path.exists()) {
|
if (!path.exists()) {
|
||||||
path.mkdirs();
|
path.mkdirs();
|
||||||
@ -173,8 +173,16 @@ public class MainActivity implements BaseActivityInterface {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
Utils.toast(context, "操作完成");
|
Utils.toast(context, "操作完成");
|
||||||
|
}else{
|
||||||
|
Utils.toast(context, "Cocos2dxPrefsFile.xml处理失败");
|
||||||
|
hud.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Utils.toast(context, "Cocos2dxPrefsFile.xml文件不存在!");
|
||||||
|
hud.dismiss();
|
||||||
}
|
}
|
||||||
}).start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user