req dumper
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.vk.api.gifts;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.vk.api.base.ApiRequest;
|
||||
import com.vk.dto.gift.CatalogedGift;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class GiftGetByStickerId extends ApiRequest<GiftGetByStickerId.a> {
|
||||
public static class a {
|
||||
public final int a;
|
||||
public final CatalogedGift b;
|
||||
|
||||
public a(int i, CatalogedGift catalogedGift) {
|
||||
this.a = i;
|
||||
this.b = catalogedGift;
|
||||
}
|
||||
}
|
||||
|
||||
public GiftGetByStickerId(Context context, int i) {
|
||||
super("execute.getGiftByStickerId");
|
||||
b("sticker_id", i);
|
||||
c("no_inapp", "0");
|
||||
b("force_payment", 1);
|
||||
}
|
||||
|
||||
@Override // com.vk.api.sdk.o.VKRequest
|
||||
public GiftGetByStickerId.a a(JSONObject jSONObject) throws JSONException {
|
||||
JSONObject jSONObject2 = jSONObject.getJSONObject("response");
|
||||
return new a(jSONObject2.optInt("balance"),
|
||||
new CatalogedGift(jSONObject2.getJSONObject("gift")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package ru.vtosters.lite.hooks;
|
||||
import static ru.vtosters.lite.utils.Preferences.dev;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.vk.api.internal.MethodCall;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public class RequestDumper{
|
||||
public static void addParams(MethodCall.a paramslist, String method, LinkedHashMap params, String apiver) {
|
||||
if (method.contains("execute.getGiftByStickerId")) {
|
||||
apiver = "5.187";
|
||||
}
|
||||
|
||||
if (dev()) {
|
||||
Log.d("RequestDumper", "Method: " + method);
|
||||
Log.d("RequestDumper", "API version: " + apiver);
|
||||
Log.d("RequestDumper", "Params: " + params);
|
||||
}
|
||||
|
||||
paramslist.a(method);
|
||||
paramslist.a(params);
|
||||
paramslist.b(apiver);
|
||||
}
|
||||
}
|
||||
@@ -827,25 +827,23 @@
|
||||
|
||||
invoke-direct {v0}, Lcom/vk/api/internal/MethodCall$a;-><init>()V
|
||||
|
||||
|
||||
invoke-virtual {p0}, Lcom/vk/api/sdk/o/VKRequest;->a()Ljava/lang/String;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Lcom/vk/api/internal/MethodCall$a;->a(Ljava/lang/String;)Lcom/vk/api/internal/MethodCall$a;
|
||||
|
||||
.line 9
|
||||
invoke-virtual {p0}, Lcom/vk/api/sdk/o/VKRequest;->b()Ljava/util/LinkedHashMap;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
invoke-virtual {v0, v1}, Lcom/vk/api/internal/MethodCall$a;->a(Ljava/util/Map;)Lcom/vk/api/internal/MethodCall$a;
|
||||
move-result-object v2
|
||||
|
||||
.line 10
|
||||
invoke-virtual {p0}, Lcom/vk/api/base/ApiRequest;->f()Ljava/lang/String;
|
||||
|
||||
move-result-object v1
|
||||
move-result-object v3
|
||||
|
||||
invoke-static {v0, v1, v2, v3}, Lru/vtosters/lite/hooks/RequestDumper;->addParams(Lcom/vk/api/internal/MethodCall$a;Ljava/lang/String;Ljava/util/LinkedHashMap;Ljava/lang/String;)V
|
||||
|
||||
invoke-virtual {v0, v1}, Lcom/vk/api/internal/MethodCall$a;->b(Ljava/lang/String;)Lcom/vk/api/internal/MethodCall$a;
|
||||
|
||||
.line 11
|
||||
iget-boolean v1, p0, Lcom/vk/api/base/ApiRequest;->g:Z
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
.class public Lcom/vk/api/gifts/GiftGetByStickerId$a;
|
||||
.super Ljava/lang/Object;
|
||||
.source "GiftGetByStickerId.java"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
||||
value = Lcom/vk/api/gifts/GiftGetByStickerId;
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/InnerClass;
|
||||
accessFlags = 0x9
|
||||
name = "a"
|
||||
.end annotation
|
||||
|
||||
|
||||
# instance fields
|
||||
.field public final a:I
|
||||
|
||||
.field public final b:Lcom/vk/dto/gift/CatalogedGift;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method public constructor <init>(ILcom/vk/dto/gift/CatalogedGift;)V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||
|
||||
.line 2
|
||||
iput p1, p0, Lcom/vk/api/gifts/GiftGetByStickerId$a;->a:I
|
||||
|
||||
.line 3
|
||||
iput-object p2, p0, Lcom/vk/api/gifts/GiftGetByStickerId$a;->b:Lcom/vk/dto/gift/CatalogedGift;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -1,121 +0,0 @@
|
||||
.class public Lcom/vk/api/gifts/GiftGetByStickerId;
|
||||
.super Lcom/vk/api/base/ApiRequest;
|
||||
.source "GiftGetByStickerId.java"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Lcom/vk/api/gifts/GiftGetByStickerId$a;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/Signature;
|
||||
value = {
|
||||
"Lcom/vk/api/base/ApiRequest<",
|
||||
"Lcom/vk/api/gifts/GiftGetByStickerId$a;",
|
||||
">;"
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# direct methods
|
||||
.method public constructor <init>(Landroid/content/Context;I)V
|
||||
.locals 1
|
||||
|
||||
const-string v0, "execute.getGiftByStickerId"
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0, v0}, Lcom/vk/api/base/ApiRequest;-><init>(Ljava/lang/String;)V
|
||||
|
||||
const-string v0, "sticker_id"
|
||||
|
||||
.line 2
|
||||
invoke-virtual {p0, v0, p2}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
|
||||
|
||||
.line 3
|
||||
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtil;->isGooglePlayServicesAvailable(Landroid/content/Context;)I
|
||||
|
||||
move-result p1
|
||||
|
||||
if-eqz p1, :cond_0
|
||||
|
||||
const-string p1, "1"
|
||||
|
||||
goto :goto_0
|
||||
|
||||
:cond_0
|
||||
const-string p1, "0"
|
||||
|
||||
:goto_0
|
||||
const-string p2, "no_inapp"
|
||||
|
||||
invoke-virtual {p0, p2, p1}, Lcom/vk/api/base/ApiRequest;->c(Ljava/lang/String;Ljava/lang/String;)Lcom/vk/api/base/ApiRequest;
|
||||
|
||||
const/4 p1, 0x1
|
||||
|
||||
const-string p2, "force_payment"
|
||||
|
||||
.line 4
|
||||
invoke-virtual {p0, p2, p1}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public a(Lorg/json/JSONObject;)Lcom/vk/api/gifts/GiftGetByStickerId$a;
|
||||
.locals 3
|
||||
.annotation system Ldalvik/annotation/Throws;
|
||||
value = {
|
||||
Lorg/json/JSONException;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
const-string v0, "response"
|
||||
|
||||
.line 2
|
||||
invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
.line 3
|
||||
new-instance v0, Lcom/vk/dto/gift/CatalogedGift;
|
||||
|
||||
const-string v1, "gift"
|
||||
|
||||
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
invoke-direct {v0, v1}, Lcom/vk/dto/gift/CatalogedGift;-><init>(Lorg/json/JSONObject;)V
|
||||
|
||||
.line 4
|
||||
new-instance v1, Lcom/vk/api/gifts/GiftGetByStickerId$a;
|
||||
|
||||
const-string v2, "balance"
|
||||
|
||||
invoke-virtual {p1, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I
|
||||
|
||||
move-result p1
|
||||
|
||||
invoke-direct {v1, p1, v0}, Lcom/vk/api/gifts/GiftGetByStickerId$a;-><init>(ILcom/vk/dto/gift/CatalogedGift;)V
|
||||
|
||||
return-object v1
|
||||
.end method
|
||||
|
||||
.method public bridge synthetic a(Lorg/json/JSONObject;)Ljava/lang/Object;
|
||||
.locals 0
|
||||
.annotation system Ldalvik/annotation/Throws;
|
||||
value = {
|
||||
Ljava/lang/Exception;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
.line 1
|
||||
invoke-virtual {p0, p1}, Lcom/vk/api/gifts/GiftGetByStickerId;->a(Lorg/json/JSONObject;)Lcom/vk/api/gifts/GiftGetByStickerId$a;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
return-object p1
|
||||
.end method
|
||||
Reference in New Issue
Block a user