4 changed files with 120 additions and 0 deletions
@ -0,0 +1,68 @@ |
|||||
|
<?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> |
||||
|
|
||||
|
<groupId>com.hellodk</groupId> |
||||
|
<artifactId>gfwlist-decoder</artifactId> |
||||
|
<version>1.0-SNAPSHOT</version> |
||||
|
|
||||
|
<properties> |
||||
|
<maven.compiler.source>11</maven.compiler.source> |
||||
|
<maven.compiler.target>11</maven.compiler.target> |
||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-core --> |
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-core</artifactId> |
||||
|
<version>5.7.19</version> |
||||
|
</dependency> |
||||
|
|
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-compiler-plugin</artifactId> |
||||
|
<version>2.3.2</version> |
||||
|
<configuration> |
||||
|
<source>1.8</source> |
||||
|
<target>1.8</target> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-assembly-plugin</artifactId> |
||||
|
<version>3.2.0</version> |
||||
|
<configuration> |
||||
|
<archive> |
||||
|
<manifest> |
||||
|
<!-- 运行 jar 包时运行的主类,要求写全类名 需要包含 package name --> |
||||
|
<mainClass>ApplicationEntry</mainClass> |
||||
|
<!-- 是否指定项目 classpath 下的依赖 --> |
||||
|
<addClasspath>true</addClasspath> |
||||
|
</manifest> |
||||
|
</archive> |
||||
|
<descriptorRefs> |
||||
|
<descriptorRef>jar-with-dependencies</descriptorRef> |
||||
|
</descriptorRefs> |
||||
|
</configuration> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<id>make-assembly</id> |
||||
|
<phase>package</phase> |
||||
|
<goals> |
||||
|
<goal>single</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,13 @@ |
|||||
|
/** |
||||
|
* @author: hellodk |
||||
|
* @description Application Entry class |
||||
|
* @date: 2022/4/14 14:21 |
||||
|
*/ |
||||
|
|
||||
|
public class ApplicationEntry { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
MainService mainService = new MainService(); |
||||
|
mainService.entry(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
import cn.hutool.core.codec.Base64; |
||||
|
import cn.hutool.core.io.file.FileWriter; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.nio.file.Files; |
||||
|
import java.nio.file.Paths; |
||||
|
import java.util.stream.Stream; |
||||
|
|
||||
|
/** |
||||
|
* @author: hellodk |
||||
|
* @description main service class |
||||
|
* @date: 2022/4/14 14:22 |
||||
|
*/ |
||||
|
|
||||
|
public class MainService { |
||||
|
|
||||
|
public MainService() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void entry() { |
||||
|
String fileLocation = "C:\\Users\\dk\\Downloads\\gfwlist.txt"; |
||||
|
String outputLocation = "C:\\Users\\dk\\Downloads\\gfwlist-decoded.txt"; |
||||
|
FileWriter fileWriter = new FileWriter(outputLocation); |
||||
|
try { |
||||
|
Stream<String> lines = Files.lines(Paths.get(fileLocation)); |
||||
|
lines.forEachOrdered(e -> { |
||||
|
String lineDecoded = Base64.decodeStr(e); |
||||
|
fileWriter.write(lineDecoded, true); |
||||
|
}); |
||||
|
} |
||||
|
catch (IOException ex) { |
||||
|
System.out.println(ex); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue