53 lines
1.8 KiB
Java
53 lines
1.8 KiB
Java
|
package o;
|
||
|
|
||
|
import android.text.TextUtils;
|
||
|
import com.huawei.hms.android.HwBuildEx;
|
||
|
import java.io.UnsupportedEncodingException;
|
||
|
import java.security.GeneralSecurityException;
|
||
|
import java.security.NoSuchAlgorithmException;
|
||
|
import java.security.spec.InvalidKeySpecException;
|
||
|
import java.util.regex.Matcher;
|
||
|
import java.util.regex.Pattern;
|
||
|
import javax.crypto.SecretKey;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class FOx implements InterfaceC14883gax {
|
||
|
private final vbd a;
|
||
|
private SecretKey d;
|
||
|
private boolean e = false;
|
||
|
|
||
|
@Override // o.InterfaceC14883gax
|
||
|
public final String c(String str, String str2) {
|
||
|
if (!this.e) {
|
||
|
try {
|
||
|
this.d = wac.c(new WuW(this.a.a("/code/code1", null), this.a.a("/code/code2", null), this.a.a("/code/code3", null), this.a.a("/code/code4", null), "PBKDF2WithHmacSHA1", HwBuildEx.VersionCodes.CUR_DEVELOPMENT));
|
||
|
} catch (IllegalArgumentException | NoSuchAlgorithmException | InvalidKeySpecException unused) {
|
||
|
this.d = null;
|
||
|
}
|
||
|
this.e = true;
|
||
|
}
|
||
|
if (this.d != null && !TextUtils.isEmpty(str) && Pattern.matches("^\\[!([A-Fa-f0-9]*)]", str)) {
|
||
|
try {
|
||
|
return new String(wac.e(this.d, KzA.b(e(str))), "UTF-8");
|
||
|
} catch (UnsupportedEncodingException | IllegalArgumentException | GeneralSecurityException unused2) {
|
||
|
}
|
||
|
}
|
||
|
return str2;
|
||
|
}
|
||
|
|
||
|
private static String e(String str) {
|
||
|
try {
|
||
|
Matcher matcher = Pattern.compile("^\\[!([A-Fa-f0-9]*)]").matcher(str);
|
||
|
if (matcher.find()) {
|
||
|
return matcher.group(1);
|
||
|
}
|
||
|
} catch (IllegalStateException | IndexOutOfBoundsException unused) {
|
||
|
}
|
||
|
return "";
|
||
|
}
|
||
|
|
||
|
public FOx(vbd vbdVar) {
|
||
|
this.a = vbdVar;
|
||
|
}
|
||
|
}
|