先用模拟器看看,发现是个登入页面,通过关键词搜索找到主要代码
package com.example.easyapk;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/* loaded from: classes3.dex */
public class llooggiinn extends AppCompatActivity {
static String str1 = "admin";
static String str2;
Button loginBtn;
EditText passwdEt;
Button signBtn;
EditText userEt;
/* JADX INFO: Access modifiers changed from: protected */
@Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
this.userEt = (EditText) findViewById(R.id.user);
this.passwdEt = (EditText) findViewById(R.id.passwd);
this.loginBtn = (Button) findViewById(R.id.loginBtn);
this.signBtn = (Button) findViewById(R.id.signBtn);
try {
String key = getString(R.string.keyishere);
byte[] ciphertext = Base64.getDecoder().decode("Lz49p2OjPZzUMXakynHQuw==");
byte[] plaintext = decrypt(ciphertext, key.getBytes(), "iviviviviviviviv".getBytes());
str2 = new String(plaintext);
} catch (InvalidAlgorithmParameterException | InvalidKeyException | NoSuchAlgorithmException | BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException e) {
e.printStackTrace();
}
this.loginBtn.setOnClickListener(new View.OnClickListener() { // from class: com.example.easyapk.llooggiinn.1
@Override // android.view.View.OnClickListener
public void onClick(View view) {
String username = llooggiinn.this.userEt.getText().toString();
String passwd = llooggiinn.this.passwdEt.getText().toString();
if (passwd.equals("") | username.equals("")) {
Toast.makeText(llooggiinn.this, "想空手套白狼?没门!", 0).show();
} else if (!username.equals(llooggiinn.str1) || !passwd.equals(llooggiinn.str2)) {
Toast.makeText(llooggiinn.this, "用户名或密码不正确", 0).show();
} else {
Intent intent = new Intent(llooggiinn.this, ffuucc.class);
llooggiinn.this.startActivity(intent);
Toast.makeText(llooggiinn.this, "恭喜你,离成功又进一步", 0).show();
}
}
});
this.signBtn.setOnClickListener(new View.OnClickListener() { // from class: com.example.easyapk.llooggiinn.2
@Override // android.view.View.OnClickListener
public void onClick(View view) {
Toast.makeText(llooggiinn.this, "不支持注册喵~\n快去找登录名和密码", 0).show();
}
});
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
public void onStart() {
super.onStart();
}
public static byte[] decrypt(byte[] data, byte[] key, byte[] iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(2, new SecretKeySpec(key, "AES"), new IvParameterSpec(iv));
byte[] result = cipher.doFinal(data);
return result;
}
}
看看chatgpt的解释:
这是一个简单的Android登录界面的代码。它包含了使用AES算法对密文进行解密的逻辑。
在代码中,解密函数`decrypt`使用了AES/CBC/PKCS5Padding加密模式,通过传入密钥和初始向量(IV)来初始化`Cipher`对象。然后使用密钥和IV对密文进行解密操作。
在`onCreate`方法中,从资源文件中获取密钥并将密文进行解密。解密后的明文被存储在静态变量`str2`中,用于后续的用户名和密码验证。
点击登录按钮时,会获取用户输入的用户名和密码,并与`str1`和`str2`进行比较。如果匹配成功,则跳转到`ffuucc`界面,并显示登录成功的提示消息。
点击注册按钮时,会显示一个不支持注册的提示消息。
需要注意的是,该代码片段只提供了部分代码,可能无法直接运行。还需要结合其他相关代码才能完整运行一个可用的Android应用。
先对其进行AES解密:
登入一下,得到一些数据
最后用厨子解密一下咯