mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-22 15:31:10 +01:00
Update Conscrypt to 2.1.0, activate the default cipher suite in cross-arch loader
This commit is contained in:
parent
dfb1e7fbb7
commit
06c8b765ba
@ -30,7 +30,7 @@ dependencies {
|
||||
implementation "com.squareup.wire:wire-runtime:1.6.1"
|
||||
implementation "com.takisoft.fix:preference-v7:$supportLibraryVersion.0"
|
||||
implementation "de.hdodenhof:circleimageview:1.3.0"
|
||||
implementation "org.conscrypt:conscrypt-android:2.0.0"
|
||||
implementation "org.conscrypt:conscrypt-android:2.1.0"
|
||||
// TODO: Switch to upstream once raw requests are merged
|
||||
// https://github.com/vitalidze/chromecast-java-api-v2/pull/99
|
||||
// implementation "su.litvak.chromecast:api-v2:0.10.4"
|
||||
|
@ -35,8 +35,8 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.security.Security;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
@ -86,13 +86,57 @@ public class ProviderInstallerImpl {
|
||||
System.load(cacheFile.getAbsolutePath());
|
||||
|
||||
Class<NativeCrypto> clazz = NativeCrypto.class;
|
||||
|
||||
Field loadError = clazz.getDeclaredField("loadError");
|
||||
loadError.setAccessible(true);
|
||||
loadError.set(null, null);
|
||||
Method clinit =clazz.getDeclaredMethod("clinit");
|
||||
|
||||
Method clinit = clazz.getDeclaredMethod("clinit");
|
||||
clinit.setAccessible(true);
|
||||
|
||||
Method get_cipher_names = clazz.getDeclaredMethod("get_cipher_names", String.class);
|
||||
get_cipher_names.setAccessible(true);
|
||||
|
||||
Method cipherSuiteToJava = clazz.getDeclaredMethod("cipherSuiteToJava", String.class);
|
||||
cipherSuiteToJava.setAccessible(true);
|
||||
|
||||
Method EVP_has_aes_hardware = clazz.getDeclaredMethod("EVP_has_aes_hardware");
|
||||
EVP_has_aes_hardware.setAccessible(true);
|
||||
|
||||
Field f = clazz.getDeclaredField("SUPPORTED_TLS_1_2_CIPHER_SUITES_SET");
|
||||
f.setAccessible(true);
|
||||
|
||||
Set<String> SUPPORTED_TLS_1_2_CIPHER_SUITES_SET = (Set<String>) f.get(null);
|
||||
f = clazz.getDeclaredField("SUPPORTED_LEGACY_CIPHER_SUITES_SET");
|
||||
f.setAccessible(true);
|
||||
|
||||
Set<String> SUPPORTED_LEGACY_CIPHER_SUITES_SET = (Set<String>) f.get(null);
|
||||
f = clazz.getDeclaredField("SUPPORTED_TLS_1_2_CIPHER_SUITES");
|
||||
f.setAccessible(true);
|
||||
|
||||
try {
|
||||
clinit.invoke(null);
|
||||
|
||||
String[] allCipherSuites = (String[]) get_cipher_names.invoke(null, "ALL:!DHE");
|
||||
int size = allCipherSuites.length;
|
||||
|
||||
String[] SUPPORTED_TLS_1_2_CIPHER_SUITES = new String[size / 2 + 2];
|
||||
for (int i = 0; i < size; i += 2) {
|
||||
String cipherSuite = (String) cipherSuiteToJava.invoke(null, allCipherSuites[i]);
|
||||
|
||||
SUPPORTED_TLS_1_2_CIPHER_SUITES[i / 2] = cipherSuite;
|
||||
SUPPORTED_TLS_1_2_CIPHER_SUITES_SET.add(cipherSuite);
|
||||
|
||||
SUPPORTED_LEGACY_CIPHER_SUITES_SET.add(allCipherSuites[i + 1]);
|
||||
}
|
||||
SUPPORTED_TLS_1_2_CIPHER_SUITES[size / 2] = "TLS_EMPTY_RENEGOTIATION_INFO_SCSV";
|
||||
SUPPORTED_TLS_1_2_CIPHER_SUITES[size / 2 + 1] = "TLS_FALLBACK_SCSV";
|
||||
f.set(null, SUPPORTED_TLS_1_2_CIPHER_SUITES);
|
||||
|
||||
f = clazz.getDeclaredField("HAS_AES_HARDWARE");
|
||||
f.setAccessible(true);
|
||||
f.set(null, (int) EVP_has_aes_hardware.invoke(null) == 1);
|
||||
|
||||
provider = new OpenSSLProvider("GmsCore_OpenSSL");
|
||||
} catch (InvocationTargetException inner) {
|
||||
if (inner.getTargetException() instanceof UnsatisfiedLinkError) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user