From f615b199a41f6fd48e16d1cd899c0c85d4cae126 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Wed, 10 Jul 2024 01:47:05 -0500 Subject: [PATCH] Better visual feedback during asset decryption --- firestar/src/main/java/Bert.java | 8 ++++++++ firestar/src/main/java/Fozzie.java | 32 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/firestar/src/main/java/Bert.java b/firestar/src/main/java/Bert.java index dd4fb56..9a8c92c 100644 --- a/firestar/src/main/java/Bert.java +++ b/firestar/src/main/java/Bert.java @@ -148,6 +148,8 @@ public class Bert implements ActionListener { // dump contents System.out.println("Extracting asset.pkg"); + Fozzie popup = new Fozzie(); + popup.displayTextOnly("Extracting PKG...", "Extracting"); Process p; try { if (!Main.windows) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + Main.inpath + ";wine pkg2zip.exe -x asset.pkg " + key.toString()});} @@ -202,6 +204,8 @@ public class Bert implements ActionListener { return; } + popup.setText("Decrypting protected PFS:
" + extracted + "", "Decrypting"); + try { if (!Main.windows) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + Main.inpath + ";wine psvpfsparser.exe -i " + extracted + " -o ./temp/ -z " + key.toString() + " -f cma.henkaku.xyz"});} else {p = Runtime.getRuntime().exec(new String[]{Main.inpath + "psvpfsparser.exe", "-i", extracted, "-o", "./temp/", "-z", key.toString(), "-f", "cma.henkaku.xyz"}, null, new File(Main.inpath));} @@ -228,6 +232,8 @@ public class Bert implements ActionListener { return; } + popup.setText("Deleting temporary files...", "Cleaning Up"); + // stage & cleanup System.out.println("Cleaning up"); new File(Main.inpath + "asset.pkg").delete(); @@ -237,6 +243,8 @@ public class Bert implements ActionListener { Main.deleteDir(new File(Main.inpath + "addcont/")); Main.deleteDir(new File(Main.inpath + "temp/")); + popup.destroyDialog(); + // restore controls JOptionPane.showMessageDialog(frame, "Assets downloaded successfully.", "Download Complete", JOptionPane.INFORMATION_MESSAGE); invoker.setEnabled(true); diff --git a/firestar/src/main/java/Fozzie.java b/firestar/src/main/java/Fozzie.java index ea1681c..33793f2 100644 --- a/firestar/src/main/java/Fozzie.java +++ b/firestar/src/main/java/Fozzie.java @@ -96,6 +96,38 @@ public class Fozzie { } } + public void displayTextOnly(String text, String title) { + frame.add(frameContainer); + frame.setSize(300, 100); + frame.setTitle(title); + frame.setResizable(false); + frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + frame.setLayout(new GridLayout()); + frame.setLocationRelativeTo(null); + frame.setAlwaysOnTop(true); + try { + windowIcon = ImageIO.read(Main.class.getResourceAsStream("/titleIcon.png")); + frame.setIconImage(windowIcon); + } catch (IOException e) { + System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon."); + } + frame.setVisible(true); + + label.setText(text); + + progressBar.setVisible(false); + } + + public void setText(String text, String title) { + label.setText(text); + frame.setTitle(title); + } + + public void destroyDialog() { + frame.setVisible(false); + frame.dispose(); + } + public void disconnect() throws IOException { inputStream.close(); httpConn.disconnect();