鱼C论坛

 找回密码
 立即注册
查看: 365|回复: 1

求帮写注册机

[复制链接]
发表于 2025-1-24 15:50:02 From FishC Mobile | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

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

x
本帖最后由 ArmedImmediatel 于 2025-1-24 15:56 编辑

今天看到一个有秘钥验证的apk 本来想着练练手写个注册机 结果绕着绕着绕晕了 有哪位大佬能看懂
反编译伪java代码:
  1. package formatFa.comic;

  2. import android.app.Activity;
  3. import android.app.AlertDialog;
  4. import android.app.AlertDialog.Builder;
  5. import android.content.DialogInterface.OnClickListener;
  6. import android.content.Intent;
  7. import android.content.SharedPreferences;
  8. import android.graphics.drawable.Drawable;
  9. import android.os.Bundle;
  10. import android.preference.PreferenceManager;
  11. import android.view.View;
  12. import android.widget.Button;
  13. import android.widget.EditText;
  14. import android.widget.LinearLayout;
  15. import android.widget.TextView;
  16. import java.io.IOException;
  17. import java.io.InputStream;
  18. import java.util.Date;
  19. import javax.crypto.Cipher;
  20. import javax.crypto.spec.SecretKeySpec;

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

  28.     public FAppProtect() {
  29.     }

  30.     public static String byte2hex(byte[] bArr) {
  31.         byte[] bArr2 = bArr;
  32.         String str = "";
  33.         String str2 = "";
  34.         for (byte b : bArr2) {  //依次抽出bArr2数组每个项遍历
  35.             str2 = Integer.toHexString(b & 255);  
  36.             StringBuffer stringBuffer;
  37.             StringBuffer stringBuffer2;
  38.             if (str2.length() == 1) {
  39.                 stringBuffer = r8;
  40.                 stringBuffer2 = new StringBuffer();
  41.                 stringBuffer2 = r8;
  42.                 StringBuffer stringBuffer3 = new StringBuffer();
  43.                 str = stringBuffer.append(stringBuffer2.append(str).append("0").toString()).append(str2).toString();
  44.             } else {
  45.                 stringBuffer = r8;
  46.                 stringBuffer2 = new StringBuffer();
  47.                 str = stringBuffer.append(str).append(str2).toString();
  48.             }
  49.         }
  50.         return str.toUpperCase();
  51.     }

  52.     public static String de(String str) {
  53.         String str2 = str;
  54.         if (str2 == null) {
  55.             return (String) null;
  56.         }
  57.         String str3 = "vice587@.613฿@95";
  58.         if (str3 == null) {
  59.             try {
  60.                 return (String) null;
  61.             } catch (Exception e) {
  62.                 System.out.println(e.toString());
  63.                 return (String) null;
  64.             }
  65.         } else if (str3.length() != 16) {
  66.             return (String) null;
  67.         } else {
  68.             SecretKeySpec secretKeySpec = r13;
  69.             SecretKeySpec secretKeySpec2 = new SecretKeySpec(str3.getBytes("ASCII"), "AES");
  70.             SecretKeySpec secretKeySpec3 = secretKeySpec;
  71.             Cipher instance = Cipher.getInstance("AES");
  72.             instance.init(2, secretKeySpec3);
  73.             try {
  74.                 String str4 = r13;
  75.                 String str5 = new String(instance.doFinal(hex2byte(str2)));
  76.                 return str4;
  77.             } catch (Exception e2) {
  78.                 System.out.println(e2.toString());
  79.                 return (String) null;
  80.             }
  81.         }
  82.     }

  83.     public static String en(String str) throws Exception {
  84.         String str2 = str;
  85.         String str3 = "vice587@.613฿@95";
  86.         if (str3 == null) {
  87.             return (String) null;
  88.         }
  89.         if (str3.length() != 16) {
  90.             return (String) null;
  91.         }
  92.         SecretKeySpec secretKeySpec = r11;
  93.         SecretKeySpec secretKeySpec2 = new SecretKeySpec(str3.getBytes("ASCII"), "AES");
  94.         SecretKeySpec secretKeySpec3 = secretKeySpec;
  95.         Cipher instance = Cipher.getInstance("AES");
  96.         instance.init(1, secretKeySpec3);
  97.         return byte2hex(instance.doFinal(str2.getBytes())).toLowerCase();
  98.     }

  99.     public static String formatDuring(long j) {
  100.         long j2 = j;
  101.         long j3 = j2 / ((long) 86400000);
  102.         long j4 = (j2 % ((long) 86400000)) / ((long) 3600000);
  103.         long j5 = (j2 % ((long) 3600000)) / ((long) 60000);
  104.         long j6 = (j2 % ((long) 60000)) / ((long) 1000);
  105.         StringBuffer stringBuffer = r20;
  106.         StringBuffer stringBuffer2 = new StringBuffer();
  107.         stringBuffer2 = r20;
  108.         StringBuffer stringBuffer3 = new StringBuffer();
  109.         stringBuffer3 = r20;
  110.         StringBuffer stringBuffer4 = new StringBuffer();
  111.         stringBuffer4 = r20;
  112.         StringBuffer stringBuffer5 = new StringBuffer();
  113.         stringBuffer5 = r20;
  114.         StringBuffer stringBuffer6 = new StringBuffer();
  115.         stringBuffer6 = r20;
  116.         StringBuffer stringBuffer7 = new StringBuffer();
  117.         stringBuffer7 = r20;
  118.         StringBuffer stringBuffer8 = new StringBuffer();
  119.         return stringBuffer.append(stringBuffer2.append(stringBuffer3.append(stringBuffer4.append(stringBuffer5.append(stringBuffer6.append(stringBuffer7.append(j3).append(" 天 ").toString()).append(j4).toString()).append(" 小时 ").toString()).append(j5).toString()).append(" 分钟 ").toString()).append(j6).toString()).append(" 秒 ").toString();
  120.     }

  121.     public static byte[] hex2byte(String str) {
  122.         String str2 = str;
  123.         if (str2 == null) {
  124.             return (byte[]) null;
  125.         }
  126.         int length = str2.length();
  127.         if (length % 2 == 1) {
  128.             return (byte[]) null;
  129.         }
  130.         byte[] bArr = new byte[(length / 2)];
  131.         for (int i = 0; i != length / 2; i++) {
  132.             bArr[i] = (byte) Integer.parseInt(str2.substring(i * 2, (i * 2) + 2), 16);
  133.         }
  134.         return bArr;
  135.     }

  136.     void dia(String str, OnClickListener onClickListener) {
  137.         String str2 = str;
  138.         OnClickListener onClickListener2 = onClickListener;
  139.         Builder builder = r8;
  140.         Builder builder2 = new Builder(this);
  141.         Builder builder3 = builder;
  142.         builder = builder3.setTitle("*_*");
  143.         builder = builder3.setMessage(str2);
  144.         builder = builder3.setPositiveButton("确定", onClickListener2);
  145.         AlertDialog show = builder3.show();
  146.     }

  147.     void enter() {
  148.         Intent intent = r5;
  149.         Intent intent2 = intent2;
  150.         try {
  151.             intent2 = new Intent(this, Class.forName("com.iapp.app.run.load"));
  152.             startActivity(intent);
  153.             finish();
  154.         } catch (Throwable e) {
  155.             Throwable th = e;
  156.             NoClassDefFoundError noClassDefFoundError = r11;
  157.             NoClassDefFoundError noClassDefFoundError2 = new NoClassDefFoundError(th.getMessage());
  158.             throw noClassDefFoundError;
  159.         }
  160.     }

  161.     @Override
  162.     public void onCreate(Bundle bundle) {
  163.         Exception exception;
  164.         NumberFormatException numberFormatException;
  165.         this.key = 123456789;
  166.         super.onCreate(bundle);
  167.         SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
  168.         boolean z = defaultSharedPreferences.getBoolean("q1737611219077", false);
  169.         if (defaultSharedPreferences.getBoolean("q1737611220076", false)) {
  170.             enter();
  171.             return;
  172.         }
  173.         boolean commit;
  174.         this.temp = defaultSharedPreferences.getString("sss", "");
  175.         Date date = r24;
  176.         Date date2 = new Date();
  177.         Date date3 = date;
  178.         long j = (long) -1;
  179.         long j2 = (long) -1;
  180.         try {
  181.             j = Long.parseLong(de(this.temp));
  182.         } catch (Exception e) {
  183.             exception = e;
  184.         } catch (NumberFormatException e2) {
  185.             numberFormatException = e2;
  186.         }
  187.         if (z) {
  188.             this.temp = defaultSharedPreferences.getString("ttt", "");
  189.             try {
  190.                 j2 = Long.parseLong(de(this.temp));
  191.             } catch (Exception e3) {
  192.                 exception = e3;
  193.             } catch (NumberFormatException e22) {
  194.                 numberFormatException = e22;
  195.             }
  196.             if (date3.getTime() - j > j2) {
  197.                 dia("已过期!", (OnClickListener) null);
  198.                 commit = defaultSharedPreferences.edit().putBoolean("q1737611219077", false).commit();
  199.                 commit = defaultSharedPreferences.edit().putString("sss", "").commit();
  200.                 commit = defaultSharedPreferences.edit().putString("ttt", "").commit();
  201.             } else {
  202.                 enter();
  203.                 return;
  204.             }
  205.         }
  206.         this.id = defaultSharedPreferences.getInt("id", -1);
  207.         if (this.id == -1) {
  208.             this.id = (int) ((Math.random() * ((double) 1000000000)) % ((double) 100000));
  209.             commit = defaultSharedPreferences.edit().putInt("id", this.id).commit();
  210.         }
  211.         View view = r24;
  212.         View linearLayout = new LinearLayout(this);
  213.         View view2 = view;
  214.         view2.setOrientation(1);
  215.         InputStream inputStream = (InputStream) null;
  216.         try {
  217.             inputStream = getAssets().open("background.jpg");
  218.         } catch (IOException e4) {
  219.             IOException iOException = e4;
  220.         }
  221.         if (inputStream != null) {
  222.             view2.setBackgroundDrawable(Drawable.createFromStream(inputStream, ""));
  223.         }
  224.         TextView textView = r24;
  225.         TextView textView2 = new TextView(this);
  226.         this.tv = textView;
  227.         this.tv.setTextSize((float) 20);
  228.         this.tv.setText("1\n2\n3\n4\n5format\n6\n7\n8\n9\n");
  229.         TextView textView3 = this.tv;
  230.         StringBuffer stringBuffer = r24;
  231.         StringBuffer stringBuffer2 = new StringBuffer();
  232.         textView3.append(stringBuffer.append("你的ID:").append(this.id).toString());
  233.         view2.addView(this.tv);
  234.         EditText editText = r24;
  235.         EditText editText2 = new EditText(this);
  236.         this.edit = editText;
  237.         view2.addView(this.edit);
  238.         view = r24;
  239.         linearLayout = new Button(this);
  240.         View view3 = view;
  241.         view3.setText("复制ID");
  242.         view = view3;
  243.         View.OnClickListener onClickListener = r24;
  244.         100000000 100000000 = new 100000000(this);
  245.         view.setOnClickListener(onClickListener);
  246.         view2.addView(view3);
  247.         Button button = r24;
  248.         Button button2 = new Button(this);
  249.         this.enter = button;
  250.         this.enter.setText("进入");
  251.         view2.addView(this.enter);
  252.         Button button3 = this.enter;
  253.         onClickListener = r24;
  254.         100000002 100000002 = new 100000002(this, defaultSharedPreferences, date3);
  255.         button3.setOnClickListener(onClickListener);
  256.         button3 = r24;
  257.         button = new Button(this);
  258.         button3 = button3;
  259.         setContentView(view2);
  260.     }
  261. }
复制代码

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-16 08:10

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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