更新自动打包程序到UI界面

反编译默认处理加密包
This commit is contained in:
Yutousama 2020-05-11 09:52:36 +08:00
parent c310907a1b
commit 75fc8065c2
3 changed files with 38 additions and 12 deletions

View File

@ -30,15 +30,12 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import com.qy.utils.*;
import com.sun.javaws.exceptions.ExitException; import com.sun.javaws.exceptions.ExitException;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import com.qy.Interfaces.SmaliApkToolsPath; 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 { public class AppMain extends JFrame {
private JList<String> configList; private JList<String> configList;
@ -105,7 +102,7 @@ public class AppMain extends JFrame {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); e.printStackTrace();
} }
setTitle("\u8F6C\u6362\u5668v2.8"); setTitle("\u8F6C\u6362\u5668v2.9");
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
setSize(900, 456); setSize(900, 456);
getContentPane().setLayout(null); getContentPane().setLayout(null);
@ -512,6 +509,29 @@ public class AppMain extends JFrame {
}); });
menu.add(csj); 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"); mnBasetools = new JMenu("Base64\u5DE5\u5177");
menuBar.add(mnBasetools); menuBar.add(mnBasetools);

View File

@ -84,8 +84,9 @@ public class AutoPackageSDK {
delete(qysdkPath,qysdk); delete(qysdkPath,qysdk);
outAssetsADS(path); outAssetsADS(path);
copy(); copy();
zip(); File sdk=zip();
System.out.println("制作SDK完成"); System.out.println("制作SDK完成:");
inter.smaliPath(sdk==null?"sdk打包失败":sdk.getAbsolutePath());
} }
private void delete(File path,File sdk){ private void delete(File path,File sdk){
for (File file : path.listFiles()) { for (File file : path.listFiles()) {
@ -183,7 +184,7 @@ public class AutoPackageSDK {
e.printStackTrace(); e.printStackTrace();
} }
} }
private void zip(File file) throws Exception { private File zip(File file) throws Exception {
String cd = "cd " + new File("packageSDK").getAbsolutePath(); String cd = "cd " + new File("packageSDK").getAbsolutePath();
File sdk = new File("packageSDK" + File.separator + "sdk.aar"); File sdk = new File("packageSDK" + File.separator + "sdk.aar");
File files=new File("packageSDK"); File files=new File("packageSDK");
@ -202,8 +203,10 @@ public class AutoPackageSDK {
} }
} }
return sdk;
} }
private void zip() { private File zip() {
File sdk=null;
try { try {
Tools.copyFile(new File("input" + File.separator + "Documents" + File.separator + "sdk.aar").getAbsolutePath(), Tools.copyFile(new File("input" + File.separator + "Documents" + File.separator + "sdk.aar").getAbsolutePath(),
new File("packageSDK").getAbsolutePath(), true); new File("packageSDK").getAbsolutePath(), true);
@ -214,7 +217,7 @@ public class AutoPackageSDK {
stream.flush(); stream.flush();
stream.close(); stream.close();
process.destroy(); process.destroy();
zip(new File("packageSDK")); sdk=zip(new File("packageSDK"));
File copy=new File("packageSDK"+File.separator+"copy"); File copy=new File("packageSDK"+File.separator+"copy");
if(copy.exists()){ if(copy.exists()){
zip(copy); zip(copy);
@ -223,7 +226,9 @@ public class AutoPackageSDK {
process.destroy(); process.destroy();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return sdk;
} }
private void copy(){ private void copy(){
try{ try{
@ -241,7 +246,8 @@ public class AutoPackageSDK {
@Override @Override
public void smaliPath(String path) { public void smaliPath(String path) {
//com.tanggttaxc.langtt.mi //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");
} }
} }

View File

@ -190,7 +190,7 @@ public class SmaliUtils {
} }
return old; return old;
} }
private boolean isEncryption=false; private boolean isEncryption=true;
public void unPack(String jarPath, SmaliApkToolsPath smaliApkToolsPath) { public void unPack(String jarPath, SmaliApkToolsPath smaliApkToolsPath) {
File path=new File(jarPath+".out"); File path=new File(jarPath+".out");
if(path.exists()&&path.isDirectory()) { if(path.exists()&&path.isDirectory()) {