开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1335|回复: 5
收起左侧

[js/PHP求助] 问一下java代码的加密的过程,从某APK取出来的

[复制链接]
结帖率:25% (1/4)
发表于 2020-8-12 11:12:14 | 显示全部楼层 |阅读模式   广东省汕头市
5精币
  
package p000667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils;
import java.io.UnsupportedEncodingException;
/* renamed from: 667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64  reason: invalid package */
public class DXBase64 {
static final /* synthetic */ boolean $assertionsDisabled = false;
public static final int CRLF = 4;
public static final int DEFAULT = 0;
public static final int NO_CLOSE = 16;
public static final int NO_PADDING = 1;
public static final int NO_WRAP = 2;
public static final int URL_SAFE = 8;
/* renamed from: 667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64$Coder */
static abstract class Coder {
public int op;
public byte[] output;
public abstract int maxOutputSize (int i);
public abstract boolean process (byte[] bArr, int i, int i2, boolean z);
Coder () {
}
}
public static byte[] decode (String str, int i) {
return decode (str.getBytes (), i);
}
public static byte[] decode (byte[] bArr, int i) {
return decode (bArr, 0, bArr.length, i);
}
public static byte[] decode (byte[] bArr, int i, int i2, int i3) {
Decoder decoder = new Decoder (i3, new byte[ ( (i2 * 3) / 4)]);
if (!decoder.process (bArr, i, i2, true)) {
throw new IllegalArgumentException ("bad base-64");
} else if (decoder.op == decoder.output.length) {
return decoder.output;
} else {
byte[] bArr2 = new byte[decoder.op];
System.arraycopy (decoder.output, 0, bArr2, 0, decoder.op);
return bArr2;
}
}
/* renamed from: 667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64$Decoder */
static class Decoder extends Coder {
private static final int[] DECODE = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
private static final int[] DECODE_WEBSAFE = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
private static final int EQUALS = -2;
private static final int SKIP = -1;
private final int[] alphabet;
private int state;
private int value;
public Decoder (int i, byte[] bArr) {
this.output = bArr;
this.alphabet = (i & 8) == 0 ? DECODE : DECODE_WEBSAFE;
this.state = 0;
this.value = 0;
}
public int maxOutputSize (int i) {
return ( (i * 3) / 4) + 10;
}
/* JADX WARNING: Removed duplicated region for block: B:50:0x00e4  */
/* JADX WARNING: Removed duplicated region for block: B:52:0x00eb  */
/* JADX WARNING: Removed duplicated region for block: B:64:0x00e1 A[SYNTHETIC] */
/* Code decompiled incorrectly, please refer to instructions dump. */
public boolean process (byte[] r12, int r13, int r14, boolean r15) {
throw new UnsupportedOperationException ("Method not decompiled: p000667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64.Decoder.process (byte[], int, int, boolean):boolean");
}
}
public static String encodeToString (byte[] bArr, int i) {
try {
return new String (encode (bArr, i), "US-ASCII");
} catch (UnsupportedEncodingException e) {
throw new AssertionError (e);
}
}
public static String encodeToString (byte[] bArr, int i, int i2, int i3) {
try {
return new String (encode (bArr, i, i2, i3), "US-ASCII");
} catch (UnsupportedEncodingException e) {
throw new AssertionError (e);
}
}
public static byte[] encode (byte[] bArr, int i) {
return encode (bArr, 0, bArr.length, i);
}
public static byte[] encode (byte[] bArr, int i, int i2, int i3) {
Encoder encoder = new Encoder (i3, (byte[]) null);
int i4 = (i2 / 3) * 4;
if (!encoder.do_padding) {
switch (i2 % 3) {
case 1:
i4 += 2;
break;
case 2:
i4 += 3;
break;
}
} else if (i2 % 3 > 0) {
i4 += 4;
}
if (encoder.do_newline && i2 > 0) {
i4 += ( ( (i2 - 1) / 57) + 1) * (encoder.do_cr ? 2 : 1);
}
encoder.output = new byte[i4];
encoder.process (bArr, i, i2, true);
return encoder.output;
}
/* renamed from: 667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64$Encoder */
static class Encoder extends Coder {
static final /* synthetic */ boolean $assertionsDisabled = false;
private static final byte[] ENCODE = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47};
private static final byte[] ENCODE_WEBSAFE = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95};
public static final int LINE_GROUPS = 19;
private final byte[] alphabet;
private int count;
public final boolean do_cr;
public final boolean do_newline;
public final boolean do_padding;
private final byte[] tail;
int tailLen;
static {
Class cls = DXBase64.class;
}
public Encoder (int i, byte[] bArr) {
this.output = bArr;
boolean z = true;
this.do_padding = (i & 1) == 0;
this.do_newline = (i & 2) == 0;
this.do_cr = (i & 4) == 0 ? false : z;
this.alphabet = (i & 8) == 0 ? ENCODE : ENCODE_WEBSAFE;
this.tail = new byte[2];
this.tailLen = 0;
this.count = this.do_newline ? 19 : -1;
}
public int maxOutputSize (int i) {
return ( (i * 8) / 5) + 10;
}
/* JADX WARNING: Can ' t fix incorrect switch cases order */
/* Code decompiled incorrectly, please refer to instructions dump. */
public boolean process (byte[] r18, int r19, int r20, boolean r21) {
throw new UnsupportedOperationException ("Method not decompiled: p000667129a30fe2dba1ef578a30daec00e4.com.dingxiang.mobile.utils.DXBase64.Encoder.process (byte[], int, int, boolean):boolean");
}
}
private DXBase64 () {
}
}

结帖率:78% (25/32)
发表于 2020-8-12 11:20:13 | 显示全部楼层   河北省石家庄市
这看上去不是个base64吗 可以把代码copy下来 放到工具运行一下 就知道了
回复

使用道具 举报

结帖率:25% (1/4)

签到天数: 1 天

 楼主| 发表于 2020-8-12 11:26:53 高大上手机用户 | 显示全部楼层   广东省深圳市
这里面定义了两个密钥,还有说明了加密方法,就是不知道是怎样的过程,所以还麻烦各位解释一下
回复

使用道具 举报

结帖率:25% (1/4)

签到天数: 1 天

 楼主| 发表于 2020-8-12 11:30:59 高大上手机用户 | 显示全部楼层   广东省深圳市
暴走的莎莉酱 发表于 2020-8-12 11:20
这看上去不是个base64吗 可以把代码copy下来 放到工具运行一下 就知道了

用什么工具运行
回复

使用道具 举报

结帖率:78% (25/32)
发表于 2020-8-12 11:32:18 | 显示全部楼层   河北省石家庄市
lin6163 发表于 2020-8-12 11:30
用什么工具运行

idea eclipse 等等都可以
回复

使用道具 举报

结帖率:25% (1/4)

签到天数: 1 天

 楼主| 发表于 2020-8-12 11:51:27 高大上手机用户 | 显示全部楼层   广东省深圳市
没搞过,好像某些引用代码还不全,运行不起来
回复

使用道具 举报

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

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

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