User Tools

Site Tools


java:xjar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
java:xjar [2023/11/19 02:49] – 创建 morgan0329java:xjar [2023/11/19 03:08] (current) morgan0329
Line 1: Line 1:
 +<code xml>
 +  <repositories>
 +    <repository>
 +      <id>jitpack.io</id>
 +      <url>https://jitpack.io</url>
 +    </repository>
 +  </repositories>
 +</code>
 +
 +<code java BreakXjar.java>
 +import java.util.Scanner;
 +
 +/**
 + * @author Morgan.L
 + * @version 3.0
 + * @date 2023/6/26 22:31
 + */
 +public class BreakXjar {
 +
 +  public static void main(String[] args) {
 +    Scanner scanner = new Scanner(System.in);
 +    String algorithm = scanner.nextLine();
 +    int keySize = Integer.parseInt(scanner.nextLine());
 +    int ivSize = Integer.parseInt(scanner.nextLine());
 +    String password = scanner.nextLine();
 +
 +    System.out.println("Algorithm: " + algorithm);
 +    System.out.println("KeySize: " + keySize);
 +    System.out.println("IvSize: " + ivSize);
 +    System.out.println("Password: " + password);
 +  }
 +
 +}
 +
 +</code>
 +
 +<code java DecryptionXjar.java>
 +import io.xjar.XCryptos;
 +
 +/**
 + * @author Morgan.L
 + * @version 3.0
 + * @date 2023/6/26 22:58
 + */
 +
 +public class DecryptionXjar {
 +
 +  public static void main(String[] args) throws Exception {
 +
 +    encrypt();
 +
 +  }
 +
 +  public static void encrypt() throws Exception {
 +        XCryptos.encryption()
 +
 +      // 项目生成的jar
 +
 +      .from("D:\\mmm\\nova_v1_update.jar")
 +
 +      // 加密的密码
 +      .use("<password>")
 +      // 要加密的资源
 +      .include("/**/*.class")
 +      // 加密后的jar,此时:通过jd-gui反编译失败
 +
 +      .to("D:\\mmm\\nova.jar");
 +  }
 +
 +  public static void decrypt() throws Exception {
 +
 +    XCryptos.decryption()
 +      .from("D:\\mmm\\nova.jar")
 +      .use("<password>")
 +      .include("/**/*.class")
 +      .to("D:\\mmm\\nova_new.jar");
 +
 +  }
 +}
 +</code>
  

Except where otherwise noted, content on this wiki is licensed under the following license: 沪ICP备12046235号-2
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki