Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9bf92a

Browse files
authoredJul 20, 2021
Merge pull request #328 from ThexXTURBOXx/convenience-stuff
Convenience stuff
2 parents 8c761e7 + adb403f commit b9bf92a

File tree

11 files changed

+38
-23
lines changed

11 files changed

+38
-23
lines changed
 

‎pom.xml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@
226226
<dependency>
227227
<groupId>com.github.weisj</groupId>
228228
<artifactId>darklaf-core</artifactId>
229-
<version>2.6.2-SNAPSHOT</version> <!-- TODO Change to release when ready -->
229+
<version>2.6.2-20210719.010320-83</version> <!-- TODO Change to release when ready -->
230+
</dependency>
231+
<dependency>
232+
<groupId>com.github.weisj</groupId>
233+
<artifactId>darklaf-windows</artifactId>
234+
<version>2.6.2-20210719.010320-83</version> <!-- TODO Remove when ready -->
230235
</dependency>
231236
<dependency>
232237
<groupId>com.github.weisj</groupId>
@@ -237,19 +242,6 @@
237242

238243
<build>
239244
<plugins>
240-
<plugin>
241-
<groupId>org.apache.maven.plugins</groupId>
242-
<artifactId>maven-jar-plugin</artifactId>
243-
<version>3.1.1</version> <!-- 3.1.2 breaks build on JDK 9+ -->
244-
<configuration>
245-
<archive>
246-
<manifest>
247-
<addClasspath>true</addClasspath>
248-
<mainClass>the.bytecode.club.bytecodeviewer.BytecodeViewer</mainClass>
249-
</manifest>
250-
</archive>
251-
</configuration>
252-
</plugin>
253245
<plugin>
254246
<groupId>org.apache.maven.plugins</groupId>
255247
<artifactId>maven-compiler-plugin</artifactId>
@@ -287,9 +279,21 @@
287279
<exclude>META-INF/*.SF</exclude>
288280
<exclude>META-INF/*.DSA</exclude>
289281
<exclude>META-INF/*.RSA</exclude>
282+
<exclude>META-INF/*LICENSE*</exclude>
283+
<exclude>META-INF/*NOTICE*</exclude>
284+
<exclude>META-INF/MANIFEST.MF</exclude>
290285
</excludes>
291286
</filter>
292287
</filters>
288+
<transformers>
289+
<transformer
290+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
291+
<mainClass>the.bytecode.club.bytecodeviewer.BytecodeViewer</mainClass>
292+
<manifestEntries>
293+
<Implementation-Version>${project.version}</Implementation-Version>
294+
</manifestEntries>
295+
</transformer>
296+
</transformers>
293297
</configuration>
294298
</plugin>
295299
</plugins>

‎src/main/java/the/bytecode/club/bytecodeviewer/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class Constants
1717
{
1818
/*per version*/
19-
public static final String VERSION = "2.10.14"; //could be loaded from the pom
19+
public static final String VERSION = BytecodeViewer.class.getPackage().getImplementationVersion();
2020
public static String krakatauVersion = "12";
2121
public static String enjarifyVersion = "4";
2222
public static final boolean BLOCK_TAB_MENU = true;

‎src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public byte[] compile(String contents, String fullyQualifiedName)
5151
if(!ExternalResources.getSingleton().hasSetPython2Command())
5252
return null;
5353

54-
String origName = MiscUtils.randomString(20);
55-
5654
File tempD = new File(Constants.tempDirectory + fs + MiscUtils.randomString(32) + fs);
5755
tempD.mkdir();
5856

‎src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/CFRDecompiler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import java.io.StringWriter;
1212
import java.util.Deque;
1313
import java.util.LinkedList;
14-
import java.util.Objects;
1514
import java.util.Random;
1615
import java.util.zip.ZipEntry;
1716
import java.util.zip.ZipOutputStream;

‎src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ClassViewer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import the.bytecode.club.bytecodeviewer.SettingsSerializer;
2727
import the.bytecode.club.bytecodeviewer.resources.Resource;
2828
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
29+
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
30+
import the.bytecode.club.bytecodeviewer.translation.Translation;
2931
import the.bytecode.club.bytecodeviewer.util.MethodParser;
3032

