Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
代码重构
Browse files Browse the repository at this point in the history
  • Loading branch information
4ra1n committed Jun 9, 2023
1 parent fb4bb93 commit 4a5a71d
Show file tree
Hide file tree
Showing 74 changed files with 267 additions and 198 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.idea/
target/
jar-analyzer/
jar-analyzer-*/
release/*.jar
release/*.exe
release/*.zip
1 change: 0 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,3 @@ Others:

## 1.2

todo
5 changes: 0 additions & 5 deletions build/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions build/build-jre.xml

This file was deleted.

24 changes: 0 additions & 24 deletions build/build-nojre.xml

This file was deleted.

Binary file removed build/jar-analyzer.ico
Binary file not shown.
115 changes: 115 additions & 0 deletions jar-analyzer-gui/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.n1ar4</groupId>
<artifactId>jar-analyzer</artifactId>
<version>1.2</version>
</parent>

<artifactId>jar-analyzer-gui</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>me.n1ar4</groupId>
<artifactId>jar-analyzer-lib</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
</dependency>
<dependency>
<groupId>com.intellij</groupId>
<artifactId>forms_rt</artifactId>
<version>7.0.3</version>
<exclusions>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.25</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.4</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>9.4</version>
</dependency>
<dependency>
<groupId>org.bitbucket.mstrobel</groupId>
<artifactId>procyon-compilertools</artifactId>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>org.benf</groupId>
<artifactId>cfr</artifactId>
<version>0.152</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>me.n1ar4.jar.analyzer.Application</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.n1ar4.jar.analyzer.core;

import me.n1ar4.jar.analyzer.asm.DiscoveryClassVisitor;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.objectweb.asm.ClassReader;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.n1ar4.jar.analyzer.core;

import me.n1ar4.jar.analyzer.asm.MethodCallClassVisitor;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.objectweb.asm.ClassReader;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.n1ar4.jar.analyzer.util;

import me.n1ar4.jar.analyzer.core.ClassFile;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -13,7 +14,7 @@
import java.util.Set;

public class CoreUtil {
private static final Logger logger = Logger.getLogger(CoreUtil.class);
private static final Logger logger = LogManager.getLogger(CoreUtil.class);

public static List<ClassFile> getAllClassesFromJars(List<String> jarPathList) {
logger.info("get all classes");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package me.n1ar4.jar.analyzer.util;

import org.apache.log4j.Logger;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.InputStream;
import java.io.OutputStream;

public class IOUtil {
private static final Logger logger = Logger.getLogger(IOUtil.class);
private static final Logger logger = LogManager.getLogger(IOUtil.class);

public static void copy(InputStream inputStream, OutputStream outputStream) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import me.n1ar4.jar.analyzer.core.ClassFile;
import me.n1ar4.jar.analyzer.form.JarAnalyzerForm;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.InputStream;
import java.io.OutputStream;
Expand All @@ -14,7 +15,7 @@
import java.util.jar.JarInputStream;

public class JarUtil {
private static final Logger logger = Logger.getLogger(JarUtil.class);
private static final Logger logger = LogManager.getLogger(JarUtil.class);
private static final Set<ClassFile> classFileSet = new HashSet<>();

public static List<ClassFile> resolveNormalJarFile(String jarPath) {
Expand Down
File renamed without changes
Binary file added jar-analyzer-lib/lib/fern.jar
Binary file not shown.
File renamed without changes.
73 changes: 73 additions & 0 deletions jar-analyzer-lib/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.n1ar4</groupId>
<artifactId>jar-analyzer</artifactId>
<version>1.2</version>
</parent>

<artifactId>jar-analyzer-lib</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>lib</groupId>
<artifactId>panel</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>lib</groupId>
<artifactId>fern</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>fern</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/fern.jar</file>
<groupId>lib</groupId>
<artifactId>fern</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
</configuration>
</execution>
<execution>
<id>panel</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/lib/panel.jar</file>
<groupId>lib</groupId>
<artifactId>panel</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
5 changes: 0 additions & 5 deletions lib/README.md

This file was deleted.

Loading

0 comments on commit 4a5a71d

Please sign in to comment.