Initial commit
This commit is contained in:
35
sources/com/baidu/license/util/SecretUtil.java
Normal file
35
sources/com/baidu/license/util/SecretUtil.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.baidu.license.util;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SecretUtil {
|
||||
static {
|
||||
System.loadLibrary("license");
|
||||
}
|
||||
|
||||
static String a() {
|
||||
String concat = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALCwRZyG7UhmHNjqeWmnqBmYG0Q49SRdd2NZgVY+AYOJeUcmR1Drpuh/++30mBV2qu1Db94/fHNfjw".concat("BPqfHGM062hnYQ5NFe84Uj6OAWg3IieuMzwq6HRTROUIH2muGi1glcpjxaZquQOODT0ont1lDamcRvDgnUqByOz6lynbuBAgMBAAECgYEAkmxSE+iBJZlx2JVfrp5BI");
|
||||
String str = new String(a("Kk%_9fpjP}fSG~Sv\\*Z#QW]B#vYxXJf{C|tTbQ!bV|\u007fHb9JA}Sy]#j$|bP\u007fF`E}+=sU^DAq{FQFVkqYcJ^Ax#Ky`]w^Wu_`%=]Q@9|b[eB|uY\"uvVxP^${~+fJP'=w=eXC&".getBytes()));
|
||||
String str2 = new String(getSecretByte(""), StandardCharsets.UTF_8);
|
||||
String str3 = new String(getSecretByte2(), StandardCharsets.UTF_8);
|
||||
return concat.concat(str.concat(str2).concat(str3).concat(new String(getSecretByte3(), StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
private static native byte[] getSecretByte(String str);
|
||||
|
||||
private static native byte[] getSecretByte2();
|
||||
|
||||
private static native byte[] getSecretByte3();
|
||||
|
||||
private static byte[] a(byte[] bArr) {
|
||||
if (bArr == null) {
|
||||
return null;
|
||||
}
|
||||
int length = bArr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
bArr[i] = (byte) (bArr[i] ^ 18);
|
||||
}
|
||||
return bArr;
|
||||
}
|
||||
}
|
49
sources/com/baidu/license/util/mas.java
Normal file
49
sources/com/baidu/license/util/mas.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package com.baidu.license.util;
|
||||
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import javax.crypto.Cipher;
|
||||
|
||||
/* compiled from: RsaUtil.java */
|
||||
/* loaded from: classes.dex */
|
||||
public final class mas {
|
||||
public static String a(String str, String str2) {
|
||||
byte[] a = nx.a(str);
|
||||
byte[] a2 = nx.a(str2);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
|
||||
cipher.init(2, keyFactory.generatePrivate(new PKCS8EncodedKeySpec(a2)));
|
||||
return new String(a(a, cipher));
|
||||
}
|
||||
|
||||
private static byte[] a(byte[] bArr, Cipher cipher) {
|
||||
byte[] doFinal;
|
||||
try {
|
||||
int length = bArr.length;
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
int i3 = length - i;
|
||||
if (i3 > 0) {
|
||||
if (i3 > 128) {
|
||||
doFinal = cipher.doFinal(bArr, i, PeripheralType.SERVO);
|
||||
} else {
|
||||
doFinal = cipher.doFinal(bArr, i, i3);
|
||||
}
|
||||
byteArrayOutputStream.write(doFinal, 0, doFinal.length);
|
||||
i2++;
|
||||
i = i2 << 7;
|
||||
} else {
|
||||
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
||||
byteArrayOutputStream.close();
|
||||
return byteArray;
|
||||
}
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
129
sources/com/baidu/license/util/nx.java
Normal file
129
sources/com/baidu/license/util/nx.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package com.baidu.license.util;
|
||||
|
||||
/* compiled from: Base64Utils.java */
|
||||
/* loaded from: classes.dex */
|
||||
public final class nx {
|
||||
private static byte[] a = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, -1, -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};
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x0085, code lost:
|
||||
|
||||
if (r3 == (-1)) goto L48;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:41:0x0087, code lost:
|
||||
|
||||
r1.append((char) (r3 | ((r7 & 3) << 6)));
|
||||
r3 = r6;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public static byte[] a(java.lang.String r10) {
|
||||
/*
|
||||
r0 = 0
|
||||
java.lang.StringBuffer r1 = new java.lang.StringBuffer // Catch: java.lang.Exception -> L9c
|
||||
r1.<init>() // Catch: java.lang.Exception -> L9c
|
||||
java.lang.String r2 = "US-ASCII"
|
||||
byte[] r10 = r10.getBytes(r2) // Catch: java.lang.Exception -> L9c
|
||||
int r2 = r10.length // Catch: java.lang.Exception -> L9c
|
||||
r3 = 0
|
||||
Le:
|
||||
java.lang.String r4 = "iso8859-1"
|
||||
if (r3 >= r2) goto L93
|
||||
L12:
|
||||
byte[] r5 = com.baidu.license.util.nx.a // Catch: java.lang.Exception -> L9c
|
||||
int r6 = r3 + 1
|
||||
r3 = r10[r3] // Catch: java.lang.Exception -> L9c
|
||||
r3 = r5[r3] // Catch: java.lang.Exception -> L9c
|
||||
r5 = -1
|
||||
if (r6 >= r2) goto L22
|
||||
if (r3 == r5) goto L20
|
||||
goto L22
|
||||
L20:
|
||||
r3 = r6
|
||||
goto L12
|
||||
L22:
|
||||
if (r3 == r5) goto L93
|
||||
L24:
|
||||
byte[] r7 = com.baidu.license.util.nx.a // Catch: java.lang.Exception -> L9c
|
||||
int r8 = r6 + 1
|
||||
r6 = r10[r6] // Catch: java.lang.Exception -> L9c
|
||||
r6 = r7[r6] // Catch: java.lang.Exception -> L9c
|
||||
if (r8 >= r2) goto L33
|
||||
if (r6 == r5) goto L31
|
||||
goto L33
|
||||
L31:
|
||||
r6 = r8
|
||||
goto L24
|
||||
L33:
|
||||
if (r6 == r5) goto L93
|
||||
int r3 = r3 << 2
|
||||
r7 = r6 & 48
|
||||
int r7 = r7 >>> 4
|
||||
r3 = r3 | r7
|
||||
char r3 = (char) r3 // Catch: java.lang.Exception -> L9c
|
||||
r1.append(r3) // Catch: java.lang.Exception -> L9c
|
||||
L40:
|
||||
int r3 = r8 + 1
|
||||
r7 = r10[r8] // Catch: java.lang.Exception -> L9c
|
||||
r8 = 61
|
||||
if (r7 != r8) goto L51
|
||||
java.lang.String r10 = r1.toString() // Catch: java.lang.Exception -> L9c
|
||||
byte[] r10 = r10.getBytes(r4) // Catch: java.lang.Exception -> L9c
|
||||
return r10
|
||||
L51:
|
||||
byte[] r9 = com.baidu.license.util.nx.a // Catch: java.lang.Exception -> L9c
|
||||
r7 = r9[r7] // Catch: java.lang.Exception -> L9c
|
||||
if (r3 >= r2) goto L5c
|
||||
if (r7 == r5) goto L5a
|
||||
goto L5c
|
||||
L5a:
|
||||
r8 = r3
|
||||
goto L40
|
||||
L5c:
|
||||
if (r7 == r5) goto L93
|
||||
r6 = r6 & 15
|
||||
int r6 = r6 << 4
|
||||
r9 = r7 & 60
|
||||
int r9 = r9 >>> 2
|
||||
r6 = r6 | r9
|
||||
char r6 = (char) r6 // Catch: java.lang.Exception -> L9c
|
||||
r1.append(r6) // Catch: java.lang.Exception -> L9c
|
||||
L6b:
|
||||
int r6 = r3 + 1
|
||||
r3 = r10[r3] // Catch: java.lang.Exception -> L9c
|
||||
if (r3 != r8) goto L7a
|
||||
java.lang.String r10 = r1.toString() // Catch: java.lang.Exception -> L9c
|
||||
byte[] r10 = r10.getBytes(r4) // Catch: java.lang.Exception -> L9c
|
||||
return r10
|
||||
L7a:
|
||||
byte[] r9 = com.baidu.license.util.nx.a // Catch: java.lang.Exception -> L9c
|
||||
r3 = r9[r3] // Catch: java.lang.Exception -> L9c
|
||||
if (r6 >= r2) goto L85
|
||||
if (r3 == r5) goto L83
|
||||
goto L85
|
||||
L83:
|
||||
r3 = r6
|
||||
goto L6b
|
||||
L85:
|
||||
if (r3 == r5) goto L93
|
||||
r4 = r7 & 3
|
||||
int r4 = r4 << 6
|
||||
r3 = r3 | r4
|
||||
char r3 = (char) r3 // Catch: java.lang.Exception -> L9c
|
||||
r1.append(r3) // Catch: java.lang.Exception -> L9c
|
||||
r3 = r6
|
||||
goto Le
|
||||
L93:
|
||||
java.lang.String r10 = r1.toString() // Catch: java.lang.Exception -> L9c
|
||||
byte[] r10 = r10.getBytes(r4) // Catch: java.lang.Exception -> L9c
|
||||
return r10
|
||||
L9c:
|
||||
r10 = move-exception
|
||||
r10.printStackTrace()
|
||||
byte[] r10 = new byte[r0]
|
||||
return r10
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.baidu.license.util.nx.a(java.lang.String):byte[]");
|
||||
}
|
||||
}
|
189
sources/com/baidu/license/util/oi.java
Normal file
189
sources/com/baidu/license/util/oi.java
Normal file
@@ -0,0 +1,189 @@
|
||||
package com.baidu.license.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import com.ubt.jimu.base.entities.Course;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Locale;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* compiled from: AuthenticationManager.java */
|
||||
/* loaded from: classes.dex */
|
||||
public final class oi {
|
||||
private static Context a;
|
||||
private static String b;
|
||||
private static String c;
|
||||
private static C0003oi d;
|
||||
private static oi e;
|
||||
|
||||
/* compiled from: AuthenticationManager.java */
|
||||
/* renamed from: com.baidu.license.util.oi$oi, reason: collision with other inner class name */
|
||||
public static class C0003oi {
|
||||
public String a;
|
||||
public String b;
|
||||
}
|
||||
|
||||
static {
|
||||
Long.valueOf(0L);
|
||||
e = null;
|
||||
}
|
||||
|
||||
private oi(String str) {
|
||||
b = str;
|
||||
}
|
||||
|
||||
public static String a() {
|
||||
return SecretUtil.a().concat("gihBYYM8rBQUNM9RAYjXdFPdeiwTmww+Mw2gSCXDqexH6B+kfIglVjnAHX9UIgPVtu10e4Ls=");
|
||||
}
|
||||
|
||||
private static void b(String str) {
|
||||
String str2;
|
||||
try {
|
||||
str2 = mas.a(str, a());
|
||||
} catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
str2 = null;
|
||||
}
|
||||
C0003oi c0003oi = d;
|
||||
String str3 = c0003oi != null ? c0003oi.a : "";
|
||||
C0003oi c2 = c(str2);
|
||||
if (c2 != null) {
|
||||
d = c2;
|
||||
c2.a = str3;
|
||||
try {
|
||||
Long.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).parse(c2.b).getTime());
|
||||
} catch (Exception e3) {
|
||||
e3.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean c() {
|
||||
if (d != null) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
long j = 0;
|
||||
try {
|
||||
j = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).parse(d.b).getTime();
|
||||
} catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
if (j > currentTimeMillis) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static String d() {
|
||||
try {
|
||||
InputStream open = a.getResources().getAssets().open("player" + a(b) + ".license");
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(open, "UTF-8");
|
||||
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine == null) {
|
||||
bufferedReader.close();
|
||||
inputStreamReader.close();
|
||||
open.close();
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(readLine + "\n");
|
||||
}
|
||||
} catch (IOException e2) {
|
||||
e2.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized oi a(Context context, String str) {
|
||||
oi oiVar;
|
||||
synchronized (oi.class) {
|
||||
if (e == null) {
|
||||
e = new oi(str);
|
||||
if (context != null) {
|
||||
a = context;
|
||||
}
|
||||
if (c == null) {
|
||||
c = a(a.getPackageName() + a(b));
|
||||
}
|
||||
if (d == null) {
|
||||
try {
|
||||
C0003oi c2 = c(mas.a(d(), a()));
|
||||
d = c2;
|
||||
if (c2 != null) {
|
||||
Long.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).parse(d.b).getTime());
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
oiVar = e;
|
||||
}
|
||||
return oiVar;
|
||||
}
|
||||
|
||||
private static C0003oi c(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return d;
|
||||
}
|
||||
try {
|
||||
C0003oi c0003oi = new C0003oi();
|
||||
JSONObject jSONObject = new JSONObject(str);
|
||||
jSONObject.optInt(Course.TYPE_BLOCKLY);
|
||||
c0003oi.a = jSONObject.optString("vc");
|
||||
jSONObject.optString("ar");
|
||||
c0003oi.b = jSONObject.optString("expireTime");
|
||||
jSONObject.optJSONArray("funcCodeList");
|
||||
return c0003oi;
|
||||
} catch (JSONException e2) {
|
||||
e2.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean b() {
|
||||
String str;
|
||||
C0003oi c0003oi = d;
|
||||
return (c0003oi == null || (str = c0003oi.a) == null || !c.equals(str)) ? false : true;
|
||||
}
|
||||
|
||||
public static void a(Context context) {
|
||||
if (c()) {
|
||||
return;
|
||||
}
|
||||
String string = context != null ? context.getSharedPreferences("account_sp", 0).getString("license", "") : "";
|
||||
if (TextUtils.isEmpty(string)) {
|
||||
return;
|
||||
}
|
||||
b(string);
|
||||
}
|
||||
|
||||
public static String a(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
String str2 = "";
|
||||
for (byte b2 : MessageDigest.getInstance("MD5").digest(str.getBytes())) {
|
||||
String hexString = Integer.toHexString(b2 & 255);
|
||||
if (hexString.length() == 1) {
|
||||
hexString = "0".concat(String.valueOf(hexString));
|
||||
}
|
||||
str2 = str2 + hexString;
|
||||
}
|
||||
return str2.toLowerCase();
|
||||
} catch (NoSuchAlgorithmException e2) {
|
||||
e2.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user