some proxy fixes (vkui dead idk why)
This commit is contained in:
@@ -59,7 +59,7 @@ public class ProxyUtils{
|
||||
}
|
||||
|
||||
public static Boolean isApiProxyEnabled(){
|
||||
return getPrefsValue("proxy").equals("apiproxy");
|
||||
return getPrefsValue("proxy").equals("apiproxy") || getPrefsValue("proxy").equals("vika");
|
||||
}
|
||||
|
||||
public static Boolean isVikaProxyEnabled(){
|
||||
|
||||
@@ -10,6 +10,9 @@ public class ApiProxy{
|
||||
var vkapi = "api.vk.ru";
|
||||
var oauth = "oauth.vk.ru";
|
||||
var vkstatic = "static.vk.ru";
|
||||
var vkapiold = "api.vk.com";
|
||||
var oauthold = "oauth.vk.com";
|
||||
var vkstaticold = "static.vk.com";
|
||||
|
||||
var proxyapi = getPrefsValue("proxyapi");
|
||||
var proxyoauth = getPrefsValue("proxyoauth");
|
||||
@@ -21,7 +24,7 @@ public class ApiProxy{
|
||||
proxystatic = VikaMobile.getStaticHost();
|
||||
}
|
||||
|
||||
if (!isApiProxyEnabled() || link.isEmpty()) {
|
||||
if ((!isApiProxyEnabled() || !isVikaProxyEnabled()) || link.isEmpty()) {
|
||||
return link;
|
||||
}
|
||||
|
||||
@@ -31,24 +34,48 @@ public class ApiProxy{
|
||||
}
|
||||
|
||||
if (link.contains(vkapi)) {
|
||||
return link.replace(proxyapi, vkapi);
|
||||
return link.replaceAll(vkapi, proxyapi);
|
||||
}
|
||||
|
||||
if (link.contains(oauth)) {
|
||||
return link.replace(proxyoauth, oauth);
|
||||
return link.replaceAll(oauth, proxyoauth);
|
||||
}
|
||||
|
||||
if (link.contains(vkstatic)) {
|
||||
return link.replace(proxystatic, vkstatic);
|
||||
return link.replaceAll(vkstatic, proxystatic);
|
||||
}
|
||||
|
||||
if (link.contains(vkapiold)) {
|
||||
return link.replaceAll(vkapiold, proxyapi);
|
||||
}
|
||||
|
||||
if (link.contains(oauthold)) {
|
||||
return link.replaceAll(vkapiold, proxyoauth);
|
||||
}
|
||||
|
||||
if (link.contains(vkstaticold)) {
|
||||
return link.replaceAll(vkapiold, proxystatic);
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
public static String staticFix(String str) {
|
||||
var string = getPrefsValue("proxystatic");
|
||||
|
||||
if (isVikaProxyEnabled()) {
|
||||
string = VikaMobile.getStaticHost();
|
||||
}
|
||||
|
||||
if ((isApiProxyEnabled() || isVikaProxyEnabled()) && string.isEmpty()) return str;
|
||||
|
||||
return str.replaceAll(string, "static.vk.ru");
|
||||
}
|
||||
|
||||
public static String getAwayPhpCom(){
|
||||
var proxyapi = getPrefsValue("proxyapi");
|
||||
|
||||
if (isApiProxyEnabled() & !proxyapi.isEmpty()) {
|
||||
if ((isApiProxyEnabled() || isVikaProxyEnabled()) & !proxyapi.isEmpty()) {
|
||||
return proxyapi;
|
||||
}
|
||||
|
||||
|
||||
@@ -548,6 +548,10 @@
|
||||
|
||||
const-string v3, "https://oauth.vk.ru/blank.html"
|
||||
|
||||
invoke-static {v3}, Lru/vtosters/lite/proxy/api/ApiProxy;->linkReplacer(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
invoke-virtual {p0, v2, v1, v3}, Lcom/vk/webapp/bridges/AndroidBridge;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri;
|
||||
|
||||
move-result-object v1
|
||||
@@ -1491,7 +1495,7 @@
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {p1}, Lru/vtosters/lite/proxy/api/ApiProxy;->linkReplacer(Ljava/lang/String;)Ljava/lang/String;
|
||||
invoke-static {p1}, Lru/vtosters/lite/proxy/api/ApiProxy;->staticFix(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
@@ -2141,6 +2145,10 @@
|
||||
|
||||
const-string v3, "https://oauth.vk.ru/blank.html"
|
||||
|
||||
invoke-static {v3}, Lru/vtosters/lite/proxy/api/ApiProxy;->linkReplacer(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
.line 5
|
||||
invoke-virtual {p1, v2, v3}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
|
||||
@@ -132,6 +132,10 @@
|
||||
|
||||
aput-object p1, v0, v1
|
||||
|
||||
invoke-static {p3}, Lru/vtosters/lite/proxy/api/ApiProxy;->staticFix(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object p3
|
||||
|
||||
const-string p1, "source_url"
|
||||
|
||||
.line 5
|
||||
|
||||
@@ -87,6 +87,10 @@
|
||||
|
||||
move-result-object v4
|
||||
|
||||
invoke-static {v4}, Lru/vtosters/lite/proxy/api/ApiProxy;->staticFix(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object v4
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
|
||||
Reference in New Issue
Block a user