Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Una Thompson 2022-10-28 15:19:19 -07:00
commit ffafe6cf8d
No known key found for this signature in database
GPG key ID: CD9D524194BE98F5
4 changed files with 132 additions and 44 deletions

View file

@ -17,21 +17,21 @@ jobs:
java: [ '8', '11', '17' ] # LTS versions
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract Maven project version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
run: echo "bcv_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
id: project
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ matrix.java == '8' }}
with:
name: Bytecode-Viewer-${{ steps.project.outputs.version }}-SNAPSHOT
path: target/Bytecode-Viewer-${{ steps.project.outputs.version }}.jar
name: Bytecode-Viewer-${{ env.bcv_version }}-SNAPSHOT
path: target/Bytecode-Viewer-${{ env.bcv_version }}.jar
retention-days: 90

50
pom.xml
View file

@ -16,38 +16,38 @@
<annotations.version>23.0.0</annotations.version>
<antlr4.version>4.9.3</antlr4.version>
<apktool.version>2.6.1</apktool.version>
<asm.version>9.3</asm.version>
<asm.version>9.4</asm.version>
<bined.version>0.2.0</bined.version>
<byteanalysis.version>1.0bcv</byteanalysis.version>
<cfr.version>0.152</cfr.version>
<cloning.version>1.9.12</cloning.version>
<commons-cli.version>1.5.0</commons-cli.version>
<commons-codec.version>1.15</commons-codec.version>
<commons-compiler.version>3.1.7</commons-compiler.version>
<commons-compiler.version>3.1.8</commons-compiler.version>
<commons-compress.version>1.21</commons-compress.version>
<commons-io.version>2.11.0</commons-io.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-text.version>1.9</commons-text.version>
<darklaf.version>3.0.1-SNAPSHOT</darklaf.version>
<commons-text.version>1.10.0</commons-text.version>
<darklaf.version>3.0.2</darklaf.version>
<darklaf-extensions-rsta.version>0.4.1</darklaf-extensions-rsta.version>
<decompiler-fernflower.version>5.2.1.Final</decompiler-fernflower.version>
<dex2jar.version>v49</dex2jar.version>
<fernflower.version>1.8.1</fernflower.version>
<gson.version>2.9.0</gson.version>
<decompiler-fernflower.version>6.0.0.Final</decompiler-fernflower.version>
<dex2jar.version>v56</dex2jar.version>
<fernflower.version>1.9.0</fernflower.version>
<gson.version>2.9.1</gson.version>
<guava.version>31.1-jre</guava.version>
<imgscalr-lib.version>4.2</imgscalr-lib.version>
<jadx.version>1.3.5</jadx.version>
<jadx.version>1.4.4</jadx.version>
<jd-gui.version>1.6.6bcv</jd-gui.version>
<jgraphx.version>3.4.1.3</jgraphx.version>
<js.version>21.2.0</js.version>
<objenesis.version>3.2</objenesis.version>
<objenesis.version>3.3</objenesis.version>
<paged-data.version>0.2.0</paged-data.version>
<procyon.version>0.6.0</procyon.version>
<rsyntaxtextarea.version>3.2.0</rsyntaxtextarea.version>
<rsyntaxtextarea.version>3.3.0</rsyntaxtextarea.version>
<semantic-version.version>2.1.1</semantic-version.version>
<slf4j.version>1.7.36</slf4j.version>
<slf4j.version>2.0.3</slf4j.version>
<smali.version>2.5.2</smali.version>
<snakeyaml.version>1.30</snakeyaml.version>
<snakeyaml.version>1.33</snakeyaml.version>
<treelayout.version>1.0.3</treelayout.version>
<webp-imageio.version>0.2.2</webp-imageio.version>
<xpp3.version>1.1.4c</xpp3.version>
@ -384,7 +384,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
@ -394,7 +394,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
<configuration>
<source>${maven.compiler.source}</source>
</configuration>
@ -425,6 +425,26 @@
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
<!-- Ignore all ASM-related files from d2j-external but MCTLE fix -->
<filter>
<artifact>com.github.ThexXTURBOXx.dex2jar:d2j-external</artifact>
<excludeDefaults>true</excludeDefaults>
<includes>
<include>com/android/**</include>
<include>api_database/**</include>
<include>META-INF/services/**</include>
<include>LICENSE</include>
<include>r8-version.properties</include>
<include>org/objectweb/asm/MethodWriter.class</include>
</includes>
</filter>
<!-- Ignore original MethodWriter for MCTLE fix above -->
<filter>
<artifact>org.ow2.asm:asm</artifact>
<excludes>
<exclude>org/objectweb/asm/MethodWriter.class</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer

View file

@ -176,29 +176,22 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
for (String name : container.resourceClasses.keySet())
{
final String[] spl = name.split("/");
if (spl.length < 2)
int splLength = spl.length;
if (splLength < 2)
{
root.add(new ResourceTreeNode(name + ".class"));
}
else
{
ResourceTreeNode parent = root;
for (int i1 = 0; i1 < spl.length; i1++)
for (int i1 = 0; i1 < splLength; i1++)
{
String s = spl[i1];
if (i1 == spl.length - 1)
if (i1 == splLength - 1)
s += ".class";
ResourceTreeNode child = null;
for (int i = 0; i < parent.getChildCount(); i++)
{
if (((ResourceTreeNode) parent.getChildAt(i)).getUserObject().equals(s))
{
child = (ResourceTreeNode) parent.getChildAt(i);
break;
}
}
ResourceTreeNode child = parent.getChildByUserObject(s);
if (child == null)
{
@ -227,20 +220,14 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
ResourceTreeNode parent = root;
for (final String s : spl)
{
ResourceTreeNode child = null;
for (int i = 0; i < parent.getChildCount(); i++)
{
if (((ResourceTreeNode) parent.getChildAt(i)).getUserObject().equals(s))
{
child = (ResourceTreeNode) parent.getChildAt(i);
break;
}
}
ResourceTreeNode child = parent.getChildByUserObject(s);
if (child == null)
{
child = new ResourceTreeNode(s);
parent.add(child);
}
parent = child;
}
}

View file

@ -1,9 +1,10 @@
package the.bytecode.club.bytecodeviewer.gui.resourcelist;
import java.util.Comparator;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import java.util.Comparator;
import java.util.HashMap;
/***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@ -32,6 +33,9 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
private static final long serialVersionUID = -8817777566176729571L;
private static final int CHILD_MAP_BUILD_THRESHOLD = 3;
private HashMap<Object, ResourceTreeNode> userObjectToChildMap = null;
public ResourceTreeNode(final Object o)
{
super(o);
@ -41,6 +45,7 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
public void insert(final MutableTreeNode newChild, final int childIndex)
{
super.insert(newChild, childIndex);
addToMap((ResourceTreeNode) newChild);
}
public void sort()
@ -61,6 +66,82 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
}
}
@Override
public void add(MutableTreeNode newChild) {
super.add(newChild);
addToMap((ResourceTreeNode) newChild);
}
private void addToMap(ResourceTreeNode newChild) {
if (userObjectToChildMap != null)
{
userObjectToChildMap.put(newChild.getUserObject(), newChild);
}
else if (getChildCount() == CHILD_MAP_BUILD_THRESHOLD)
{
buildMap();
}
}
private void buildMap() {
userObjectToChildMap = new HashMap<>();
for (int i = 0, childCount = getChildCount(); i < childCount; i++)
{
ResourceTreeNode item = (ResourceTreeNode) getChildAt(i);
userObjectToChildMap.put(item.getUserObject(), item);
}
}
@Override
public void remove(int childIndex) {
if (userObjectToChildMap != null)
{
TreeNode childAt = getChildAt(childIndex);
userObjectToChildMap.remove(((ResourceTreeNode) childAt).getUserObject());
}
super.remove(childIndex);
}
@Override
public void remove(MutableTreeNode aChild) {
if (userObjectToChildMap != null && aChild != null)
{
userObjectToChildMap.remove(((ResourceTreeNode) aChild).getUserObject());
}
super.remove(aChild);
}
@Override
public void removeAllChildren() {
if (userObjectToChildMap != null)
{
userObjectToChildMap.clear();
}
super.removeAllChildren();
}
public ResourceTreeNode getChildByUserObject(Object userObject) {
if (userObjectToChildMap != null)
{
return userObjectToChildMap.get(userObject);
}
for (int i = 0, childCount = getChildCount(); i < childCount; i++)
{
ResourceTreeNode child = (ResourceTreeNode) getChildAt(i);
if (child.getUserObject().equals(userObject))
{
return child;
}
}
return null;
}
protected Comparator<TreeNode> nodeComparator = new Comparator<TreeNode>()
{
@Override