3133
import static the.bytecode.club.bytecodeviewer.util.MethodParser.Method;
@@ -89,7 +91,14 @@ public void refresh(final JButton button)
8991
{
9092
setPanes();
9193
refreshTitle();
92-
94+
95+
// Warn user if no Decompiler is selected
96+
if (bytecodeViewPanel1.decompiler == Decompiler.NONE
97+
&& bytecodeViewPanel2.decompiler == Decompiler.NONE
98+
&& bytecodeViewPanel3.decompiler == Decompiler.NONE) {
99+
BytecodeViewer.showMessage(TranslatedStrings.SUGGESTED_FIX_NO_DECOMPILER_WARNING.toString());
100+
}
101+
93102
bytecodeViewPanel1.createPane(this);
94103
bytecodeViewPanel2.createPane(this);
95104
bytecodeViewPanel3.createPane(this);

‎src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareCodeScanner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ public String header()
117117

118118
public void foundLDC(MalwareScan scan, String ldc, String foundAt)
119119
{
120-
scan.sb.append(header() + " Found LDC \"").append(ldc).append("\" ").append(foundAt);
120+
scan.sb.append(header()).append(" Found LDC \"").append(ldc).append("\" ").append(foundAt);
121121
}
122122

123123
public void foundMethod(MalwareScan scan, String foundAt)
124124
{
125-
scan.sb.append(header() + " Found Method call to ").append(foundAt);
125+
scan.sb.append(header()).append(" Found Method call to ").append(foundAt);
126126
}
127127

128128
public void found(MalwareScan scan, String found)
129129
{
130-
scan.sb.append(header() + " Found ").append(found);
130+
scan.sb.append(header()).append(" Found ").append(found);
131131
}
132132
}

‎src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public enum TranslatedStrings
8484
FIRST_OPEN_A_RESOURCE,
8585
FIRST_OPEN_A_CLASS,
8686
FIRST_VIEW_A_CLASS,
87+
SUGGESTED_FIX_NO_DECOMPILER_WARNING,
8788
DRAG_CLASS_JAR,
8889
;
8990

‎src/main/java/the/bytecode/club/bytecodeviewer/translation/Translation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ public enum Translation
226226
ERROR,
227227
SUGGESTED_FIX_DECOMPILER_ERROR,
228228
SUGGESTED_FIX_COMPILER_ERROR,
229+
SUGGESTED_FIX_NO_DECOMPILER_WARNING,
229230
PROCYON_DECOMPILER,
230231
CFR_DECOMPILER,
231232
FERNFLOWER_DECOMPILER,

‎src/main/java/the/bytecode/club/bytecodeviewer/util/VersionChecker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package the.bytecode.club.bytecodeviewer.util;
22

3+
import java.util.Objects;
34
import me.konloch.kontainer.io.HTTPRequest;
45
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
56
import the.bytecode.club.bytecodeviewer.Configuration;
@@ -58,7 +59,7 @@ public void run()
5859

5960
}
6061

61-
if (!VERSION.equals(version))
62+
if (VERSION != null && !VERSION.equals(version))
6263
{
6364
MultipleChoiceDialogue outdatedDialogue = new MultipleChoiceDialogue("Bytecode Viewer - Outdated Version",
6465
"Your version: " + VERSION + ", latest version: "

‎src/main/resources/translations/english.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
"NEW_JAVASCRIPT_PLUGIN": "New Javascript Plugin",
127127
"SUGGESTED_FIX_DECOMPILER_ERROR": "Suggested Fix: Click refresh class, if it fails again try another decompiler.",
128128
"SUGGESTED_FIX_COMPILER_ERROR": "Suggested Fix: Try View>Pane>Krakatau>Bytecode and enable Editable.",
129+
"SUGGESTED_FIX_NO_DECOMPILER_WARNING": "WARNING: No decompiler is currently selected. Try View>Pane and choose a decompiler.",
129130
"COMPILER_TIP": "Keep in mind most decompilers cannot produce compilable classes",
130131
"FIRST_OPEN_A_RESOURCE": "First open a resource inside of BCV (class, jar, zip or apk file)",
131132
"FIRST_OPEN_A_CLASS": "First open a classfile resource inside of BCV (jar, zip, apk, dex)",

‎src/main/resources/translations/german.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"ERROR": "Fehler",
9494
"SUGGESTED_FIX_DECOMPILER_ERROR": "Vorgeschlagene Lösung: Klicken Sie auf Klasse aktualisieren und wenn es wieder fehlschlägt, versuchen Sie einen anderen Dekompilierer.",
9595
"SUGGESTED_FIX_COMPILER_ERROR": "Vorgeschlagene Lösung: Aktivieren Sie unter Ansicht>Fenster>Krakatau>Bytecode Editierbar.",
96+
"SUGGESTED_FIX_NO_DECOMPILER_WARNING": "ACHTUNG: Derzeit ist kein Dekompilierer ausgewählt. Versuchen Sie unter Ansicht>Fenster einen Dekompilierer auszuwählen.",
9697
"FILES": "Dateien",
9798
"QUICK_FILE_SEARCH_NO_FILE_EXTENSION": "Dateien-Schnellsuche öffnen (ohne Dateiendungen)",
9899
"WORK_SPACE": "Arbeitsbereich",

0 commit comments

Comments
 (0)
Please sign in to comment.