穿山甲资源包生成 API化

This commit is contained in:
Yutousama 2020-06-03 21:54:11 +08:00
parent 4c1aeed350
commit 80c3f208e3

View File

@ -54,10 +54,67 @@ public class AppMain extends JFrame {
private JMenuItem mntmbase; private JMenuItem mntmbase;
private JMenuItem mntmBase; private JMenuItem mntmBase;
public static void main(String[] args) { private static String cscPath = null;
// TODO Auto-generated method stub
new AppMain(); public static void main(String[] args) {
/*args = new String[]{"-package=com.test.abc"
, "-version=5800"
, "-apk=E:\\idea\\tools\\tmp\\app-release-1.apk"
, "-csj=E:\\idea\\tools\\csj\\demo.apk"
, "-csc=E:\\idea\\tools\\csj\\out\\csc"};*/
// TODO Auto-generated method stub
if (args.length == 0) {
new AppMain();
} else {
String packageName = null;
String version = null;
String apkPath = null;
String csjPath = null;
for (String arg : args) {
if (arg.startsWith("-package")) {
packageName = arg.replace("-package=", "");
}
if (arg.startsWith("-version")) {
version = arg.replace("-version=", "");
}
if (arg.startsWith("-apk")) {
apkPath = arg.replace("-apk=", "");
}
if (arg.startsWith("-csj")) {
csjPath = arg.replace("-csj=", "");
}
if (arg.startsWith("-csc")) {
cscPath = arg.replace("-csc=", "");
}
if (arg.trim().equals("-h")) {
System.err.println("-package packageName " +
"\n-version CsjVersion" +
"\n-apk apkFilePath" +
"\n-csj csjDemoApkFilePath" +
"\n-csc csc save Path");
return;
}
}
if (packageName != null && version != null && apkPath != null && csjPath != null) {
new CsjTools(apkPath, csjPath, packageName, version, new SmaliApkToolsPath() {
@Override
public void smaliPath(String path) {
if (cscPath != null) {
File file = new File(path);
file.renameTo(new File(cscPath));
}
}
});
} else {
System.err.println("-package packageName " +
"\n-version CsjVersion" +
"\n-apk apkFilePath" +
"\n-csj csjDemoApkFilePath" +
"\n-csc csc save Path");
}
}
} }
public AppMain() { public AppMain() {
@ -536,7 +593,7 @@ public class AppMain extends JFrame {
new EditToDalog("提示", "请输入版本号", "", path -> { new EditToDalog("提示", "请输入版本号", "", path -> {
if (!Tools.stringIsNull(path)) { if (!Tools.stringIsNull(path)) {
version = path; version = path;
packageName="com."+Tools.getRandomString(5).toLowerCase()+"."+ Tools.getRandomString(5).toLowerCase(); packageName = "com." + Tools.getRandomString(5).toLowerCase() + "." + Tools.getRandomString(5).toLowerCase();
new EditToDalog("提示", "请输入包名", packageName, path1 -> { new EditToDalog("提示", "请输入包名", packageName, path1 -> {
if (!Tools.stringIsNull(path1)) { if (!Tools.stringIsNull(path1)) {
packageName = path1; packageName = path1;