Привет, я хочу добавить сообщение в этот файл Smali, но я не понимаю, как это работает. Я не могу преобразовать свой Java-код в Smali.
Я хочу показать свою переменную V2. Я пытаюсь это:
invoke-virtual {v2}, Landroid / widget / Toast; -> show () V
Но не работает ... Приложение вылетает при запуске. Спасибо вам, я ценю любую помощь!
Код Энтери:
.class public final Lcom/sube/subemobileclient/b/b/b/b/b/a$a;
.super Ljava/lang/Object;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/sube/subemobileclient/b/b/b/b/b/a;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "a"
.end annotation
# instance fields
.field public a:B
.field public b:B
.field public c:[B
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public constructor <init>(BB[B)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-byte p1, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->a:B
iput-byte p2, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->b:B
iput-object p3, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->c:[B
return-void
.end method
# virtual methods
.method public final toString()Ljava/lang/String;
.locals 3
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "Sector: "
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-byte v2, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->a:B
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "line.separator"
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "Key Type: "
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-byte v2, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->b:B
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "line.separator"
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "Key: "
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v2, p0, Lcom/sube/subemobileclient/b/b/b/b/b/a$a;->c:[B
invoke-static {v2}, Ljava/util/Arrays;->toString([B)Ljava/lang/String;
**HEREHEREHERE** So message to display = "Key: ...."
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "line.separator"
invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
.end method
JAVA
public final String toString() {
StringBuilder stringBuilder = new StringBuilder();
StringBuilder stringBuilder2 = new StringBuilder("Sector: ");
stringBuilder2.append(this.f892a);
stringBuilder.append(stringBuilder2.toString());
stringBuilder.append(System.getProperty("line.separator"));
stringBuilder2 = new StringBuilder("Key Type: ");
stringBuilder2.append(this.f893b);
stringBuilder.append(stringBuilder2.toString());
stringBuilder.append(System.getProperty("line.separator"));
stringBuilder2 = new StringBuilder("Key: ");
stringBuilder2.append(Arrays.toString(this.f894c));
stringBuilder.append(stringBuilder2.toString());
stringBuilder.append(System.getProperty("line.separator"));
return stringBuilder.toString();
}