This commit is contained in:
2020-06-03 09:41:10 +08:00
parent 9c41ab000b
commit afe1407825
8 changed files with 328 additions and 264 deletions

View File

@@ -1,6 +1,7 @@
package com.qy.utils;
import com.qy.Interfaces.SmaliApkToolsPath;
import com.qy.ui.EditToDalog;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -27,7 +28,7 @@ public class CsjTools {
@Override
public void smaliPath(String path) {
System.out.println(path);
if(path.startsWith("已出包")) {
if (path.startsWith("已出包")) {
out(path.replace("已出包", ""),
new File("csj").getAbsolutePath() + File.separator + "csc",
Integer.parseInt(version));
@@ -100,7 +101,11 @@ public class CsjTools {
reader.close();
return getXMLValue("package", tmp);
} else {
return "com.prujwk.jdyphn";
if (packageName == null) {
return Tools.loadConfig(new File("config.cfg")).getString("csjPackageName");
} else {
return packageName;
}
}
} catch (Exception e) {
e.printStackTrace();
@@ -128,6 +133,7 @@ public class CsjTools {
writer.write(manifest);
writer.flush();
writer.close();
reader.close();
} catch (Exception e) {
e.printStackTrace();
@@ -254,6 +260,7 @@ public class CsjTools {
public void smaliPath(String path) {
_log.smaliPath("已出包" + csjRes.getAbsolutePath());
_log.smaliPath("耗时:" + (System.currentTimeMillis() - time) / 1000 + "");
System.gc();
}
});
@@ -346,16 +353,30 @@ public class CsjTools {
//还有最后一个问题穿山甲的Activity没改
public static void main(String[] args) {
new CsjTools("C:\\Users\\58381\\Documents\\WeChat Files\\z583819556\\FileStorage\\File\\2020-04\\CasualGame-release.apk"
, "E:\\idea\\android_sdk_tools\\input\\csjDemo\\demo_2.9.0.0.apk"
, "com.abc.test"
, "5700"
, new SmaliApkToolsPath() {
@Override
public void smaliPath(String path) {
System.out.println("打包完成:"+path);
}
});
CsjTools tools = new CsjTools();
tools.build("D:\\IdeaProjects\\android_sdk_tools\\demo_2.8.0.2.apk",
"D:\\IdeaProjects\\android_sdk_tools\\app-release.apk",
new SmaliApkToolsPath() {
@Override
public void smaliPath(String log) {
System.out.println(log);
if (log.startsWith("已出包")) {
System.out.println("打包完成");
new EditToDalog("成功", "打包完成,请输入版本号", "5600", new SmaliApkToolsPath() {
@Override
public void smaliPath(String path) {
System.out.println(">>" + path);
tools.out(log.replace("已出包", ""),
new File("csj").getAbsolutePath() + File.separator + "csc",
Integer.parseInt(path));
}
});
}
}
});
// tools.outManifest();
// tools.start();
}
}