ssl + debug check
This commit is contained in:
@@ -26,6 +26,7 @@ import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Debug;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -49,6 +50,8 @@ public class Preferences {
|
||||
public static Integer VKBUILD = 12116; // 3439 orig
|
||||
public static String VKVER = "7.24"; // 5.29 orig
|
||||
|
||||
static final boolean isDebug = Debug.isDebuggerConnected();
|
||||
|
||||
public static void init(Application application) {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
@@ -185,11 +188,11 @@ public class Preferences {
|
||||
}
|
||||
|
||||
public static boolean dev() {
|
||||
return getBoolValue("dev", false);
|
||||
return getBoolValue("dev", false) || isDebug;
|
||||
}
|
||||
|
||||
public static boolean devmenu() {
|
||||
return getBoolValue("devmenu", false);
|
||||
return getBoolValue("devmenu", false) || isDebug;
|
||||
}
|
||||
|
||||
public static boolean dnr() {
|
||||
@@ -305,7 +308,7 @@ public class Preferences {
|
||||
}
|
||||
|
||||
public static boolean ssl() {
|
||||
return getBoolValue("ssl", true);
|
||||
return !isDebug; // getBoolValue("ssl", true) ||
|
||||
}
|
||||
|
||||
public static boolean stories() {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<debug-overrides>
|
||||
<trust-anchors>
|
||||
<!-- Trust user added CAs while debuggable only -->
|
||||
<certificates src="user" />
|
||||
<certificates src="system" />
|
||||
</trust-anchors>
|
||||
</debug-overrides>
|
||||
<base-config cleartextTrafficPermitted="true">
|
||||
<trust-anchors>
|
||||
<certificates src="system" />
|
||||
</trust-anchors>
|
||||
</base-config>
|
||||
<domain-config>
|
||||
<!-- Make sure your URL Server here -->
|
||||
<domain includeSubdomains="true">vk.com</domain>
|
||||
<trust-anchors>
|
||||
<certificates src="user"/>
|
||||
<certificates src="system"/>
|
||||
</trust-anchors>
|
||||
</domain-config>
|
||||
<domain-config>
|
||||
<!-- Make sure your URL Server here -->
|
||||
<domain includeSubdomains="true">api.vk.com</domain>
|
||||
<trust-anchors>
|
||||
<certificates src="user"/>
|
||||
<certificates src="system"/>
|
||||
</trust-anchors>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
@@ -696,7 +696,9 @@
|
||||
return v0
|
||||
|
||||
:cond_1
|
||||
const/4 v0, 0x1
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->ssl()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
@@ -82,6 +82,15 @@
|
||||
.method private final a(Landroid/content/Context;)V
|
||||
.locals 7
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->ssl()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_7
|
||||
|
||||
return-void
|
||||
|
||||
:cond_7
|
||||
const/4 v0, 0x1
|
||||
|
||||
const/4 v1, 0x2
|
||||
@@ -284,6 +293,8 @@
|
||||
.line 1
|
||||
iget-boolean v0, p0, Lcom/vk/core/network/security/NetworkKeyStore;->c:Z
|
||||
|
||||
const v0, 0x0
|
||||
|
||||
return v0
|
||||
.end method
|
||||
|
||||
|
||||
@@ -358,6 +358,15 @@
|
||||
}
|
||||
.end annotation
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->ssl()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_7
|
||||
|
||||
return-void
|
||||
|
||||
:cond_7
|
||||
.line 1
|
||||
iget-object v0, p0, Lcom/vk/core/network/security/a;->a:Ljavax/net/ssl/X509TrustManager;
|
||||
|
||||
@@ -377,7 +386,15 @@
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 1
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->ssl()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_7
|
||||
|
||||
return-void
|
||||
|
||||
:cond_7
|
||||
iget-object v0, p0, Lcom/vk/core/network/security/a;->a:Ljavax/net/ssl/X509TrustManager;
|
||||
|
||||
if-eqz v0, :cond_0
|
||||
@@ -391,7 +408,17 @@
|
||||
.method public getAcceptedIssuers()[Ljava/security/cert/X509Certificate;
|
||||
.locals 1
|
||||
|
||||
.line 1
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->ssl()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
if-nez v0, :cond_7
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
return-object v0
|
||||
|
||||
:cond_7
|
||||
iget-object v0, p0, Lcom/vk/core/network/security/a;->a:Ljavax/net/ssl/X509TrustManager;
|
||||
|
||||
if-eqz v0, :cond_0
|
||||
|
||||
Reference in New Issue
Block a user