返回列表 发新帖

[求助问答] key找不到很让人头疼

[复制链接]

7

主题

272

回帖

1271

积分

高中生

将军好凶猛

Rank: 4

金币
478
好评
0
信誉
92
发表在  2026-4-1 15:49:51 来自手机  | 显示全部楼层 | 阅读模式  来自 北京
本帖最后由 单车骑千里 于 2026-4-1 23:43 编辑

点击蓝色文字软件下载各位大佬,帮忙找一下,看不懂他的算法。
  1. //
  2. // Decompiled by Jadx - 596ms
  3. //
  4. package com.zhouge.lordily;

  5. import android.app.Activity;
  6. import android.app.AlertDialog;
  7. import android.content.ClipboardManager;
  8. import android.content.DialogInterface;
  9. import android.content.Intent;
  10. import android.content.SharedPreferences;
  11. import android.os.Bundle;
  12. import android.view.View;
  13. import android.widget.Button;
  14. import android.widget.EditText;
  15. import android.widget.TextView;
  16. import android.widget.Toast;
  17. import com.stub.StubApp;
  18. import java.util.Date;
  19. import javax.crypto.Cipher;
  20. import javax.crypto.spec.SecretKeySpec;

  21. public class ApkTool_ZSDialog extends Activity {
  22.     EditText edit;
  23.     Button enter;
  24.     int id = -1;
  25.     int key;
  26.     String temp;
  27.     TextView tv;

  28.     static {
  29.         StubApp.interface11(3235);
  30.     }

  31.     @Override
  32.     public native void onCreate(Bundle bundle);

  33.     class 1 implements View.OnClickListener {
  34.         private final ApkTool_ZSDialog this$0;

  35.         1(ApkTool_ZSDialog apkTool_ZSDialog) {
  36.             this.this$0 = apkTool_ZSDialog;
  37.         }

  38.         @Override
  39.         public void onClick(View view) {
  40.             ((ClipboardManager) this.this$0.getSystemService("clipboard")).setText(new StringBuffer().append(this.this$0.id).append("").toString());
  41.             Toast.makeText(this.this$0, new StringBuffer().append(this.this$0.id).append("").toString(), 2000).show();
  42.         }
  43.     }

  44.     class 3 implements View.OnClickListener {
  45.         3() {
  46.         }

  47.         @Override
  48.         public void onClick(View view) {
  49.             ApkTool_ZSDialog.this.edit.setText(((ClipboardManager) ApkTool_ZSDialog.this.getSystemService("clipboard")).getPrimaryClip().getItemAt(0).getText().toString());
  50.         }
  51.     }

  52.     class 2 implements View.OnClickListener {
  53.         private final ApkTool_ZSDialog this$0;
  54.         private final Date val$date;
  55.         private final SharedPreferences val$sp;

  56.         2(ApkTool_ZSDialog apkTool_ZSDialog, SharedPreferences sharedPreferences, Date date) {
  57.             this.this$0 = apkTool_ZSDialog;
  58.             this.val$sp = sharedPreferences;
  59.             this.val$date = date;
  60.         }

  61.         @Override
  62.         public void onClick(View view) {
  63.             int i = this.this$0.id / 2;
  64.             int i2 = this.this$0.key;
  65.             int i3 = i + this.this$0.key;
  66.             String de = ApkTool_ZSDialog.de(this.this$0.edit.getText().toString());
  67.             if (de != null) {
  68.                 String[] split = de.split("z");
  69.                 try {
  70.                     if (Integer.parseInt(split[0], 16) == i3) {
  71.                         Toast.makeText(this.this$0, "成功!", 2000).show();
  72.                         String str = "软件使用无期限";
  73.                         if (split.length > 1) {
  74.                             str = new StringBuffer().append("软件使用期:").append(ApkTool_ZSDialog.formatDuring(Long.parseLong(split[1]))).toString();
  75.                         }
  76.                         this.this$0.dia(str, new DialogInterface.OnClickListener(this, split, this.val$sp, this.val$date) {
  77.                             private final 2 this$0;
  78.                             private final Date val$date;
  79.                             private final SharedPreferences val$sp;
  80.                             private final String[] val$y;

  81.                             {
  82.                                 this.this$0 = this;
  83.                                 this.val$y = split;
  84.                                 this.val$sp = r11;
  85.                                 this.val$date = r12;
  86.                             }

  87.                             @Override
  88.                             public void onClick(DialogInterface dialogInterface, int i4) {
  89.                                 if (this.val$y.length > 1) {
  90.                                     this.val$sp.edit().putBoolean("F1534847429958", true).commit();
  91.                                     try {
  92.                                         this.val$sp.edit().putString("ttt", ApkTool_ZSDialog.en(this.val$y[1])).commit();
  93.                                     } catch (Exception e) {
  94.                                     }
  95.                                     this.this$0.this$0.temp = new StringBuffer().append("").append(this.val$date.getTime()).toString();
  96.                                     try {
  97.                                         this.val$sp.edit().putString("sss", ApkTool_ZSDialog.en(this.this$0.this$0.temp)).commit();
  98.                                     } catch (Exception e2) {
  99.                                     }
  100.                                     this.val$sp.edit().putInt("id", -1).commit();
  101.                                 } else {
  102.                                     this.val$sp.edit().putBoolean("F1534847442303", true).commit();
  103.                                 }
  104.                                 this.this$0.this$0.enter();
  105.                             }
  106.                         });
  107.                         return;
  108.                     }
  109.                     this.this$0.enter.setText("失败,点击重试!");
  110.                 } catch (NumberFormatException e) {
  111.                     this.this$0.enter.setText("失败,点击重试!");
  112.                 }
  113.             }
  114.         }
  115.     }

  116.     void dia(String str, DialogInterface.OnClickListener onClickListener) {
  117.         AlertDialog.Builder builder = new AlertDialog.Builder(this);
  118.         builder.setTitle("*_*");
  119.         builder.setMessage(str);
  120.         builder.setPositiveButton("确定", onClickListener);
  121.         builder.show();
  122.     }

  123.     void enter() {
  124.         try {
  125.             startActivity(new Intent(this, Class.forName("acdibben.ejbaefgo.aabjehjp.iccbfdfq.view.CPUI001Activity")));
  126.             finish();
  127.         } catch (ClassNotFoundException e) {
  128.             throw new NoClassDefFoundError(e.getMessage());
  129.         }
  130.     }

  131.     public static String en(String str) throws Exception {
  132.         if ("Format2044153997" == 0) {
  133.             return (String) null;
  134.         }
  135.         if ("Format2044153997".length() != 16) {
  136.             return (String) null;
  137.         }
  138.         SecretKeySpec secretKeySpec = new SecretKeySpec("Format2044153997".getBytes("ASCII"), "AES");
  139.         Cipher cipher = Cipher.getInstance("AES");
  140.         cipher.init(1, secretKeySpec);
  141.         return byte2hex(cipher.doFinal(str.getBytes())).toLowerCase();
  142.     }

  143.     public static String byte2hex(byte[] bArr) {
  144.         String stringBuffer;
  145.         String str = "";
  146.         for (byte b : bArr) {
  147.             String hexString = Integer.toHexString(b & 255);
  148.             if (hexString.length() == 1) {
  149.                 stringBuffer = new StringBuffer().append(new StringBuffer().append(str).append("0").toString()).append(hexString).toString();
  150.             } else {
  151.                 stringBuffer = new StringBuffer().append(str).append(hexString).toString();
  152.             }
  153.             str = stringBuffer;
  154.         }
  155.         return str.toUpperCase();
  156.     }

  157.     public static String de(String str) {
  158.         String str2;
  159.         if (str == null) {
  160.             return (String) null;
  161.         }
  162.         try {
  163.             if ("Format2044153997" == 0) {
  164.                 str2 = (String) null;
  165.             } else if ("Format2044153997".length() != 16) {
  166.                 str2 = (String) null;
  167.             } else {
  168.                 SecretKeySpec secretKeySpec = new SecretKeySpec("Format2044153997".getBytes("ASCII"), "AES");
  169.                 Cipher cipher = Cipher.getInstance("AES");
  170.                 cipher.init(2, secretKeySpec);
  171.                 try {
  172.                     str2 = new String(cipher.doFinal(hex2byte(str)));
  173.                 } catch (Exception e) {
  174.                     System.out.println(e.toString());
  175.                     str2 = (String) null;
  176.                 }
  177.             }
  178.             return str2;
  179.         } catch (Exception e2) {
  180.             System.out.println(e2.toString());
  181.             return (String) null;
  182.         }
  183.     }

  184.     public static byte[] hex2byte(String str) {
  185.         if (str == null) {
  186.             return (byte[]) null;
  187.         }
  188.         int length = str.length();
  189.         if (length % 2 == 1) {
  190.             return (byte[]) null;
  191.         }
  192.         byte[] bArr = new byte[length / 2];
  193.         for (int i = 0; i != length / 2; i++) {
  194.             bArr[i] = (byte) Integer.parseInt(str.substring(i * 2, (i * 2) + 2), 16);
  195.         }
  196.         return bArr;
  197.     }

  198.     public static String formatDuring(long j) {
  199.         return new StringBuffer().append(new StringBuffer().append(new StringBuffer().append(new StringBuffer().append(new StringBuffer().append(new StringBuffer().append(new StringBuffer().append(j / 0x05265c00).append(" 天 ").toString()).append((j % 0x05265c00) / 3600000).toString()).append(" 小时 ").toString()).append((j % 3600000) / 60000).toString()).append(" 分钟 ").toString()).append((j % 60000) / 1000).toString()).append(" 秒 ").toString();
  200.     }
  201. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

3

主题

318

回帖

1201

积分

高中生

Rank: 4

金币
768
好评
0
信誉
100
发表于 2026-4-1 15:52:29 | 显示全部楼层  来自 贵州
不懂的话,你可以问问ai,现在ai确实好用
回复

使用道具 举报

109

主题

1167

回帖

4923

积分

大学生

https://director4168.github.io

Rank: 5Rank: 5

金币
3124
好评
9
信誉
100

考神MT论坛新人MT论坛最佳新人MT论坛帅哥

QQ
发表于 2026-4-1 15:57:12 来自手机  | 显示全部楼层  来自 河南
该激活码验证算法基于AES加密和特定验证逻辑,具体步骤如下:

1. 参数准备

id:一个整数,在应用启动时生成或从SharedPreferences读取,并显示在界面上(用户可通过复制按钮获取)。
key:一个整数,可能为固定值或从Native层(so库)获取,Java代码中未直接赋值。
密钥:AES加密使用的固定密钥字符串  "Format2044153997" (16字节)。

2. 激活码格式

有效的激活码是一个十六进制字符串(小写),由以下明文字符串经AES加密后转换得到:

明文字符串格式: <hex>z<timestamp>  或仅  <hex> 。
 <hex> :是  (id/2 + key)  的十六进制表示(无前缀,如  "3F" )。
 <timestamp> (可选):表示有效期的毫秒时间戳。

3. 验证过程

1. 用户输入激活码字符串。
2. 调用  de()  方法解密:
使用AES算法,密钥为  "Format2044153997" ,模式为ECB,填充默认为PKCS5Padding。
将激活码十六进制字符串转换为字节数组,解密后得到明文字符串。
3. 用  "z"  分割明文字符串,得到数组  split 。
4. 将  split  解析为十六进制整数,与计算值  id/2 + key  比较。
若相等,则验证成功;否则失败。
5. 若  split  长度大于1,表示激活码含时间戳,会记录有效期并设置相应标志( F1534847429958 );否则为永久激活(设置标志  F1534847442303 )。

4. 激活码生成方法

要生成有效激活码,需按以下步骤:

1. 获取当前设备的  id (从界面显示或SharedPreferences)。
2. 获取  key (可能为固定值,需分析Native代码或动态调试)。
3. 计算  value = id/2 + key ,将其转换为十六进制字符串(小写)。
4. 可选添加有效期时间戳(毫秒),用  "z"  连接,形成明文字符串。
5. 使用AES加密该明文字符串,密钥为  "Format2044153997" 。
6. 将密文转换为小写十六进制字符串,即为激活码。

5. 关键代码片段

验证逻辑位于  类2  的  onClick  方法中。
加密/解密方法: en()  和  de() 。
时间格式化: formatDuring()  将毫秒转换为天、小时、分钟、秒。

备注

key的来源:由于Java代码中未初始化,很可能在Native层的  onCreate  方法中赋值,需逆向so文件或动态调试获取。
激活类型:含时间戳的激活码会检查有效期,永久激活码则无时间限制。
成功激活后:应用会启动  CPUI001Activity  并结束当前界面。
回复

使用道具 举报

7

主题

272

回帖

1271

积分

高中生

将军好凶猛

Rank: 4

金币
478
好评
0
信誉
92
发表于 2026-4-1 16:24:06 来自手机  | 显示全部楼层  来自 北京
laa 发表于 2026-4-1 15:52
不懂的话,你可以问问ai,现在ai确实好用

不好使,会把人带偏的
回复

使用道具 举报

7

主题

272

回帖

1271

积分

高中生

将军好凶猛

Rank: 4

金币
478
好评
0
信誉
92
发表于 2026-4-1 16:26:23 来自手机  | 显示全部楼层  来自 北京
director_mark 发表于 2026-4-1 15:57
该激活码验证算法基于AES加密和特定验证逻辑,具体步骤如下:

1. 参数准备

真实的key找不到
回复

使用道具 举报

20

主题

2239

回帖

7696

积分

硕士生

小白

Rank: 6Rank: 6

金币
4168
好评
6
信誉
103

MT论坛最佳新人考神

QQ
发表于 2026-4-1 16:29:32 来自手机  | 显示全部楼层  来自 福建
软件发一下
回复

使用道具 举报

218

主题

5609

回帖

1万

积分

博士生

Rank: 7Rank: 7Rank: 7

金币
8152
好评
25
信誉
134

MT论坛最佳新人MT论坛活跃会员MT论坛帅哥MT论坛新人MT论坛灌水老大考神

发表于 2026-4-1 23:01:56 来自手机  | 显示全部楼层  来自 广东
软件都不发看毛线
回复

使用道具 举报

7

主题

272

回帖

1271

积分

高中生

将军好凶猛

Rank: 4

金币
478
好评
0
信誉
92
发表于 2026-4-1 23:44:21 来自手机  | 显示全部楼层  来自 天津
  枷锁 发表于 2026-4-1 23:01
软件都不发看毛线

置顶
回复

使用道具 举报

0

主题

1458

回帖

5951

积分

硕士生

Rank: 6Rank: 6

金币
4406
好评
1
信誉
101
发表于 2026-4-7 01:18:34 来自手机  | 显示全部楼层  来自 四川
也是闲的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

24

主题

6959

回帖

2万

积分

博士后

⊕1921863353

Rank: 8Rank: 8

金币
2162
好评
66
信誉
135

MT论坛最佳新人考神MT论坛活跃会员

发表于 2026-4-7 15:12:46 来自手机  | 显示全部楼层  来自 广东
com.stub.StubApp加固抽走了
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表