Merge branch 'vtl-remaster' of https://github.com/vtosters/lite into vtl-remaster

This commit is contained in:
gdlbo
2022-06-21 20:40:46 +03:00
5 changed files with 15 additions and 215 deletions
-204
View File
@@ -1,204 +0,0 @@
package okhttp3;
import androidx.annotation.Nullable;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okhttp3.f0.Util;
import okhttp3.f0.f.HttpMethod;
public final class Request {
final HttpUrl a;
final String b;
final Headers c;
final Map<Class<?>, Object> e;
@Nullable
final RequestBody requestBody;
private volatile CacheControl f;
Request(Builder builder) {
this.a = builder.a;
this.b = builder.b;
this.c = builder.c.a();
this.requestBody = builder.d;
this.e = Util.a(builder.e);
}
public HttpUrl a() {
return this.a;
}
public String b() {
return this.b;
}
public Headers c() {
return this.c;
}
@Nullable
public String header(String str) {
return this.c.a(str);
}
public List<String> b(String str) {
return this.c.b(str);
}
@Nullable
public RequestBody d() {
return this.requestBody;
}
@Nullable
public <T> T a(Class<? extends T> cls) {
return cls.cast(this.e.get(cls));
}
public Builder e() {
return new Builder(this);
}
public CacheControl f() {
CacheControl cacheControl = this.f;
if (cacheControl != null) {
return cacheControl;
}
CacheControl a2 = CacheControl.a(this.c);
this.f = a2;
return a2;
}
public boolean g() {
return this.a.d();
}
public String toString() {
return "Request{method=" + this.b + ", url=" + this.a + ", tags=" + this.e + '}';
}
public static class Builder {
HttpUrl a;
String b;
Headers.a c;
RequestBody d;
Map<Class<?>, Object> e;
public Builder() {
this.e = Collections.emptyMap();
this.b = "GET";
this.c = new Headers.a();
}
Builder(Request request) {
Map<Class<?>, Object> map;
this.e = Collections.emptyMap();
this.a = request.a;
this.b = request.b;
this.d = request.requestBody;
if (request.e.isEmpty()) {
map = Collections.emptyMap();
} else {
map = new LinkedHashMap<>(request.e);
}
this.e = map;
this.c = request.c.b();
}
public Builder a(HttpUrl httpUrl) {
if (httpUrl == null) {
throw new NullPointerException("url == null");
}
this.a = httpUrl;
return this;
}
public Builder url(String str) {
if (str == null) {
throw new NullPointerException("url == null");
}
if (str.regionMatches(true, 0, "ws:", 0, 3)) {
str = "http:" + str.substring(3);
} else if (str.regionMatches(true, 0, "wss:", 0, 4)) {
str = "https:" + str.substring(4);
}
return a(HttpUrl.f(str));
}
public Builder a(String str, String str2) {
this.c.c(str, str2);
return this;
}
public Builder b(String str, String str2) {
this.c.a(str, str2);
return this;
}
public Builder b(String str) {
this.c.b(str);
return this;
}
public Builder a(Headers headers) {
this.c = headers.b();
return this;
}
public Builder a(CacheControl cacheControl) {
String cacheControl2 = cacheControl.toString();
return cacheControl2.isEmpty() ? b("Cache-Control") : a("Cache-Control", cacheControl2);
}
public Builder a() {
return a("GET", (RequestBody) null);
}
public Builder a(RequestBody requestBody) {
return a("POST", requestBody);
}
public Builder a(String str, @Nullable RequestBody requestBody) {
if (str == null) {
throw new NullPointerException("method == null");
} else if (str.length() == 0) {
throw new IllegalArgumentException("method.length() == 0");
} else if (requestBody != null && !HttpMethod.c(str)) {
throw new IllegalArgumentException("method " + str + " must not have a request body.");
} else if (requestBody != null || !HttpMethod.b(str)) {
this.b = str;
this.d = requestBody;
return this;
} else {
throw new IllegalArgumentException("method " + str + " must have a request body.");
}
}
public <T> Builder a(Class<? super T> cls, @Nullable T t) {
if (cls == null) {
throw new NullPointerException("type == null");
}
if (t == null) {
this.e.remove(cls);
} else {
if (this.e.isEmpty()) {
this.e = new LinkedHashMap();
}
this.e.put(cls, cls.cast(t));
}
return this;
}
public Request build() {
if (this.a != null) {
return new Request(this);
}
throw new IllegalStateException("url == null");
}
}
}
@@ -14,7 +14,7 @@ import java.util.List;
public class DNRInjector {
public static void inject(Dialog dialog, List<DialogAction> list) {
int peerId = dialog.a();
int peerId = dialog.getId();
if (isDnrEnabledFor(peerId)) {
list.add(DialogAction.valueOf("DNR_OFF"));
@@ -38,7 +38,7 @@ public class DNRInjector {
}
public static boolean onClick(Dialog dialog, DialogAction action) {
var id = dialog.a();
var id = dialog.getId();
if (action == DialogAction.valueOf("DNR_ON")) {
setDnr(dialog, true);
@@ -60,11 +60,11 @@ public class DNRInjector {
}
public static void setDnr(Dialog dialog, boolean value) {
hookDNR(dialog.a());
hookDNR(dialog.getId());
}
public static void setDnt(Dialog dialog, boolean value) {
hookDNT(dialog.a());
hookDNT(dialog.getId());
}
}
@@ -42,16 +42,16 @@ public class DNRModule {
public static boolean isDnrEnabledFor(Dialog dialog) {
if (dialog == null) return false;
return isDnrEnabledFor(dialog.a());
return isDnrEnabledFor(dialog.getId());
}
public static boolean isDntEnabledFor(Dialog dialog) {
if (dialog == null) return false;
return isDntEnabledFor(dialog.a());
return isDntEnabledFor(dialog.getId());
}
public static void hookRead(Dialog dialog) {
makeRequest("https://" + getApiCom() + "/method/messages.markAsRead?start_message_id=" + dialog.lastMsgVkId + "&peer_id=" + dialog.a() + "&v=5.91&access_token=" + getUserToken(), response -> {
makeRequest("https://" + getApiCom() + "/method/messages.markAsRead?start_message_id=" + dialog.F1() + "&peer_id=" + dialog.getId() + "&v=5.91&access_token=" + getUserToken(), response -> {
ToastUtils.a("Чат помечен как прочитанный!");
});
}
@@ -10,6 +10,7 @@ import static ru.vtosters.lite.utils.Proxy.proxy;
import android.app.ProgressDialog;
import android.content.Context;
import androidx.appcompat.app.AlertDialog;
import androidx.exifinterface.media.ExifInterface;
import com.vk.core.dialogs.alert.VkAlertDialog;
@@ -33,7 +34,10 @@ public class FoafBase {
private static final OkHttpClient client = new OkHttpClient();
public static int GetLastSeenInt(int i) throws ParseException, IOException {
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(client.a(new okhttp3.Request.Builder().url(getLink(i)).build()).b().body().string());
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(
client.a(
new okhttp3.Request.a().a(getLink(i)).b().a()
).execute().a().g());
if (!matcher.find()) {
return 0;
}
@@ -78,8 +82,8 @@ public class FoafBase {
matcher2.find();
String normalHumanDate = getNormalHumanDate(matcher.group(1));
getNormalHumanDate(matcher2.group(1));
AlertDialog.a a2 = new VkAlertDialog.a(context).a(getIdentifier("addinf", "string"));
a2.b(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).b(17039370, null).b().show();
VkAlertDialog.Builder a2 = new VkAlertDialog.Builder(context).setTitle(getIdentifier("addinf", "string"));
a2.setMessage(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).setPositiveButton(17039370, null).create().show();
} catch (Exception e) {
e.printStackTrace();
makeText(context, getString("foaferr"), LENGTH_SHORT).show();
@@ -43,7 +43,7 @@
# instance fields
.field private final b:I
.field public final b:I
.field private final c:Lcom/vk/im/engine/models/typing/ComposingType;