From 75fc8065c221aa6491144389cd26ca492cd534ea Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 11 May 2020 09:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=AA=E5=8A=A8=E6=89=93?= =?UTF-8?q?=E5=8C=85=E7=A8=8B=E5=BA=8F=E5=88=B0UI=E7=95=8C=E9=9D=A2=20?= =?UTF-8?q?=E5=8F=8D=E7=BC=96=E8=AF=91=E9=BB=98=E8=AE=A4=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/qy/ui/AppMain.java | 30 +++++++++++++++++++++++----- src/com/qy/utils/AutoPackageSDK.java | 18 +++++++++++------ src/com/qy/utils/SmaliUtils.java | 2 +- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/com/qy/ui/AppMain.java b/src/com/qy/ui/AppMain.java index 0f42b1c..671fd60 100755 --- a/src/com/qy/ui/AppMain.java +++ b/src/com/qy/ui/AppMain.java @@ -30,15 +30,12 @@ import javax.swing.SwingConstants; import javax.swing.UIManager; import javax.swing.border.LineBorder; +import com.qy.utils.*; import com.sun.javaws.exceptions.ExitException; import org.json.JSONArray; import org.json.JSONObject; import com.qy.Interfaces.SmaliApkToolsPath; -import com.qy.utils.EncryptJar; -import com.qy.utils.JarToAJar; -import com.qy.utils.JarToBase; -import com.qy.utils.Tools; public class AppMain extends JFrame { private JList configList; @@ -105,7 +102,7 @@ public class AppMain extends JFrame { // TODO: handle exception e.printStackTrace(); } - setTitle("\u8F6C\u6362\u5668v2.8"); + setTitle("\u8F6C\u6362\u5668v2.9"); // TODO Auto-generated constructor stub setSize(900, 456); getContentPane().setLayout(null); @@ -512,6 +509,29 @@ public class AppMain extends JFrame { }); menu.add(csj); + JMenuItem autoSDK=new JMenuItem("自动生成SDK"); + autoSDK.addActionListener(new ActionListener() { + String version; + String packageName; + @Override + public void actionPerformed(ActionEvent e) { + new EditToDalog("提示", "请输入版本号", "", path -> { + if(!Tools.stringIsNull(path)){ + version=path; + new EditToDalog("提示", "请输入包名", "com.prujwk.jdyphn", path1 -> { + if(!Tools.stringIsNull(path1)){ + packageName= path1; + autoPackageSdk(); + } + }); + } + }); + } + public void autoPackageSdk(){ + new AutoPackageSDK(path -> new TextToDalog("提示",String.format("打包完成%s",path)),version,packageName); + } + }); + menu.add(autoSDK); mnBasetools = new JMenu("Base64\u5DE5\u5177"); menuBar.add(mnBasetools); diff --git a/src/com/qy/utils/AutoPackageSDK.java b/src/com/qy/utils/AutoPackageSDK.java index db0bf78..e30f211 100644 --- a/src/com/qy/utils/AutoPackageSDK.java +++ b/src/com/qy/utils/AutoPackageSDK.java @@ -84,8 +84,9 @@ public class AutoPackageSDK { delete(qysdkPath,qysdk); outAssetsADS(path); copy(); - zip(); - System.out.println("制作SDK完成"); + File sdk=zip(); + System.out.println("制作SDK完成:"); + inter.smaliPath(sdk==null?"sdk打包失败":sdk.getAbsolutePath()); } private void delete(File path,File sdk){ for (File file : path.listFiles()) { @@ -183,7 +184,7 @@ public class AutoPackageSDK { e.printStackTrace(); } } - private void zip(File file) throws Exception { + private File zip(File file) throws Exception { String cd = "cd " + new File("packageSDK").getAbsolutePath(); File sdk = new File("packageSDK" + File.separator + "sdk.aar"); File files=new File("packageSDK"); @@ -202,8 +203,10 @@ public class AutoPackageSDK { } } + return sdk; } - private void zip() { + private File zip() { + File sdk=null; try { Tools.copyFile(new File("input" + File.separator + "Documents" + File.separator + "sdk.aar").getAbsolutePath(), new File("packageSDK").getAbsolutePath(), true); @@ -214,7 +217,7 @@ public class AutoPackageSDK { stream.flush(); stream.close(); process.destroy(); - zip(new File("packageSDK")); + sdk=zip(new File("packageSDK")); File copy=new File("packageSDK"+File.separator+"copy"); if(copy.exists()){ zip(copy); @@ -223,7 +226,9 @@ public class AutoPackageSDK { process.destroy(); } catch (Exception e) { e.printStackTrace(); + } + return sdk; } private void copy(){ try{ @@ -241,7 +246,8 @@ public class AutoPackageSDK { @Override public void smaliPath(String path) { //com.tanggttaxc.langtt.mi + System.out.println(">"+path); } - }, "5700", a==0?"com.luckyboy.mmxing":"com.prujwk.jdyphn"); + }, "5800", a==0?"com.luckyboy.mmxing":"com.prujwk.jdyphn"); } } diff --git a/src/com/qy/utils/SmaliUtils.java b/src/com/qy/utils/SmaliUtils.java index 50e10c1..6e1fc0f 100755 --- a/src/com/qy/utils/SmaliUtils.java +++ b/src/com/qy/utils/SmaliUtils.java @@ -190,7 +190,7 @@ public class SmaliUtils { } return old; } - private boolean isEncryption=false; + private boolean isEncryption=true; public void unPack(String jarPath, SmaliApkToolsPath smaliApkToolsPath) { File path=new File(jarPath+".out"); if(path.exists()&&path.isDirectory()) {